/* テニス人生スロット：見た目の決まり
   ・輪郭線は太く（--edge）、影はぼかさずに下へずらすだけ（--drop）。シールやゲーム筐体のような硬い見た目にそろえる。
   ・書体は 3 つ。見出し＝極太（--display）、本文（--text）、数字＝スポーツ中継風の細長い太字（--num）。
   ・色は先頭の変数で決める。昼（ライト）と夜（ダーク）の両方を用意する。 */
@font-face { font-family: "TS Display"; src: url("fonts/display.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TS Text"; src: url("fonts/text-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "TS Text"; src: url("fonts/text-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "TS Num"; src: url("fonts/num-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "TS Num"; src: url("fonts/num-800i.woff2") format("woff2"); font-weight: 800; font-style: italic; font-display: swap; }

:root {
  --bg: #efe6cf;            /* 地：あたたかい紙の色 */
  --panel: #fffaf0;
  --panel2: #f4ecd9;
  --ink: #14231d;           /* 文字と輪郭線 */
  --sub: #55675e;
  --line: #14231d;
  --soft: #d8ceb4;          /* 弱い区切り線 */
  --ball: #d6ee35;          /* ボールの黄色：いちばん大事なボタン */
  --ball-ink: #14231d;
  --court: #1e7b56;         /* コートの緑 */
  --court-dk: #165f43;
  --clay: #e2603a;          /* クレーの朱色：賭け・ゾーン・お知らせ */
  --board: #14231d;         /* スコアボード */
  --board-ink: #f6f1e1;
  --board-sub: #9fb6ab;
  --digit: #e2f552;
  --t-miss: #a9aea6;
  --t-white: #fffaf0;
  --t-blue: #2f7fe0;
  --t-red: #e2483a;
  --t-gold: #f2b705;
  --gold-ink: #8a6500;      /* 金色の文字（明るい地の上で読める濃さ） */
  --rainbow: linear-gradient(100deg, #e6483c, #f0a01a, #3fae4a, #2f7fe0, #9a4ad8);
  --edge: .125rem;
  --drop: 0 .25rem 0 var(--line);
  --drop-s: 0 .125rem 0 var(--line);
  --r: .875rem;
  --r-s: .5rem;
  --display: "TS Display", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  --text: "TS Text", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  --num: "TS Num", "TS Text", system-ui, sans-serif;
  --cell: clamp(5.25rem, 20dvh, 10rem); /* リールの窓の高さ（画面の高さに合わせる） */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1813;
    --panel: #183229;
    --panel2: #122720;
    --ink: #f6f1e1;
    --sub: #a5baaf;
    --line: #030806;
    --soft: #2b4a3e;
    --ball-ink: #14231d;
    --court: #1b6e4e;
    --court-dk: #124a35;
    --clay: #f27a52;
    --board: #050d0a;
    --t-miss: #5f6f67;
    --gold-ink: #f6c93a;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--text); font-weight: 500; line-height: 1.6; overscroll-behavior: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }
h1, h2, h3, p, ul, ol, dl { margin: 0; padding: 0; font-weight: inherit; }
ul, ol { list-style: none; }
b { font-weight: 700; }
:focus-visible { outline: .1875rem solid var(--clay); outline-offset: .125rem; }

#fxCanvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
.app { max-width: 27rem; min-height: 100dvh; margin: 0 auto; padding: calc(.75rem + env(safe-area-inset-top)) calc(1rem + env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) calc(1rem + env(safe-area-inset-left)); display: flex; flex-direction: column; }
.scr { display: none; flex: 1; flex-direction: column; gap: .75rem; }
.scr.is-on { display: flex; animation: scrIn .25s ease-out; }
@keyframes scrIn { from { opacity: 0; transform: translateY(.5rem); } to { opacity: 1; transform: none; } }

/* ---------- 共通の部品 ---------- */
.btn-main { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 3.75rem; padding: .375rem .75rem; border: var(--edge) solid var(--line); border-radius: var(--r); background: var(--ball); color: var(--ball-ink); box-shadow: 0 .3125rem 0 var(--line); transition: transform .05s, box-shadow .05s; }
.btn-main b { font-family: var(--display); font-weight: 400; font-size: 1.25rem; letter-spacing: .04em; line-height: 1.3; }
.btn-main small { font-size: .75rem; font-weight: 700; opacity: .8; }
.btn-main:active { transform: translateY(.25rem); box-shadow: 0 .0625rem 0 var(--line); }
.btn-sub { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 3rem; padding: .375rem .875rem; border: var(--edge) solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); font-weight: 700; font-size: .9375rem; text-decoration: none; box-shadow: var(--drop-s); transition: transform .05s, box-shadow .05s; }
.btn-sub:active { transform: translateY(.125rem); box-shadow: none; }
.btn-sub small { font-size: .75rem; font-weight: 500; color: var(--sub); }
.btn-sub:disabled { opacity: .45; }
.pill { display: inline-flex; align-items: center; gap: .3125rem; min-height: 2.25rem; padding: 0 .75rem; border-radius: 99rem; background: var(--panel); border: var(--edge) solid var(--line); box-shadow: var(--drop-s); font-family: var(--num); font-size: 1.125rem; font-weight: 700; line-height: 1; }
.pill-btn { min-height: 2.75rem; font-family: var(--text); font-size: .75rem; }
.ic { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pill .ic { color: var(--gold-ink); }
.bar { position: relative; height: .75rem; border-radius: 99rem; background: var(--panel2); border: var(--edge) solid var(--line); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ball); border-right: var(--edge) solid var(--line); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.bar i[style*="width: 0"] { border-right: 0; }
.note { font-size: .75rem; color: var(--sub); text-align: center; }

/* ボールのキャラクター（顔つき）。mood で表情が変わる */
.mascot { --s: 4.5rem; position: relative; width: var(--s); height: var(--s); border-radius: 50%; background: var(--ball); border: var(--edge) solid var(--line); box-shadow: var(--drop); overflow: hidden; flex: none; }
.mascot::before, .mascot::after { content: ""; position: absolute; top: -10%; width: 100%; height: 120%; border: calc(var(--s) * .045) solid #fff; border-radius: 50%; }
.mascot::before { left: -78%; }
.mascot::after { right: -78%; }
.mascot i { position: absolute; top: 38%; width: 9%; height: 13%; border-radius: 50%; background: var(--ball-ink); animation: blink 4s infinite; }
.mascot i:nth-of-type(1) { left: 34%; }
.mascot i:nth-of-type(2) { right: 34%; }
.mascot s { position: absolute; left: 40%; top: 56%; width: 20%; height: 12%; border: calc(var(--s) * .04) solid var(--ball-ink); border-top: 0; border-radius: 0 0 99rem 99rem; }
.mascot[data-mood="wow"] s { height: 18%; top: 54%; border-top: calc(var(--s) * .04) solid var(--ball-ink); border-radius: 50%; background: var(--ball-ink); }
.mascot[data-mood="sad"] s { top: 60%; border: calc(var(--s) * .04) solid var(--ball-ink); border-bottom: 0; border-radius: 99rem 99rem 0 0; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }

/* ---------- はじめの画面 ---------- */
.home-top { display: flex; justify-content: space-between; align-items: center; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem; }
.hero .mascot { animation: bob 1.4s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-.375rem) rotate(6deg); } }
.hero-lead { margin-top: .375rem; padding: .0625rem .625rem; border-radius: 99rem; background: var(--ink); color: var(--bg); font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.hero-logo { font-family: var(--display); font-size: 2.625rem; line-height: 1.12; letter-spacing: .01em; }
.hero-logo span { display: inline-block; margin-top: .125rem; padding: 0 .625rem .0625rem; background: var(--court); color: #fff; border: var(--edge) solid var(--line); border-radius: var(--r-s); box-shadow: var(--drop); transform: rotate(-2.5deg); }
.hero-sub { margin-top: .5rem; font-size: .8125rem; font-weight: 700; color: var(--sub); }
.hero-mentor { padding: .125rem .625rem; border-radius: var(--r-s); background: var(--clay); color: #fff; font-size: .75rem; font-weight: 700; }
.hero-mentor:empty { display: none; }
.start { background: var(--panel); border: var(--edge) solid var(--line); border-radius: var(--r); box-shadow: var(--drop); padding: .875rem; display: flex; flex-direction: column; gap: .625rem; }
.field { display: flex; flex-direction: column; gap: .3125rem; }
.field > span { font-size: .75rem; font-weight: 700; color: var(--sub); }
.field input { width: 100%; min-height: 2.75rem; padding: .375rem .75rem; font-size: 1rem; font-weight: 700; border: var(--edge) solid var(--line); border-radius: var(--r-s); background: var(--bg); }
.field input::placeholder { color: var(--sub); font-weight: 500; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.chips button { min-height: 2.75rem; padding: .125rem .25rem; font-size: .875rem; font-weight: 700; border: var(--edge) solid var(--line); border-radius: var(--r-s); background: var(--bg); box-shadow: var(--drop-s); transition: transform .05s, box-shadow .05s; }
.chips button.on { background: var(--ink); color: var(--bg); box-shadow: none; transform: translateY(.125rem); }
.hint { font-size: .75rem; color: var(--sub); min-height: 1.6em; }
.hint-locked { min-height: 0; }
.hint-locked:empty { display: none; }
.home-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: auto; padding-top: .25rem; }
.nav-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 3.25rem; padding: .25rem; border: var(--edge) solid var(--line); border-radius: var(--r-s); background: var(--panel); box-shadow: var(--drop-s); }
.nav-btn:active { transform: translateY(.125rem); box-shadow: none; }
.nav-btn b { font-size: 1rem; }
.nav-btn small { font-size: .625rem; color: var(--sub); font-weight: 700; }
.nav-btn.has-new::after { content: ""; position: absolute; top: -.3125rem; right: -.3125rem; width: .875rem; height: .875rem; border-radius: 50%; background: var(--clay); border: var(--edge) solid var(--line); }
.text-link { align-self: center; min-height: 2.75rem; padding: 0 1rem; border: 0; background: none; font-size: .75rem; font-weight: 700; color: var(--sub); text-decoration: underline; text-underline-offset: .2em; }

/* ---------- スロットの画面：スコアボード ---------- */
.board { background: var(--board); color: var(--board-ink); border: var(--edge) solid var(--line); border-radius: var(--r); padding: .625rem .875rem .5rem; box-shadow: var(--drop); display: flex; flex-direction: column; gap: .4375rem; }
.board-row { display: flex; justify-content: space-between; align-items: flex-end; gap: .5rem; }
.board-year { font-family: var(--display); font-size: 1.625rem; line-height: 1.2; }
.board-team { font-size: .75rem; font-weight: 700; color: var(--board-sub); }
.board-score { text-align: right; line-height: 1; }
.board-score small { display: block; font-size: .6875rem; font-weight: 700; color: var(--board-sub); margin-bottom: .0625rem; }
.board-score b { font-family: var(--num); font-style: italic; font-weight: 800; font-size: 3rem; line-height: .9; color: var(--digit); font-variant-numeric: tabular-nums; }
.board-sub { align-items: center; font-size: .8125rem; font-weight: 700; color: var(--board-sub); }
.board-sub > span:first-child { flex: 1; color: var(--board-ink); }
.zone-chip { padding: 0 .625rem; border-radius: 99rem; background: var(--clay); color: #fff; font-size: .75rem; font-weight: 700; animation: pulse .6s ease-in-out infinite alternate; }
.snd { min-width: 2.75rem; min-height: 2.75rem; margin: -.625rem -.375rem -.625rem 0; padding: 0 .375rem; font-size: .6875rem; font-weight: 700; border: 0; background: none; color: var(--board-sub); text-decoration: underline; text-underline-offset: .2em; }
.lamps { display: grid; grid-template-columns: repeat(12, 1fr); gap: .1875rem; }
.lamps li { height: .5rem; border-radius: .125rem; background: rgba(255, 255, 255, .14); }
.lamps li:nth-child(6), .lamps li:nth-child(9) { margin-right: .25rem; }
.lamps li[data-t="miss"] { background: #6f7d75; }
.lamps li[data-t="white"] { background: #f6f1e1; }
.lamps li[data-t="blue"] { background: #4d9bee; }
.lamps li[data-t="red"] { background: #f0594a; }
.lamps li[data-t="gold"] { background: #f2c230; }
.lamps li[data-t="rainbow"] { background: var(--rainbow); }
.lamps li.now { background: var(--digit); animation: pulse .6s ease-in-out infinite alternate; }
.card .lamps { padding: .25rem; border-radius: var(--r-s); background: var(--board); }

/* 次の大会までの目標 */
.goal { display: flex; flex-direction: column; gap: .1875rem; }
.goal-text { display: flex; justify-content: space-between; align-items: baseline; font-size: .75rem; font-weight: 700; color: var(--sub); }
.goal-text span:last-child { color: var(--ink); }
.goal .bar { overflow: visible; margin-bottom: .875rem; }
.goal .bar i { border-radius: 99rem 0 0 99rem; }
.bar em { position: absolute; top: -.1875rem; bottom: -.1875rem; width: var(--edge); background: var(--line); font-style: normal; }
.bar em::after { content: attr(data-label); position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: .0625rem; font-size: .625rem; font-weight: 700; color: var(--sub); white-space: nowrap; }

/* ---------- コートとリール ---------- */
.court { position: relative; flex: 1; display: flex; align-items: center; min-height: 11.5rem; padding: .875rem .5rem; border: var(--edge) solid var(--line); border-radius: var(--r); background:
    linear-gradient(#fff, #fff) 50% 50% / calc(100% - 1.25rem) .125rem no-repeat,
    linear-gradient(#fff, #fff) .625rem .625rem / calc(100% - 1.25rem) .125rem no-repeat,
    linear-gradient(#fff, #fff) .625rem calc(100% - .625rem) / calc(100% - 1.25rem) .125rem no-repeat,
    linear-gradient(#fff, #fff) .625rem .625rem / .125rem calc(100% - 1.25rem) no-repeat,
    linear-gradient(#fff, #fff) calc(100% - .625rem) .625rem / .125rem calc(100% - 1.25rem) no-repeat,
    repeating-linear-gradient(90deg, var(--court) 0 2.25rem, var(--court-dk) 2.25rem 4.5rem);
  box-shadow: var(--drop); overflow: hidden; }
.reels { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: .3125rem; width: 100%; }
.reels.pro { grid-template-columns: repeat(4, 1fr); }
.reel { display: flex; flex-direction: column; align-items: center; background: var(--panel); border: var(--edge) solid var(--line); border-radius: var(--r-s); padding: .3125rem .1875rem .375rem; box-shadow: var(--drop); min-width: 0; }
.reel-name { font-size: .625rem; font-weight: 700; white-space: nowrap; letter-spacing: -.04em; }
.reels.pro .reel-name { font-size: 1rem; letter-spacing: 0; }
.reel-mark { font-size: .5625rem; height: .875rem; line-height: .875rem; padding: 0 .3125rem; border-radius: 99rem; font-weight: 700; }
.reel-mark:not(:empty) { background: var(--court); color: #fff; }
.reel-mark.bad:not(:empty) { background: var(--t-miss); color: var(--ball-ink); }
.reel-win { position: relative; width: 100%; height: var(--cell); margin-top: .1875rem; overflow: hidden; border: var(--edge) solid var(--line); border-radius: .375rem; background: var(--panel2); }
.strip { will-change: transform; }
/* 当たりは、色の面で見せる */
.cell { height: var(--cell); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; background: var(--t-white); color: #14231d; }
.cell b { font-family: var(--num); font-style: italic; font-weight: 800; font-size: 2rem; line-height: .9; font-variant-numeric: tabular-nums; }
.reels.pro .cell b { font-family: var(--display); font-style: normal; font-weight: 400; font-size: 1.25rem; line-height: 1.2; letter-spacing: -.02em; }
.sym { font-size: clamp(1.5rem, 5.5dvh, 2.5rem); width: 1em; height: 1em; border-radius: 50%; background: var(--ball); border: .07em solid #14231d; position: relative; overflow: hidden; flex: none; }
.sym::before, .sym::after { content: ""; position: absolute; top: -.1em; width: 1em; height: 1.2em; border: .07em solid #fff; border-radius: 50%; box-sizing: border-box; }
.sym::before { left: -.76em; }
.sym::after { right: -.76em; }
.cell[data-t="miss"] { background: repeating-linear-gradient(-45deg, var(--t-miss) 0 .375rem, color-mix(in srgb, var(--t-miss) 80%, #000) .375rem .75rem); color: #14231d; }
.cell[data-t="miss"] .sym { background: none; border-style: dashed; opacity: .55; }
.cell[data-t="miss"] .sym::before, .cell[data-t="miss"] .sym::after { display: none; }
.cell[data-t="blue"] { background: var(--t-blue); color: #fff; }
.cell[data-t="red"] { background: var(--t-red); color: #fff; }
.cell[data-t="gold"] { background: linear-gradient(160deg, #ffe37a, var(--t-gold) 55%, #d99800); color: #14231d; }
.cell[data-t="rainbow"] { background: var(--rainbow); color: #fff; text-shadow: 0 .0625rem 0 rgba(0, 0, 0, .45); }
.reel.spinning .strip { filter: blur(.0625rem); }
.reel[data-t="gold"] { background: var(--t-gold); }
.reel[data-t="rainbow"] { background: var(--rainbow); color: #fff; }
.reel.pop { animation: pop .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 0% { transform: scale(1.1) translateY(-.25rem); } 100% { transform: none; } }
.reel.flip { animation: flip .45s ease-out; }
@keyframes flip { 0% { transform: rotateY(90deg) scale(1.08); } 100% { transform: none; } }
.reel.reach { animation: reach .2s linear infinite alternate; }
@keyframes reach { from { background: var(--panel); } to { background: var(--t-gold); } }
.reel.can-respin { cursor: pointer; animation: nudge 1.1s ease-in-out infinite; }
.reel.can-respin:nth-child(2n) { animation-delay: .18s; }
.reel.can-respin:active { transform: translateY(.25rem); box-shadow: none; animation: none; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-.1875rem); } }
.reel-foot { display: flex; align-items: baseline; justify-content: center; gap: .1875rem; margin-top: .25rem; min-height: 1.375rem; }
.reel-grade { font-family: var(--num); font-weight: 700; font-size: 1.375rem; line-height: 1; }
.reel-val { font-family: var(--num); font-weight: 700; font-size: .875rem; color: var(--sub); font-variant-numeric: tabular-nums; }
.reel[data-t="rainbow"] .reel-val, .reel[data-t="rainbow"] .reel-name { color: #fff; }
.reel[data-t="gold"] .reel-val { color: #14231d; }
.reel[data-t="gold"] .reel-name, .reel[data-t="gold"] .reel-grade { color: #14231d !important; }
.reel[data-t="rainbow"] .reel-grade { color: #fff !important; }
.reels.pro .reel-grade { font-family: var(--text); font-size: .6875rem; color: var(--gold-ink); }

/* まんなかに出る大きな知らせ */
.banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-3deg); z-index: 5; width: max-content; max-width: 94%; padding: .5rem 1.125rem .625rem; border: var(--edge) solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); font-family: var(--display); font-size: 1.5rem; text-align: center; line-height: 1.3; box-shadow: 0 .375rem 0 var(--line); animation: bannerIn .28s cubic-bezier(.3, 1.7, .5, 1); pointer-events: none; }
.banner small { display: block; font-family: var(--text); font-size: .8125rem; font-weight: 700; }
.banner[data-kind="gold"] { background: var(--t-gold); color: #14231d; }
.banner[data-kind="rainbow"] { background: var(--rainbow); color: #fff; text-shadow: 0 .125rem 0 rgba(0, 0, 0, .4); }
.banner[data-kind="clay"] { background: var(--clay); color: #fff; }
@keyframes bannerIn { 0% { transform: translate(-50%, -50%) scale(.3) rotate(-14deg); opacity: 0; } 100% { transform: translate(-50%, -50%) rotate(-3deg); opacity: 1; } }

/* 予告：良い結果が決まっているときだけ、コートの色が変わる */
.app.hint-hot .court { animation: courtHot .4s steps(2) infinite; }
.app.hint-super .court { animation: courtSuper .24s steps(2) infinite; }
@keyframes courtHot { 50% { filter: sepia(1) saturate(4) hue-rotate(-30deg); } }
@keyframes courtSuper { 50% { filter: hue-rotate(160deg) saturate(2); } }
.app.shake { animation: shake .4s linear; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-.375rem); } 40% { transform: translateX(.375rem); } 60% { transform: translateX(-.25rem); } 80% { transform: translateX(.25rem); } }
@keyframes pulse { from { opacity: 1; } to { opacity: .5; } }

/* ---------- ギアと経験値 ---------- */
.build { display: flex; flex-direction: column; gap: .375rem; }
.xp { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .5rem; font-size: .6875rem; font-weight: 700; color: var(--sub); }
.xp .bar { height: .5rem; }
.xp .bar i { background: var(--clay); }
.gears { display: flex; flex-wrap: wrap; gap: .3125rem; min-height: 1.75rem; }
.gear { display: inline-flex; align-items: center; gap: .25rem; height: 1.75rem; padding: 0 .5rem 0 .375rem; border-radius: 99rem; background: var(--panel); border: var(--edge) solid var(--line); font-size: .6875rem; font-weight: 700; }
.gear .ic { width: .9375rem; height: .9375rem; }
.gear u { text-decoration: none; display: inline-flex; gap: .125rem; }
.gear u::before, .gear u::after, .gear u s { content: ""; width: .3125rem; height: .3125rem; border-radius: 50%; background: var(--soft); }
.gear[data-lv="1"] u::before, .gear[data-lv="2"] u::before, .gear[data-lv="3"] u::before, .gear[data-lv="2"] u s, .gear[data-lv="3"] u s, .gear[data-lv="3"] u::after { background: var(--clay); }
.gear[data-lv="3"] { background: var(--ball); color: var(--ball-ink); }
.gear.evo { background: var(--rainbow); color: #fff; text-shadow: 0 .0625rem 0 rgba(0, 0, 0, .4); padding: 0 .625rem 0 .4375rem; }
.gear.new { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.gears-empty { font-size: .75rem; color: var(--sub); line-height: 1.75rem; }

.msg { min-height: 1.6em; text-align: center; font-size: .875rem; font-weight: 700; color: var(--sub); }
.msg.hot { color: var(--clay); }
.btn-spin { min-height: 4.25rem; }
.btn-spin b { font-size: 1.5rem; }
.app.busy .btn-spin { background: var(--panel2); color: var(--sub); }

/* ---------- 結果の画面：選手カード ---------- */
.card { position: relative; overflow: hidden; background: var(--panel); border: .1875rem solid var(--line); border-radius: var(--r); box-shadow: 0 .375rem 0 var(--line); padding: 0 .875rem .875rem; text-align: center; display: flex; flex-direction: column; gap: .5rem; }
.card-head { margin: 0 -.875rem; padding: .25rem .5rem; background: var(--ink); color: var(--bg); font-size: .6875rem; font-weight: 700; letter-spacing: .08em; }
.card[data-frame="blue"] .card-head { background: var(--t-blue); color: #fff; }
.card[data-frame="gold"] .card-head { background: var(--t-gold); color: #14231d; }
.card[data-frame="rainbow"] .card-head { background: var(--rainbow); color: #fff; }
.card[data-frame="gold"]::after, .card[data-frame="rainbow"]::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .3) 50%, transparent 65%); transform: translateX(-100%); animation: sheen 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.card-top { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: .25rem; text-align: left; }
.card-top .mascot { --s: 3.5rem; }
.card-title { font-family: var(--display); font-size: 1.5rem; line-height: 1.25; }
.card-name { font-size: .875rem; font-weight: 700; overflow-wrap: anywhere; }
.card-name small { font-size: .75rem; font-weight: 500; color: var(--sub); margin-left: .375rem; }
.card-rank { display: flex; align-items: baseline; justify-content: center; gap: .375rem; padding: .25rem; border-radius: var(--r-s); background: var(--panel2); }
.card-rank small { font-size: .75rem; color: var(--sub); font-weight: 700; }
.card-rank b { font-family: var(--num); font-style: italic; font-weight: 800; font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
.card-abil { display: grid; grid-template-columns: repeat(5, 1fr); gap: .25rem; }
.card-abil div { display: flex; flex-direction: column; padding: .1875rem 0; border: var(--edge) solid var(--line); border-radius: var(--r-s); font-size: .5625rem; font-weight: 700; white-space: nowrap; letter-spacing: -.04em; }
.card-abil b { font-family: var(--num); font-size: 1.5rem; line-height: 1; }
.card .gears { justify-content: center; }
.card-facts { display: grid; grid-template-columns: auto 1fr; gap: .125rem .75rem; text-align: left; font-size: .8125rem; }
.card-facts dt { color: var(--sub); font-weight: 700; }
.card-facts dd { margin: 0; font-weight: 700; }
.card-epi { font-size: .8125rem; color: var(--sub); }
.card-near { padding: .375rem; border: var(--edge) dashed var(--clay); border-radius: var(--r-s); color: var(--clay); font-size: .875rem; font-weight: 700; }
.card-pro { padding: .5rem; border-radius: var(--r-s); background: var(--board); color: var(--board-ink); }
.card-pro-rank { font-size: .75rem; font-weight: 700; color: var(--board-sub); }
.card-pro-rank b { font-family: var(--num); font-style: italic; font-weight: 800; font-size: 1.75rem; color: var(--digit); margin: 0 .125rem; }
.card-slams { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; margin-top: .125rem; }
.card-slams div { display: flex; flex-direction: column; font-size: .6875rem; font-weight: 700; color: var(--board-sub); }
.card-slams b { font-size: .8125rem; color: var(--board-ink); }
.card-slams .won b { color: #f2c230; }
.reward { background: var(--panel); border: var(--edge) solid var(--line); border-radius: var(--r); box-shadow: var(--drop); padding: .625rem .875rem; }
.reward h2 { display: flex; justify-content: space-between; align-items: baseline; font-size: .875rem; font-weight: 700; }
.reward h2 b { font-family: var(--num); font-style: italic; font-weight: 800; font-size: 2rem; line-height: 1; color: var(--gold-ink); }
.reward li { display: flex; justify-content: space-between; align-items: baseline; font-size: .8125rem; font-weight: 500; color: var(--sub); padding: .0625rem 0; }
.reward li span:last-child { font-family: var(--num); font-weight: 700; font-size: 1rem; }
.reward li.ach { color: var(--ink); font-weight: 700; }
.reward li.ach::before { content: "実績"; margin-right: .5rem; padding: 0 .375rem; border-radius: .25rem; background: var(--clay); color: #fff; font-size: .625rem; }
.reward li.ach span:first-of-type { flex: 1; }
.reward li.unlock { color: var(--clay); font-weight: 700; }
.result-actions { display: grid; grid-template-columns: 1fr 1.6fr; gap: .625rem; align-items: start; }
.result-actions .btn-sub { min-height: 3.75rem; }

/* ---------- 部室・図鑑 ---------- */
.sub-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .625rem; }
.sub-head h2 { font-family: var(--display); font-size: 1.5rem; }
.back { min-height: 2.75rem; padding: 0 .875rem; border: var(--edge) solid var(--line); border-radius: 99rem; background: var(--panel); box-shadow: var(--drop-s); font-size: .8125rem; font-weight: 700; }
.sub-lead { font-size: .8125rem; color: var(--sub); }
.sub-h { margin-top: .625rem; font-size: 1rem; font-weight: 700; }
.list { display: flex; flex-direction: column; gap: .5rem; }
.list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 .75rem; padding: .5rem .75rem; border-radius: var(--r-s); background: var(--panel); border: var(--edge) solid var(--line); }
.list li b { font-size: .9375rem; }
.list li small { grid-column: 1; font-size: .75rem; color: var(--sub); white-space: pre-line; }
.list li .side { grid-row: 1 / span 2; grid-column: 2; display: inline-flex; align-items: center; gap: .1875rem; font-family: var(--num); font-size: 1rem; font-weight: 700; color: var(--sub); }
.list li .side .ic { width: .875rem; height: .875rem; }
.list li.done { border-left: .5rem solid var(--court); }
.list li.done .side { padding: 0 .5rem; border-radius: 99rem; background: var(--court); color: #fff; font-family: var(--text); font-size: .6875rem; }
.list li.locked { border-style: dashed; background: none; }
.list li.locked b { color: var(--sub); }
.list li.more { display: block; text-align: center; color: var(--sub); font-size: .75rem; font-weight: 700; border-style: dashed; background: none; }
.list li button { grid-row: 1 / span 2; grid-column: 2; display: inline-flex; align-items: center; justify-content: center; gap: .25rem; min-height: 2.75rem; min-width: 4.75rem; padding: 0 .625rem; border: var(--edge) solid var(--line); border-radius: var(--r-s); background: var(--ball); color: var(--ball-ink); box-shadow: var(--drop-s); font-family: var(--num); font-weight: 700; font-size: 1.125rem; }
.list li button:active { transform: translateY(.125rem); box-shadow: none; }
.list li button:disabled { background: var(--panel2); color: var(--sub); box-shadow: none; }
.pips { display: inline-flex; gap: .1875rem; margin-left: .375rem; vertical-align: middle; }
.pips i { width: .5rem; height: .5rem; border-radius: 50%; border: .0625rem solid var(--line); background: var(--panel2); }
.pips i.on { background: var(--clay); }
.tags { display: flex; flex-wrap: wrap; gap: .375rem; }
.tags li { padding: .125rem .625rem; border-radius: 99rem; background: var(--ball); color: var(--ball-ink); border: var(--edge) solid var(--line); font-size: .75rem; font-weight: 700; }
.tags li.locked { background: none; color: var(--sub); border-style: dashed; }
.save-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.save-text { width: 100%; padding: .5rem; font-size: .75rem; border: var(--edge) solid var(--line); border-radius: var(--r-s); background: var(--panel); resize: vertical; }

/* ---------- 下から出る知らせ・ギア選び ---------- */
.sheet, .pick { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; padding: 1rem; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); background: rgba(5, 13, 10, .7); animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-box, .pick-box { width: 100%; max-width: 25rem; max-height: 88dvh; overflow-y: auto; background: var(--panel); border: var(--edge) solid var(--line); border-radius: var(--r); padding: 1rem; box-shadow: 0 .375rem 0 var(--line); animation: sheetIn .26s cubic-bezier(.2, .9, .3, 1.15); }
@keyframes sheetIn { from { transform: translateY(2.5rem); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-kicker { display: inline-block; padding: 0 .5rem; border-radius: .25rem; background: var(--ink); color: var(--bg); font-size: .6875rem; font-weight: 700; }
.sheet-box[data-tone="good"] .sheet-kicker { background: var(--court); color: #fff; }
.sheet-box[data-tone="bad"] .sheet-kicker { background: var(--t-red); color: #fff; }
.sheet-box[data-tone="gamble"] .sheet-kicker { background: var(--clay); color: #fff; }
.sheet-box h2, .pick-box h2 { margin: .25rem 0 .375rem; font-family: var(--display); font-size: 1.375rem; line-height: 1.35; }
.sheet-body { margin-bottom: .75rem; font-size: .875rem; color: var(--sub); white-space: pre-line; }
.steps { display: grid; gap: .5rem; color: var(--ink); white-space: normal; }
.steps li { display: grid; grid-template-columns: 1.75rem 1fr; gap: .5rem; align-items: start; font-weight: 700; }
.steps li::before { content: attr(data-n); display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: var(--edge) solid var(--line); border-radius: 50%; background: var(--ball); color: var(--ball-ink); font-family: var(--num); font-size: 1.125rem; }
.steps small { display: block; font-size: .75rem; font-weight: 500; color: var(--sub); }
.sheet-body b, .sheet-body strong { color: var(--ink); }
.sheet-odds { display: block; font-family: var(--display); font-size: 1.625rem; line-height: 1.3; color: var(--clay); }
.sheet-actions { display: grid; gap: .5rem; position: sticky; bottom: -1rem; margin: 0 -1rem -1rem; padding: .5rem 1rem 1.125rem; background: linear-gradient(transparent, var(--panel) 28%); }
.sheet-actions .btn-main { min-height: 3.25rem; }
.sheet-actions .btn-main b { font-size: 1.0625rem; }
.pick-cards { display: grid; gap: .5625rem; margin-bottom: .625rem; }
.pick-card { display: grid; grid-template-columns: 2.75rem 1fr; align-items: center; gap: 0 .75rem; width: 100%; min-height: 4.25rem; padding: .5rem .75rem; text-align: left; border: var(--edge) solid var(--line); border-radius: var(--r); background: var(--bg); box-shadow: var(--drop); animation: cardIn .3s cubic-bezier(.2, .9, .3, 1.2) backwards; transition: transform .05s, box-shadow .05s; }
.pick-card:nth-child(2) { animation-delay: .06s; }
.pick-card:nth-child(3) { animation-delay: .12s; }
.pick-card:nth-child(4) { animation-delay: .18s; }
@keyframes cardIn { from { transform: translateX(1.5rem); opacity: 0; } }
.pick-card:active { transform: translateY(.25rem); box-shadow: none; }
.pick-card .ico { grid-row: 1 / span 2; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border: var(--edge) solid var(--line); border-radius: var(--r-s); background: var(--court); color: #fff; }
.pick-card .ico .ic { width: 1.5rem; height: 1.5rem; }
.pick-card b { font-size: 1rem; }
.pick-card b em { margin-left: .375rem; padding: 0 .375rem; border-radius: .25rem; background: var(--ink); color: var(--bg); font-style: normal; font-size: .6875rem; vertical-align: .1em; }
.pick-card b em.new { background: var(--clay); color: #fff; }
.pick-card small { font-size: .75rem; color: var(--sub); }
.pick-card.evo { background: var(--rainbow); color: #fff; text-shadow: 0 .0625rem 0 rgba(0, 0, 0, .4); }
.pick-card.evo small { color: #fff; }
.pick-card.evo .ico { background: #fff; color: #14231d; }

@media (max-height: 44rem) {
  :root { --cell: 4.25rem; }
  .cell b { font-size: 1.5rem; }
  .cell { gap: .0625rem; }
  .sym { font-size: 1.375rem; }
  .court { min-height: 0; padding: .625rem .375rem; }
  .btn-spin { min-height: 3.5rem; }
  .board-year { font-size: 1.375rem; }
  .board-score b { font-size: 2.25rem; }
  .hero-logo { font-size: 2.125rem; }
  .hero .mascot { --s: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
