/* ============================================================
   ディアボロ選手育成 スマホUI「おもちゃ箱パワプロ」
   - 400px 端末幅基準・ホームは1画面（縦スクロールなし）を目標
   - 右側の開発用パラメータパネルは 1100px 以上で表示（実機幅では非表示）
   ============================================================ */
:root {
  --sky-1: #7ec8f5;
  --sky-2: #b9e3ff;
  --cream: #fff8ec;
  --paper: #ffffff;
  --ink: #2b3a67;
  --ink-soft: #64719c;   /* 補助テキスト。4.5:1確保のため7%濃くした(旧 #6b7aa8 はクリーム地で4.00) */
  --coral: #ff6b6b;
  --coral-deep: #e6504f;
  --sun: #ffd166;
  --teal: #2ec4b6;
  --leaf: #7ac74f;
  --blue: #4d96ff;
  --lock: #c9cede;
  --line: 3px solid var(--ink);
  --pop-shadow: 0 4px 0 var(--ink);
  --pop-shadow-sm: 0 3px 0 var(--ink);
  --radius: 18px;
  --dur-tap: 80ms; --dur-pop: 260ms; --dur-row: 380ms; --stagger-row: 140ms;
  --dur-stamp: 340ms; --dur-count: 500ms; --dur-fill: 450ms; --dur-radar: 320ms;
  --dur-enter: 180ms;
  --ease-pop: cubic-bezier(.34,1.56,.64,1); --ease-stamp: cubic-bezier(.2,1.7,.35,1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
button { font-family: inherit; cursor: pointer; }
html { height: -webkit-fill-available; }

body {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif;
  font-weight: 700;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,.55) 0 40px, transparent 41px),
    radial-gradient(circle at 82% 12%, rgba(255,255,255,.45) 0 56px, transparent 57px),
    radial-gradient(circle at 60% 82%, rgba(255,255,255,.35) 0 48px, transparent 49px),
    linear-gradient(180deg, var(--sky-1), var(--sky-2) 70%, #d8f1ff);
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  padding: 24px 20px;
}

/* ---------- 端末シェル ---------- */
#app {
  position: relative;
  width: 400px; max-width: 100%;
  height: min(844px, calc(100vh - 48px));
  height: min(844px, calc(100dvh - 48px));
  background:
    repeating-linear-gradient(45deg, rgba(255,209,102,.06) 0 14px, transparent 14px 28px),
    var(--cream);
  border: var(--line);
  border-radius: 32px;
  box-shadow: 0 24px 48px rgba(30,60,110,.35);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.screens { flex: 1; min-height: 0; display: flex; }
.screen {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  gap: 6px; padding: 12px 14px 10px;
  overflow-y: auto;
  animation: screen-in var(--dur-enter) ease-out;
}
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } }
.screen.hidden { display: none; }
.hidden { display: none !important; }

/* 実機幅ではフルブリード（端末枠を消す） */
@media (max-width: 480px) {
  body {
    padding: 0; gap: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
  }
  #app {
    width: 100%;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    max-height: 100dvh;
    border: none; border-radius: 0; box-shadow: none;
  }
  .bottom-nav {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* ---------- 見出し・共通テキスト ---------- */
h1 { font-size: 1.7rem; text-align: center; color: var(--coral-deep); letter-spacing: .04em; }
/* 見出しは2行になるとき行の長さを均す。日本語はどこでも改行できるので、
   放っておくと「…予選（9 / 月）」のように括弧の途中で割れる（2026-08-29 大会名の改称で発生） */
h2 { font-size: 1.2rem; text-align: center; color: var(--ink); letter-spacing: .04em; text-wrap: balance; }
/* 大会名が長いエントリー画面だけ、括弧書きの月がちぎれないよう1文字ぶん詰める */
#entry-title { font-size: 1.12rem; line-height: 1.35; }
.subtitle { text-align: center; color: var(--ink-soft); font-size: .82rem; }
/* タイトル画面: 収集カードが飛び出す一枚絵を中央の主役にする */
#screen-title {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), transparent 26%),
    repeating-linear-gradient(45deg, rgba(255,209,102,.055) 0 14px, transparent 14px 28px);
}
#screen-title > *:not(.title-confetti) { position: relative; z-index: 1; }
#screen-title > h1,
#screen-title > .subtitle { flex-shrink: 0; }
.title-art-stage {
  flex: 1 1 250px;
  min-height: 158px;
  margin: -4px -14px -8px;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%),
    linear-gradient(180deg, transparent 0, #000 12%, #000 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%),
    linear-gradient(180deg, transparent 0, #000 12%, #000 82%, transparent 100%);
  mask-composite: intersect;
}
.title-art-stage img {
  position: absolute;
  width: 126%;
  max-width: none;
  height: 126%;
  left: -13%;
  top: -11%;
  object-fit: cover;
  object-position: 46% 50%;
  filter: saturate(1.04) contrast(1.015);
}

/* 一枚絵からこぼれた紙吹雪。ボタン背面とセクション間を同じ色とリズムでつなぐ */
.title-confetti {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.title-confetti i {
  --tc: var(--coral);
  position: absolute;
  display: block;
  width: 8px;
  height: 13px;
  border-radius: 1px;
  background: var(--tc);
  opacity: .56;
  transform: rotate(var(--tr, 18deg));
  animation: tc-drift var(--tc-dur, 7s) ease-in-out var(--tc-delay, 0s) infinite alternate;
}
.title-confetti i:nth-child(2n) { --tc-dur: 8.5s; --tc-delay: -2.4s; --tc-dx: -3px; }
.title-confetti i:nth-child(3n) { --tc-dur: 6.2s; --tc-delay: -4.1s; }
.title-confetti i:nth-child(4n+1) { --tc-dur: 5.5s; --tc-delay: -1.2s; --tc-dx: 4px; }
.title-confetti i:nth-child(4n+2) { --tc: #f4aa14; }
.title-confetti i:nth-child(4n+3) { --tc: #42b9c2; }
.title-confetti i:nth-child(4n) { --tc: #6ea8d9; }
.title-confetti i:nth-child(5n) {
  width: 7px;
  height: 7px;
  --tr: 45deg;
}
.title-confetti i:nth-child(6n) {
  width: 25px;
  height: 12px;
  background: transparent;
  border-top: 3px solid var(--tc);
  border-radius: 50%;
}
@keyframes tc-drift {
  from { transform: translate3d(0, -4px, 0) rotate(var(--tr, 18deg)); }
  to   { transform: translate3d(var(--tc-dx, 3px), 7px, 0) rotate(calc(var(--tr, 18deg) + 7deg)); }
}
.tc-1 { left: 5%; top: 9%; --tr: -20deg; }
.tc-2 { left: 88%; top: 12%; --tr: 26deg; }
.tc-3 { left: 7%; top: 27%; --tr: 38deg; }
.tc-4 { left: 91%; top: 31%; --tr: -16deg; }
.tc-5 { left: 16%; top: 43%; }
.tc-6 { left: 78%; top: 46%; --tr: -22deg; }
.tc-7 { left: 3%; top: 55%; --tr: 31deg; }
.tc-8 { left: 93%; top: 58%; --tr: 14deg; }
.tc-9 { left: 11%; top: 65%; --tr: -38deg; }
.tc-10 { left: 85%; top: 67%; --tr: 18deg; }
.tc-11 { left: 5%; top: 73%; --tr: 28deg; }
.tc-12 { left: 95%; top: 76%; --tr: -14deg; }
.tc-13 { left: 18%; top: 80%; --tr: -25deg; }
.tc-14 { left: 80%; top: 82%; --tr: 34deg; }
.tc-15 { left: 7%; top: 87%; --tr: 12deg; }
.tc-16 { left: 91%; top: 89%; --tr: -32deg; }
.tc-17 { left: 23%; top: 93%; --tr: 21deg; }
.tc-18 { left: 72%; top: 95%; --tr: -18deg; }
.tc-19 { left: 39%; top: 69%; --tr: 40deg; }
.tc-20 { left: 63%; top: 85%; --tr: -27deg; }
#screen-title > button {
  z-index: 2;
  flex-shrink: 0;
  background-color: rgba(255, 255, 255, .9);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
/* 「はじめから」だけコーラルを少し濃く・文字を少し大きく。
   白文字とのコントラストが 2.49 しかなく、屋外や視力差で読みにくかった。
   19px/太字にすると WCAG の「大きい文字」扱い(基準3.0)になり、この濃さで 3.18〜3.19。
   色相はそのまま(7〜12%暗くしただけ)なので、ポップな見た目は変えていない。 */
#screen-title > button.primary {
  background: linear-gradient(100deg, rgba(237,100,100,.97), rgba(224,111,92,.97));
  font-size: 1.2rem;
}
@media (max-width: 480px) {
  .title-art-stage { min-height: clamp(150px, 25dvh, 232px); }
}
@media (max-height: 700px) {
  .title-art-stage { min-height: 122px; }
  #screen-title > button { padding-top: 9px; padding-bottom: 9px; }
}
.app-version { text-align: center; font-size: .7rem; font-weight: 700; color: var(--ink-soft); padding: 4px 0 2px; letter-spacing: .05em; }
html.short-mode #app { background: repeating-linear-gradient(135deg, rgba(255,209,102,.09) 0 14px, transparent 14px 28px), var(--cream); }
.center { text-align: center; }
.num { font-family: "Baloo 2", "M PLUS Rounded 1c", sans-serif; font-weight: 800; }

/* ---------- 汎用ボタン（title/create/event/entry 等の縦積みボタン） ---------- */
.screen > button,
.cta-wrap button,
#create-bg button,
#event-choices button,
#entry-divisions button {
  padding: 12px 14px;
  border: var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem; font-weight: 800;
  box-shadow: var(--pop-shadow-sm);
}
.screen > button:active,
.cta-wrap button:active,
#event-choices button:active,
#entry-divisions button:active { transform: translateY(3px); box-shadow: none; }
button.primary { background: var(--coral); color: #fff; }
/* ID内ボタンでも .primary（選択中・推奨）をコーラルで塗る（ID指定に負けないよう明示） */
#create-bg button.primary,
#event-choices button.primary,
#entry-divisions button.primary { background: var(--coral); color: #fff; }
button:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* 画面末尾の主要ボタン（CTA）を下部に固定して、内容が長くても必ず見えるようにする */
/* 画面末尾CTA: ラッパー(.cta-wrap)でsticky化し、背後にクリーム背景を敷いて
   下に透けるリスト（成績表等）を隠す（2026-07-15。ボタン単体sticky+疑似要素は
   描画順の仕様でボタンが薄くなるため廃止） */
.cta-wrap {
  position: sticky; bottom: -10px; z-index: 3; margin-top: auto;
  /* 画面(.screen)のpadding(左右14/下10)を打ち消して下端までフルブリードに */
  margin-left: -14px; margin-right: -14px; margin-bottom: -10px;
  padding: 12px 14px 16px;
  background: linear-gradient(180deg, rgba(255, 248, 236, 0), var(--cream) 40%);
}
.cta-wrap button { width: 100%; }
.cta-bar {
  position: sticky; bottom: 14px; z-index: 3; margin-top: auto;
  display: flex; gap: 8px;
  padding: 8px 0 2px;
  background: linear-gradient(180deg, rgba(255,248,236,0), var(--cream) 45%);
}
.cta-bar button {
  flex: 1;
  padding: 12px 10px; border: var(--line); border-radius: 16px;
  background: var(--paper); color: var(--ink);
  font-size: 1rem; font-weight: 800; box-shadow: var(--pop-shadow-sm);
}
.cta-bar button.primary { background: var(--coral); color: #fff; }
.cta-bar button:active { transform: translateY(3px); box-shadow: none; }
input {
  width: 100%; padding: 11px;
  border: var(--line); border-radius: 12px;
  background: #fffdf6; color: var(--ink);
  font-size: 1rem; font-weight: 700;
}
input::placeholder { color: #b6bedb; }
select {
  width: 100%; padding: 11px 38px 11px 12px;
  border: var(--line); border-radius: 12px;
  background-color: #fffdf6; color: var(--ink);
  font-family: inherit; font-size: 1rem; font-weight: 800;
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232b3a67' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
select:focus { outline: none; box-shadow: var(--pop-shadow-sm); }

/* ---------- カード ---------- */
.card {
  background: var(--paper);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop-shadow);
  padding: 8px 11px;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .7rem; font-weight: 800;
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 2px 10px; background: var(--paper);
}
.section-label { color: var(--ink-soft); font-size: .7rem; font-weight: 800; margin: 4px 0 2px; letter-spacing: .08em; }
.board-label { font-size: .7rem; font-weight: 800; color: var(--ink-soft); letter-spacing: .1em; }

/* ---------- 次大会バナー ---------- */
.contest-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(120deg, var(--sun), #ffe3a3);
  border: var(--line); border-radius: 14px;
  padding: 5px 12px; box-shadow: var(--pop-shadow-sm); flex-shrink: 0;
}
.contest-banner.worlds { background: linear-gradient(120deg, #b5f0e6, #d9fff8); }
.contest-banner.meetup { background: linear-gradient(120deg, #cdeafd, #e6f5ff); }
.contest-banner .flag { font-size: 1.3rem; }
.contest-banner .name { font-size: .86rem; font-weight: 800; }
.contest-banner .when { font-size: .7rem; color: #8a6d1f; }
.contest-banner .count {
  margin-left: auto; background: var(--coral); color: #fff;
  border: 2px solid var(--ink); border-radius: 10px;
  padding: 2px 10px; text-align: center; line-height: 1.15;
}
.contest-banner .count .n { font-size: 1.05rem; display: block; }
.contest-banner .count .u { font-size: .7rem; letter-spacing: .08em; }
/* 次のイベントバナー（タップ可能） */
.contest-banner.next-event { cursor: pointer; }
.contest-banner.next-event:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.ce-meta { display: flex; flex-direction: column; gap: 1px; }
.ce-tag {
  align-self: flex-start;
  font-size: .7rem; font-weight: 800; color: #8a6d1f;
  background: rgba(255,255,255,.7); border: 1.5px solid var(--ink);
  border-radius: 999px; padding: 0 8px; letter-spacing: .06em;
}
.ce-meta .name { font-size: .9rem; font-weight: 800; }
.ce-meta .when { font-size: .7rem; color: #8a6d1f; }

/* 次のイベント枠（大会＋その他固定イベントを1つの囲みに縦並び） */
.next-events {
  border: var(--line); border-radius: 14px;
  background: linear-gradient(120deg, var(--sun), #ffe3a3);
  box-shadow: var(--pop-shadow-sm); flex-shrink: 0;
  padding: 5px 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.next-events:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.ne-head { display: flex; align-items: center; justify-content: space-between; }
.ne-title {
  font-size: .7rem; font-weight: 800; color: #8a6d1f;
  background: rgba(255,255,255,.75); border: 1.5px solid var(--ink);
  border-radius: 999px; padding: 0 8px; letter-spacing: .06em;
}
.ne-hint { font-size: .7rem; font-weight: 800; color: #8a6d1f; }
.ne-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.7); border: 2px solid var(--ink); border-radius: 10px;
  padding: 3px 9px;
}
.ne-icon { display: flex; flex-shrink: 0; }
.ne-icon .ui-icon { width: 18px; height: 18px; }
.ne-name { font-size: .84rem; font-weight: 800; flex: 1; }
.ne-count {
  flex-shrink: 0; font-size: .7rem; font-weight: 800; color: #fff;
  background: var(--coral); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 9px;
}

/* ---------- 今後の予定モーダル（ボトムシート） ---------- */
.modal { position: absolute; inset: 0; z-index: 20; display: flex; align-items: flex-end; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(43,58,103,.45); }
.modal-card {
  position: relative; z-index: 1; width: 100%; max-height: 80%;
  background: var(--cream); border-top: var(--line);
  border-radius: 24px 24px 0 0; box-shadow: 0 -8px 24px rgba(20,30,70,.3);
  display: flex; flex-direction: column;
  animation: sheet-up .26s cubic-bezier(.34,1.4,.64,1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px; flex-shrink: 0;
}
.modal-title { display: flex; align-items: center; gap: 6px; font-size: 1.05rem; font-weight: 800; color: var(--ink); letter-spacing: .04em; }
.modal-close {
  width: 32px; height: 32px; border: var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-size: 1.1rem; font-weight: 800;
  box-shadow: var(--pop-shadow-sm); line-height: 1;
}
.modal-close:active { transform: translateY(2px); box-shadow: none; }
.modal-sub { padding: 0 16px 8px; font-size: .82rem; font-weight: 800; color: var(--coral-deep); flex-shrink: 0; }

/* 中央ポップアップ（定期イベント通知） */
.modal.center { align-items: center; }
.modal.center .modal-card {
  margin: 0 20px; border: var(--line); border-radius: 22px; max-height: 80%;
  animation: pop-in .26s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pop-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.popup-body { padding: 6px 18px 4px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.popup-text { font-size: .92rem; font-weight: 700; color: var(--ink); line-height: 1.6; }
.popup-effect {
  font-size: .78rem; font-weight: 800; color: var(--teal);
  background: #eafaf7; border: 2px solid var(--teal); border-radius: 10px; padding: 5px 10px;
}
.popup-ok { margin: 10px 18px 16px; }
.settings-note { font-size: .86rem; font-weight: 700; color: var(--ink); text-align: center; line-height: 1.6; }
.popup-body button {
  width: 100%; padding: 12px; border: var(--line); border-radius: 14px;
  background: var(--paper); color: var(--ink); font-weight: 800; font-size: .95rem;
  box-shadow: var(--pop-shadow-sm);
}
.popup-body button:active { transform: translateY(3px); box-shadow: none; }
.popup-body button.retire { background: var(--coral); color: #fff; }
.month-transition {
  position: absolute; inset: 0; z-index: 60;
  display: grid; place-items: center; overflow: hidden;
  cursor: pointer;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.72) 0 42px, transparent 43px),
    radial-gradient(circle at 82% 84%, rgba(255,255,255,.55) 0 58px, transparent 59px),
    rgba(232, 246, 255, .94);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.month-transition-card {
  width: min(294px, calc(100% - 44px));
  padding: 24px 22px 22px; border: var(--line); border-radius: 24px;
  background: var(--cream); box-shadow: 0 14px 0 rgba(43,58,103,.16), 0 24px 44px rgba(30,60,110,.24);
  text-align: center;
}
.month-transition-kicker { color: var(--ink-soft); font-family: 'Baloo 2', sans-serif; font-size: .74rem; font-weight: 800; letter-spacing: .17em; }
/* 月切替のディアボロ（TIDCローディングへのオマージュ）:
   2本のスティックと1本の紐に、学年の数だけディアボロが乗る装置をSVGで描く。
   コマ送り（7コマ×100ms）はJS側で行い、CSSは見た目だけを持つ。 */
.month-transition-diabolo { position: relative; height: 62px; margin: 7px 0 5px; }
.mt-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mt-stick { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.mt-string { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.mt-cup { fill: var(--coral); stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.mt-axle { fill: var(--sun); stroke: var(--ink); stroke-width: 2; }
.mt-dia.is-air .mt-cup { fill: var(--sun); }
.mt-dia.is-air .mt-axle { fill: var(--coral); }
/* キャラ表示（2026-08-08）: 絵は分解せず1枚のまま、コマ送りで左右へ小さく揺れる。
   素材が揃わないときは has-chars が付かず、上のSVG装置がそのまま使われる。 */
.month-transition-diabolo.has-chars { height: 96px; }
.mt-chars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; }
.mt-char {
  height: 100%; width: auto; max-width: 25%; object-fit: contain; object-position: bottom center;
  transform-origin: 50% 100%; /* 足元を軸に揺らすと、立っているまま傾いて見える */
  will-change: transform;
}
.month-transition-label { color: var(--ink); font-size: 1.55rem; font-weight: 900; letter-spacing: .04em; }
.month-transition-sub { min-height: 2.6em; margin-top: 3px; color: var(--ink-soft); font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif; font-size: .7rem; font-weight: 800; letter-spacing: .07em; line-height: 1.3; }
.month-transition-progress { height: 8px; margin-top: 13px; overflow: hidden; border: 2px solid var(--ink); border-radius: 999px; background: #e3edff; }
.month-transition-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--teal), var(--sun), var(--coral)); }
.month-transition-skip { margin-top: 8px; font-size: .7rem; font-weight: 800; color: var(--ink-soft); letter-spacing: .08em; }
.month-transition.is-active .month-transition-card { animation: month-transition-pop .24s cubic-bezier(.34,1.56,.64,1); }
.month-transition.is-active .month-transition-progress span { animation: month-transition-progress 1.5s linear forwards; }
@keyframes month-transition-pop { from { opacity: 0; transform: translateY(12px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes month-transition-progress { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .month-transition.is-active .month-transition-card,
  .month-transition.is-active .month-transition-progress span { animation: none; }
  .month-transition.is-active .month-transition-progress span { width: 100%; }
}
.registration-card { max-width: 420px; }
.registration-lead { font-size: .84rem; line-height: 1.6; color: var(--ink); }
.registration-name-readout {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 2px solid var(--ink); border-radius: 12px; background: #fffdf6;
  color: var(--ink-soft); font-size: .7rem; font-weight: 800;
}
.registration-name-readout b { color: var(--ink); font-size: 1.2rem; word-break: break-all; text-align: right; }
.popup-body .registration-rename { background: #eef5ff; border-color: var(--blue); color: var(--ink); }
.popup-body .registration-rename:disabled { opacity: 1; color: var(--ink-soft); border-color: #b8c5dd; background: #f4f6fa; }
.registration-name-edit { display: flex; flex-direction: column; gap: 7px; }
.registration-name-edit label { font-size: .72rem; color: var(--ink-soft); font-weight: 800; }
.registration-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; padding: 10px 18px 16px; }
.registration-actions button {
  padding: 11px 8px; border: var(--line); border-radius: 14px; background: var(--paper);
  color: var(--ink); font-family: inherit; font-size: .82rem; font-weight: 800; box-shadow: var(--pop-shadow-sm);
}
.registration-actions button.primary { background: var(--coral); color: #fff; }
.registration-actions button:active { transform: translateY(3px); box-shadow: none; }

/* 顔の器（SVGアバター）。PNG版(.has-img)と同じ扱いにする */
.mood-face.has-avatar { padding: 0; overflow: hidden; background: none; }
.mood-face.has-avatar svg,
.mood-mini.has-avatar svg { width: 100%; height: 100%; display: block; }
#trainmenu-mood .mood-mini.has-avatar {
  width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
}

/* スカウト画面の入口 */
.avatar-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  font-family: inherit; color: var(--ink); cursor: pointer;
}
.avatar-row:active { transform: translateY(3px); box-shadow: none; }
.avatar-row-face {
  width: 54px; height: 54px; flex-shrink: 0;
  border: 2px solid var(--ink); border-radius: 50%; overflow: hidden; background: var(--paper);
}
.avatar-row-face svg { width: 100%; height: 100%; display: block; }
.avatar-row-meta { flex: 1; min-width: 0; }
.avatar-row-meta b { display: block; font-size: .95rem; font-weight: 800; }
.avatar-row-meta small { display: block; font-size: .7rem; font-weight: 700; color: var(--ink-soft); }
.avatar-row-arrow { font-size: 1.1rem; font-weight: 800; color: var(--ink-soft); }

/* 登録確認の顔 */
.registration-face {
  width: 78px; height: 78px; margin: 0 auto 4px;
  border: var(--line); border-radius: 50%; overflow: hidden; background: var(--paper);
  box-shadow: var(--pop-shadow-sm);
}
.registration-face svg { width: 100%; height: 100%; display: block; }

/* 顔エディタ */
.avatar-modal-card { max-height: 92%; }
.avatar-preview { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 2px 16px 8px; flex-shrink: 0; }
.avatar-preview-face {
  width: 124px; height: 124px;
  border: var(--line); border-radius: 50%; overflow: hidden; background: var(--paper);
  box-shadow: var(--pop-shadow);
}
.avatar-preview-face svg { width: 100%; height: 100%; display: block; }
.avatar-random {
  width: 48px; height: 48px; font-size: 1.3rem;
  border: var(--line); border-radius: 14px; background: var(--sun); color: var(--ink);
  box-shadow: var(--pop-shadow-sm);
}
.avatar-random:active { transform: translateY(3px); box-shadow: none; }
.apart { display: flex; flex-direction: column; gap: 4px; }
.apart-label { font-size: .7rem; font-weight: 800; color: var(--ink-soft); letter-spacing: .1em; }
/* 候補は折り返して全部見せる。横スクロールにすると隠れた候補に気づけないため
   （2026-08-29 本人指摘で変更）。列数は幅に応じて自動、余った幅は候補を大きくして埋める。 */
.apart-opts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 7px; padding: 1px 0 3px;
}
.apart-opts.is-colors { grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 8px; }
.apart-opt {
  width: 100%; aspect-ratio: 1; padding: 0;
  border: 2px solid var(--ink); border-radius: 50%; overflow: hidden; background: var(--paper);
}
.apart-opt svg { width: 100%; height: 100%; display: block; }
.apart-opt.on { outline: 3px solid var(--teal); outline-offset: 2px; }
.apart-sw {
  width: 100%; aspect-ratio: 1;
  border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 2px 0 var(--ink);
}
.apart-sw.on { outline: 3px solid var(--teal); outline-offset: 2px; }
.apart-sw:active { transform: translateY(2px); box-shadow: none; }
.avatar-savebar {
  flex-shrink: 0; padding: 10px 14px max(14px, env(safe-area-inset-bottom));
  border-top: 2px dashed #bdc6dd; background: var(--cream);
}
.avatar-savebar button {
  width: 100%; padding: 12px; border: var(--line); border-radius: 14px;
  background: var(--coral); color: #fff; font-family: inherit; font-size: 1rem; font-weight: 800;
  box-shadow: var(--pop-shadow-sm);
}
.avatar-savebar button:active { transform: translateY(3px); box-shadow: none; }

/* 学年ごとのホーム背景（識別しやすいよう淡く色分け。カードは白なので可読性維持） */
#screen-home.year-1 { background: repeating-linear-gradient(45deg, rgba(122,199,79,.05) 0 14px, transparent 14px 28px), #f2fbe9; }
#screen-home.year-2 { background: repeating-linear-gradient(45deg, rgba(77,150,255,.06) 0 14px, transparent 14px 28px), #e9f3ff; }
#screen-home.year-3 { background: repeating-linear-gradient(45deg, rgba(255,145,90,.06) 0 14px, transparent 14px 28px), #fff0e4; }
#screen-home.year-4 { background: repeating-linear-gradient(45deg, rgba(180,120,255,.06) 0 14px, transparent 14px 28px), #f4ecff; }
.modal-list { overflow-y: auto; padding: 4px 14px 16px; display: flex; flex-direction: column; gap: 7px; }
.event-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: var(--line); border-radius: 14px;
  padding: 7px 12px; box-shadow: var(--pop-shadow-sm);
}
.event-row.next { border-color: var(--coral); box-shadow: 0 3px 0 var(--coral); background: #fff3f0; }
.event-row.exam { background: #f2f5fd; }
.event-row.meetup { background: #eef8ff; }
.event-icon { display: flex; flex-shrink: 0; }
.event-icon .ui-icon { width: 22px; height: 22px; }
.event-meta { flex: 1; min-width: 0; }
.event-when { font-size: .7rem; color: var(--ink-soft); font-weight: 800; }
.event-name { font-size: .9rem; font-weight: 800; }
.event-sub { font-size: .7rem; color: var(--ink-soft); }
.event-badge {
  flex-shrink: 0; font-size: .7rem; font-weight: 800; color: #fff;
  background: var(--coral); border: 2px solid var(--ink); border-radius: 999px;
  padding: 1px 10px;
}

/* ---------- 卒業生名簿（ショート版） ---------- */
.alumni-modal-card { max-height: 88%; }
.alumni-help {
  margin: 0 16px 8px; padding: 8px 10px;
  border: 2px dashed #9fafd8; border-radius: 12px;
  background: #f3f5ff; color: var(--ink-soft);
  font-size: .7rem; font-weight: 700; line-height: 1.55;
}
.alumni-search {
  flex-shrink: 0; margin: 0 14px 8px;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px;
  color: var(--ink-soft); font-size: .7rem; font-weight: 800;
}
.alumni-search input {
  width: 100%; min-width: 0; padding: 7px 10px;
  border: 2px solid #9fafd8; border-radius: 10px;
  background: #fff; color: var(--ink);
  font-family: inherit; font-size: 16px; font-weight: 700; line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(43,58,103,.08);
}
.alumni-search input:focus { outline: 3px solid rgba(60,199,178,.28); border-color: var(--teal); }
.alumni-roster-row {
  width: 100%; min-height: 68px; padding: 8px 10px;
  display: flex; align-items: center; gap: 10px; text-align: left;
  border: 2px solid #aeb8d2; border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(159,175,216,.12) 0 28px, transparent 28px),
    var(--paper);
  color: var(--ink); box-shadow: 0 3px 0 #aeb8d2;
}
.alumni-roster-row:active { transform: translateY(2px); box-shadow: 0 1px 0 #aeb8d2; }
.alumni-roster-row.selected {
  border-color: var(--teal); box-shadow: 0 3px 0 #238d83;
  background:
    linear-gradient(90deg, rgba(60,199,178,.2) 0 34px, transparent 34px),
    #eefcf8;
}
.alumni-pick {
  width: 30px; height: 30px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%;
  background: #e6eaf4; color: var(--ink-soft); font-size: .82rem; font-weight: 800;
}
.alumni-roster-row.selected .alumni-pick { background: var(--teal); color: #fff; }
/* 卒業生名簿の顔 */
.alumni-face {
  width: 36px; height: 36px; flex-shrink: 0;
  border: 2px solid var(--ink); border-radius: 50%; overflow: hidden; background: var(--paper);
}
.alumni-face svg { width: 100%; height: 100%; display: block; }
.alumni-roster-meta { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 2px; }
.alumni-roster-name { display: flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 800; }
.alumni-origin {
  padding: 1px 6px; border-radius: 999px; font-size: .7rem; letter-spacing: .05em;
  border: 1.5px solid var(--ink); background: #fff3c4; color: #795a12;
}
.alumni-origin.graduate { background: #ffe0eb; color: #a33a62; }
.alumni-roster-detail { font-size: .7rem; font-weight: 800; color: var(--teal); }
.alumni-roster-achievement {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .7rem; font-weight: 700; color: var(--ink-soft);
}
.alumni-savebar {
  flex-shrink: 0; padding: 10px 14px max(14px, env(safe-area-inset-bottom));
  border-top: 2px dashed #bdc6dd; background: var(--cream);
}
.alumni-savebar button { width: 100%; }
.alumni-ending-btn {
  align-self: center; padding: 9px 16px; margin: 2px 0 4px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: #eefcf8; color: var(--teal); font-size: .76rem; font-weight: 800;
  box-shadow: 0 2px 0 var(--ink);
}
.alumni-ending-btn:active { transform: translateY(2px); box-shadow: none; }
.alumni-note { border-color: var(--teal); background: #eefcf8; }
.alumni-rank-effect { border-color: #d39b2c; background: #fff7dc; color: #8a6116; }

/* ---------- 選手ボード（名前・やる気・ステータス・技術を1枠に集約） ---------- */
.pboard { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
/* ヘッダー帯：紺地に学年月・名前・pt */
.pb-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--ink); color: #fff;
  border-radius: 12px; padding: 5px 12px;
}
.pb-head .pb-turn { font-size: .7rem; color: #aebbe6; letter-spacing: .06em; }
.pb-head .pb-name { font-size: 1rem; font-weight: 800; letter-spacing: .04em; }
.pb-head .pt {
  flex-shrink: 0; background: var(--sun); color: var(--ink);
  border-radius: 999px; min-height: 34px; display: inline-flex; align-items: center; padding: 4px 14px;
  font-size: .78rem; font-weight: 800; border: 2px solid #fff; cursor: pointer;
}
.pb-head .pt::after { content: " ▸"; font-size: .7rem; }
.pb-head .pt:active { transform: translateY(1px); }
/* コンディション：やる気の顔｜メーター2×2 */
.pb-cond { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.pb-mood {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding-right: 12px; border-right: 2px dashed #dde1f0;
}
.pb-mood .mood-face {
  width: 44px; height: 44px; font-size: 1.4rem;
  display: grid; place-items: center;
  background: #fff2cf; border: var(--line); border-radius: 50%;
}
.pb-mood .mood-face.has-img { padding: 0; overflow: hidden; background: none; }
.mood-face-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-mood .mood-label { font-size: .74rem; font-weight: 800; color: var(--coral-deep); margin-top: 2px; }
.pb-mood .mood-note { font-size: .7rem; color: var(--ink-soft); }
.pb-mood .mood-awaken {
  margin-top: 3px; font-size: .7rem; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, #ff9d2f, #ff5e7e);
  padding: 2px 7px; border-radius: 999px; letter-spacing: .5px;
  box-shadow: 0 1px 4px rgba(255,94,126,.5); animation: awakenPulse 1.4s ease-in-out infinite;
}
@keyframes awakenPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.pb-meters { display: grid; grid-template-columns: 1fr; gap: 7px; }
/* 構成メーター（レーダーの下） */
.pb-comp { margin-top: 6px; }
/* 技術見出し（レーダーの上） */
.pb-tech-head {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 40px; cursor: pointer; border-radius: 10px;
}
.pb-tech-head:active { background: rgba(43,58,103,.06); }

/* メーター（label / gauge / value） */
.meter { display: grid; grid-template-columns: 3.4em 1fr 2.4em; align-items: center; gap: 8px; font-size: .72rem; }
.meter .m-label { font-weight: 800; }
/* 4文字ラベル（演技構成）は3.4emだと折り返すため、この行だけ左列を広げる */
.meter.wide-label { grid-template-columns: 5em 1fr 2.4em; }
.meter .m-val { text-align: right; font-size: .8rem; }
.gauge { height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: #eef1fa; overflow: hidden; }
.gauge > span { display: block; height: 100%; border-radius: 999px 0 0 999px; background: linear-gradient(90deg, var(--teal), var(--sun)); transition: width var(--dur-fill) ease-out; }
.gauge.warn > span { background: linear-gradient(90deg, var(--sun), var(--coral)); }

/* ---------- 詳細リンク ---------- */
.detail-link {
  font-size: .7rem; font-weight: 800; color: var(--blue);
  background: #eaf2ff; border: 2px solid var(--blue); border-radius: 999px;
  padding: 2px 10px;
}
.detail-link:active { transform: translateY(2px); }

/* ---------- どうする？ 3大アクション ---------- */
.prompt-line { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 800; color: var(--ink); flex-shrink: 0; }
.prompt-line::before, .prompt-line::after {
  content: ""; flex: 1; height: 3px; border-radius: 3px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 8px, transparent 8px 14px); opacity: .25;
}
.action-stack { display: flex; flex-direction: column; gap: 7px; flex-shrink: 0; }
.action-btn {
  display: flex; align-items: center; gap: 11px;
  border: var(--line); border-radius: 16px; padding: 7px 13px;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease; text-align: left;
}
.action-btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ink); }
.action-btn .icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.2rem;
  background: rgba(255,255,255,.55); border: 2.5px solid #fff; border-radius: 11px;
}
/* アイコンを画像にした場合は白枠いっぱいに表示（角丸クリップ・白背景なし） */
.action-btn .icon.has-img { background: none; padding: 0; overflow: hidden; border-color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.action-btn .icon.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.action-btn .t { flex: 1; }
.action-btn .t .name { display: block; font-size: 1.04rem; font-weight: 800; letter-spacing: .12em; }
.action-btn .t .desc { display: block; font-size: .75rem; font-weight: 700; }
.action-btn .arrow { font-size: 1.1rem; font-weight: 800; }
.action-btn.train { background: linear-gradient(135deg, #ff8b7b, var(--coral)); color: #fff; }
.action-btn.train .t .desc { color: #ffe3dc; }
.action-btn.study { background: linear-gradient(135deg, #7db4ff, var(--blue)); color: #fff; }
.action-btn.study .t .desc { color: #dcebff; }
.action-btn.rest  { background: linear-gradient(135deg, #8ed35f, #5fae3a); color: #fff; }
.action-btn.rest  .t .desc { color: #eafce0; }
/* 勉強・休養は横並び2列。ボタンは幅が狭いのでコンパクト表示（矢印なし・アイコン小） */
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.action-btn.compact { padding: 8px 10px; gap: 8px; box-shadow: 0 4px 0 var(--ink); }
.action-btn.compact .icon { width: 32px; height: 32px; font-size: 1.05rem; border-radius: 10px; }
.action-btn.compact .t .name { font-size: .92rem; letter-spacing: .06em; }
.action-btn.compact .t .desc { font-size: .75rem; }
.action-btn.injured { background: linear-gradient(135deg, #ffbf80, #ff9e52); color: #fff; }
.action-btn.injured .t .desc { color: #fff1e2; }
/* 休養・療養は薄色地のため、白文字の可読性確保に軽く影を付ける */
.action-btn.rest .t .name, .action-btn.injured .t .name { text-shadow: 0 1px 2px rgba(0,0,0,.28); }

/* ---------- ログ帯 ---------- */
.log-strip {
  font-size: .7rem; font-weight: 700; color: var(--ink-soft);
  background: #f2f5fd; border: 2px dashed #b9c3e0; border-radius: 12px;
  padding: 5px 10px; min-height: 1.7em; display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.log-strip.multi { flex-direction: column; align-items: flex-start; line-height: 1.5; }
.log-strip { cursor: pointer; }
.log-strip:active { transform: translateY(1px); }
/* タップ導線（記録ログを開く） */
.log-more { align-self: flex-end; margin-top: 2px; font-size: .7rem; font-weight: 800; color: var(--blue);
  display: flex; align-items: center; gap: 5px; }
.log-more .ui-icon { width: 15px; height: 15px; }

/* 記録ログモーダルの各ターン記録 */
.log-entry { border: 2px solid #e2e6f3; border-radius: 12px; background: var(--paper); padding: 7px 10px; }
.log-entry-turn { font-size: .72rem; font-weight: 800; color: var(--coral-deep); margin-bottom: 3px; }
.log-entry-msg { font-size: .8rem; font-weight: 700; color: var(--ink); line-height: 1.55; }

.cond-warn { color: var(--coral-deep); font-weight: 800; font-size: .72rem; }
/* 選択肢なしイベント/ハプニングの効果表示（ピル） */
.notice-effect { display: inline-block; margin: 8px 6px 0 0; padding: 3px 12px; font-size: .8rem; font-weight: 800; color: var(--ink); background: #eef1fb; border: 2px solid #d8ddf0; border-radius: 999px; }

/* 覚醒エフェクト（全画面オーバーレイ・光の放射＋文字がドンと弾ける） */
.awaken-splash {
  position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 45%, rgba(255,244,200,.96), rgba(255,209,102,.9) 42%, rgba(230,80,79,.62) 100%);
}
.awaken-splash.hidden { display: none; }
.awaken-splash.play { animation: awaken-bg .3s ease-out both; }
@keyframes awaken-bg { from { opacity: 0; } to { opacity: 1; } }
.awaken-rays {
  position: absolute; width: 240%; height: 240%; opacity: .55;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.9) 0deg 5deg, transparent 5deg 15deg);
}
.awaken-splash.play .awaken-rays { animation: awaken-spin 1.4s linear both; }
@keyframes awaken-spin { from { transform: rotate(0deg); } to { transform: rotate(140deg); } }
.awaken-word {
  position: relative; font-family: "Baloo 2", "M PLUS Rounded 1c", sans-serif;
  font-size: 4.4rem; font-weight: 800; letter-spacing: .04em; color: #fff;
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 0 0 16px rgba(255,255,255,.95), 0 6px 0 var(--coral-deep), 0 0 44px var(--sun);
}
.awaken-splash.play .awaken-word { animation: awaken-pop .6s cubic-bezier(.2,1.7,.35,1) both; }
@keyframes awaken-pop {
  0% { transform: scale(.2) rotate(-10deg); opacity: 0; }
  55% { transform: scale(1.2) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
/* 怪我バリアント（赤／衝撃）。背景を赤系に差し替え、文字はドンと出た後に小刻みに震える */
.awaken-splash.injury { background: radial-gradient(circle at 50% 45%, rgba(255,220,215,.96), rgba(230,80,79,.92) 42%, rgba(80,20,30,.7) 100%); }
.awaken-splash.injury .awaken-rays { background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.7) 0deg 5deg, transparent 5deg 15deg); opacity: .4; }
.awaken-splash.injury.play .awaken-rays { animation: none; }
.awaken-splash.injury .awaken-word { color: #fff; text-shadow: 0 0 16px rgba(255,120,120,.9), 0 6px 0 #7a1220, 0 0 40px rgba(230,80,79,.9); }
.awaken-splash.injury.play .awaken-word { animation: injury-hit .6s ease-out both; }
@keyframes injury-hit {
  0% { transform: scale(2.2) rotate(-4deg); opacity: 0; }
  35% { transform: scale(1) rotate(0deg); opacity: 1; }
  45% { transform: translateX(-6px) rotate(-2deg); }
  60% { transform: translateX(5px) rotate(2deg); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); opacity: 1; }
}

/* ---------- ボトムナビ ---------- */
.bottom-nav {
  flex-shrink: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 8px 14px 12px;
  border-top: 2px dashed #e0d4b8;
}
.bottom-nav.hidden { display: none; }
.nav-btn {
  border: var(--line); border-radius: 14px; background: var(--paper);
  padding: 6px 4px 4px; font-size: .7rem; font-weight: 800; color: var(--ink-soft);
  box-shadow: var(--pop-shadow-sm);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.nav-btn .ui-icon { width: 19px; height: 19px; }
.nav-btn.active { background: var(--sun); color: var(--ink); }
.nav-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }

/* ---------- サブ画面ヘッダー ---------- */
.sub-header { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.back-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  border: var(--line); border-radius: 12px; background: var(--paper);
  box-shadow: var(--pop-shadow-sm); font-size: 1rem; font-weight: 800; color: var(--ink);
}
.back-btn:active { transform: translateY(3px); box-shadow: none; }
.sub-title { font-size: 1.05rem; font-weight: 800; letter-spacing: .05em; }
.sub-title small { display: block; font-size: .7rem; color: var(--ink-soft); letter-spacing: .1em; }
.sub-header .chip { margin-left: auto; }

/* ---------- 練習メニュー画面 ---------- */
#trainmenu-mood .mood-mini { display: inline-flex; align-items: center; justify-content: center; }
#trainmenu-mood .mood-mini.has-img {
  width: 18px; height: 18px; border: 2px solid var(--ink); border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
}
.mood-mini-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot-board { display: flex; flex-direction: column; gap: 6px; }
.slot-head { display: flex; align-items: center; justify-content: space-between; min-height: 28px; }
.slot-repeat {
  padding: 5px 12px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--ink); font-family: inherit; font-size: .72rem; font-weight: 800;
  box-shadow: 0 2px 0 var(--ink);
}
.slot-repeat:active { transform: translateY(2px); box-shadow: none; }
.slot-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot {
  border: var(--line); border-radius: 14px; min-height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: .7rem; font-weight: 800; color: var(--ink); padding: 4px;
  position: relative; background: var(--paper);
}
.slot.empty { background: #f2f5fd; border-style: dashed; color: #a6b1d2; box-shadow: none; cursor: default; }
.slot.filled { box-shadow: var(--pop-shadow-sm); }
.slot.filled.m-difficulty { background: #ffe1d9; border-color: var(--coral); }
.slot.filled.m-novelty    { background: #dbe8ff; border-color: var(--blue); }
.slot.filled.m-control    { background: #d1f4ef; border-color: var(--teal); }
.slot.filled.routine      { background: #ffeec2; border-color: #e0a500; }
.slot.just-set { animation: slot-pop 240ms var(--ease-pop); }
@keyframes slot-pop { 0% { transform: scale(.82); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
.slot .s-genre { font-size: .7rem; padding: 1px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--sun); }
.slot .s-genre.routine-tag { background: #ffdd8a; }
.slot .s-x {
  position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--coral); color: #fff; border: 2px solid var(--ink);
  font-size: .7rem; line-height: 1; display: grid; place-items: center;
}
/* ---------- ホームのジャンルバー（レーダー置き換え・UXレビュー B3） ---------- */
.gbar-box { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.gbar { display: grid; grid-template-columns: 3.2em 1fr 2.2em 2.8em; align-items: center; gap: 8px; min-height: 26px; }
.gbar-label { font-size: .78rem; font-weight: 800; color: var(--ink); }
.gbar-val { font-size: .95rem; font-weight: 800; text-align: right; color: var(--ink); }
.gbar-up {
  font-size: .7rem; font-weight: 800; color: var(--ink); background: #ffeec2;
  border-radius: 999px; padding: 1px 6px; text-align: center;
}
.gbar-flat { font-size: .7rem; font-weight: 800; color: var(--ink-soft); text-align: center; }
.gbar-lock { font-size: .7rem; font-weight: 800; color: var(--ink-soft); text-align: center; }
.gbar.locked .gbar-label, .gbar.locked .gbar-val { color: #8a90a8; }

/* ジャンル×内容の表。4列＝ジャンル見出し＋内容3つ。最後のルーチン行だけ全幅 */
.train-grid { display: grid; grid-template-columns: 62px repeat(3, 1fr); gap: 5px; }
.tg-corner { }
.tg-head { font-size: .7rem; font-weight: 800; color: var(--ink-soft); text-align: center; letter-spacing: .04em; align-self: end; padding-bottom: 2px; }
.tg-genre { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding-left: 2px; }
.tg-genre b { font-size: .88rem; }
.tg-genre small { font-size: .7rem; font-weight: 700; color: var(--ink-soft); }
.tg-genre.locked { color: #8a90a8; }
.tg-genre.locked b { font-size: .8rem; }
.tg-cell {
  position: relative; min-height: 62px; padding: 2px 0;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--paper);
  box-shadow: var(--pop-shadow-sm); font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.tg-cell .tg-val { font-size: 1.05rem; font-weight: 800; color: var(--ink); }
.tg-cell .tg-gain { font-size: .7rem; font-weight: 700; color: var(--ink-soft); line-height: 1; }
/* 得意技の印はマスの中の3行目に置く。はみ出させると下のマスに重なり、
   肝心の見込み（.tg-gain）を隠してしまう（2026-09-06 実測で確認） */
.tg-cell .tg-fav {
  font-size: .7rem; font-weight: 800; color: var(--ink); background: var(--sun);
  border: 2px solid var(--ink); border-radius: 999px; padding: 0 6px; line-height: 14px; white-space: nowrap;
}
/* 伸びを抑える側の得意技ルール（例: ハイトスの新奇性-1）は失敗系の淡色で区別する */
.tg-cell .tg-fav.minus { background: #ffe1d9; }
.train-note { font-size: .75rem; font-weight: 700; color: var(--ink-soft); padding: 2px 2px 4px; line-height: 1.4; }

.tg-cell.m-difficulty { background: #ffe1d9; border-color: var(--coral); }
.tg-cell.m-novelty    { background: #dbe8ff; border-color: var(--blue); }
.tg-cell.m-control    { background: #d1f4ef; border-color: var(--teal); }
.tg-cell:active { transform: translateY(3px); box-shadow: none; }
.tg-cell.picked { outline: 3px solid var(--sun); outline-offset: -3px; }
.tg-cell.locked, .tg-routine.locked { background: var(--lock); border-color: #8a90a8; color: #8a90a8; box-shadow: none; cursor: default; }
.tg-cell.locked .tg-val { color: #8a90a8; }
/* 3枠が埋まって押せなくなっても、選んだマス（picked）の数字は色を保つ＝何を選んだかが読める */
.tg-cell.locked.picked { background: var(--paper); color: var(--ink); opacity: 1; }
.tg-cell.locked.picked .tg-val, .tg-cell.locked.picked .tg-gain { color: var(--ink); }
.tg-cell.m-difficulty.locked.picked { background: #ffe1d9; }
.tg-cell.m-novelty.locked.picked    { background: #dbe8ff; }
.tg-cell.m-control.locked.picked    { background: #d1f4ef; }
.tg-routine.locked.picked { background: #ffeec2; color: var(--ink); opacity: 1; }

.tg-count {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--coral); color: #fff;
  font-size: .7rem; font-weight: 800; line-height: 16px; text-align: center;
}
.tg-routine {
  grid-column: 1 / -1; position: relative; min-height: 46px; padding: 6px 12px;
  border: 2px solid #e0a500; border-radius: 12px; background: #ffeec2; color: var(--ink);
  box-shadow: var(--pop-shadow-sm); font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.tg-routine b { font-size: .92rem; }
.tg-routine small { font-size: .7rem; font-weight: 700; color: var(--ink-soft); }
.tg-routine:active { transform: translateY(3px); box-shadow: none; }
.tg-routine.picked { outline: 3px solid var(--sun); outline-offset: -3px; }
.pick-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pick-grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pick-btn {
  border: var(--line); border-radius: 14px; background: var(--paper); box-shadow: var(--pop-shadow-sm);
  padding: 8px 4px; font-size: .74rem; font-weight: 800; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.pick-btn small { font-size: .7rem; font-weight: 700; color: var(--ink-soft); }
.pick-btn:active { transform: translateY(3px); box-shadow: none; }
/* 練習内容（技の種類）の色分け。locked/selectedは後段ルールで上書きされる */
.pick-btn.m-difficulty { background: #ffe1d9; border-color: var(--coral); }
.pick-btn.m-novelty    { background: #dbe8ff; border-color: var(--blue); }
.pick-btn.m-control    { background: #d1f4ef; border-color: var(--teal); }
.pick-btn.m-routine    { background: #ffeec2; border-color: #e0a500; }
.pick-btn.selected { background: var(--teal); color: #fff; }
.pick-btn.selected small { color: #d7f6f2; }
.pick-btn.locked { background: var(--lock); color: #8a90a8; box-shadow: none; cursor: default; border-color: #8a90a8; }
.pick-btn.locked small { color: #8a90a8; }
.train-hint { font-size: .75rem; font-weight: 700; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; padding: 0 2px; }
/* button.go-btn で特異度を上げ、`.screen > button`（白背景）に負けないようにする＝アクティブ時は赤 */
button.go-btn {
  border: var(--line); border-radius: 18px;
  background: linear-gradient(135deg, #ff8b7b, var(--coral));
  color: #fff; font-size: 1rem; font-weight: 800; letter-spacing: .12em;
  padding: 13px; box-shadow: 0 5px 0 var(--ink); flex-shrink: 0;
}
button.go-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
button.go-btn:disabled { background: var(--lock); color: #8a90a8; box-shadow: none; transform: translateY(4px); cursor: default; }
#btn-training-go.ready-pulse { animation: go-pulse var(--dur-count) ease-out; }
@keyframes go-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* ---------- スロット行（汎用: 大会前ステータス表示など） ---------- */
.stat-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-size: .8rem; flex-wrap: wrap; }
.stat-row .label { min-width: 6em; flex-shrink: 0; font-weight: 800; word-break: break-word; }
.stat-row .bar-bg { flex: 1; height: 12px; background: #eef1fa; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; display: block; min-width: 40px; }
.stat-row .bar { height: 100%; background: linear-gradient(90deg, var(--teal), var(--sun)); display: block; transition: width var(--dur-fill) ease-out; }
.stat-row .val { flex-shrink: 0; text-align: right; font-weight: 800; }

/* ---------- 練習結果: スロット別の成長（列を揃える） ---------- */
.train-rows { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px 10px; align-items: center; font-size: .84rem; }
.train-rows .tr-menu { font-weight: 800; }
.train-rows .tr-tier { font-weight: 800; text-align: center; }
.train-rows .tr-tier.fail { color: var(--coral-deep); }
.train-rows .tr-val { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.train-rows .tr-target { font-weight: 800; color: var(--ink-soft); }
.rv-cell {
  opacity: 0;
  transform: translateY(12px);
  animation: rv-row-in var(--dur-row) ease-out both;
}
@keyframes rv-row-in { to { opacity: 1; transform: none; } }
.tr-stamp {
  display: inline-block;
  padding: 1px 7px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  line-height: 1.2;
  opacity: 0;
  animation: rv-stamp-in var(--dur-stamp) var(--ease-stamp) both;
}
/* 文字は全チップともインク（淡色地）。白抜きはteal 2.17:1/coral 2.78:1でAA未達のため使わない
   （実測記録: design/TOKEN_SHEET.md §1） */
.tr-stamp.tier-great { background: var(--sun); }
.tr-stamp.tier-success { background: #d1f4ef; }
.tr-stamp.tier-normal { background: #eef1fa; }
.tr-stamp.tier-fail { background: #ffe1d9; border-color: var(--coral); }
@keyframes rv-stamp-in {
  from { opacity: 0; transform: scale(1.55) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes rv-shake {
  0%, 100% { transform: translateX(0); }
  25%, 75% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
}
.grow-row { display: flex; flex-direction: column; gap: 2px; padding: 3px 0; }
.grow-head { display: flex; align-items: baseline; justify-content: space-between; }
.grow-label { font-size: .82rem; font-weight: 800; color: var(--ink); }
.grow-delta { font-size: .82rem; font-weight: 800; color: var(--coral-deep); }
.grow-bar { display: flex; height: 12px; border: 2px solid var(--ink); border-radius: 999px; background: #eef1fa; overflow: hidden; }
.grow-base { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #7fd8cf); }
.grow-add { display: block; height: 100%; background: var(--sun); transition: width var(--dur-fill) ease-out; }
.grow-val { font-size: .72rem; font-weight: 800; color: var(--ink-soft); text-align: right; }
#training-summary.rv-wait { opacity: 0; }
#training-summary.rv-in { animation: rv-summary-in var(--dur-pop) ease-out both; }
@keyframes rv-summary-in { from { opacity: 0; transform: translateY(8px); } }
.rv-total {
  display: inline-block;
  padding: 4px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-size: .92rem;
  animation: rv-total-in var(--dur-stamp) var(--ease-stamp) both;
}
@keyframes rv-total-in {
  0% { opacity: 0; transform: scale(.4); }
  60% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
#screen-training.rv-done .rv-cell,
#screen-training.rv-done .tr-stamp,
#screen-training.rv-done .rv-total { animation: none !important; opacity: 1; transform: none; }
#screen-training.rv-done #training-summary { animation: none; opacity: 1; transform: none; }

/* ---------- 技術グリッド表（詳細/大会前） ---------- */
table.skill-table { width: 100%; border-collapse: collapse; font-size: .74rem; margin: 2px 0; }
table.skill-table th, table.skill-table td { padding: 4px 3px; text-align: center; border-bottom: 2px dotted #d8ddf0; }
table.skill-table th { font-size: .7rem; color: var(--ink-soft); letter-spacing: .04em; }
table.skill-table th:first-child, table.skill-table td:first-child { text-align: left; font-weight: 800; }
table.skill-table tr:last-child td { border-bottom: none; }

/* ---------- レーダー（ジャンル別三角） ---------- */
.radar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.radar-card { border: 2px solid var(--ink); border-radius: 12px; background: #fffdf6; padding: 3px; cursor: pointer; transition: transform .08s; }
.radar-card:active { transform: scale(.94); }
.radar-svg { width: 100%; height: auto; display: block; max-height: 88px; }
.radar-svg .radar-value {
  transform-box: fill-box;
  transform-origin: center;
  animation: radar-in var(--dur-radar) var(--ease-pop) both;
}
@keyframes radar-in { from { opacity: 0; transform: scale(.55); } }
/* 未解禁ジャンル: チャート本体だけ彩度を落として淡くグレーアウト（前面の大きな鍵は鮮明なまま） */
.radar-dim { filter: grayscale(1); opacity: .45; }

/* レーダー拡大ポップアップ */
#radar-big { display: flex; justify-content: center; padding: 4px 0 2px; }
#radar-big .radar-svg { max-height: 240px; width: 240px; max-width: 100%; }
/* レーダー拡大ポップアップ：メイン枠と他ジャンル枠を縦に分けて表示 */
.radar-stack {
  position: relative; z-index: 1; width: 100%; margin: 0 20px; max-height: 92%;
  display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
}
/* 詳細度を .modal.center .modal-card より高くして二重マージン/はみ出しを防ぐ */
.modal.center .radar-stack .modal-card { margin: 0; width: 100%; max-height: none; }

/* 他ジャンルのサムネイル（別枠。タップでメインに切替） */
.radar-thumbs-card { padding: 8px 10px 10px; }
.radar-thumbs-title { font-size: .78rem; font-weight: 800; color: var(--ink-soft); padding: 0 2px 6px; }
.radar-thumbs { display: flex; gap: 6px; }
.radar-thumb { flex: 1; border: 2px solid var(--ink); border-radius: 10px; background: #fffdf6; padding: 2px 2px 0; cursor: pointer; transition: transform .08s; }
.radar-thumb:active { transform: scale(.92); }
.radar-thumb .radar-svg { max-height: 66px; }
.radar-thumb-label { text-align: center; font-size: .7rem; font-weight: 800; color: var(--ink-soft); padding-bottom: 2px; }

.radar-legend { display: flex; flex-direction: column; gap: 6px; padding: 4px 6px 6px; }
.radar-leg-row, .radar-leg-avg { display: flex; align-items: center; gap: 9px; }
.radar-leg-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); flex-shrink: 0; }
.radar-leg-label { font-weight: 800; color: var(--ink); }
.radar-leg-val { margin-left: auto; font-weight: 800; color: var(--ink); font-size: 1.05rem; }
.radar-leg-avg { border-top: 2px dashed #dde1f0; margin-top: 2px; padding-top: 7px; }
.radar-leg-locked { font-weight: 800; color: var(--coral-deep); text-align: center; line-height: 1.6; padding: 6px 4px; }

/* ---------- 大会スコア発表 演出（部門を1つずつドラマチックに） ---------- */
.reveal-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.reveal-progress { font-size: .7rem; font-weight: 800; color: var(--ink-soft); letter-spacing: .12em; }
.reveal-divname {
  font-size: 1.1rem; font-weight: 800; color: #fff;
  background: var(--ink); border-radius: 999px; padding: 5px 20px;
  box-shadow: var(--pop-shadow-sm);
  animation: rv-name-in .45s cubic-bezier(.34,1.5,.6,1) both;
}
@keyframes rv-name-in { from { opacity: 0; transform: translateY(-16px) scale(.9); } to { opacity: 1; transform: none; } }

/* 順位＝主役 */
.reveal-rank {
  position: relative; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 0 8px; overflow: hidden;
}
/* 1〜3位は背景に光のバースト */
.reveal-rank.rank-1::before, .reveal-rank.rank-2::before, .reveal-rank.rank-3::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255,209,102,.55), rgba(255,209,102,0) 62%);
  animation: rv-burst .7s .35s both;
}
.reveal-rank.rank-2::before { background: radial-gradient(circle at 50% 42%, rgba(180,196,220,.5), rgba(180,196,220,0) 62%); }
.reveal-rank.rank-3::before { background: radial-gradient(circle at 50% 42%, rgba(224,164,110,.5), rgba(224,164,110,0) 62%); }
@keyframes rv-burst { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
.reveal-rank > * { position: relative; z-index: 1; }
.reveal-medal { font-size: 2.6rem; line-height: 1; animation: rv-pop .5s .35s both; }
.reveal-rank-num { display: flex; align-items: baseline; gap: 3px; animation: rv-pop .6s .45s both; }
.reveal-rank-num .rn-side { font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.reveal-rank-num .rn-n {
  font-family: 'Baloo 2', 'M PLUS Rounded 1c', sans-serif; font-weight: 800;
  font-size: 4.4rem; line-height: .9; color: var(--coral-deep);
  text-shadow: 0 4px 0 var(--ink), 0 0 18px rgba(255,107,107,.35);
}
.reveal-rank.rank-1 .rn-n { color: #eaa100; text-shadow: 0 4px 0 var(--ink), 0 0 20px rgba(255,193,7,.5); }
.reveal-rank.rank-2 .rn-n { color: #8091ad; }
.reveal-rank.rank-3 .rn-n { color: #c07b3a; }
.reveal-entrants { font-size: .7rem; font-weight: 800; color: var(--ink-soft); animation: rv-fade .5s .75s both; }
.reveal-trend { font-size: .78rem; font-weight: 800; color: var(--ink-soft); margin-top: 2px; animation: rv-fade .5s .85s both; }
.reveal-trend.is-up { color: #1f8a7e; }
.reveal-trend.is-down { color: var(--ink-soft); }
.reveal-best {
  margin-top: 4px; font-size: .74rem; font-weight: 800; color: var(--ink);
  background: var(--sun); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 12px;
  animation: rv-pop .5s 1s both;
}
.reveal-champ { margin-top: 3px; font-size: 1.05rem; font-weight: 800; color: #cf9400; animation: rv-champ 1.1s .6s both; }
@keyframes rv-pop { 0% { opacity: 0; transform: scale(.2); } 60% { opacity: 1; transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes rv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rv-champ { 0% { opacity: 0; transform: scale(.5) rotate(-4deg); } 50% { opacity: 1; transform: scale(1.14) rotate(2deg); } 70% { transform: scale(.98) rotate(0); } 100% { transform: scale(1); } }

.reveal-scoreline { display: flex; gap: 10px; align-items: center; justify-content: center; animation: rv-fade .5s .9s both; }
.reveal-scoreline .rs-score {
  font-size: 1rem; font-weight: 800; color: var(--ink);
  background: var(--paper); border: var(--line); border-radius: 999px; padding: 3px 16px;
}
.reveal-scoreline .rs-pt {
  font-size: .92rem; font-weight: 800; color: #fff;
  background: var(--coral); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 13px;
}
.reveal-detail {
  width: 100%; text-align: left; margin-top: 2px;
  background: rgba(255,255,255,.55); border: 2px dashed #c7cfe6; border-radius: 12px;
  padding: 8px 11px; animation: rv-fade .5s 1.05s both;
}

/* ---------- 結果表（大会/エンディング） ---------- */
.ending-highlights { border: 2px dashed #c7cfe6; border-radius: 12px; background: rgba(255,255,255,.55); padding: 8px 11px; margin: 6px 0; display: flex; flex-direction: column; gap: 3px; }
.eh-row { font-size: .82rem; font-weight: 800; color: var(--ink); }
.eh-row.is-up { color: #1f8a7e; }
.result-big { text-align: center; font-size: 1.8rem; margin: 8px 0; color: var(--coral-deep); font-weight: 800; }
.best-note { color: var(--coral-deep); font-weight: 800; font-size: 1rem; background: #fff2cf; border: var(--line); border-radius: 12px; padding: 6px 10px; margin: 4px auto; display: inline-block; }
table.results { width: 100%; border-collapse: collapse; font-size: .8rem; margin-top: 6px; }
table.results td, table.results th { padding: 4px; border-bottom: 2px dotted #d8ddf0; text-align: left; }
table.results th { color: var(--ink-soft); font-size: .7rem; }
table.results tr.me-row { color: var(--coral-deep); font-weight: 800; }
/* 開発用: 大会でステータスより実スコアが低かった理由 */
.dev-reason {
  margin-top: 6px; padding: 6px 10px; border-radius: 10px;
  background: #1c2240; color: #ffd166;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .7rem; line-height: 1.5;
}

/* ---------- イベント選択肢: 全幅・画面下部 ---------- */
/* イベント画面: 一目でイベントと分かるスポットライト背景＋全要素を中央に寄せる */
#screen-event {
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, #f5f7ff 0%, #e7ecff 52%, #d7e0ff 100%);
}
#event-char { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.event-portrait { display: none; }
.event-portrait.has-img {
  display: block; width: 64px; height: 64px;
  border: var(--line); border-radius: 50%; overflow: hidden;
  background: var(--paper); box-shadow: var(--pop-shadow-sm);
}
.event-portrait-img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* イベントの顔チップ: SVGでもPNGと同じ枠で出す */
.event-portrait.has-avatar {
  display: block; width: 64px; height: 64px;
  border: var(--line); border-radius: 50%; overflow: hidden;
  background: var(--paper); box-shadow: var(--pop-shadow-sm);
}
.event-portrait.has-avatar svg { width: 100%; height: 100%; display: block; }
#event-text { animation: screen-part-in 240ms ease-out .06s both; }
#event-choices { animation: screen-part-in 240ms ease-out .14s both; }
@keyframes screen-part-in { from { opacity: 0; transform: translateY(10px); } }
/* 文章(白カード)とボタン群の間に明確な余白を作り、上下分割ではなく中央にまとめる */
#event-choices { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- 大会エントリー: 下寄せ・均等サイズ・チェックボックス ---------- */
#entry-divisions { margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }
#entry-divisions.gate-layout { flex: 1; min-height: 0; }
#entry-divisions.gate-layout .gate-choices { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; }
/* この2画面では固定CTA(#btn-entry-go)を使わない。空の .cta-wrap が余白(28px)を残して
   画面をはみ出させるため、丸ごと隠す（2026-09-07 実測: 844pxに対し852pxになっていた） */
#entry-divisions.gate-layout ~ .cta-wrap { display: none; }
.entry-empty { font-size: .72rem; font-weight: 800; color: var(--coral-deep); text-align: center; padding: 2px 0; }
#entry-divisions .entry-option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: var(--line); border-radius: 14px; background: var(--paper);
  box-shadow: var(--pop-shadow-sm); padding: 13px 14px;
  font-size: .95rem; font-weight: 800; color: var(--ink);
}
#entry-divisions .entry-option:active { transform: translateY(3px); box-shadow: none; }
#entry-divisions .entry-option.selected { background: #fff3f0; border-color: var(--coral); box-shadow: 0 3px 0 var(--coral); }
.entry-check {
  width: 26px; height: 26px; flex-shrink: 0;
  border: 2px solid var(--ink); border-radius: 7px; background: var(--paper);
  display: grid; place-items: center; font-size: .95rem; font-weight: 800; color: transparent;
}
.entry-option.selected .entry-check { background: var(--coral); color: #fff; }
/* 未選択のうちは押せないことを見た目で示す（押しても進まない理由が分かるように） */
#btn-entry-go:disabled { background: #d8dfea; color: #8b97ad; box-shadow: none; }
#btn-entry-go:disabled:active { transform: none; }
.entry-label { flex: 1; }
.entry-self { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.entry-self-val { font-size: .78rem; font-weight: 800; color: var(--ink); }
.entry-self-note { font-size: .7rem; font-weight: 700; color: var(--ink-soft); }
/* ---------- 出る／出ないを決める「見立てカード」（2026-09-07） ---------- */
.gate-box { margin-bottom: 10px; }
.gate-verdict {
  align-self: flex-start;
  display: inline-block; margin: 2px 0 8px; padding: 3px 12px; border-radius: 999px;
  border: 2px solid var(--ink); font-size: .95rem; font-weight: 800; color: var(--ink);
}
.gate-verdict.is-sure { background: var(--sun); }
.gate-verdict.is-half { background: #d1f4ef; }
.gate-verdict.is-none { background: #ffe1d9; }
.gate-row {
  display: grid; grid-template-columns: 1fr 3.2em 8.2em; align-items: baseline; gap: 8px;
  padding: 3px 0; border-top: 2px dotted #dfe4f2;
}
.gate-k { font-size: .78rem; font-weight: 800; color: var(--ink); }
.gate-v { font-size: 1.05rem; font-weight: 800; color: var(--ink); text-align: right; }
.gate-need { font-size: .7rem; font-weight: 700; color: var(--ink-soft); text-align: right; }
.gate-note { margin-top: 8px; font-size: .75rem; font-weight: 700; color: var(--ink-soft); line-height: 1.45; }
.gate-bar { display: grid; grid-template-columns: 4.9em 1fr 2.6em; align-items: center; gap: 8px; min-height: 26px; }
.gate-bl { white-space: nowrap; }   /* ラベルは折り返さない（「5項目の平均」が2行になっていた） */
.gate-bl { font-size: .78rem; font-weight: 800; color: var(--ink); }
.gate-bv { font-size: .95rem; font-weight: 800; color: var(--ink); text-align: right; }
.gate-gauge { position: relative; }
.gate-tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); opacity: .38; }
.gate-bar.is-total { border-top: 2px dotted #dfe4f2; margin-top: 4px; padding-top: 6px; }
.gate-legend { font-size: .7rem; font-weight: 700; color: var(--ink-soft); padding-top: 6px; }
.policy-sub { font-size: .7rem; font-weight: 700; color: var(--ink-soft); }

/* ============================================================
   右側: 開発用パラメータパネル（1100px以上で表示）
   ============================================================ */
.dev-panel {
  display: none;
  width: 320px; align-self: flex-start;
  position: sticky; top: 24px;
  background: #1c2240; border-radius: 20px; border: 3px solid #10132b;
  box-shadow: 0 18px 40px rgba(20,30,70,.4);
  color: #d7defa; font-size: .74rem; overflow: hidden;
}
/* 開発パネルは ?dev を付けたとき（html.dev）かつ幅1100px以上でのみ表示。テスターには非表示 */
@media (min-width: 1100px) { html.dev .dev-panel { display: block; } }
.dev-head { background: #10132b; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; }
.dev-head .dev-title { font-weight: 800; letter-spacing: .1em; font-size: .78rem; color: #ffd166; }
.dev-head .dev-badge { font-size: .7rem; background: #2ec4b6; color: #10132b; padding: 2px 8px; border-radius: 999px; font-weight: 800; }
.dev-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.dev-section .dev-label { font-size: .6rem; letter-spacing: .16em; color: #7f8ec2; margin-bottom: 5px; font-weight: 800; }
.dev-row { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 0; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .72rem; gap: 10px; }
.dev-row .k { color: #9aa8d8; flex-shrink: 0; }
.dev-row .v { color: #fff; font-weight: 700; text-align: right; }
.dev-row .v.warn { color: #ff6b6b; }
.dev-row .v.good { color: #2ec4b6; }
table.dev-grid { width: 100%; border-collapse: collapse; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .7rem; }
table.dev-grid th, table.dev-grid td { padding: 2px 4px; text-align: right; border-bottom: 1px solid #2a3158; }
table.dev-grid th { color: #7f8ec2; font-size: .7rem; font-weight: 700; }
table.dev-grid td:first-child, table.dev-grid th:first-child { text-align: left; color: #9aa8d8; }
table.dev-grid td.avg { color: #ffd166; font-weight: 700; }
table.dev-grid tr.locked td { color: #545d85; }
.dev-note { font-size: .7rem; color: #7f8ec2; line-height: 1.5; }

/* ==== 選手カード（カード化エンディング Phase1・2026-07-15） ====
   クール基調（スチール/ブルー）。フレーム色＋キラはランク連動（S=虹UR/A=金SR/B=銀R/C=銅/D・E=ノーマル/X=退学） */
.pcard {
  width: min(300px, 88%); margin: 4px auto 10px; border-radius: 18px; padding: 5px;
  box-shadow: 0 10px 26px rgba(30, 45, 80, .35);
}
.pcard.rank-S { background: linear-gradient(135deg, #67e8f9, #818cf8, #c084fc, #67e8f9); }
.pcard.rank-A { background: linear-gradient(145deg, #ffd76a, #e8a12b 45%, #fff3c4 60%, #d98a1c); }
.pcard.rank-B { background: linear-gradient(145deg, #c3d0de, #5b6b82 50%, #e2eaf2, #6b7d94); }
.pcard.rank-C { background: linear-gradient(145deg, #d9a37c, #9a6a44 55%, #e8c3a4, #8a5c3a); }
.pcard.rank-D { background: #46577a; }
.pcard.rank-E { background: #7a8aa8; }
.pcard.rank-X { background: repeating-linear-gradient(135deg, #6b7280 0 12px, #4b5563 12px 24px); }
.pcard-inner { background: #0e1830; border-radius: 14px; overflow: hidden; color: #eaf2ff; }
.pcard.rank-X .pcard-inner { background: #1c2129; color: #c8ccd4; }
.pcard-head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px 4px; }
.pcard-rarity { font-size: .56rem; letter-spacing: 2px; font-weight: 800; color: #9fb6e8; }
.pcard.rank-S .pcard-rarity { background: linear-gradient(90deg, #67e8f9, #c084fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pcard.rank-A .pcard-rarity { color: #ffd76a; }
.pcard-rankbadge {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: .95rem; color: #0e1830; background: #b9c8dc;
}
.pcard.rank-S .pcard-rankbadge { background: linear-gradient(135deg, #67e8f9, #818cf8); }
.pcard.rank-A .pcard-rankbadge { background: #ffd76a; }
.pcard-name { padding: 0 13px; font-size: 1.3rem; font-weight: 900; line-height: 1.15; }
.pcard-epithet { padding: 1px 13px 7px; font-size: .7rem; color: #a9c4ff; }
.pcard-art {
  margin: 0 10px; height: 150px; border-radius: 10px; position: relative; overflow: hidden;
  border: 1px solid #3b4f86; background: radial-gradient(120% 90% at 50% 20%, #233a6e 0, #141f3d 60%);
  display: grid; place-items: center;
}
.pcard.rank-S .pcard-art::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(150,220,255,.18) 45%, rgba(200,160,255,.18) 55%, transparent 70%);
}
.pcard-art svg { width: 166px; height: 148px; color: #8fc4e8; filter: drop-shadow(0 0 8px rgba(120, 190, 255, .45)); }
.pcard.rank-S .pcard-art svg { color: #8fe6ff; filter: drop-shadow(0 0 12px rgba(140, 220, 255, .7)); }
.pcard.rank-A .pcard-art svg { color: #ffdf8f; filter: drop-shadow(0 0 10px rgba(255, 210, 120, .55)); }
.pcard.rank-X .pcard-art svg { color: #8a919c; filter: none; }
.pcard-artlabel { position: absolute; bottom: 6px; left: 10px; font-size: .5rem; letter-spacing: 2px; color: #7f96b8; }
/* 卒業カードの選手フェイス（左下のART表記と重ならないよう右下に置く） */
.pcard-face {
  position: absolute; right: 8px; bottom: 8px; width: 58px; height: 58px;
  border: 3px solid #eaf2ff; border-radius: 50%; overflow: hidden;
  background: #0e1830; box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}
.pcard-face svg { width: 100%; height: 100%; display: block; }
.pcard-nums { display: flex; padding: 8px 13px 2px; gap: 10px; }
.pcard-num { flex: 1; }
.pcard-num.right { text-align: right; }
.pcard-num small { display: block; font-size: .56rem; letter-spacing: 2px; color: #7f97cf; }
.pcard-num b { font-size: 1.45rem; font-weight: 900; }
.pcard.rank-S .pcard-num b { background: linear-gradient(90deg, #67e8f9, #c084fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pcard-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 14px; padding: 4px 13px 9px; font-size: .7rem; }
.pcard-stat { display: flex; justify-content: space-between; }
.pcard-stat span { color: #a9c4ff; }
.pcard-foot {
  background: rgba(0, 0, 0, .32); padding: 6px 13px;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  flex-wrap: wrap; /* メダルが長い時はNo.行が下に折り返す（単語中では折らない） */
}
.pcard-medals { font-size: .7rem; color: #ffe4a3; white-space: nowrap; }
.pcard-no { font-size: .7rem; color: #6d80ad; white-space: nowrap; margin-left: auto; }

/* ==== パック開封演出（Phase2・2026-07-15） ==== */
.pack-stage { position: relative; display: grid; place-items: center; }
.pack-stage > .pcard { grid-area: 1 / 1; }
.card-pack {
  grid-area: 1 / 1;
  width: min(300px, 88%); height: 430px; border-radius: 18px; padding: 5px;
  background: linear-gradient(160deg, #2b3a67, #16224a 55%, #33436f);
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  animation: packFloat 2.2s ease-in-out infinite;
}
.card-pack-inner {
  height: 100%; border-radius: 14px; background: #0e1830; color: #eaf2ff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  overflow: hidden; position: relative;
}
.pack-logo svg { width: 150px; height: 135px; color: #24345f; }
.pack-q {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%);
  font-family: 'Baloo 2', sans-serif; font-size: 3.2rem; font-weight: 800; color: #8fc4e8;
  text-shadow: 0 0 18px rgba(120, 190, 255, .55);
}
.pack-tap { position: absolute; bottom: 26px; font-size: .72rem; letter-spacing: 3px; color: #7f96b8; animation: tapPulse 1.4s ease-in-out infinite; }
@keyframes packFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes tapPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
/* レア度の気配（発光色のみ・枠色は開封まで伏せる） */
.card-pack.glow-S { animation: packFloat 2.2s ease-in-out infinite, glowS 2.2s ease-in-out infinite; }
.card-pack.glow-A { animation: packFloat 2.2s ease-in-out infinite, glowA 2.2s ease-in-out infinite; }
.card-pack.glow-B { animation: packFloat 2.2s ease-in-out infinite, glowB 2.2s ease-in-out infinite; }
.card-pack.glow-C, .card-pack.glow-D, .card-pack.glow-E { box-shadow: 0 10px 26px rgba(30, 45, 80, .35); }
.card-pack.glow-X { background: repeating-linear-gradient(135deg, #4b5563 0 12px, #374151 12px 24px); box-shadow: 0 10px 26px rgba(0, 0, 0, .4); }
@keyframes glowS {
  0%, 100% { box-shadow: 0 10px 26px rgba(30,45,80,.35), 0 0 22px rgba(103,232,249,.55), 0 0 44px rgba(192,132,252,.35); }
  50%      { box-shadow: 0 10px 26px rgba(30,45,80,.35), 0 0 34px rgba(255,138,212,.65), 0 0 60px rgba(129,140,248,.45); }
}
@keyframes glowA {
  0%, 100% { box-shadow: 0 10px 26px rgba(30,45,80,.35), 0 0 20px rgba(255,215,106,.5); }
  50%      { box-shadow: 0 10px 26px rgba(30,45,80,.35), 0 0 36px rgba(255,215,106,.75); }
}
@keyframes glowB {
  0%, 100% { box-shadow: 0 10px 26px rgba(30,45,80,.35), 0 0 14px rgba(195,208,222,.4); }
  50%      { box-shadow: 0 10px 26px rgba(30,45,80,.35), 0 0 24px rgba(195,208,222,.6); }
}
/* 開封: 震え→白フラッシュ */
.card-pack.opening { animation: packShake .7s ease-in-out forwards; }
.card-pack.opening .card-pack-inner::after {
  content: ''; position: absolute; inset: 0; background: #fff; opacity: 0;
  animation: packFlash .7s ease-in forwards;
}
@keyframes packShake {
  0% { transform: rotate(0); } 15% { transform: rotate(-3deg) scale(1.02); }
  30% { transform: rotate(3deg) scale(1.04); } 45% { transform: rotate(-4deg) scale(1.06); }
  60% { transform: rotate(4deg) scale(1.08); } 80% { transform: rotate(-2deg) scale(1.12); }
  100% { transform: rotate(0) scale(1.18); }
}
@keyframes packFlash { 0% { opacity: 0; } 70% { opacity: .1; } 100% { opacity: 1; } }
/* カード出現 */
.pcard.reveal { animation: cardReveal .65s cubic-bezier(.2, 1.35, .4, 1); }
@keyframes cardReveal {
  0% { transform: scale(.55) rotateY(80deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1) rotateY(0); opacity: 1; }
}
/* バースト・パーティクル */
.pack-burst { position: absolute; left: 50%; top: 45%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.pk-particle {
  position: absolute; width: 9px; height: 9px; border-radius: 3px;
  background: var(--c, #9fc8ee);
  transform: rotate(var(--a)) translateY(0);
  animation: pkFly .95s ease-out forwards;
}
@keyframes pkFly {
  0% { transform: rotate(var(--a)) translateY(-30px) scale(1); opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(calc(var(--d) * -1 - 60px)) scale(.3); opacity: 0; }
}
/* 成績表エリアのフェードイン */
.ending-rest { display: flex; flex-direction: column; gap: 6px; animation: restIn .5s ease-out; }
@keyframes restIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==== カード図鑑（Phase3・2026-07-15） ==== */
.zukan-layer { font-size: .7rem; font-weight: 800; color: var(--ink-soft); letter-spacing: .08em; margin: 8px 2px 4px; }
.zukan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.zukan-tile {
  border: 2px solid var(--ink); border-radius: 12px; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  min-height: 96px; justify-content: flex-start; overflow: hidden; font-family: inherit;
  background: #0e1830; color: #eaf2ff; box-shadow: 0 2px 0 var(--ink);
}
.zukan-tile:active { transform: translateY(2px); box-shadow: none; }
.zukan-tile .zt-art {
  position: relative; display: grid; place-items: center; flex-shrink: 0;
  width: 100%; aspect-ratio: 592 / 300; overflow: hidden;
  border-bottom: 1px solid #3b4f86;
  background: radial-gradient(120% 90% at 50% 20%, #233a6e 0, #141f3d 60%);
}
.zukan-tile .zt-art .pcard-artimg { width: 100%; height: 100%; object-fit: cover; }
.zukan-tile .zt-art svg {
  width: 92%; height: 92%; color: #8fc4e8;
  filter: drop-shadow(0 0 5px rgba(120, 190, 255, .42));
}
.zukan-tile .zt-copy {
  flex: 1; min-height: 37px; width: 100%; padding: 5px 4px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.zukan-tile .zt-title { font-size: .7rem; font-weight: 800; line-height: 1.25; text-align: center; }
.zukan-tile .zt-sub { font-size: .7rem; color: #8fa4d6; }
.zukan-tile.locked { background: #e7e9f2; color: #a7afc9; border-color: #b6bedb; box-shadow: none; }
.zukan-tile.locked .zt-art { border-color: #c7ccdc; background: #d9ddea; }
.zukan-tile.locked .zt-art svg { color: #7e88a5; opacity: .18; filter: grayscale(1); }
.zukan-tile .zt-lockmark {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 1.2rem; font-weight: 800; color: #8791ad;
}
.zukan-tile.locked .zt-title { color: #a7afc9; }
/* 解禁済みタイルの縁色＝レア度 */
.zukan-tile.zrank-S { border-color: #7dd3fc; box-shadow: 0 2px 0 #4338ca, 0 0 10px rgba(129, 140, 248, .5); }
.zukan-tile.zrank-A { border-color: #e8a12b; box-shadow: 0 2px 0 #a16207; }
.zukan-tile.zrank-B { border-color: #8fa8c8; box-shadow: 0 2px 0 #5b6b82; }
.zukan-tile.zrank-C { border-color: #b07a50; box-shadow: 0 2px 0 #8a5c3a; }
.zukan-tile.zrank-X { background: #1c2129; border-color: #6b7280; }
.zukan-date { font-size: .7rem; color: var(--ink-soft); margin: 4px 0 2px; }
#zukan-detail .popup-card { max-height: 86%; overflow-y: auto; }
#zukan-detail .pcard { margin-top: 2px; }
/* カード画像保存ボタン（エンディング・図鑑共通） */
.card-dl-btn {
  display: block; margin: 2px auto 4px; padding: 9px 18px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-size: .78rem; font-weight: 800; box-shadow: 0 2px 0 var(--ink);
}
.card-dl-btn:active { transform: translateY(2px); box-shadow: none; }
/* 記録一覧の排出カード行 */
.event-cardtitle { font-size: .7rem; color: #8a5c3a; font-weight: 800; }

/* ==== カード シェア/保存アクション（Phase3.5・2026-07-15） ==== */
.card-actions { display: flex; gap: 8px; justify-content: center; margin: 4px 0 6px; }
.card-actions .card-dl-btn, .card-actions .card-share-btn { margin: 0; }
.card-share-btn {
  padding: 9px 20px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--coral); color: #fff;
  font-size: .82rem; font-weight: 800; box-shadow: 0 2px 0 var(--ink);
}
.card-share-btn:active { transform: translateY(2px); box-shadow: none; }

/* ==== 全カード見本ギャラリー（2026-07-15） ==== */
.gallery-overlay {
  position: absolute; inset: 0; z-index: 40; background: var(--cream);
  display: flex; flex-direction: column; overflow: hidden;
}
.gallery-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 6px; flex-shrink: 0;
}
.gallery-title { font-size: 1rem; font-weight: 800; color: var(--ink); }
.gallery-close {
  width: 34px; height: 34px; border: var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-size: 1.1rem; font-weight: 800; box-shadow: var(--pop-shadow-sm);
}
.gallery-close:active { transform: translateY(2px); box-shadow: none; }
.gallery-note { font-size: .7rem; color: var(--ink-soft); padding: 0 14px 6px; flex-shrink: 0; }
.card-gallery {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; padding: 8px 12px 20px;
}
.gallery-section-title {
  grid-column: 1 / -1; margin: 8px 0 -2px; padding: 9px 12px;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--sun);
  color: var(--ink); box-shadow: 0 3px 0 var(--ink); font-size: .82rem; text-align: left;
}
.gallery-cell {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 3px;
}
.gallery-cell .pcard {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.gallery-cell .pcard-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.gallery-cell .pcard-name {
  min-height: 2.3em;
}
.gallery-cell .pcard-epithet {
  min-height: 2.5em;
  line-height: 1.25;
  white-space: normal;
}
.gallery-cell .pcard-foot {
  margin-top: auto;
}
.gallery-cell-cap { font-size: .7rem; font-weight: 800; color: var(--ink-soft); text-align: center; }
.gallery-cell-cap.is-provisional { color: var(--coral-deep); }
@media (min-width: 900px) {
  body.gallery-mode { padding: 16px 20px; }
  body.gallery-mode #app {
    width: min(1680px, 100%); max-width: none; height: calc(100vh - 32px);
    border-radius: 24px;
  }
  body.gallery-mode .gallery-head { padding: 16px 22px 8px; }
  body.gallery-mode .gallery-title { font-size: 1.25rem; }
  body.gallery-mode .gallery-note { padding: 0 22px 8px; font-size: .72rem; }
  body.gallery-mode .card-gallery {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px 16px; padding: 10px 22px 30px;
  }
}
/* 図鑑内の見本リンク */
.zukan-gallery-link {
  font-size: .7rem; font-weight: 800; color: var(--coral-deep);
  border: 2px solid var(--coral); border-radius: 999px; background: #fff;
  padding: 2px 10px; box-shadow: 0 2px 0 var(--coral-deep);
}
.zukan-gallery-link:active { transform: translateY(2px); box-shadow: none; }

/* カード中央アートのイラスト画像（CARD_IMAGE登録時。未登録はSVG）。パネルをcoverで埋める */
.pcard-artimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* カード選択（改善プラン#3）: 最上位所持済みの周に、達成した称号から記録する物語を選ぶ */
.card-choice { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.choice-lead { white-space: pre-line; font-weight: 700; }
.card-choice .choice-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; text-align: left; }
.choice-head { display: flex; justify-content: space-between; width: 100%; align-items: center; gap: 8px; }
.choice-title { font-size: 1.02em; }
.choice-layer { font-size: .76em; opacity: .85; flex-shrink: 0; }
.choice-note { font-size: .8em; opacity: .9; }

/* 早期引退の提案（改善プラン#4）: 現時点評価の情報ボックス */
.retire-info { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(46, 196, 182, .12); border: 2px solid rgba(46, 196, 182, .4); display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.retire-info-head { font-size: .85em; opacity: .85; }

/* 演技方針セレクタ（改善プラン#1）: エントリー画面で安全/通常/攻めを選ぶ */
.policy-box { margin-top: 12px; padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .75); border: 2px solid #d8dff0; }
.policy-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.policy-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; font-size: .82rem; font-weight: 800; }
.policy-label { white-space: nowrap; }
.policy-btn .policy-icon { font-size: 1.5em; }
.policy-btn.selected { background: #ff6b6b; color: #fff; border-color: #e2504f; }
.policy-hint { margin-top: 6px; font-size: .78em; font-weight: 700; opacity: .8; text-align: center; }

/* バックアップ画面（設定モーダル内） */
.backup-file { display: none; }
.backup-now { font-weight: 800; opacity: .95; }

@media (prefers-reduced-motion: reduce) {
  .title-confetti i,
  .rv-cell,
  .tr-stamp,
  #training-summary.rv-in,
  .rv-total,
  .radar-svg .radar-value,
  .slot.just-set,
  #btn-training-go.ready-pulse,
  .screen,
  #event-text,
  #event-choices,
  .reveal-divname,
  .reveal-medal,
  .reveal-rank-num,
  .reveal-entrants,
  .reveal-trend,
  .reveal-best,
  .reveal-champ,
  .reveal-scoreline,
  .reveal-detail,
  .reveal-rank.rank-1::before,
  .reveal-rank.rank-2::before,
  .reveal-rank.rank-3::before {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
  #training-summary.rv-wait { opacity: 1; transform: none; }
  .gauge > span,
  .stat-row .bar { transition: none; }
  .grow-add { transition: none; }
}

/* ---------- UIアイコン（インク線SVG・絵文字の置き換え。2026-09-07） ---------- */
.ui-icon { width: 1.05rem; height: 1.05rem; display: block; flex-shrink: 0; color: inherit; }
.modal-title .ui-icon { width: 20px; height: 20px; }
#screen-title > button, #btn-alumni { display: flex; align-items: center; justify-content: center; gap: 8px; }
#screen-title > button .ui-icon, #btn-alumni .ui-icon { width: 20px; height: 20px; }
.log-prompt { display: flex; align-items: center; gap: 6px; }
.log-prompt .ui-icon { width: 16px; height: 16px; color: var(--ink-soft); }

/* 初回だけ出る一言。読ませる説明ではなく、次の一手を指す短い声かけ */
.coach-tip {
  display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--sun);
  color: var(--ink); padding: 6px 8px 6px 14px; margin-bottom: 6px;
  box-shadow: var(--pop-shadow-sm);
}
.coach-tip-text { flex: 1; font-size: .78rem; font-weight: 800; line-height: 1.35; }
.coach-tip-x {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font-size: .9rem; font-weight: 800; line-height: 1;
}
