* { box-sizing: border-box; }
:root {
  color-scheme: dark;
  --bg-top: #0f0b24;
  --bg-bottom: #1d1440;
  --card: #1c1638;
  --card-edge: #463a7c;
  --text: #f5efe2;
  --muted: #cbc2de; /* 背景・札のどちらに対しても10:1以上 */
  --gold: #e8c56a;
  --gold-soft: #f4dc9c;
  --button: #261d4c;
  --button-hover: #342a63;
  --button-edge: #8f82c8; /* 押せるものの輪郭。背景に対して5:1 */
  --ink: #1b1233;
  --danger: #ffb4a8;
  --loss: #ff8a7a; /* 読みが下がった印（輪・札・軌跡）。色だけに頼らず、矢印と符号も添える */
  --mincho: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  --gothic: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  /* 舞台の絵の横幅。質問中は --ask の高さの窓で、目から卓の上までを寄りで見せる。
     --ask は「質問（2行）・答え5つ・ひとつ戻る」を1画面に収めた残りの高さ（390×664で164px。窓の下の約20pxに「読み 63%」を置く。
     答えの間隔8pxまで含めて、390×664で「ひとつ戻る」の下端が655px） */
  --big: min(340px, calc(100vw - 32px));
  --ask: clamp(64px, calc(100vh - 500px), 170px);
  font-family: var(--gothic);
  background: var(--bg-top);
}
@supports (height: 100svh) {
  :root { --ask: clamp(64px, calc(100svh - 500px), 170px); }
}

body {
  position: relative;
  z-index: 0;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  background: radial-gradient(ellipse 90% 420px at 50% 0, #2b1f5e 0, transparent 100%), linear-gradient(180deg, var(--bg-top) 0, var(--bg-bottom) 720px, var(--bg-bottom) 100%);
}
/* 夜空の星。周期の違うタイルを4枚重ねて並びの規則を見せない（明るい星ほど周期を長くしてまばらに）。
   本文に掛からないよう上だけ */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 620px;
  pointer-events: none;
  background:
    radial-gradient(circle at 13% 37%, rgba(255, 255, 255, .95) 0 1.3px, transparent 2px) 0 0 / 293px 241px,
    radial-gradient(circle at 71% 64%, rgba(255, 244, 214, .75) 0 1px, transparent 1.6px) 0 0 / 173px 151px,
    radial-gradient(circle at 86% 81%, rgba(233, 228, 255, .6) 0 .9px, transparent 1.5px) 0 0 / 229px 199px,
    radial-gradient(circle at 42% 12%, rgba(214, 206, 255, .45) 0 .7px, transparent 1.3px) 0 0 / 113px 97px;
  -webkit-mask-image: linear-gradient(#000 45%, transparent);
  mask-image: linear-gradient(#000 45%, transparent);
  opacity: .8;
}

.site-header, main, .site-footer { width: min(640px, calc(100% - 32px)); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 14px; }
.site-header a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.day { color: var(--gold); font-weight: 700; letter-spacing: .14em; }
/* 「最初から」を舞台の右上に置くための基準 */
main { position: relative; }

[hidden] { display: none !important; }
button, input { font: inherit; }
p { margin: 10px 0; }
:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 3px; }
/* 状態が変わったときに見出しへ移す焦点は、読み上げのためのもの。枠は出さない */
[tabindex="-1"]:focus { outline: none; }

/* ---------------------------------------------------------------- 舞台 */

.theater { position: relative; }
.stage {
  position: relative;
  height: calc(var(--big) * .8);
  overflow: hidden;
  /* 卓の布の下端を夜に溶かす（絵の縁で直線に切れて見えないように） */
  -webkit-mask-image: linear-gradient(#000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 24px), transparent);
  transition: height .5s var(--ease);
}
.scene { position: absolute; top: 0; left: 50%; width: var(--big); aspect-ratio: 5 / 4; transform: translateX(-50%); transition: width .5s var(--ease), top .5s var(--ease); }
.scene > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* 質問中は絵の y=84〜300（目から卓の上まで）を窓に入れる。水晶玉と読みの輪の下に「読み 63%」の置き場が残る */
#app[data-state="asking"] .stage { height: var(--ask); }
#app[data-state="asking"] .scene { top: calc(var(--ask) * -84 / 216); width: calc(var(--ask) * 400 / 216); }

.eyes__set { opacity: 0; transition: opacity .16s ease; }
.stage[data-mood="idle"] .eyes--idle,
.stage[data-mood="thinking"] .eyes--thinking,
.stage[data-mood="confident"] .eyes--confident,
.stage[data-mood="reveal"] .eyes--reveal,
.stage[data-mood="surprised"] .eyes--surprised,
.stage[data-mood="defeated"] .eyes--defeated { opacity: 1; }
.eyes--idle ellipse { transform-box: fill-box; transform-origin: center; animation: blink 5.6s infinite; }
.eyes--idle ellipse + ellipse { animation-delay: .04s; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.12); } }
.eye-glow { opacity: .55; transition: opacity .3s ease; }
.stage[data-mood="reveal"] .eye-glow, .stage[data-mood="surprised"] .eye-glow { opacity: 1; }
.stage[data-mood="defeated"] .eye-glow { opacity: .2; }
/* 驚いた瞬間に、占い師がびくっと身を引く */
.stage[data-mood="surprised"] .teller { animation: jolt .45s var(--ease); }
@keyframes jolt { 20% { transform: translateY(-6px); } 50% { transform: translateY(1px); } }

/* 待っている間も水晶玉がゆっくり光を放つ */
.aura:not(.aura--gold) { animation: glow 3.6s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .55; } }
.aura--gold, .sparkles { opacity: 0; transition: opacity .6s ease; }
#app[data-state="guessing"] .aura--gold, #app[data-state="won"] .aura--gold,
#app[data-state="guessing"] .sparkles, #app[data-state="won"] .sparkles { opacity: 1; }
.sparkles path { transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
.sparkles path:nth-child(2) { animation-delay: .8s; }
.sparkles path:nth-child(3) { animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.55); } 50% { opacity: 1; transform: scale(1); } }

.mist { transition: opacity .8s ease; }
.mist__layer { transform-origin: 200px 200px; }
.mist__layer--a { animation: swirl 38s linear infinite; }
.mist__layer--b { animation: swirl 54s linear infinite reverse; }
@keyframes swirl { to { transform: rotate(360deg); } }
/* 質問中は、見当が付くほど霧が薄くなる */
#app[data-state="asking"] .mist { opacity: calc(1 - .45 * var(--clarity)); }
#app[data-state="guessing"] .mist, #app[data-state="won"] .mist, #app[data-state="taught"] .mist { opacity: .22; }

/* 料理の絵（3Dの画像）。読めないときは app.js が絵文字に差し替える */
.art { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.art__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art__emoji { font-family: var(--emoji); line-height: 1; }

/* まぼろし。見え方 --clarity（読みの値の平方根。app.js が舞台に置く）が高いほどぼかしが取れて濃くなる。
   玉の中では円で切り抜き、縁をぼかして玉の色になじませる。ぼかしは絵の大きさに比例させる（0.3em≒絵の幅の17%） */
.stage { --clarity: 0; }
.vision {
  position: absolute;
  top: 43.75%;
  left: 35%;
  width: 30%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  container-type: inline-size;
  -webkit-mask-image: radial-gradient(closest-side, #000 58%, transparent);
  mask-image: radial-gradient(closest-side, #000 58%, transparent);
}
.vision__layer {
  position: absolute;
  inset: 0;
  font-size: 48px;
  font-size: 56cqw;
  opacity: 0;
  filter: blur(calc(.3em * (1 - var(--clarity))));
  transform: scale(.92);
  transition: opacity .6s ease, filter .6s var(--ease), transform .6s var(--ease);
}
.vision__layer.is-on { opacity: calc(.15 + .7 * var(--clarity)); }
.vision[data-mode="clear"] .vision__layer { filter: blur(0); transform: scale(1.12); }
.vision[data-mode="clear"] .vision__layer.is-on { opacity: 1; }
.vision[data-mode="hidden"] .vision__layer.is-on { opacity: 0; }

/* 読みの輪。手と台座より手前に描く。値は app.js が stroke-dashoffset（100−読み%）で置く */
.scene__ring {
  overflow: visible;
  opacity: 0;
  filter: drop-shadow(0 0 2px rgba(232, 197, 106, .5)) drop-shadow(0 0 0 rgba(255, 226, 154, 0));
  transition: opacity .4s ease;
}
#app[data-state="asking"] .scene__ring, #app[data-state="guessing"] .scene__ring { opacity: 1; }
.ring__track, .ring__loss, .ring__fill, .ring__glint { fill: none; stroke-dasharray: 100 100; stroke-dashoffset: 100; }
.ring__track { stroke: rgba(232, 197, 106, .26); stroke-width: 3; stroke-dashoffset: 0; }
.ring__fill { stroke: var(--gold-soft); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .45s var(--ease), opacity .2s ease; }
/* 下がるときは金の輪を先に新しい値へ切り、失った分は赤い輪（ring__loss）が光ってから縮む */
.scene__ring[data-dir="down"] .ring__fill, .scene__ring[data-dir="reset"] .ring__fill { transition: none; }
.scene__ring[data-empty="true"] .ring__fill { opacity: 0; }
.ring__loss { stroke: var(--loss); stroke-width: 4.6; stroke-linecap: round; opacity: 0; transition: stroke-dashoffset .55s var(--ease) .3s, opacity .35s ease; }
.ring__loss.is-losing { opacity: 1; transition: stroke-dashoffset .55s var(--ease) .3s, opacity .1s ease; }
/* 100%に達した瞬間：光の粒が輪を一周し、輪全体が明るく光る */
.ring__glint { stroke: #fffbea; stroke-width: 5.5; stroke-linecap: round; stroke-dasharray: 7 93; opacity: 0; }
.scene__ring.is-full .ring__glint { animation: glint .8s ease-in-out .3s both; }
.scene__ring.is-full { animation: flare 1.1s ease .25s both; }
@keyframes glint { 0% { stroke-dashoffset: 7; opacity: 0; } 10%, 85% { opacity: 1; } 100% { stroke-dashoffset: -93; opacity: 0; } }
@keyframes flare { 45% { filter: drop-shadow(0 0 5px rgba(255, 239, 190, .95)) drop-shadow(0 0 16px rgba(232, 197, 106, .75)); } }

/* 推測・結果の画面で、玉から浮かび上がって大きくなる料理の絵。玉と同じ大きさ・位置から出てくる */
.reveal {
  --rise: calc(var(--big) * .06);
  position: absolute;
  z-index: 1;
  left: 50%;
  top: calc(var(--big) * .5 - var(--rise));
  width: clamp(150px, calc(var(--big) * .52), 200px);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  container-type: inline-size;
  background: #1d1440;
  box-shadow: 0 0 0 2px rgba(246, 226, 168, .92), 0 0 34px 8px rgba(232, 197, 106, .42), 0 18px 40px -12px rgba(0, 0, 0, .75);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-50% + var(--rise))) scale(.6);
  transition: opacity .35s ease, transform .45s var(--ease);
}
/* 絵の四隅の背景が縁で途切れて見えないよう、内側を夜の色でぼかす */
.reveal::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 22px 8px rgba(15, 11, 36, .6); }
.reveal .art__emoji { font-size: 56cqw; }
.reveal.is-shown { opacity: 1; transform: translate(-50%, -50%); }
/* 輪が満ちて光るのを見せてから浮かび上がる */
.reveal.is-rising { animation: reveal .8s var(--ease) .55s both; }
@keyframes reveal { from { opacity: 0; transform: translate(-50%, calc(-50% + var(--rise))) scale(.6); } }

/* 玉の下の「読み 63%」と、前回との差の札。札は右に出すので、値の位置は動かない */
.reading {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
#app[data-state="asking"] .reading, #app[data-state="guessing"] .reading { opacity: 1; }
.reading__label {
  grid-column: 2;
  padding: 0 10px;
  border: 1px solid rgba(232, 197, 106, .5);
  border-radius: 999px;
  background: rgba(15, 11, 36, .86);
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.reading__value { color: var(--gold-soft); font-weight: 700; }
.reading__delta {
  grid-column: 3;
  justify-self: start;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s ease, transform .3s var(--ease);
}
.reading__delta.is-shown { opacity: 1; transform: none; transition-duration: .15s; }
.reading__delta[data-dir="up"] { background: linear-gradient(180deg, #f2d98f, #dcb452); color: var(--ink); }
.reading__delta[data-dir="down"] { background: var(--loss); color: #2b0a12; }
.reading__delta[data-dir="flat"] { border: 1px solid var(--button-edge); background: rgba(15, 11, 36, .86); color: var(--muted); }

/* 初回だけの説明。輪の左に吹き出しで添える（縦の行を増やさない）。
   狭い画面では1行8字ほどしか入らないので、文を行、句をかたまりにして、句の途中で折り返さない */
.ring-hint {
  position: absolute;
  z-index: 2;
  top: calc(var(--ask) * 116 / 216);
  right: calc(50% + var(--ask) * 68 / 216 + 10px);
  max-width: min(260px, calc(50% - var(--ask) * 68 / 216 - 10px));
  margin: 0;
  padding: 5px 8px;
  border: 1px solid rgba(232, 197, 106, .55);
  border-radius: 12px;
  background: #151033;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  transform: translateY(-50%);
  animation: fade .5s ease both;
}
.ring-hint__line { display: block; }
.ring-hint::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -6px;
  width: 10px;
  height: 10px;
  border-top: 1px solid rgba(232, 197, 106, .55);
  border-right: 1px solid rgba(232, 197, 106, .55);
  background: #151033;
  transform: translateY(-50%) rotate(45deg);
}
#app:not([data-state="asking"]) .ring-hint { display: none; }

/* ---------------------------------------------------------------- 共通の部品 */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 26px;
  border: 1px solid var(--button-edge);
  border-radius: 999px;
  background: var(--button);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
.button:active { transform: translateY(1px); }
.button--primary { border-color: #f6e2a8; background: linear-gradient(180deg, #f2d98f, #dcb452); color: var(--ink); box-shadow: 0 8px 24px -12px rgba(232, 197, 106, .7); }
.button:disabled, .button[aria-disabled="true"] { opacity: .45; cursor: default; transform: none; }
/* 押せない主ボタンは、金の半透明（押せそうに見える）ではなく枠線だけにする */
.button--primary:disabled { border-color: rgba(143, 130, 200, .7); background: transparent; color: rgba(203, 194, 222, .75); box-shadow: none; opacity: 1; }
.button--danger { border-color: var(--danger); color: var(--danger); }
.text-button { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.text-button:disabled { opacity: .45; text-decoration: none; cursor: default; }
.note { font-size: 14px; color: var(--muted); }
/* 句の途中で折り返さない（「でした／か。」「読め／ます。」のような泣き別れを防ぐ）。1行に収まらない長さのときだけ中で折れる */
.phrase, .chunk { display: inline-block; }
.phrase--line { display: block; }
kbd { display: inline-grid; place-items: center; min-width: 1.7em; height: 1.7em; padding: 0 .35em; border: 1px solid var(--button-edge); border-radius: 6px; font: 600 14px/1 var(--gothic); color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------- 状態ごとの札 */

.panel--intro, .panel--guessing, .panel--won, .panel--teaching, .panel--taught, .panel--ended { text-align: center; }
h1 { margin: 6px 0 12px; font-family: var(--mincho); font-size: clamp(28px, 7.6vw, 40px); font-weight: 600; line-height: 1.35; letter-spacing: .03em; }
.lead { max-width: 30em; margin: 0 auto 18px; }
#start { min-width: 220px; min-height: 52px; font-size: 18px; }
.memory { max-width: 420px; margin: 18px auto 0; padding: 8px 14px 4px; border: 1px solid var(--card-edge); border-radius: 14px; background: rgba(28, 22, 56, .7); }
.memory p { margin: 0; font-size: 14px; color: var(--muted); }
.memory strong { color: var(--gold-soft); }
#memory-said:empty { display: none; }

/* 問数と推測の残りを左に、読みの軌跡を右に。どちらも1問目から出す */
.progress { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 6px; }
.counter { margin: 0; font-size: 14px; color: var(--muted); letter-spacing: .06em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.trail { flex: 0 1 120px; min-width: 64px; height: 20px; overflow: visible; }
.trail__guide { stroke: rgba(232, 197, 106, .4); stroke-width: 1; stroke-dasharray: 2 3; }
.trail__base { stroke: rgba(203, 194, 222, .2); stroke-width: 1; }
.trail__line { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.trail__point { fill: var(--gold-soft); }
.trail__point.is-down { fill: var(--loss); }
.trail__switch { fill: none; stroke: var(--text); stroke-width: 1; }

.card { position: relative; padding: 8px 16px 12px; border: 1px solid var(--card-edge); border-radius: 16px; background: var(--card); box-shadow: 0 12px 30px -20px #000; text-align: center; }
.card::before { content: ""; position: absolute; top: -1px; right: 18%; left: 18%; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
/* いちばん長い質問（29字）が390px幅で2行に収まる大きさ。
   札の高さは質問の長さによらず2行ぶんに固定し、1行の質問は上下の中央に置く（質問が替わっても答えのボタンが動かない） */
.question {
  display: grid;
  grid-template-rows: auto minmax(calc(2em * 1.45), auto);
  align-items: center;
  margin: 0;
  font-family: var(--mincho);
  font-size: clamp(20px, 5.4vw, 26px);
  font-weight: 600;
  line-height: 1.45;
  text-wrap: balance;
  word-break: auto-phrase;
}
#question-text.is-new { animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; } }
.question__lead { display: block; font-family: var(--gothic); font-size: 14px; font-weight: 500; line-height: 1.6; color: var(--gold); letter-spacing: .12em; }
/* 縦に5つ並ぶスマホでは押し間違えないよう8px空ける（390×664で「ひとつ戻る」の下端が655px） */
.answers { display: grid; gap: 8px; margin-top: 10px; }
.answer { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--button-edge); border-radius: 12px; background: var(--button); color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.3; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.answer:active { background: #43377a; }
.answer.is-chosen { border-color: var(--gold); background: #4a3c86; }
.answer kbd { display: none; }

.aux { display: flex; justify-content: flex-start; gap: 8px; margin-top: 4px; }
/* 推測の画面では、当たり／ちがうの行（最大420pxで中央）の左端にそろえる。広い画面で左の端に離れて見えないように */
#app[data-state="guessing"] .aux { max-width: 420px; margin-inline: auto; }
/* 舞台の右上。答えのボタンから離して、「いいえ」との押し間違いを無くす */
.restart { position: absolute; z-index: 3; top: 0; right: 0; }
.key-hint { display: none; margin: 4px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.key-hint kbd { margin: 0 .15em; }

.guess__note { margin: 6px 0 0; font-size: 14px; font-weight: 700; color: var(--gold); letter-spacing: .14em; }
.guess { margin: 2px 0 0; font-weight: 400; }
.guess.is-revealing { animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.guess__lead, .guess__tail { display: block; font-size: 16px; color: var(--muted); }
.guess__name { display: block; margin: 2px 0; font-family: var(--mincho); font-size: clamp(30px, 8.4vw, 44px); font-weight: 600; line-height: 1.3; color: var(--gold-soft); text-shadow: 0 0 22px rgba(232, 197, 106, .4); overflow-wrap: anywhere; }
.guess__mist { margin: 18px 0; font-family: var(--mincho); font-size: 18px; line-height: 1.8; }
.guess__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 420px; margin: 14px auto 0; }

.result-title { margin: 8px 0 4px; font-family: var(--mincho); font-size: clamp(24px, 6.6vw, 32px); font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
/* 料理名の途中で折り返さない（1行に収まらない長さのときだけ中で折れる） */
.result-title .name { display: inline-block; }
.result-count { margin: 0; color: var(--muted); }
/* 気分で答えた人への推測が当たったとき（提案として出したもの） */
.result-suggest { margin: 0 0 6px; font-family: var(--mincho); font-size: 18px; color: var(--gold-soft); }
.deciders { max-width: 480px; margin: 12px auto 0; padding: 10px 16px; border: 1px solid var(--card-edge); border-radius: 16px; background: var(--card); text-align: left; }
.deciders h3 { margin: 0 0 2px; font-size: 14px; font-weight: 700; color: var(--gold); letter-spacing: .1em; }
.deciders ul { margin: 0; padding: 0; list-style: none; }
/* 質問は左で折り返し、答えは右に1語で置く（「→ はい」だけが次の行に落ちないように） */
.deciders li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 15px; }
.deciders li:first-child { border-top: 0; }
.decider__q { word-break: auto-phrase; }
.decider__a { flex: none; white-space: nowrap; }
.decider__a .arrow { color: var(--muted); }
.decider__a .reply { color: var(--gold-soft); font-weight: 700; }
.result-memory { margin: 12px 0 0; }

.finale { margin-top: 16px; text-align: center; }
#again { min-width: 220px; }
.result-share { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 0; }
.result-share__button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border: 1px solid var(--button-edge); border-radius: 999px; background: transparent; color: var(--text); font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.result-share__said { margin: 6px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.result-share__said:empty { margin: 0; }

.teach { max-width: 480px; margin: 14px auto 0; text-align: left; }
.teach label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.teach input { width: 100%; min-height: 50px; padding: 10px 14px; border: 1px solid var(--button-edge); border-radius: 12px; background: #120d29; color: var(--text); font-size: 17px; }
.teach input:focus-visible { outline-offset: 2px; }
.teach input::placeholder { color: #9a90b8; opacity: 1; }
.teach__error { min-height: 1.6em; margin: 6px 0 0; font-size: 14px; color: var(--danger); }
.teach__hint { margin: 2px 0 8px; font-size: 14px; color: var(--muted); }
.candidates { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
.candidate { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 1px 16px 1px 1px; border: 1px solid var(--button-edge); border-radius: 999px; background: var(--button); color: var(--text); font-size: 15px; font-weight: 700; cursor: pointer; }
.candidate__art { flex: none; width: 40px; height: 40px; overflow: hidden; border-radius: 50%; background: #1d1440; }
.candidate__art .art__emoji { font-size: 22px; }
#teach-new { width: 100%; }
#teach-skip { display: block; margin: 10px auto 0; }

dialog { width: min(440px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--card-edge); border-radius: 18px; background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(5, 3, 14, .75); }
dialog h2 { margin: 0 0 8px; font-family: var(--mincho); font-size: 20px; line-height: 1.5; }
dialog p { margin: 0 0 20px; font-size: 15px; color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.site-footer { padding: 28px 0 40px; font-size: 14px; }
.site-footer > a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
/* 共通の共有欄も本文と同じ最小文字サイズにする */
.share, .share__label, .share__button, .share__note, .share__said { font-size: 14px; }
.share { min-width: 0; max-width: 100%; }

/* ---------------------------------------------------------------- 画面の大きさごと */

/* 指で押す端末では :hover が押したあとも残り、次の質問の同じ位置の答えが「選ばれている」ように見える。
   ホバーの見た目はマウスで操作する端末だけにする */
@media (hover: hover) and (pointer: fine) {
  .site-header a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
  .button:not(:disabled):hover { background: var(--button-hover); }
  .button--primary:not(:disabled):hover { background: linear-gradient(180deg, #f7e3a6, #e6c164); }
  .text-button:hover { color: var(--text); }
  .text-button:disabled:hover { color: var(--muted); }
  .answer:hover { border-color: var(--gold); background: var(--button-hover); }
  .result-share__button:hover { background: var(--button); }
  .candidate:hover { border-color: var(--gold); background: var(--button-hover); }
}

/* 390px より狭い画面では、初回の説明の句（「いまの読みです。」8字）が1行に入るよう字を少し小さくする */
@media (max-width: 389px) {
  .ring-hint { font-size: 11px; }
}

/* キーのヒントは、キーボードとマウスで操作する広い画面でだけ出す（狭い画面では答えの札が混み合う）。
   外れの知らせ（霧）を出している間は、押しても効かないので隠す */
@media (hover: hover) and (pointer: fine) and (min-width: 720px) {
  .answer kbd { display: inline-grid; }
  #app[data-state="intro"] .key-hint--intro,
  #app[data-state="asking"] .key-hint--asking,
  #app[data-state="guessing"]:not([data-busy="true"]) .key-hint--guessing,
  #app:is([data-state="won"], [data-state="taught"], [data-state="ended"]) .key-hint--finale { display: block; }
}
@media (min-width: 720px) {
  :root { --big: 400px; --ask: clamp(84px, calc(100vh - 420px), 230px); }
  @supports (height: 100svh) { :root { --ask: clamp(84px, calc(100svh - 420px), 230px); } }
  .answers { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  /* 横一列では1つ123px。数字と「たぶんそう」を1行に収める */
  .answer { gap: 6px; padding-inline: 4px; white-space: nowrap; }
}
@media (min-width: 1024px) {
  :root { --big: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
