/* ===== リセット & ベース ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --lemon:    #FFE135;
  --lemon-dk: #D4A800;
  --lemon-lt: #FFFDE7;
  --brown:    #6B4F12;
  --green:    #5AB55E;
  --red:      #E05252;
  --bg:       #FFFDF0;
  --text:     #3A2D0A;
  --radius:   12px;
  --shadow:   0 2px 8px rgba(0,0,0,0.15);
}

html {
  font-size: 17px; /* デフォルト16px → 17px に上げて全体を底上げ */
}
html, body {
  height: 100%;
  font-family: 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ===== 画面共通 ===== */
.screen { width: 100%; height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ===== セットアップ画面 ===== */
#setup-screen {
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 16px;
  overflow-y: auto;
}

.setup-header { text-align: center; }
.game-logo { font-size: 4rem; line-height: 1; }
.setup-header h1 {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--brown);
  letter-spacing: 0.05em;
}
.tagline { font-size: 0.88rem; color: #888; margin-top: 4px; }

.setup-body { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 12px; }

.section-label { font-weight: bold; font-size: 1rem; color: var(--brown); }

.count-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.count-btn {
  flex: 1; min-width: 50px;
  padding: 12px 0;
  border: 2px solid var(--lemon-dk);
  border-radius: 8px;
  background: white;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
}

/* スタートボタン：2行デザイン */
.start-btn { line-height: 1.5; padding: 12px 20px; }
.start-btn-sub { font-size: 0.92em; opacity: 0.85; }
.count-btn:hover, .count-btn.selected {
  background: var(--lemon);
  border-color: var(--brown);
}

#name-inputs { display: flex; flex-direction: column; gap: 8px; }
.name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.name-emoji { font-size: 1.4rem; }
.name-input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  outline: none;
  transition: border-color 0.15s;
}
.name-input:focus { border-color: var(--lemon-dk); }
.name-input:disabled { background: #f0f0f0; color: #888; }

/* CPU トグルボタン */
.cpu-toggle {
  padding: 6px 10px;
  border: 2px solid #ccc;
  border-radius: 20px;
  background: #f8f8f8;
  font-size: 0.78rem;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.cpu-toggle.is-cpu {
  border-color: #4A90E2;
  background: #e8f0fb;
  color: #2c5aa0;
}

/* プレイヤーバーのCPUバッジ */
.cpu-chip-badge {
  font-size: 0.65rem;
  vertical-align: middle;
  margin-left: 1px;
}
.player-chip.is-cpu { opacity: 0.9; }

.win-rule {
  font-size: 0.88rem;
  color: #888;
  text-align: center;
  padding: 10px 16px;
  border: 1px dashed #ccc;
  border-radius: 8px;
  max-width: 400px;
  line-height: 1.7;
}

/* ===== ボタン共通 ===== */
.primary-btn {
  padding: 14px 20px;
  background: var(--lemon);
  border: 2px solid var(--brown);
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--brown);
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}
.primary-btn:hover:not(:disabled) { background: var(--lemon-dk); color: white; }
.primary-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.buy-btn {
  padding: 13px 16px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1.15rem;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}
.skip-btn {
  padding: 13px 16px;
  background: white;
  color: var(--text);
  border: 2px solid #ccc;
  border-radius: var(--radius);
  font-size: 1.15rem;
  cursor: pointer;
  width: 100%;
}
.next-btn {
  padding: 14px 20px;
  background: #4A90E2;
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}

/* ===== ゲーム画面レイアウト ===== */
#game-screen {
  height: 100svh; /* iOS Safari 等のブラウザUIを除いた実際の表示領域に合わせる */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* プレイヤーバー：全員を3列グリッドで一覧表示 */
#player-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 4px 6px;
  background: var(--brown);
  flex-shrink: 0;
}
.player-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 4px 7px;
  color: white;
  transition: background 0.2s;
  overflow: hidden;
}
.player-chip.active { background: var(--lemon); color: var(--brown); font-weight: bold; }
.player-chip.is-cpu { opacity: 0.92; }
/* チップ内の2行レイアウト */
.chip-row1 { display: flex; align-items: center; gap: 3px; overflow: hidden; }
.chip-row2 { display: flex; gap: 4px; }
.player-chip .chip-emoji { font-size: 1.0rem; flex-shrink: 0; }
.chip-name  { font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.chip-coins, .chip-points { font-size: 0.72rem; white-space: nowrap; }

/* ボードエリア：コンテナクエリで正確なサイズ計算 */
#board-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
  min-height: 0;
  container-type: size; /* コンテナクエリ有効化 */
}

#board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  width: min(100cqw, 100cqh); /* 利用可能な幅・高さの小さい方に合わせる */
  aspect-ratio: 1;
  border: 3px solid var(--brown);
  border-radius: 4px;
  background: white;
  box-shadow: var(--shadow);
}

/* マスのスタイル */
.sq {
  border: 1px solid #D4B44A;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2px 1px;
  font-size: 0.42rem;
  position: relative;
  overflow: hidden;
  cursor: default;
  min-width: 0;
}
.sq-inner {
  grid-column: 2 / 7;
  grid-row: 2 / 7;
  background: var(--lemon-lt);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid #D4B44A;
}
.sq-inner .inner-logo { font-size: 1.6rem; }
.sq-inner .inner-title { font-size: 0.65rem; font-weight: 900; color: var(--brown); }
.sq-inner .inner-sub { font-size: 0.5rem; color: #888; }

/* マスの種類別色 */
.sq.type-property { background: #FFFDE7; }
.sq.type-chance    { background: #FFF0CC; }
.sq.type-start     { background: #E8FFE8; }
.sq.type-battle    { background: #FFE8E8; }

.sq .sq-emoji  { font-size: 0.85rem; line-height: 1.1; }
.sq .sq-name   { font-size: 0.38rem; text-align: center; line-height: 1.2; color: var(--text); word-break: break-all; }
.sq .sq-price  { font-size: 0.36rem; color: var(--brown); font-weight: bold; }
.sq .sq-rent   { font-size: 0.33rem; color: #888; }

/* プレイヤートークン */
.tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  position: absolute;
  bottom: 3px;
  left: 0;
  right: 0;
  z-index: 2; /* グラデーションオーバーレイより前面に */
}
.token {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.65), 0 0 0 1px rgba(0,0,0,0.2);
  font-size: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 所有者インジケーター */
.sq .owner-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

/* アクションパネル */
#action-panel {
  flex-shrink: 0;
  background: white;
  border-top: 2px solid var(--lemon);
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#turn-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 1行目：絵文字 + 名前 + 歯車 */
.turn-row-main {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.05rem;
}
.turn-row-main strong { font-size: 1.2rem; }
.turn-label { font-size: 1.05rem; }
#cp-emoji { font-size: 1.3rem; }

/* 2行目：コイン・ポイント */
.turn-row-sub {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#cp-coins, #cp-points { font-size: 0.95rem; background: var(--lemon-lt); padding: 3px 8px; border-radius: 10px; }

#status-msg {
  font-size: 1.1rem;
  color: #555;
  min-height: 1.3em;
  text-align: center;
}

#action-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== モーダル ===== */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
#modal {
  background: white;
  border-radius: 16px;
  padding: 24px 20px 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 88vh;
  overflow-y: auto;
}
#modal-emoji  { font-size: 2.8rem; }
#modal-title  { font-size: 1.35rem; font-weight: 900; color: var(--brown); }
#modal-body   { font-size: 1.1rem; line-height: 1.75; color: #444; white-space: pre-line; }

/* ===== 勝利画面 ===== */
#win-screen {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FFF9C4 0%, #FFE135 100%);
}
.win-content { text-align: center; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.win-trophy { font-size: 5rem; }
.win-player-emoji { font-size: 3rem; }
#win-screen h2 { font-size: 2.2rem; color: var(--brown); }
.win-subtitle { font-size: 1.15rem; color: #666; }
#win-stats { font-size: 1.05rem; background: white; border-radius: 12px; padding: 16px 28px; line-height: 2.2; box-shadow: var(--shadow); }
#restart-btn { max-width: 280px; }

/* ===== サイコロ結果表示 ===== */
#dice-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--lemon-lt);
  border-radius: 8px;
  padding: 4px 10px;
}
#dice-face  { font-size: 1.8rem; line-height: 1; }
#dice-label { font-size: 1.05rem; color: var(--brown); font-weight: bold; }

/* ===== モーダル画像（マスカード） ===== */
#modal-img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 10px;
}
/* チャンスカード画像は縦長なので大きく表示 */
#modal-img[src*="chance/"] {
  max-height: 320px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
/* Make sense / No Make sense 結果画像 */
#modal-img[src*="makesense"] {
  max-height: 260px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
#modal-owner {
  font-size: 1rem;
  color: #888;
  min-height: 0;
}

/* ===== サイコロアニメ ===== */
@keyframes shake {
  0%,100% { transform: rotate(0deg); }
  20%      { transform: rotate(-15deg); }
  60%      { transform: rotate(15deg); }
}
.rolling { animation: shake 0.4s ease; }

/* ===== サイコロ絵文字アニメ ===== */
@keyframes dice-roll {
  0%   { transform: scale(1.0) rotate(0deg); }
  25%  { transform: scale(1.4) rotate(-25deg); }
  50%  { transform: scale(1.0) rotate(15deg); }
  75%  { transform: scale(1.3) rotate(-10deg); }
  100% { transform: scale(1.0) rotate(0deg); }
}
@keyframes dice-pop {
  0%   { transform: scale(1.0); }
  40%  { transform: scale(1.5); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1.0); }
}
#dice-face {
  display: inline-block;
  font-size: 2rem;
}
#dice-face.rolling {
  animation: dice-roll 0.15s ease infinite;
}
#dice-face.settled {
  animation: dice-pop 0.35s ease forwards;
}

/* ===== 空港選択時のマスハイライト（background上書きなし → 画像が消えない） ===== */

/* ===== ホーム中断ボタン ===== */
.home-btn {
  padding: 3px 9px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.7rem;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
}
.home-btn:hover { background: #c0392b; }

/* ===== セットアップ画面：右上ミュートボタン ===== */
#setup-screen { position: relative; }

.setup-mute-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(107,79,18,0.12);
  border: 1px solid rgba(107,79,18,0.2);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.15s;
}
.setup-mute-btn:hover { background: rgba(107,79,18,0.22); }

/* ===== ゲーム画面：歯車ボタン ===== */
.gear-btn {
  padding: 3px 9px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  margin-left: auto;
  line-height: 1.4;
}
.gear-btn:hover { background: rgba(255,255,255,0.35); }

/* ===== 設定パネル ===== */
#settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 150;
  display: flex;
  align-items: flex-end;
}
#settings-panel {
  background: white;
  width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slide-up 0.22s ease;
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.settings-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--brown);
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}
.settings-btn {
  padding: 14px 16px;
  background: white;
  border: 2px solid #ebebeb;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.settings-btn:hover { background: #f5f5f5; }
.settings-btn-danger {
  color: var(--red);
  border-color: #fdd;
  background: #fff8f8;
}
.settings-btn-danger:hover { background: #ffeaea; }
.settings-btn-back {
  color: #4A90E2;
  border-color: #ddefff;
  background: #f0f8ff;
}
.settings-btn-back:hover { background: #e0f0ff; }
.settings-btn-sub {
  color: #888;
  font-size: 13px;
  padding: 8px 12px;
}
.settings-btn-sub:hover { background: #f8f8f8; color: #555; }
/* ボットON中はハイライト */
.settings-btn-bot-on {
  background: #fff8e1;
  color: #e65100;
  border-color: #ffcc80;
  font-weight: bold;
}
.settings-btn-bot-on:hover { background: #fff3cd; }
.settings-divider { height: 1px; background: #eee; margin: 2px 0; }

/* ===== ボットモードバッジ ===== */
.bot-badge {
  position: fixed;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.5px;
  padding: 3px 12px;
  border-radius: 12px;
  z-index: 9999;
  pointer-events: none;
  animation: bot-pulse 1.6s ease-in-out infinite;
}
@keyframes bot-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ===== 空港移動：選択可能マスのハイライト ===== */
.sq.airport-target {
  outline: 3px dashed #4A90E2 !important;
  cursor: pointer !important;
  filter: brightness(1.12);
  transition: filter 0.15s;
}
.sq.airport-target:hover {
  filter: brightness(1.25);
}

/* ===== ボードマス：画像あり ===== */
.sq.has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 0;
}
/* トークン背景の視認性確保：底部に半透明の暗いグラデ */
.sq.has-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: linear-gradient(transparent, rgba(0,0,0,0.45));
  pointer-events: none;
  border-radius: 0 0 2px 2px;
}

/* ===== セカンダリボタン（コレクションなど） ===== */
.secondary-btn {
  padding: 12px 20px;
  background: white;
  border: 2px solid var(--lemon-dk);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--brown);
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
}
.secondary-btn:hover { background: var(--lemon-lt); }

/* ===== ミュートボタン（ゲーム画面内） ===== */
.mute-btn {
  padding: 2px 7px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  color: white;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: auto;
  line-height: 1.4;
}
.mute-btn:hover { background: rgba(255,255,255,0.35); }
.mute-btn.muted { opacity: 0.6; }

/* ===== カードコレクション画面 ===== */
#collection-screen {
  background: var(--bg);
}

.collection-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--brown);
  color: white;
  flex-shrink: 0;
}

.collection-title {
  flex: 1;
  font-size: 1.15rem;
  text-align: center;
  color: white;
  font-weight: 900;
}

.back-btn {
  padding: 7px 14px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}
.back-btn:hover { background: rgba(255,255,255,0.35); }

.collection-count {
  font-size: 0.9rem;
  background: var(--lemon);
  color: var(--brown);
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: bold;
  white-space: nowrap;
}

.collection-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-content: start;
}

/* タブレット：4列 */
@media (min-width: 600px) {
  .collection-grid { grid-template-columns: repeat(4, 1fr); }
}
/* 広いタブレット：5列 */
@media (min-width: 900px) {
  .collection-grid { grid-template-columns: repeat(5, 1fr); }
}

.card-item {
  background: white;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  padding: 4px 4px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.2s, background 0.2s;
}
.card-item.unlocked {
  border-color: var(--lemon-dk);
  background: var(--lemon-lt);
  box-shadow: 0 1px 4px rgba(212,168,0,0.2);
}

/* カード画像エリア（固定比率で全カード統一） */
.card-col-img-wrap {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  background: #f0ead6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-col-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
/* 画像なし時の絵文字フォールバック */
.card-col-fallback {
  display: none;
  font-size: 2rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
/* ロック中カード */
.card-col-locked {
  background: #e8e8e8;
  flex-direction: column;
  gap: 2px;
}
.card-lock-inner {
  font-size: 1.4rem;
  line-height: 1.8;
  filter: grayscale(1) opacity(0.3);
}
/* カード番号バッジ（右下に重ねる） */
.card-num-badge {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 0.46rem;
  font-weight: bold;
  color: white;
  background: rgba(0,0,0,0.45);
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.4;
}
/* カード名 */
.card-name {
  font-size: 0.68rem;
  font-weight: bold;
  color: var(--brown);
  line-height: 1.4;
  word-break: break-all;
  width: 100%;
}
.card-name-locked { color: #bbb; }

/* ===== PCレイアウト (768px以上) ===== */
@media (min-width: 768px) {
  /* ゲーム画面全体をグリッドに */
  #game-screen {
    display: grid;
    grid-template-areas:
      "bar   bar"
      "board panel";
    grid-template-columns: 1fr 300px;
    grid-template-rows: auto 1fr;
    height: 100dvh;
    overflow: hidden;
  }

  #player-bar {
    grid-area: bar;
  }

  #board-area {
    grid-area: board;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    min-height: 0;
    overflow: hidden;
  }

  /* ボードを画面いっぱいに — 幅(左側領域)と高さ(player-bar除く)の小さい方に合わせる */
  #board {
    width:  min(calc(100vw - 324px), calc(100vh - 56px));
    height: min(calc(100vw - 324px), calc(100vh - 56px));
  }

  /* アクションパネルを右サイドバーに */
  #action-panel {
    grid-area: panel;
    border-top: none;
    border-left: 2px solid var(--lemon);
    padding: 16px 14px 24px;
    overflow-y: auto;
    gap: 12px;
    justify-content: flex-start;
  }

  /* マス文字サイズを少し大きく */
  .sq              { font-size: 0.62rem; }
  .sq .sq-emoji   { font-size: 1.6rem; }
  .sq .sq-name    { font-size: 0.55rem; }
  .sq .sq-price   { font-size: 0.5rem; }

  /* 中央マスのロゴ */
  .sq-inner .inner-logo  { font-size: 2.6rem; }
  .sq-inner .inner-title { font-size: 1rem; }

  /* トークンをさらに大きく */
  .token { width: 20px; height: 20px; font-size: 0.6rem; }

  /* モーダルは中央ポップアップ風に */
  #modal { max-width: 440px; }
}

/* ===== 紙吹雪エフェクト ===== */
.confetti-particle {
  position: fixed;
  top: -20px;
  pointer-events: none;
  z-index: 9999;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0)     rotate(0deg);   opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
