/*
  いろジャケ 共通スタイル（スマホ前提）
  デザイン指示書（2026-12-04）の構成に従い、配色は本人の希望で Wordle に合わせる（2026-12-04）：
  - ライト＝白地・黒文字、ダーク＝#121213。アクセント（ボタン・選択中）はライトで黒、ダークで白
  - 状態色は Wordle と同じ 緑＝正解／黄＝近い／グレー＝外れ。未開放の段は Wordle の空のマスと同じく枠だけ
  - 初期値はOS設定、プレイヤーの選択は html[data-theme] で上書き（保存は header.ts）
  - テーマで変わるのは色だけ（レイアウトは同じ）
*/
:root {
  /* ライト：Wordleの配色（白地・黒文字・グレーの枠、緑＝正解／黄＝近い／グレー＝外れ） */
  --bg: #ffffff;
  --bg-image: none;
  --surface: #ffffff;        /* カード */
  --surface-2: #f2f3f4;      /* 押せない面・コース切替の台 */
  --line: #d3d6da;           /* 区切り・空のマス（Wordleの枠線） */
  --text: #1a1a1b;
  --muted: #6b6f72;          /* 補足文字（Wordleのグレーを AA まで少し濃く） */
  --accent: #1a1a1b;         /* アクセント：Wordle（NYT Games）と同じく黒 */
  --accent-btn: #1a1a1b;
  --accent-text: #ffffff;
  --active-line: #878a8c;    /* 最新の段の枠（Wordleの入力中のマス） */
  --open-bg: #f2f3f4;        /* 開いた段 */
  --open-text: #1a1a1b;
  --open-line: #d3d6da;
  --locked-bg: transparent;  /* 未開放の段：Wordleの空のマスと同じく枠だけ */
  --locked-text: #6b6f72;
  --ok-bg: #468541;          /* 正解：Wordleの緑（白文字で AA になるよう少し濃く） */
  --ok-text: #ffffff;
  --ok: #468541;
  --near-bg: #c9b458;        /* 近い：Wordleの黄 */
  --near-text: #1a1a1b;
  --miss-bg: #6b6f72;        /* 外れ：Wordleのグレー */
  --miss-text: #ffffff;
  --streak: #b45309;
  --ng: #b91c1c;
  --warn: #b45309;
  --header-bg: rgba(255, 255, 255, 0.94);
  --header-line: #d3d6da;
  --header-text: #1a1a1b;
  --shadow-board: 0 1px 2px rgba(0, 0, 0, 0.14), 0 8px 18px -6px rgba(0, 0, 0, 0.22);
  --ring-board: 0 0 0 1px rgba(0, 0, 0, 0.08);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.16);
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
      --bg: #121213;
    --bg-image: none;
    --surface: #1a1a1b;
    --surface-2: #2a2a2c;
    --line: #3a3a3c;
    --text: #ffffff;
    --muted: #a1a3a5;
    --accent: #ffffff;
    --accent-btn: #ffffff;
    --accent-text: #121213;
    --active-line: #818384;
    --open-bg: #2a2a2c;
    --open-text: #ffffff;
    --open-line: #3a3a3c;
    --locked-bg: transparent;
    --locked-text: #8f9193;
    --ok-bg: #468541;
    --ok-text: #ffffff;
    --ok: #468541;
    --near-bg: #b59f3b;
    --near-text: #121213;
    --miss-bg: #3a3a3c;
    --miss-text: #ffffff;
    --streak: #fbbf24;
    --ng: #f87171;
    --warn: #fbbf24;
    --header-bg: rgba(18, 18, 19, 0.94);
    --header-line: #3a3a3c;
    --header-text: #ffffff;
    --shadow-board: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 22px -6px rgba(0, 0, 0, 0.65);
    --ring-board: 0 0 0 1px rgba(255, 255, 255, 0.10);
    --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  /* ダーク：Wordleのダークモード（#121213 地・#3a3a3c の枠） */
  --bg: #121213;
  --bg-image: none;
  --surface: #1a1a1b;
  --surface-2: #2a2a2c;
  --line: #3a3a3c;
  --text: #ffffff;
  --muted: #a1a3a5;
  --accent: #ffffff;
  --accent-btn: #ffffff;
  --accent-text: #121213;
  --active-line: #818384;
  --open-bg: #2a2a2c;
  --open-text: #ffffff;
  --open-line: #3a3a3c;
  --locked-bg: transparent;
  --locked-text: #8f9193;
  --ok-bg: #468541;
  --ok-text: #ffffff;
  --ok: #468541;
  --near-bg: #b59f3b;
  --near-text: #121213;
  --miss-bg: #3a3a3c;
  --miss-text: #ffffff;
  --streak: #fbbf24;
  --ng: #f87171;
  --warn: #fbbf24;
  --header-bg: rgba(18, 18, 19, 0.94);
  --header-line: #3a3a3c;
  --header-text: #ffffff;
  --shadow-board: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 22px -6px rgba(0, 0, 0, 0.65);
  --ring-board: 0 0 0 1px rgba(255, 255, 255, 0.10);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); background-image: var(--bg-image); background-attachment: fixed;
  color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- ヘッダー：ロゴ／ストリーク＋ログインだけのピル ---------- */
.site-header { position: sticky; top: 0; z-index: 10; padding: calc(8px + env(safe-area-inset-top)) 12px 4px; }
.header-pill {
  max-width: 456px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 48px; padding: 4px 6px 4px 16px; border-radius: 999px;
  background: var(--header-bg); color: var(--header-text); box-shadow: 0 0 0 1px var(--header-line), 0 6px 20px rgba(15, 23, 42, 0.08);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 900; font-size: 18px; letter-spacing: 0.04em; line-height: 1; }
.logo-mark { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 20px; height: 20px; }
.logo-mark i { border-radius: 3px; }
.logo-mark i:nth-child(1) { background: #0ea5e9; }
.logo-mark i:nth-child(2) { background: #fbbf24; }
.logo-mark i:nth-child(3) { background: #22c55e; }
.logo-mark i:nth-child(4) { background: #f43f5e; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; min-width: 44px; padding: 0 12px;
  border: 0; border-radius: 999px; background: transparent; color: var(--header-text); cursor: pointer;
  font-size: 14px; font-weight: 700; text-decoration: none; justify-content: center;
}
.chip-btn:hover { background: color-mix(in srgb, var(--header-text) 8%, transparent); }
.streak-chip b { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.streak-chip .flame { color: var(--streak); }
.flame, .ico { width: 18px; height: 18px; flex: none; }
.login-chip { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--header-text) 28%, transparent); }

.site-main { max-width: 460px; margin: 0 auto; padding: 12px 16px 40px; }
.site-footer { max-width: 460px; margin: 0 auto; padding: 24px 16px calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.site-footer nav a { display: inline-block; padding: 6px 0; }
.fine { font-size: 12px; color: var(--muted); }

/* ---------- 共通部品 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 52px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px; cursor: pointer;
  transition: transform 0.08s ease, background 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn.primary:disabled, .btn.disabled { cursor: default; pointer-events: none; background: transparent; border: 1.5px dashed var(--line); color: var(--muted); }
.btn.primary { background: var(--accent-btn); border-color: var(--accent-btn); color: var(--accent-text); }
.btn.ghost { background: transparent; }
.btn.danger-btn { background: transparent; border-color: var(--ng); color: var(--ng); }
.btn.login-x { background: #000; color: #fff; border-color: #000; }
.btn.login-google { background: #fff; color: #1f1f1f; border-color: #747775; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 140px; }
.tag, .badge {
  display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--text);
}
.badge { background: var(--open-bg); color: var(--open-text); }
.notice { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.loading { color: var(--muted); text-align: center; padding: 32px 0; }
.page-title { font-weight: 900; font-size: 24px; line-height: 1.35; margin: 12px 0 12px; }
.lead { color: var(--muted); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0; }
.toast, #toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  z-index: 50; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow-pop);
}
#toast:empty, #toast:not(.show) { display: none; }

/* ---------- パレット：正方形の1枚の板（ゲーム・アーカイブ・アルバム共通） ---------- */
.board-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
/* 1色ずつ独立した正方形を横に並べる。白が背景に溶けないよう各マスに角丸＋2重の影 */
.palette-board { display: flex; width: 100%; gap: clamp(6px, 2vw, 10px); padding: 4px 0 2px; }
.palette-board .swatch { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.palette-board .chip { width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; box-shadow: var(--ring-board), var(--shadow-board); }
.palette-board .hex { font-family: var(--mono); font-size: clamp(9.5px, 2.7vw, 12px); font-weight: 600; letter-spacing: 0; line-height: 1; color: var(--muted); white-space: nowrap; }
.board-caption { margin: 0; font-size: 12px; color: var(--muted); }
.mini-palette { display: inline-flex; height: 16px; width: 80px; border-radius: 5px; overflow: hidden; vertical-align: middle; box-shadow: var(--ring-board); }
.mini-palette i { flex: 1; }

/* ---------- ゲーム ---------- */
.game { display: flex; flex-direction: column; gap: 14px; }
.archive-banner { margin: 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; font-size: 14px; }
.rerun-banner { margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--open-bg); color: var(--open-text); font-weight: 700; font-size: 14px; text-align: center; }

/* コース切替：ピルを横並び。選択中だけアクセントで塗る */
.course-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.course-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 44px; padding: 4px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; color: var(--muted);
  line-height: 1.2;
}
.course-tab.on { background: var(--accent-btn); color: var(--accent-text); }
.course-name { font-weight: 900; font-size: 15px; letter-spacing: 0.02em; }
.course-sub { font-size: 10px; font-weight: 700; opacity: 0.9; }
.course-mark { position: absolute; top: -3px; right: -1px; width: 18px; height: 18px; box-shadow: 0 0 0 2px var(--surface-2); border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 900; }
.course-mark.ok { background: var(--ok-bg); color: var(--ok-text); }
.course-mark.ng { background: var(--miss-bg); color: var(--miss-text); }

/* メタ情報：小さく1行 */
.meta { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 16px; margin: 2px 0 0; font-size: 13px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.meta .left b { color: var(--text); font-weight: 900; font-size: 15px; margin: 0 1px; }
.meta .region { padding: 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); }

.board { display: flex; flex-direction: column; gap: 14px; }

/*
  ヒント階段：状態で強弱をはっきり分ける（未開放＝点線で退く／開放＝実線で値を大きく／最新＝黒枠で一番強く）。
  値（答えの手がかり）が主役なので、段の名前は小さく、値は太く大きく。
*/
.steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.step {
  display: grid; grid-template-columns: 28px auto 1fr; align-items: center; gap: 10px;
  min-height: 50px; padding: 8px 16px 8px 10px; border-radius: 999px; border: 1.5px dashed var(--line);
  background: transparent; color: var(--locked-text); font-size: 15px;
}
.step .sno { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 900; border: 1.5px solid currentColor; }
.step .stitle { font-weight: 700; font-size: 13px; white-space: nowrap; }
.step .sval { text-align: right; min-width: 0; overflow-wrap: anywhere; }
.step.locked .sval { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 13px; font-weight: 500; }
.step.open { background: var(--surface); border: 1.5px solid var(--line); color: var(--muted); }
.step.open .sno { background: var(--text); border-color: var(--text); color: var(--bg); }
.step.open .sval { color: var(--text); font-size: 17px; font-weight: 900; }
.step.latest { border: 2px solid var(--text); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.35); }
.step.latest .stitle { color: var(--text); }
.step.latest.flash { animation: step-in 0.5s ease-out; }
@keyframes step-in { from { transform: scale(0.97); opacity: 0.3; } to { transform: none; opacity: 1; } }
.new-label { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--muted); }
.step.wide.open { grid-template-columns: 28px 1fr; border-radius: 22px; padding: 10px 16px 12px 10px; }
.step.wide.open .sval { grid-column: 2 / -1; text-align: left; font-size: 14px; font-weight: 700; }
.track-hint { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr; gap: 2px; }
.track-hint li::before { content: "♪ "; color: var(--muted); }
.length-hint { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 3px; }
.lh-box { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 24px; border-radius: 3px; border: 1.5px solid var(--line); font-weight: 900; font-size: 13px; }
.lh-box.first { background: var(--text); border-color: var(--text); color: var(--bg); }
.lh-count { margin-left: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }

/* 回答の記録：Wordleのマス（6回分）。ここだけ色を強く使う */
.tries { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 6px; }
.try { aspect-ratio: 1 / 1; display: grid; place-items: center; border-radius: 4px; font-size: 20px; font-weight: 900; border: 2px solid var(--line); color: var(--muted); max-height: 56px; }
.try.ok { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok-text); }
.try.miss { background: var(--miss-bg); border-color: var(--miss-bg); color: var(--miss-text); }
.try.near { background: var(--near-bg); border-color: var(--near-bg); color: var(--near-text); }
.try.skip { background: var(--surface-2); border-color: var(--surface-2); color: var(--muted); }
.guess-names { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.guess-names li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; color: var(--muted); }
.guess-names .gm { font-size: 12px; font-weight: 900; }
.guess-names .gt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guess-names li.ok { color: var(--text); font-weight: 700; }
.guess-names li.ok .gm { color: var(--ok); }

/* 入力（ピル型）と SKIP／GUESS */
.guess-input { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.combo { position: relative; }
.combo input {
  width: 100%; min-height: 52px; padding: 0 48px 0 20px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 16px; /* iPhoneでズームさせない */
  -webkit-appearance: none; appearance: none;
}
.combo input::placeholder { color: var(--muted); opacity: 1; }
.combo input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.combo .clear { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; font-size: 22px; color: var(--muted); cursor: pointer; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-pop);
  max-height: 50vh; overflow-y: auto;
}
.suggest li { display: flex; flex-direction: column; padding: 8px 12px; min-height: 44px; justify-content: center; cursor: pointer; border-radius: 14px; }
.suggest li.on, .suggest li:hover { background: var(--open-bg); }
.suggest li.used { opacity: 0.45; }
.suggest .st { font-weight: 700; line-height: 1.35; }
.suggest .sa { font-size: 13px; color: var(--muted); }
.no-match { margin: 8px 4px 0; font-size: 13px; color: var(--muted); }
.play-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

/* 結果 */
.result { scroll-margin-top: 76px; display: flex; flex-direction: column; gap: 14px; padding: 20px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; }
.result-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px; font-weight: 900; font-size: 15px; background: var(--miss-bg); color: var(--miss-text); }
.result.win .result-badge { background: var(--ok-bg); color: var(--ok-text); }
.answer-card { padding: 4px 0 12px; border-bottom: 1px solid var(--line); }
.answer-title { margin: 0; font-weight: 900; font-size: 22px; line-height: 1.35; }
.answer-artist { margin: 2px 0 8px; color: var(--muted); font-weight: 700; }
.answer-artist .tag { margin-left: 6px; }
.streak { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 700; }
.streak .flame { width: 22px; height: 22px; color: var(--streak); }
.streak b { font-weight: 900; font-size: 28px; line-height: 1; }
.share-preview { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-family: var(--font); font-size: 13px; white-space: pre-wrap; word-break: break-all; }
.listen-title { margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.pr { display: inline-block; font-size: 10px; font-weight: 700; padding: 0 5px; border: 1px solid var(--muted); border-radius: 4px; color: var(--muted); vertical-align: middle; }
.listen-links { display: flex; flex-wrap: wrap; gap: 8px; }
.listen-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); text-decoration: none; font-size: 14px; font-weight: 700; }
.others p { margin: 0 0 6px; font-size: 14px; color: var(--muted); }
.next { margin: 0; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.next b { color: var(--text); font-size: 18px; }
.tracks { margin: 6px 0 0; padding-left: 1.6em; }
.tracks.small { font-size: 14px; }

.skip-note { margin: -2px 4px 0; font-size: 12px; color: var(--muted); text-align: center; }
.howto-lead { margin: 10px 0 4px; font-size: 15px; }
.howto-list { margin: 8px 0 0; padding-left: 1.4em; display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.howto-list b { display: block; color: var(--text); font-size: 15px; }
.howto-start { width: 100%; margin-top: 18px; }
.howto-dont-show { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin-top: 6px; font-size: 14px; color: var(--muted); cursor: pointer; }
.howto-dont-show input { width: 18px; height: 18px; accent-color: var(--accent-btn); }
.help-chip { padding: 0 6px; min-width: 40px; }
/* 幅の狭いスマホ（320px）でもロゴとログインが折り返さないように */
.logo-text, .chip-btn { white-space: nowrap; }
@media (max-width: 359px) { .logo { font-size: 16px; gap: 6px; } .header-actions { gap: 0; } .chip-btn { padding: 0 8px; } }
.help-chip svg { width: 22px; height: 22px; }

/* ---------- ダイアログ ---------- */
.dialog-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(2, 6, 23, 0.55); display: flex; align-items: flex-end; justify-content: center; }
.dialog {
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); color: var(--text); border-radius: 24px 24px 0 0; padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}
@media (min-width: 600px) { .dialog-backdrop { align-items: center; } .dialog { border-radius: 24px; } }
/* 中央に出すモーダル（遊び方）。スマホでも下からのシートにせず、画面の真ん中に浮かせる */
.dialog-backdrop.center { align-items: center; padding: 16px; }
.dialog-backdrop.center .dialog { border-radius: 24px; padding-bottom: 20px; max-height: calc(100dvh - 32px); animation: pop-in 0.18s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dialog-backdrop.center .dialog { animation: none; } }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-head h2 { margin: 0; font-weight: 900; font-size: 20px; }
.close-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface-2); font-size: 20px; cursor: pointer; }
.dialog h3 { font-size: 15px; margin: 18px 0 6px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 12px; border-radius: 16px; background: var(--surface-2); }
.stat { display: flex; flex-direction: column; align-items: center; padding: 10px 4px; }
.stat b { font-weight: 900; font-size: 24px; line-height: 1.2; }
.stat span { font-size: 11px; color: var(--muted); }
.dist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dist li { display: grid; grid-template-columns: 1.4em 1fr; gap: 6px; align-items: center; }
.dk { font-weight: 900; text-align: center; }
.db { display: inline-block; background: var(--accent-btn); color: var(--accent-text); padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; text-align: right; min-width: 26px; }
.settings-sec { padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.settings-sec p { font-size: 14px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.segmented button { min-height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18); }
.danger { margin-top: 14px; }
.warn-text { color: var(--ng); }
.actions.login { flex-direction: column; }
.actions.login .btn { flex: none; width: 100%; }

/* ---------- アーカイブ・アルバム ---------- */
.archive-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.archive-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.archive-date { font-weight: 700; font-variant-numeric: tabular-nums; }
.archive-palettes { display: flex; gap: 6px; }
.day-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px; margin: 14px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; }
.day-card h2 { font-weight: 900; font-size: 18px; margin: 0; display: flex; gap: 8px; align-items: center; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.spoiler summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.answer { font-size: 17px; font-weight: 700; }
.cta { margin: 20px 0; }
.cta .btn { width: 100%; }
.eyebrow { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.album-artist { margin: -6px 0 14px; font-size: 17px; color: var(--muted); font-weight: 700; }
.inline-list { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; }
.prose h2 { font-size: 18px; margin-top: 28px; }
.prose p, .prose li { font-size: 15px; }

/* ---------- 広告（結果表示後・アーカイブ・アルバムだけ） ---------- */
.ad-slot { margin: 32px 0 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ad-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }

/* ---------- ログインの案内（遊び終わった直後・成績を開いたとき） ---------- */
.streak-login { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer; }
.streak-login .flame { color: var(--streak); }
.dialog .later { width: 100%; margin-top: 10px; border-color: transparent; }
