/* 和水・八神巡り - やさしいデザイン */

:root {
  --ink: #3d2b1f;
  --ink-light: #6b5344;
  --paper: #faf6f0;
  --paper-dark: #ede5d8;
  --accent: #c0713a;
  --accent-dark: #9a5a2e;
  --accent-light: #e6c9a8;
  --accent-glow: rgba(192, 113, 58, 0.18);
  --r: 12px;
  --r-lg: 20px;
  --shadow-sm: 0 1px 4px rgba(60, 40, 20, 0.10);
  --shadow: 0 2px 12px rgba(60, 40, 20, 0.13);
  --shadow-lg: 0 6px 24px rgba(60, 40, 20, 0.20);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 検索エンジン向け見出しなど（画面上は非表示） */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 右下固定: 他ゲーム導線（レイアウト非依存） */
.fixed-games-btn {
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(217, 119, 6, 0.4);
  transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.fixed-games-btn:hover,
.fixed-games-btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.42), 0 3px 10px rgba(217, 119, 6, 0.48);
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  background: linear-gradient(160deg, #1a1410 0%, #2a1d14 100%);
  color: var(--ink);
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

/* あそびかた・設定ページ用（スクロール可能） */
html.page-settings,
body.page-settings {
  /* ベース側の overflow: hidden（ショートハンド）を確実に上書きしてスクロール可能にする */
  overflow: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100%;
  background: var(--paper);
}

body.page-settings .wrap {
  height: auto !important;
  min-height: auto;
  overflow: visible !important;
  justify-content: flex-start;
  padding: 1rem 0 2rem !important;
}

.wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: 0.5rem 0;
  overflow: hidden;
}

/* ===== ゲーム画面コンテナ ===== */
.game-screen {
  flex: 0 0 auto;
  position: relative;
  margin: 0 auto;
  background: #0a0806;
  border: 2px solid var(--accent-light);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 0 32px rgba(192, 113, 58, 0.12);
}

/* 背景・グリッド線など毎フレーム変わらない描画（負荷軽減用・背面レイヤー） */
.game-screen .canvas-static-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}

#canvas {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
}

/* ===== 和水町ｅスポーツコピー（トップ画面のみ・下部1行バナー） ===== */
.town-esports-tagline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 3;
  display: flex;
  justify-content: center;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}

.town-esports-tagline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0.27rem 0.9rem;
  border-radius: 999px;
  box-sizing: border-box;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: #fff;
  background: rgba(114, 0, 9, 0.728);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
}

/* ===== 一時停止ボタン（右パネル内・ゲーム中のみ表示・グリッドに重ならない） ===== */
.pause-btn-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 720px;
  z-index: 2;
  transform-origin: 0 0;
  transform: scale(var(--game-scale, 1));
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0;
}

.pause-btn-layer.hidden {
  display: none !important;
}

/* ゲーム中の通知（アシスト終了など）— 盤面上部・キャンバスより手前 */
.game-toast-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 720px;
  z-index: 4;
  pointer-events: none;
  transform-origin: 0 0;
  transform: scale(var(--game-scale, 1));
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: max(10px, env(safe-area-inset-top, 0px)) 14px 0;
  box-sizing: border-box;
}

.game-toast-layer[hidden] {
  display: none !important;
}

.game-toast {
  max-width: 400px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  color: #fff8ec;
  background: rgba(28, 18, 14, 0.92);
  border: 1px solid rgba(255, 210, 160, 0.45);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  white-space: pre-wrap;
  word-break: break-word;
}

.hidden {
  display: none !important;
}

/* 音量ボタン（ポーズボタンの上） */
.pause-btn-layer .volume-btn {
  pointer-events: auto;
  position: absolute;
  left: 366px;
  right: 6px;
  bottom: 84px;
  margin: 0;
  padding: 0.35rem 0.5rem;
  max-width: 108px;
  min-height: 36px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fffef7;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: 1px solid #f9e2c0;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.pause-btn-layer .volume-btn:hover,
.pause-btn-layer .volume-btn:focus-visible {
  transform: scale(1.03);
  box-shadow: var(--shadow);
}

.pause-btn-layer .volume-btn:active {
  transform: scale(0.98);
}

.pause-btn-layer .volume-btn:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 1px;
}

.pause-btn-layer .volume-btn.muted {
  background: linear-gradient(180deg, var(--ink-light) 0%, var(--ink) 100%);
  color: var(--paper-dark);
}

/* 右パネル（360px〜）内に収める。グリッド(0〜360)に重ねない */
.pause-btn-layer .pause-btn {
  pointer-events: auto;
  position: absolute;
  left: 366px;
  right: 6px;
  bottom: 8px;
  margin: 0;
  padding: 0.35rem 0.5rem;
  max-width: 108px;
  min-height: 36px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #fffef7;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: 1px solid #f9e2c0;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.pause-btn:hover,
.pause-btn:focus-visible {
  transform: scale(1.03);
  box-shadow: var(--shadow);
}

.pause-btn:active {
  transform: scale(0.98);
}

.pause-btn:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 1px;
}

/* 忘却ブロック予告ゲージ用レイヤー（Canvasとは別レイヤーで描画し、他の描画に影響させない） */
.ojama-gauge-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 720px;
  transform-origin: 0 0;
  transform: scale(var(--game-scale, 1));
  pointer-events: none;
}

.ojama-gauge {
  position: absolute;
  right: 12px;          /* 右側に余白を作る（サイドバー内） */
  top: 304px;           /* 「巡り順」（神様の変化）と開始位置を揃える */
  height: 280px;        /* 「巡り順」と同じ縦幅に揃える（8段×36px相当） */
  display: flex;
  flex-direction: column; /* 縦1列に [忘却ブロック予告][ゲージ][あと◯手] */
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  font-size: 13px;
  color: #fecaca;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.ojama-gauge-label,
.ojama-gauge-remain {
  color: #f97316;
  font-weight: 700;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;  /* 縦書きで1列に並べる */
  text-orientation: upright;
}

.ojama-gauge-remain {
  display: none; /* 「あと◯手」は非表示にする */
}

/* 忘却メーター：8マス。下から溜まる。黄=通常区間・赤=圧力（満タンで赤8の次はど忘れ落下→フェーズリセット） */
.ojama-gauge-steps {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ojama-gauge-step {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(248, 113, 113, 0.7);
  background: #1a1a1a;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

.ojama-gauge-step.filled-yellow {
  background: #facc15;
  box-shadow:
    0 0 4px rgba(250, 204, 21, 0.8),
    inset 0 0 3px rgba(255, 255, 255, 0.2);
}

.ojama-gauge-step.filled-red {
  background: #dc2626;
  box-shadow:
    0 0 4px rgba(220, 38, 38, 0.85),
    inset 0 0 3px rgba(255, 255, 255, 0.15);
}

/* 満タン時：黄/赤どちらも同じ「1本分の脈動」（黄と赤が別々に暴れて「二重に増えた」ように見えないようにする） */
.ojama-gauge-steps.is-full .ojama-gauge-step.filled-yellow,
.ojama-gauge-steps.is-full .ojama-gauge-step.filled-red {
  animation: ojama-gauge-pulse-full 1.5s ease-in-out infinite;
}

.ojama-gauge-steps.is-full .ojama-gauge-step:nth-child(8) { animation-delay: 0s; }
.ojama-gauge-steps.is-full .ojama-gauge-step:nth-child(7) { animation-delay: 0.1s; }
.ojama-gauge-steps.is-full .ojama-gauge-step:nth-child(6) { animation-delay: 0.2s; }
.ojama-gauge-steps.is-full .ojama-gauge-step:nth-child(5) { animation-delay: 0.3s; }
.ojama-gauge-steps.is-full .ojama-gauge-step:nth-child(4) { animation-delay: 0.4s; }
.ojama-gauge-steps.is-full .ojama-gauge-step:nth-child(3) { animation-delay: 0.5s; }
.ojama-gauge-steps.is-full .ojama-gauge-step:nth-child(2) { animation-delay: 0.6s; }
.ojama-gauge-steps.is-full .ojama-gauge-step:nth-child(1) { animation-delay: 0.7s; }

.ojama-gauge-steps.is-dowasure-next.is-full .ojama-gauge-step.filled-red {
  animation-name: ojama-gauge-pulse-dowasure-full;
}

@keyframes ojama-gauge-pulse-full {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

@keyframes ojama-gauge-pulse-dowasure-full {
  0%, 100% { filter: brightness(1.05); }
  50% { filter: brightness(1.32); box-shadow: 0 0 10px rgba(254, 202, 202, 0.9), inset 0 0 3px rgba(255, 255, 255, 0.2); }
}

/* ===== スタート画面（論理480x720をtransformでスケール） ===== */
.start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 720px;
  z-index: 2;
  transform-origin: 0 0;
  transform: scale(var(--game-scale, 1));
  background: linear-gradient(180deg, rgba(10, 8, 4, 0.75) 0%, rgba(26, 18, 10, 0.82) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
  padding-right: max(2rem, env(safe-area-inset-right, 0px));
  padding-bottom: max(3.2rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(2rem, env(safe-area-inset-left, 0px));
  overflow: hidden;
  box-sizing: border-box;
}

/* 背景画像だけのレイヤー（ここだけで暗くする。ロゴ・ボタンには触れない） */
.start-overlay-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("images/taitolbg.png") center center / cover no-repeat;
}
.start-overlay-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0.5;
  mix-blend-mode: multiply;
}

.start-overlay > *:not(.start-overlay-bg):not(.town-esports-tagline) {
  position: relative;
  z-index: 1;
}

.start-overlay.hidden {
  display: none;
}

.start-logo {
  width: 100%;
  max-width: 100%;
  max-height: 260px;
  height: auto;
  height: auto;
  margin: 0 0 1rem;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.start-title-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.3rem;
  width: 100%;
  max-width: 100%;
  padding: 0;
}

/* start-title-row の中ではロゴ側の下余白を抑える */
.start-title-row .start-logo {
  margin: 0;
}

/* 「はじめる」行：ボタン右辺に画像の中心が来る（従来の見た目に近い） */
.start-primary-row {
  position: relative;
  width: 100%;
  align-self: stretch;
}

.start-primary-row .start-btn {
  width: 100%;
}

.start-today-god-image {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 128px;
  height: 128px;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
}

.start-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--paper);
  margin: 0 0 0.2rem;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 16px rgba(192, 113, 58, 0.5);
}

.start-subtitle {
  font-size: 1.1rem;
  color: var(--accent-light);
  margin: 0 0 3rem;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

/* トップ画面の会場・チーム・名前（全ボタンと一緒に必ず表示） */
.start-registration {
  flex-shrink: 0;
  margin: 0.75rem 0 0;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(192, 113, 58, 0.35);
  min-width: 200px;
  max-width: 90%;
}
.start-registration.hidden {
  display: none !important;
}
.start-registration-line {
  margin: 0.15rem 0;
  font-size: 1.1rem;
  line-height: 1.35;
  color: #eee;
  font-weight: 600;
}
.start-registration-line:first-child {
  margin-top: 0;
}
.start-registration-line:last-child {
  margin-bottom: 0;
}

.start-menu {
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  flex-shrink: 0;
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.concept-link-wrap {
  text-align: center;
  margin-top: 0.25rem;
}
.concept-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--paper);
  text-decoration: none;
  padding: 0.45em 1em;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 9999px;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
}

.concept-link:hover {
  background: rgba(0, 0, 0, 0.85);
  color: var(--paper);
  text-decoration: none;
}

/* ===== ボタン共通（老人向けに文字大きめ） ===== */
.btn {
  display: block;
  width: 100%;
  max-width: 300px;
  padding: 0.85rem 1.2rem;
  font-size: 1.5rem;
  font-family: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  margin: 0.2rem auto;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  letter-spacing: 0.04em;
  min-height: 52px;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  flex-shrink: 0;
  text-decoration: none;
  text-align: center;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

.btn:focus-visible {
  outline: 3px solid var(--accent-light);
  outline-offset: 2px;
}

.btn-large {
  font-size: 2.25rem !important;
  padding: 1.2rem 2rem !important;
  min-height: 88px !important;
  background: linear-gradient(180deg, #d4853f 0%, #b36a2d 100%) !important;
  border: 3px solid #fdfaf0 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin: 15px auto;
}

.btn-mid {
  font-size: 1.45rem !important;
  padding: 0.7rem 0.6rem !important;
  min-height: 64px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  line-height: 1.25 !important;
}

/* 名前未選択時はチーム選択を暗転・押せなくする */
.btn-mid:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}
.btn-mid:disabled:hover,
.btn:disabled:hover {
  transform: none;
}

.btn-warn {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%) !important;
}

.start-btn {
  font-size: 1.6rem;
  padding: 0.78rem 1.2rem;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #d4853f 0%, var(--accent-dark) 100%);
  box-shadow: 0 4px 16px rgba(192, 113, 58, 0.35);
  min-height: 52px;
}

.start-btn:hover,
.start-btn:focus-visible {
  box-shadow: 0 6px 32px rgba(192, 113, 58, 0.55);
}

.btn-sub {
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-dark) 100%);
  color: var(--ink);
  border: 2px solid var(--accent-light);
}

.btn-sub:hover,
.btn-sub:focus-visible {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
}

/* トップ画面: 「他のゲームで遊ぶ」専用（見た目は btn-sub 系で統一） */
.btn-othergame {
  text-decoration: none;
}

/* 戻るボタンは暗めの赤・白文字・大きめで品のある見た目 */
.btn-back {
  background: linear-gradient(180deg, #991b1b 0%, #7f1d1d 100%) !important;
  color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.2) !important;
  font-size: 1.65rem !important;
  padding: 0.9rem 1.2rem !important;
  min-height: 56px !important;
}
.btn-back:hover,
.btn-back:focus-visible {
  background: linear-gradient(180deg, #b91c1c 0%, #991b1b 100%) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

/* ===== ゲームオーバー／クリア画面（論理480x720をtransformでスケール） ===== */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 720px;
  z-index: 2;
  transform-origin: 0 0;
  transform: scale(var(--game-scale, 1));
  background: rgba(30, 20, 10, 0.96);
  /* より濃い茶色系にして白文字を見やすく */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.5rem 1.2rem;
  /* 余白を減らす */
  overflow-y: hidden;
  /* 画面全体のスクロールを防ぐ */
  box-sizing: border-box;
  color: #fff;
}

.overlay.hidden {
  display: none;
}

/* ゲームオーバー／クリア時は盤面が少し見えるように半透明 */
.overlay.translucent {
  background: rgba(30, 20, 10, 0.88);
}

/* クリア専用演出 */
.overlay.is-clear {
  background: linear-gradient(180deg, rgba(255, 248, 224, 0.92) 0%, rgba(255, 240, 200, 0.95) 100%);
  border: 4px solid #ffd700;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
}

.overlay.is-clear .overlay-title {
  color: #b8860b;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  animation: clear-shine 2s infinite;
}

@keyframes clear-shine {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.clear-menu {
  width: 100%;
  max-width: 300px;
  margin-bottom: 0.5rem;
}

.clear-menu.hidden {
  display: none;
}

.clear-illustration {
  width: 100%;
  max-width: 320px;
  margin: 0 auto 1.2rem;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  border: 4px solid #fff;
}

.clear-illustration img {
  display: block;
  width: 100%;
  height: auto;
}

.clear-illustration.hidden {
  display: none;
}

/* エンディング時はランキング・名前入力を隠す */
.overlay.is-clear .name-form,
.overlay.is-clear .overlay-ranking {
  display: none;
}

/* エンディングで「ゲームを終わる」を押したときのリザルト画面では表示 */
.overlay.is-clear.is-clear-result .name-form {
  display: flex;
}
.overlay.is-clear.is-clear-result .overlay-ranking {
  display: block;
}

.overlay-title {
  font-size: 2.2rem;
  color: #fff !important;
  /* 強制的に白 */
  margin-bottom: 0.2rem;
  /* 余白を減らす */
  margin-top: 0.2rem;
  /* 余白を減らす */
  font-weight: 800;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* ご利益表示の枠（品格・説得力・光る演出） */
.overlay-score-wrap {
  display: inline-block;
  margin: 0.5rem 0 0.75rem;
  padding: 0.75rem 1.5rem 0.9rem;
  border: 3px solid rgba(251, 191, 36, 0.9);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(30, 25, 15, 0.85) 0%, rgba(50, 40, 20, 0.75) 50%, rgba(30, 25, 15, 0.85) 100%);
  box-shadow:
    0 0 20px rgba(251, 191, 36, 0.35),
    0 0 40px rgba(251, 191, 36, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.4);
  animation: go-rieki-glow 3s ease-in-out infinite;
}

@keyframes go-rieki-glow {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(251, 191, 36, 0.35),
      0 0 40px rgba(251, 191, 36, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 4px 12px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow:
      0 0 28px rgba(251, 191, 36, 0.5),
      0 0 50px rgba(251, 191, 36, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.15),
      0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

.overlay-score-wrap .overlay-score {
  margin: 0;
}

.overlay-score {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #fcd34d;
  text-shadow:
    0 0 12px rgba(252, 211, 77, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.02em;
}

/* 名前入力（ラベル左・縦を詰めてスクロールなし） */
.name-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
  width: 100%;
  max-width: 320px;
}

.overlay.view-only .name-form {
  display: none;
}

.overlay.view-only .overlay-score-wrap,
.overlay.view-only .overlay-score {
  display: none;
}

.name-form-label {
  flex-shrink: 0;
  font-size: 1rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

#playerName {
  flex: 1;
  min-width: 0;
  max-width: 180px;
  padding: 0.4rem 0.6rem;
  font-size: 1.05rem;
  font-family: inherit;
  border: 2px solid var(--accent-light);
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

#playerName::placeholder {
  color: #bbb;
}

#playerName:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ランキング（全画面幅に） */
.overlay-ranking {
  width: 100%;
  max-width: 100%; /* max-widthの制限解除 */
  margin: 0.35rem 0;
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
}

.overlay-ranking-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--ink-light);
}

.ranking-list {
  font-size: 1rem;
  overflow-y: auto;
  border-radius: var(--r);
  width: 100%;
  padding-right: 18px; /* スクロールバーのスペース確保 */
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 1 auto;
  min-height: 0;
}

.ranking-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #f0ece4;
  min-height: 36px;
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item {
  display: grid;
  grid-template-columns: 40px 1fr 120px 80px;
  /* 連鎖の幅を調整 */
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.1);
  /* 少し明るくして視認性向上 */
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 1rem;
}

.ranking-header {
  display: grid;
  grid-template-columns: 40px 1fr 120px 80px;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.95rem;
  /* 字を大きくして視認性アップ */
  color: var(--accent-light);
  font-weight: bold;
  opacity: 0.9;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 4px;
}

.ranking-item.normal-game,
.ranking-header.normal-game {
  grid-template-columns: 40px 1fr 120px 80px;
  /* 順位, 名前[会場], ご利益, 連鎖 */
}

/* 順位 | なまえ（最低約7文字分） | ご利益・連鎖・クリア（右寄せ・間隔詰め） */
.ranking-item.ranking-has-clear,
.ranking-header.ranking-has-clear {
  grid-template-columns: 36px minmax(7em, 1fr) auto;
  column-gap: 6px;
  align-items: center;
}

.ranking-item.ranking-has-clear .ranking-name {
  min-width: 7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ご利益 / 連鎖 / クリア をまとめて右端に */
.ranking-metas {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.2rem 0.4rem;
  flex-shrink: 0;
}

.ranking-metas--head {
  font-size: 0.78rem;
  opacity: 0.95;
  gap: 0.15rem 0.32rem;
}

.ranking-metas--head span {
  text-align: right;
  white-space: nowrap;
}

.ranking-metas .ranking-score,
.ranking-metas .ranking-chain,
.ranking-metas .ranking-clears {
  text-align: right;
  white-space: nowrap;
}

.ranking-metas .ranking-chain,
.ranking-metas .ranking-clears {
  font-size: 0.92rem;
  min-width: 1.5rem;
}

.ranking-clears {
  font-size: 0.95rem;
  color: var(--accent);
  text-align: right;
}

.ranking-item.party-team,
.ranking-header.party-team {
  grid-template-columns: 40px 1fr 120px;
  /* 順位, チーム名, ご利益 */
}

/* 追加: 個人ランキング（パーティーモード用） */
.ranking-item.party-indiv,
.ranking-header.party-indiv {
  grid-template-columns: 40px 1fr 120px 80px;
  /* 順位, なまえ[チーム名], ご利益, 連鎖 */
}

/* メインメニューのランキングを広く */
.overlay.view-only {
  width: 100% !important;
  max-width: 480px;
  padding: 1rem;
}

/* スマホ: ランキングはゲーム枠外まで広げ、左右の余白を減らす（fixed でビューポート基準） */
@media (max-width: 600px) {
  .overlay.view-only {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    width: 100dvw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    transform: none !important;
    z-index: 20000;
    border-radius: 0;
    box-sizing: border-box;
    padding:
      max(0.6rem, env(safe-area-inset-top, 0px))
      max(0.6rem, env(safe-area-inset-right, 0px))
      max(0.6rem, env(safe-area-inset-bottom, 0px))
      max(0.6rem, env(safe-area-inset-left, 0px));
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .overlay.view-only .overlay-ranking {
    flex: 1 1 auto;
    min-height: 0;
  }

  .overlay.view-only .ranking-list {
    padding-right: 8px;
  }
}

.ranking-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 1rem;
  justify-content: center;
  width: 100%;
}

.tab-btn {
  flex: 1;
  padding: 0.8rem 1rem;
  font-size: 1.2rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.1);
  color: #ccc;
  border: 2px solid #555;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-light);
  box-shadow: 0 0 10px rgba(192, 113, 58, 0.5);
}

.ranking-rank {
  font-weight: 800;
  color: #fbbf24;
  text-align: center;
  font-size: 1.1rem;
}

.ranking-name {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.ranking-score {
  text-align: right;
  font-weight: 700;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

.ranking-chain {
  text-align: right;
  color: #fbbf24;
  /* 連鎖も目立たせる */
  font-weight: bold;
}

.ranking-sub-section-title {
  font-size: 1.1rem;
  color: var(--paper);
  margin: 18px 0 8px;
  border-left: 5px solid var(--accent);
  padding-left: 12px;
  text-align: left;
  font-weight: bold;
  width: 100%;
}

.ranking-venue-header {
  font-size: 1.2rem;
  color: #fff;
  background: rgba(192, 113, 58, 0.2);
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-weight: bold;
}

/* ランキング空状態のテキスト */
.howto-text {
  padding: 1rem;
  text-align: center;
  color: var(--ink-light);
  font-size: 0.95rem;
}

.overlay-settings {
  margin: 0.5rem 0 0;
  font-size: 1rem;
}

.overlay-settings a {
  color: var(--accent);
}

.footer-link {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--accent-light);
  letter-spacing: 0.05em;
}

.footer-link a {
  color: var(--accent-light);
}

.btn-party {
  font-size: 1.5rem !important;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(217, 119, 6, 0.4);
}

/* トップ画面の「会場・チーム」「ランキング」「あそびかた」は高さを低めに */
.start-menu .btn {
  min-height: 35px;
  padding: 0.4rem 1.0rem;
  margin: 0.06rem auto;
  border-radius: var(--r-lg);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(192, 113, 58, 0.35);
}

/* 「はじめる」だけは高めで目立たせる */
.start-menu .start-btn {
  min-height: 52px;
  padding: 0.72rem 1.2rem;
}

.start-menu .btn-party {
  font-size: 1.45rem !important;
}

.start-menu .btn-sub {
  font-size: 1.45rem;
}

.member-list,
.team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 15px 0;
}

.venue-item,
.member-item,
.team-item {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(192, 113, 58, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--ink-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.venue-item:hover,
.member-item:hover,
.team-item:hover {
  background: rgba(192, 113, 58, 0.1);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(192, 113, 58, 0.2);
}

.venue-item.selected,
.member-item.selected,
.team-item.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
}

.party-form-desc {
  margin: 0 10px 14px;
  font-size: 0.9rem;
  color: #ddd;
  line-height: 1.5;
}

.party-first-btns {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 280px;
  margin: 10px 0;
}
/* 会場・チーム登録の上のボタン：左右の余白を詰めて1行で収める */
.party-first-btns .btn-large {
  padding-left: 0.5rem !important;
  padding-right: 0.5rem !important;
}

/* 会場・チーム・名前表示は老人向けに約2倍の大きさ */
.party-venue-label {
  margin: 0 0 10px;
  font-size: 2rem;
  font-weight: bold;
  color: #eee;
  text-align: center;
  line-height: 1.3;
}

.party-venue-info-block {
  margin: 10px 0 16px;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  width: 100%;
  max-width: 340px;
}

.party-venue-info {
  margin: 10px 0;
  font-size: 2rem;
  font-weight: bold;
  color: #eee;
  line-height: 1.35;
}

.party-venue-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin: 10px 0;
}

.party-sub-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: #ddd;
}

/* パスワード画面: スクロールなし・全要素が一画面に収まりOK・もどるは必ず表示 */
.party-password-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  justify-content: flex-start;
}
.party-password-body {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px 4px;
  overflow: visible;
}
.party-password-btns {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 10px;
  padding-bottom: 6px;
}

/* 4桁パスワード用テンキー（0の右に削除で1段分コンパクト） */
.keypad-display {
  font-size: 2rem;
  letter-spacing: 0.4em;
  padding: 10px 16px;
  margin: 8px 0;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #b4966e;
  border-radius: 8px;
  color: #fff;
  text-align: center;
  min-width: 180px;
  font-variant-numeric: tabular-nums;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 220px;
  margin: 8px 0;
}

.keypad-btn {
  padding: 12px 10px;
  font-size: 1.4rem;
  font-weight: bold;
  background: #fffdf5;
  border: 2px solid #d4853f;
  border-radius: 10px;
  color: #8b4513;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 0 4px 0 #b4966e;
}

.keypad-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b4966e;
}

/* 0の右に配置（1行分高さ削減・スクロール不要に） */
.keypad-btn.keypad-delete {
  grid-column: span 2;
  font-size: 1.1rem;
}

.party-form {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
  flex: 1 1 auto;
  min-height: 0;
}

.btns-bottom {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding-top: 20px;
}

/* 会場一覧は画面幅・高さを有効に使い、もどるボタンとの隙間を減らす */
#partyVenueListPage .venue-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
  max-width: min(440px, 92%);
  margin: 10px 0 12px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(520px, 68vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}
.venue-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 10px;
  width: 100%;
  max-width: min(440px, 92%);
  margin: 10px 0 16px;
  max-height: min(400px, 55vh);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

/* 会場ボタンはコンパクトに、文字は大きく見やすく */
.venue-item {
  padding: 12px 20px;
  background: #fffdf5;
  border: 2px solid #d4853f;
  border-radius: 12px;
  font-size: 1.7rem;
  font-weight: bold;
  color: #8b4513;
  box-shadow: 0 4px 0 #b4966e;
  transition: all 0.1s;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}

.venue-item:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #b4966e;
}

.venue-item.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-dark);
  box-shadow: 0 3px 0 var(--accent-dark);
}

.party-form input {
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #b4966e;
  border-radius: 4px;
  color: #fff;
  text-align: center;
}

.mode-select {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}

.overlay-chain {
  font-size: 1.2rem;
  color: #fbbf24;
  margin: 5px 0;
}

.party-result-info {
  font-size: 1.1rem;
  /* 大きくして見やすく */
  color: #ccc;
  margin-bottom: 10px;
  font-weight: bold;
}

/* メンバー・チーム選択用リスト */
.member-list,
.team-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

/* 名前選択・チーム選択画面ではリストを大きく表示・画面幅を有効に使用 */
#partyNameSelectPage .member-list,
#partyTeamJoinPage .team-list {
  flex: 1 1 auto;
  min-height: 0;
  max-width: min(440px, 92%);
  max-height: min(420px, 58vh);
  overflow-y: auto;
  overflow-x: hidden;
  margin: 12px 0 16px;
  padding-right: 6px;
  align-content: flex-start;
}
#partyNameSelectPage .member-item,
#partyTeamJoinPage .team-item {
  font-size: 1.6rem;
  padding: 12px 20px;
  line-height: 1.3;
}

.member-item,
.team-item {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  /* 名前を白に変更 */
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.member-item:hover,
.team-item:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fbbf24;
}

/* メンバー追加フォーム */

.add-member-form {
  display: flex;
  gap: 5px;
}

.add-member-form input {
  flex: 1;
}

/* チーム編集 */
#teamEditArea {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.team-edit-row {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px;
  border-radius: 8px;
}

.member-chip {
  display: inline-block;
  padding: 3px 8px;
  margin: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  margin-bottom: 5px;
  border-radius: 4px;
}

.ranking-sub-title {
  font-size: 1.15rem;
  /* タイトルを大きく */
  color: #f59e0b;
  margin: 15px 0 10px;
  text-align: center;
  font-weight: bold;
}

.ranking-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 15px 0;
}

.ranking-item.team-rank {
  background: rgba(245, 158, 11, 0.05);
}

.ranking-stats {
  display: flex;
  gap: 10px;
  font-size: 1rem;
  /* 0.9remから大きく */
  opacity: 0.9;
}

.ranking-venue {
  font-size: 0.95rem;
  /* 0.8remから大きく */
  color: #999;
  text-align: right;
  width: 100%;
}

.ranking-main {
  display: flex;
  gap: 5px;
  align-items: center;
}

.ranking-team {
  color: #f59e0b;
  font-size: 0.95rem;
  /* 0.8remから大きく */
}

.team-group h4 {
  margin: 10px 0 5px;
  color: #f59e0b;
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
}

/* ===== ゲームオーバー 新演出 ===== */
.sokomade-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 480px;
  height: 720px;
  transform-origin: 0 0;
  transform: scale(var(--game-scale, 1));
  background: rgba(0, 0, 0, 0.85); /* 暗くする */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sokomade-overlay.show {
  display: flex !important;
  opacity: 1;
}

.sokomade-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 24px 16px 32px;
  box-sizing: border-box;
  color: #fefce8;
}

.sokomade-text {
  font-size: 4rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.95);
  transform: scale(0.5);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
  margin: 0;
  text-align: center;
}

.sokomade-overlay.show .sokomade-text {
  transform: scale(1);
  opacity: 1;
}

/* ゲームオーバー「そこまで！」＋最高到達の神様（開始時の神様効果カードと同じ体裁） */
.sokomade-inner--gameover .sokomade-text {
  font-size: 2.75rem;
  line-height: 1.15;
  margin-bottom: 0.15em;
}

.sokomade-meguri-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 8px;
  max-width: 300px;
  opacity: 0;
  transform: scale(0.92);
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.08s,
    opacity 0.4s ease 0.08s;
}

.sokomade-overlay.show .sokomade-meguri-summary:not(.hidden) {
  opacity: 1;
  transform: scale(1);
}

.sokomade-meguri-summary .sokomade-god-title {
  margin-bottom: 6px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 20px rgba(255, 255, 255, 0.2);
}

.sokomade-meguri-summary .sokomade-god-name {
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 18px rgba(255, 255, 255, 0.35);
}

.sokomade-meguri-summary .sokomade-god-image {
  width: 200px;
  height: 200px;
}

.sokomade-meguri-reached {
  margin: 10px 0 0;
  padding: 0 8px;
  font-size: 1.12rem;
  font-weight: 700;
  color: #fef08a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  line-height: 1.45;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}

.sokomade-gods {
  margin-top: 32px;
  width: 100%;
  display: none; /* デフォルトは非表示。開始演出時のみJSでflexにする */
  align-items: center;
  justify-content: center;
}

.sokomade-god {
  text-align: center;
  color: #ffffff;
  font-size: 0.8rem;
}

.sokomade-god-title {
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 1.6rem;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 18px rgba(255, 255, 255, 0.18);
}

.sokomade-god-image {
  display: block;
  width: 210px;
  height: 210px;
  object-fit: contain;
  margin: 0 auto;
}

.sokomade-god-name {
  margin-top: 4px;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 16px rgba(255, 255, 255, 0.3);
  /* かわいい丸ゴシック系フォントを優先（環境になければフォールバック） */
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic Rounded", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

.sokomade-lucky-msg {
  margin-top: 6px;
  min-height: 1.2em;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fef08a;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

/* スコア拡大アニメーション */
.score-pop {
  animation: score-pop-anim 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  display: inline-block;
  color: #fff;
}

@keyframes score-pop-anim {
  0% { transform: scale(1); }
  50% { transform: scale(1.6); color: #fff; text-shadow: 0 0 20px #fff; }
  100% { transform: scale(1); color: #fcd34d; }
}

/* ランキング強調表示 */
.ranking-emphasis {
  font-size: 1.6rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 0 15px rgba(255, 215, 0, 0.8);
  margin: 0.5rem 0;
  animation: ranking-emphasis-anim 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes ranking-emphasis-anim {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}