/* ================================================================
   自己ホスト Nunito（latin, 400 / 700 / 900）
   出典: @fontsource/nunito 5.2.5 — SIL Open Font License 1.1
   フォントファイルの場所: /fonts/ （リポジトリルート）
   ================================================================ */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/nunito-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/nunito-latin-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/fonts/nunito-latin-900.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ================================================================
   style.css – MAKE10 全スタイル
   構成:
   01. CSS カスタムプロパティ（カラーパレット）
   02. リセット & ベース
   03. 背景アニメーション（光球）
   04. レイアウト（header / main / footer）
   05. 画面切り替え（.screen / .active）
   06. ガラスカード
   07. ヘッダー
   08. フッター
   09. トップ画面
   10. ボタン共通・バリアント
   11. ゲーム画面：ヘッダー行
   12. ゲーム画面：タイムゲージ
   13. ゲーム画面：問題カード
   14. ゲーム画面：選択肢タイル
   15. フィードバック演出
   16. リザルト画面
   17. ハイスコア表示
   18. アニメーション一覧
   19. レスポンシブ
   ================================================================ */


/* ──────────────────────────────────────────────────────────────
   01. CSS カスタムプロパティ
   ゲーム全体の色・影・ガラス効果を一元管理する CSS 変数
────────────────────────────────────────────────────────────── */
:root {
  --bg:           #f5f0e6;
  --card:         #ffffff;
  --choice-fill:  #fdf8ee;
  --primary:      #4d80d1;
  --accent:       #9a6bc7;
  --gauge-full:   #6bb884;
  --gauge-warn:   #cc7566;
  /* Blitz（10秒）モード専用の強調色。
     iOS アプリ（FDL-TenBlitz）の DS.blitzColor と同じ値にしている。
       Color(red: 0.82, green: 0.30, blue: 0.30) = rgb(209, 77, 77)
     通常モードには使わない。ここぞという場面だけに使うから効く。 */
  --blitz:        #d14d4d;
  --blitz-accent: #e08a4a;
  --gauge-bg:     #dbd9cc;
  --text:         #383843;
  --muted:        #858588;
  --glass:        rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.35);
  --shadow:       rgba(56, 56, 67, 0.08);
}


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

html { height: 100%; }

html, body {
  touch-action: manipulation;           /* ダブルタップズームを抑止する */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  overflow-x: hidden;
}


/* ──────────────────────────────────────────────────────────────
   03. 背景アニメーション（光球）
   画面全体に固定した装飾用の光球。ゲーム UI より後ろに配置する。
────────────────────────────────────────────────────────────── */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 12s ease-in-out infinite alternate;
}

/* 左上：青紫の大きい光球 */
.bg-orbs .orb:nth-child(1) {
  width: 320px; height: 320px;
  background: var(--primary);
  top: -80px; left: -60px;
  animation-duration: 14s;
}

/* 右下：紫の中くらいの光球 */
.bg-orbs .orb:nth-child(2) {
  width: 260px; height: 260px;
  background: var(--accent);
  bottom: -40px; right: -40px;
  animation-duration: 10s;
  animation-delay: -4s;
}

/* 中央：緑の小さい光球 */
.bg-orbs .orb:nth-child(3) {
  width: 200px; height: 200px;
  background: var(--gauge-full);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 16s;
  animation-delay: -8s;
}


/* ──────────────────────────────────────────────────────────────
   04. レイアウト（header / main / footer）
────────────────────────────────────────────────────────────── */
#main-content {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 0 4px;
}

/* ゲーム本体ラッパー：縦幅の上限を設けてコンテンツが広がりすぎないようにする */
.game-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  height: calc(100dvh - 52px - 34px); /* 全画面高さ − ヘッダー − フッター */
  max-height: 720px;
  padding: 12px 20px 12px;
  display: flex;
  flex-direction: column;
}


/* ──────────────────────────────────────────────────────────────
   05. 画面切り替え
   非アクティブな画面は display:none で完全非表示にする。
────────────────────────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: flex;
}

/* ゲーム画面はアイテムを上揃えにする（タイムゲージを上部に固定するため） */
#screen-game {
  justify-content: flex-start;
}


/* ──────────────────────────────────────────────────────────────
   06. ガラスカード
   backdrop-filter で背景をぼかし、半透明の境界線でガラス質感を演出する。
────────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px var(--shadow);
  padding: 28px 24px;
  width: 100%;
}


/* ──────────────────────────────────────────────────────────────
   07. ヘッダー
   全画面で常時表示されるゲームタイトルバー。
────────────────────────────────────────────────────────────── */
.site-header {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: 10px 20px 6px;
  flex-shrink: 0;
}

.site-title {
  font-size: clamp(1.1rem, 5vw, 1.4rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--text);
  line-height: 1;
}

/* [FIX] "10" の部分をグラデーションカラーで強調する（旧: .title-num → 修正: .title-accent） */
.site-title .title-accent {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}



/* ──────────────────────────────────────────────────────────────
   08. フッター
   全画面で常時表示されるコピーライト・外部リンクエリア。
────────────────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 2;
  width: 100%;
  text-align: center;
  padding: 4px 12px 10px;
  flex-shrink: 0;
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.8;
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  outline: none;
}


/* ──────────────────────────────────────────────────────────────
   09. トップ画面
────────────────────────────────────────────────────────────── */

/* ゲームルール見出し */
/* [FIX] HTML で使用されているが CSS に未定義だったため追加 */
.rule-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* ゲームルールの説明文 */
.title-rule {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  margin-bottom: 28px;
}

.title-rule strong {
  color: var(--text);
}

/*
  日本語の従行（英語メイン・日本語サブ構成）

  ★ 明度を落とさず、文字サイズだけで従属を示している理由 ★
  .title-rule の色 var(--muted) #858588 は、背景 var(--bg) #f5f0e6 に対して
  コントラスト比が約 3.2:1 しかありません。WCAG AA の基準（通常文字で 4.5:1）を
  すでに下回っています。ここから opacity で薄くすると、日本語の行だけ
  さらに読みにくくなります。
  チーズクエストは白地に別色を当てて主従を分けていますが、こちらは
  背景がクリーム色で使える色域が狭いため、サイズ差だけで表現しています。
*/
.tip-ja {
  font-size: 0.9em;
}


/* ──────────────────────────────────────────────────────────────
   10. ボタン共通・バリアント
────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 16px 36px;
  text-decoration: none;
}

.btn:active  { transform: scale(0.95); }

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

/* グラデーション背景のメインボタン */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 6px 24px rgba(77, 128, 209, 0.3);
}

.btn-primary:active { box-shadow: 0 2px 12px rgba(77, 128, 209, 0.2); }

/*
  Blitz（10秒）モード中の配色。

  --primary と --accent を差し替えるだけで、タイトルの強調文字・問題の数字・
  背景の光球・リザルトのスコア・フォーカス枠まで、まとめて赤系に変わる。
  個別に上書きして回る必要がない。

  iOS アプリも mainColor を isBlitz で切り替える同じ考え方をしている。

  ■ --gauge-full は変えていない
    ゲージの緑は「まだ余裕がある」、赤（--gauge-warn）は「残りわずか」を
    意味している。Blitz だからといって常に赤にすると、この区別が消える。
    モードの色と、状態を示す色は役割が違う。
*/
body.mode-blitz {
  --primary: var(--blitz);
  --accent:  var(--blitz-accent);
}

/* リザルト画面のモード表示。どちらの記録かを小さく添える */
.result-mode {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 4px;
}

/* 10秒（Blitz）モードのボタン。
   btn-primary が青→紫なのに対し、こちらは赤→橙。
   「急ぐ」「熱い」という印象を色で伝える。 */
.btn-blitz {
  background: linear-gradient(135deg, var(--blitz), var(--blitz-accent));
  color: #fff;
  box-shadow: 0 6px 24px rgba(209, 77, 77, 0.3);
}

.btn-blitz:active { box-shadow: 0 2px 12px rgba(209, 77, 77, 0.2); }

/* モード選択の2つのボタン。
   並べて置くことで「どちらかを選ぶ」ことが一目で伝わる。 */
.mode-buttons {
  display: flex;
  gap: 10px;
}

/* ボタンの中身は2行にする。
   カードの幅は 380px で固定されており、横に並べると1つあたり約160px しかない。
   「⏱️ 30 SEC / 30びょう」を1行に収めると文字が折り返して崩れるため、
   英語と日本語を上下に分ける。サイトの他の箇所と同じ並べ方でもある。

   ※ ここはビューポート幅ではなくカード幅で決まるので、
      画面を広げても1つあたりの幅は変わらない。 */
.mode-buttons .btn {
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 14px 8px;
}

.mode-main {
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
}

.mode-sub {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.9;
  white-space: nowrap;
}

/* ごく狭い端末ではカード自体が縮むため、縦に積む */
@media (max-width: 380px) {
  .mode-buttons { flex-direction: column; }
}

/* ガラス素材のセカンダリボタン */
.btn-secondary {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 16px;
  padding: 14px 28px;
}

/* 削除: .btn-home（ゲーム画面左上のホームボタン）。
   ボタン自体は「こども向け領域を袋小路にする」方針で HTML から外したが、
   スタイルだけが残っていた。HTML・JS のどこからも参照されていない。 */


/* ──────────────────────────────────────────────────────────────
   11. ゲーム画面：ヘッダー行
────────────────────────────────────────────────────────────── */
.play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 10px;
}

.score-display {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

/* スコア数字だけ大きく目立たせる */
.score-display span {
  font-size: 22px;
  color: var(--text);
}

/* コンボがないときも高さを確保してレイアウトがずれないようにする */
.combo-display {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  min-height: 20px;
  transition: transform 0.2s ease;
}

/* JS で .pop を付け外しすることでアニメーションを毎回再トリガーする */
.combo-display.pop {
  animation: comboPop 0.3s ease;
}


/* ──────────────────────────────────────────────────────────────
   12. ゲーム画面：タイムゲージ
────────────────────────────────────────────────────────────── */
.gauge-wrapper {
  width: 100%;
  height: 12px;
  background: var(--gauge-bg);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}

.gauge-bar {
  height: 100%;
  /* 変更: width を JS が書き換える方式から、transform: scaleX() に変えた。
     width の変更はレイアウトを発生させるが、transform は合成だけで済む。
     この要素は毎フレーム（約60回/秒）更新されるため差が出る。

     transform-origin を left にしないと、中央を基準に縮んで
     両端から減っていくように見えてしまう。 */
  width: 100%;
  transform: scaleX(1);
  transform-origin: left center;
  border-radius: 6px;
  background: var(--gauge-full);
  /* 変更: 幅のトランジションを外した。
     16msごとに値が変わるのに 0.08秒の遷移を掛けていたため、
     遷移が終わる前に次の値が来て、かえって引っかかっていた。
     毎フレーム更新しているので遷移は要らない。色だけ残す。 */
  transition: background-color 0.4s ease;
  will-change: transform;
}


/* ──────────────────────────────────────────────────────────────
   13. ゲーム画面：問題カード
────────────────────────────────────────────────────────────── */
.question-area {
  width: 100%;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
}

.question-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 32px var(--shadow);
  position: relative;
}

/* 「MAKE 10!」ラベル */
.question-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

/* 問題の数字（大きく中央に表示） */
.question-number {
  font-size: 80px;
  font-weight: 900;
  line-height: 1;
  color: var(--primary);
  transition: transform 0.2s ease;
}

/* JS が付け外しするクラス。リフロー強制で毎回アニメーションをリセットする */
.question-number.animate-in {
  animation: numberIn 0.25s ease;
}

/* 「? + X = 10」ヒント行 */
.question-hint {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 700;
}

.question-hint span {
  color: var(--accent);
  font-size: 15px;
}

/* カードの右上に「NEXT」ラベルを絶対配置する */
.next-label {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  opacity: 0.7;
}

/* 次の問題の数字をやや薄く表示してプレビュー感を出す */
.next-number {
  position: absolute;
  top: 24px; right: 16px;
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.5;
}


/* ──────────────────────────────────────────────────────────────
   14. ゲーム画面：選択肢タイル
────────────────────────────────────────────────────────────── */
.tiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  margin-bottom: 8px;
}

/* 変更: タイルは div + role="button" から、本物の <button> になった。
   ボタンには既定のスタイルが付くため、ここで打ち消す必要がある。
     appearance  … OS 固有の見た目（iOS の角丸やグラデーション）を消す
     font-family … ボタンは親のフォントを継承しないため明示する
     padding     … 既定の内側余白を消す（中央揃えは flex に任せる）
     margin      … 既定の外側余白を消す
   逆に、background / border / color / cursor は元から指定済みなので
   追加の打ち消しは要らない。 */
.tile {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  padding: 0;
  margin: 0;
  aspect-ratio: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--choice-fill);
  border: 2px solid var(--glass-border);
  border-radius: 18px;
  font-size: 42px;
  font-weight: 900;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  position: relative;
  overflow: hidden;
}

/* キーボードで操作している人に、今どのタイルを選んでいるかを示す。
   これが無いと <button> にした意味が半減する。
   :focus ではなく :focus-visible を使うことで、
   マウスでクリックしたときには枠が出ない（必要な人にだけ見える）。 */
.tile:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.tile:active { transform: scale(0.93); }

.tile:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* 正解タップ時：緑色の背景＋拡大アニメーション */
.tile.correct {
  background: rgba(107, 184, 132, 0.2);
  border-color: var(--gauge-full);
  animation: tileCorrect 0.35s ease;
}

/* 誤答タップ時：赤色の背景＋横揺れアニメーション */
.tile.wrong {
  background: rgba(204, 117, 102, 0.15);
  border-color: var(--gauge-warn);
  animation: tileWrong 0.35s ease;
}

/* 問題切り替え時のタイル出現アニメーション */
.tile.appear {
  animation: tileAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ──────────────────────────────────────────────────────────────
   15. フィードバック演出
────────────────────────────────────────────────────────────── */

/* 正解・不正解時に問題エリア中央に絵文字を表示してフェードアウトさせる */
.feedback {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  pointer-events: none;
  animation: feedbackPop 0.5s ease forwards;
  z-index: 10;
}

/* コンボ達成時に画面上をランダムな絵文字が舞い上がって消える演出 */
.combo-emoji {
  position: fixed;
  font-size: 36px;
  pointer-events: none;
  z-index: 20;
  animation: emojiRise 1.2s ease forwards;
}


/* ──────────────────────────────────────────────────────────────
   16. リザルト画面
────────────────────────────────────────────────────────────── */
.result-score-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* スコア数字：グラデーション＋バウンスで登場 */
.result-score {
  font-size: 72px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
  animation: scoreReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-message {
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 6px;
}

.result-combo {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 28px;
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}


/* ──────────────────────────────────────────────────────────────
   17. ハイスコア表示
────────────────────────────────────────────────────────────── */

/* タイトル画面のハイスコア。スコアがない場合は空（min-height で高さを確保） */
.title-hi {
  font-size: 15px;
  font-weight: 900;
  color: var(--accent);
  min-height: 22px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* リザルト画面のハイスコア */
.result-hi {
  font-size: 15px;
  font-weight: 900;
  color: var(--muted);
  min-height: 22px;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

/* 新記録時：緑色で拡大アニメーション付き */
.result-hi.new-record {
  color: var(--gauge-full);
  font-size: 18px;
  animation: scoreReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ──────────────────────────────────────────────────────────────
   18. アニメーション一覧
────────────────────────────────────────────────────────────── */

/* 背景光球の浮遊 */
@keyframes orbFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -40px) scale(1.15); }
}

/* 画面切り替え時のフェードイン */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 問題数字の切り替えアニメーション */
@keyframes numberIn {
  from { transform: scale(0.5) rotate(-8deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}

/* コンボ表示のバウンス */
@keyframes comboPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* 正解タイルの拡大 */
@keyframes tileCorrect {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* 誤答タイルの横揺れ */
@keyframes tileWrong {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

/* タイル出現アニメーション */
@keyframes tileAppear {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* 正解・不正解フィードバック絵文字のポップ＆フェードアウト */
@keyframes feedbackPop {
  0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  50%  { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* コンボ達成絵文字の舞い上がり */
@keyframes emojiRise {
  0%   { transform: translateY(0) scale(0.5) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-160px) scale(1.2) rotate(20deg); opacity: 0; }
}

/* リザルトのスコア登場アニメーション */
@keyframes scoreReveal {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}


/* ──────────────────────────────────────────────────────────────
   19. レスポンシブ
────────────────────────────────────────────────────────────── */

/* 画面高さ 640px 以下（古いスマートフォン）向けに各要素を縮小する */
@media (max-height: 640px) {
  .question-number { font-size: 56px; }
  .tile            { font-size: 34px; }
  .question-card   { padding: 14px; }
  .glass-card      { padding: 20px 18px; }
}

/* 幅が広い端末ではタイルを少し横長にして余白を活かす */
@media (min-width: 500px) {
  .tile { aspect-ratio: 1.6; }
}


/*
  ★ アニメーションを減らす設定への配慮 ★
  OS 側で「視差効果を減らす」を有効にしている利用者には、
  勝手に動き続けるものが不快になることがあります。
  前庭障害のある方にとっては、めまいや吐き気の原因にもなります。

  同じ kids/ 配下の4本（ten-puzzle / whack-a-mole / 迷路 / ピンボール）と
  同じ書き方に揃えています。

  ■ animation: none ではなく duration を極小にしている理由
    none にすると、アニメーションが「無かったこと」になります。
    すると forwards / both で指定した最終状態も適用されず、
    要素が初期状態のまま残ります。初期状態が opacity: 0 の場合、
    そのまま見えなくなってしまいます。
    duration を極小にすれば「一瞬で終わる」扱いになるため、
    最終状態はきちんと適用されます。

  ■ ただし .feedback だけは例外にしています（下記）
*/
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /*
    ⭕ と ❌ のフィードバックだけは、上の指定から外します。

    feedbackPop は opacity: 0 で終わる animation で、forwards が付いています。
    上の指定をそのまま当てると一瞬で透明になり、
    「正解したのか間違えたのか」が画面から分からなくなります。

    これは装飾ではなく、プレイヤーに結果を伝える情報です。
    動きを減らしたい人から、情報まで奪ってはいけません。
    animation を切り、表示されたままにします
    （0.5秒後に JS が要素ごと取り除くので、残り続けることはありません）。
  */
  .feedback {
    animation: none !important;
    opacity: 1;
  }
}
