/* ==========================================================================
   THE 体育会サバイバー — Design System（ロゴに合わせて組み直し）
   Strict compositor-only motion (transform / opacity), tabular numerals,
   75%+ central playfield protection, and full reduced-motion support.
   ========================================================================== */

:root {
  /* THE 体育会サバイバー — ロゴ（黒・角ばった極太）に合わせた配色
     黒い墨 × 白い紙 × 信号の黄（ゼッケン・ライン）× 赤（ハチマキ）。ゲーム面の明るいスタジアムの上で読める強さ */
  --ink: #111114;
  --ink-soft: #2E2E36;
  --ink-muted: #5B5B66;
  --cream: #FFFFFF;
  --cream-warm: #F1EFE8;
  --paper: #F6F4EE;
  --surface-glass: rgba(255, 255, 255, 0.95);
  --scrim: rgba(10, 10, 14, 0.62);

  /* 競技の色（ゲーム中の表示で使う） */
  --signal: #FFE14A;
  --signal-deep: #E8B800;
  --hachimaki: #E8332A;
  --lime: #FFE14A;
  --lime-deep: #E8B800;
  --cyan: #2FB8FF;
  --cyan-deep: #0A84C6;
  --tangerine: #FF6B1A;
  --coral: #E8332A;
  --magenta: #FF3BA7;
  --gold: #FFD426;
  --emerald: #00C46E;
  --cobalt: #2962FF;

  /* 書体（すべて /tl/common/fonts/）
     --font-display: 見出し・英字ロゴ風（Oswald 700 ＋ 和文は Dela Gothic One）
     --font-ui:      本文・ボタン（Zen Kaku Gothic New 500/700）
     --font-num:     数字（Oswald・等幅数字）
     --font-jp-heavy: 和文の大見出し（Dela Gothic One） */
  --font-display: 'Oswald', 'Dela Gothic One', 'Hiragino Kaku Gothic StdN', 'Yu Gothic', system-ui, sans-serif;
  --font-ui: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', system-ui, -apple-system, sans-serif;
  --font-num: 'Oswald', 'Zen Kaku Gothic New', ui-monospace, Menlo, monospace;
  --font-jp-heavy: 'Dela Gothic One', 'Hiragino Kaku Gothic StdN', 'Yu Gothic', sans-serif;

  /* Motion Tokens */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-pop: cubic-bezier(0.22, 1.35, 0.36, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-fast: 130ms;
  --dur-ui: 190ms;
  --dur-modal: 230ms;

  /* 角は小さく・影は硬く（ゼッケンや掲示物の感じ） */
  --border-w: 3px;
  --shadow-sm: 2px 2px 0 var(--ink);
  --shadow-md: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 7px;
  --radius-pill: 4px;

  /* iOS 26 の下端（100% と 100svh の差。ひな形の css/game.css と同じ考え方） */
  --tb: max(0px, calc(100% - 100svh));
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111114;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 500;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

[hidden] {
  display: none !important;
}

.num-tabular {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ==========================================================================
   APP SHELL & CANVAS
   ========================================================================== */

.app-shell {
  /* iOS 26 の下端ツールバーに隠れないよう、下端を --tb だけ上げる（ひな形 css/game.css と同じ） */
  position: fixed;
  inset: 0;
  bottom: var(--tb);
  overflow: hidden;
}

#game-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.fx-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.turntable-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ==========================================================================
   KEYCAPS & SHARED POP ARCADE CONTROLS
   ========================================================================== */

.keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 0 var(--ink);
  vertical-align: middle;
}

.keycap--sm {
  height: 20px;
  font-size: 10px;
  padding: 0 5px;
}

.keycap--xs {
  height: 18px;
  min-width: 18px;
  font-size: 9px;
  padding: 0 4px;
  box-shadow: 0 1px 0 var(--ink);
}

.keycap--cta {
  background: var(--ink);
  color: var(--lime);
  border-color: var(--ink);
  box-shadow: none;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.eyebrow-pill--accent {
  background: var(--lime);
}

.eyebrow-pill--amix {
  background: var(--ink);
  color: var(--lime);
}

.title-legal-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 6px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--cream);
  text-shadow: 0 1.5px 0 var(--ink), 0 0 8px rgba(23, 19, 38, 0.55);
}

.pause-legal-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
}

.legal-link {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
  transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease;
}

.legal-link:hover {
  color: #FFFFFF;
}

.legal-link--modal {
  color: var(--ink-soft);
}

.legal-link--modal:hover {
  color: var(--ink);
}

.eyebrow-pill--dark {
  background: var(--ink);
  color: var(--gold);
}

.eyebrow-pill--danger {
  background: var(--coral);
  color: #FFFFFF;
}

.eyebrow-pill--victory {
  background: var(--gold);
  color: var(--ink);
}

/* Buttons */
.cta-btn,
.pill-btn,
.icon-btn {
  appearance: none;
  font-family: var(--font-ui);
  font-weight: 800;
  cursor: pointer;
  border: var(--border-w) solid var(--ink);
  color: var(--ink);
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) ease;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-md);
}

.cta-btn--primary {
  background: var(--lime);
  color: var(--ink);
}

.cta-btn--accent {
  background: var(--gold);
  color: var(--ink);
}

.cta-btn--secondary {
  background: var(--cream);
  color: var(--ink);
}

.cta-btn--ghost {
  background: var(--cream-warm);
  color: var(--ink-soft);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--cream);
  font-size: 12px;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-sm);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-glass);
  font-size: 17px;
  box-shadow: var(--shadow-sm);
}

.icon-glyph {
  line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
  .cta-btn:hover {
    transform: translate(-1px, -2px);
    box-shadow: 5px 6px 0 var(--ink);
  }
  .cta-btn--primary:hover {
    background: #D6FF54;
  }
  .pill-btn:hover,
  .icon-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--ink);
    background: #FFFFFF;
  }
}

.cta-btn:active,
.pill-btn:active,
.icon-btn:active {
  transform: translate(2px, 2px) scale(0.97);
  box-shadow: 1px 1px 0 var(--ink);
}

.select:focus { outline: none; }
/* 試合開始ボタンは斜めの形なので、四角い青い枠ではなく黄色の枠（Tab で移ったときだけ） */
.cta-btn--go:focus-visible { outline: 3px solid var(--signal) !important; outline-offset: 5px; }
.cta-btn:focus-visible,
.pill-btn:focus-visible,
.icon-btn:focus-visible,
.athlete-card:focus-visible,
.draft-card:focus-visible,
.fever-btn:focus-visible,
.switch-btn:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* ==========================================================================
   GAMEPLAY HUD — STRICT CENTER 75%+ CLEAR ZONE
   ========================================================================== */

.hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

/* Top Full-Width Slim XP Rail */
.xp-rail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: rgba(23, 19, 38, 0.85);
  border-bottom: 2px solid var(--ink);
}

.xp-rail__fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--lime) 65%, var(--gold) 100%);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 140ms var(--ease-out);
  will-change: transform;
}

.xp-level-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-sm);
}

.xp-level-pill.is-bump {
  animation: popBump 220ms var(--ease-pop);
}

/* Compact Top-Center Stadium Scoreboard */
.scoreboard {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.scoreboard__strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  box-shadow: var(--shadow-md);
}

.sb-cell {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sb-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.sb-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

.sb-cell--time .sb-value {
  min-width: 50px;
  text-align: center;
}

.sb-cell--score .sb-value {
  min-width: 58px;
  color: #D44700;
}

.sb-cell--wave .sb-value {
  color: var(--cobalt);
}

.sb-divider {
  width: 2px;
  height: 18px;
  background: rgba(23, 19, 38, 0.16);
  border-radius: 2px;
}

/* Scoreboard Meta Row: Court-Zone Pill + Combo Pill + ×2 Fever Multiplier */
.scoreboard__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.zone-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  transition: transform 160ms var(--ease-pop), border-color 140ms ease, box-shadow 140ms ease;
}

.zone-pill.is-home {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm);
  background: #FFFDF0;
}

.zone-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--cyan);
  flex-shrink: 0;
}

.zone-pill__label {
  color: var(--ink);
  text-transform: uppercase;
}

.zone-pill__buff {
  color: var(--ink-muted);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
}

.zone-pill__home {
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink);
  font-size: 9.5px;
  letter-spacing: 0.05em;
}

.fever-mult-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--gold), var(--magenta));
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 var(--ink);
  box-shadow: var(--shadow-sm);
  animation: popBump 220ms var(--ease-pop);
}

/* Combo Pill (tucked neatly beneath scoreboard) */
.combo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 0 11px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--magenta);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
  transform-origin: center top;
  transition: transform 140ms var(--ease-pop), opacity 140ms var(--ease-out);
}

.combo-pill.is-bump {
  animation: popBump 180ms var(--ease-pop);
}

.combo-pill__val {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 var(--ink);
}

.combo-pill__track {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: rgba(23, 19, 38, 0.35);
  overflow: hidden;
}

.combo-pill__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--gold);
  transform-origin: left center;
  transform: scaleX(1);
}

/* Top-Right Utility Controls */
.hud-utils {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

/* Boss HP Banner */
.boss-banner {
  position: absolute;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100vw - 36px));
  padding: 8px 14px 10px;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-md);
  animation: modalEnter 220ms var(--ease-out) both;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.boss-banner.is-overdrive {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-md);
}

.boss-banner.is-overdrive .boss-banner__tag {
  background: var(--gold);
  color: var(--ink);
  animation: popBump 240ms var(--ease-pop);
}

.boss-banner.is-overdrive .boss-banner__fill {
  background: linear-gradient(90deg, #FF1744, var(--gold), #FF3BA7);
}

/* Signature Ultimate Cut-In Ribbon (Non-blocking, top-left above playfield) */
.ultimate-banner {
  position: absolute;
  top: 60px;
  left: 16px;
  display: inline-flex;
  align-items: stretch;
  max-width: min(360px, calc(100vw - 32px));
  border: var(--border-w) solid var(--ink);
  border-radius: 14px;
  background: rgba(23, 19, 38, 0.94);
  color: var(--cream);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  opacity: 0;
  transform: translateX(-18px) scale(0.95);
  transition: transform 200ms var(--ease-out), opacity 170ms var(--ease-out);
  will-change: transform, opacity;
}

.ultimate-banner.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.ultimate-banner__bar {
  width: 8px;
  flex-shrink: 0;
  background: var(--ult-accent, var(--gold));
}

.ultimate-banner__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 14px 8px 11px;
  min-width: 0;
}

.ultimate-banner__top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.ultimate-banner__tag {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--ult-accent, var(--gold));
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.ultimate-banner__en {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 253, 247, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ultimate-banner__jp {
  font-family: var(--font-jp-heavy);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--gold);
  text-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pooled Viewport-Edge Off-Screen Radar Chevrons */
.hud-radar {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.radar-pin {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: -17px;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}

.radar-pin__arrow {
  position: absolute;
  inset: -4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.radar-pin__arrow::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid var(--ink);
  transform: translateX(4px);
}

.radar-pin__icon {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}

.radar-pin--boss .radar-pin__icon {
  background: linear-gradient(135deg, var(--coral), var(--gold));
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm);
  animation: feverPulse 750ms var(--ease-in-out) infinite;
}

.radar-pin--fever .radar-pin__icon {
  background: var(--gold);
}

.radar-pin--drink .radar-pin__icon {
  background: var(--emerald);
}

.radar-pin--event .radar-pin__icon {
  background: linear-gradient(135deg, var(--gold), var(--cyan));
  box-shadow: 0 0 0 2px #FFFFFF, var(--shadow-sm);
  animation: feverPulse 700ms var(--ease-in-out) infinite;
}

/* Mid-Match Stadium Event HUD Pill */
.event-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #FFF7C2, #D8FAFF);
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  animation: popBump 220ms var(--ease-pop);
}

.event-pill.is-charging {
  background: linear-gradient(90deg, var(--gold), var(--cyan));
}

.event-pill__icon {
  font-size: 12px;
  line-height: 1;
}

.event-pill__time {
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
}

.event-pill__track {
  width: 42px;
  height: 6px;
  border-radius: 4px;
  background: rgba(23, 19, 38, 0.25);
  overflow: hidden;
}

.event-pill__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--ink);
  transform-origin: left center;
  transform: scaleX(0);
}

.boss-banner__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.boss-banner__tag {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--coral);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.boss-banner__name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boss-banner__hp {
  font-size: 12px;
  font-weight: 700;
  color: var(--cream);
}

.boss-banner__track {
  position: relative;
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.boss-banner__trail,
.boss-banner__fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(1);
}

.boss-banner__trail {
  background: var(--gold);
  transition: transform 340ms var(--ease-out);
}

.boss-banner__fill {
  background: linear-gradient(90deg, var(--coral), #FF6B4A);
  transition: transform 90ms var(--ease-out);
}

/* Non-blocking Milestone Toast */
.hud-toast {
  position: absolute;
  bottom: 106px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: transform 200ms var(--ease-out), opacity 180ms var(--ease-out);
}

.hud-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.hud-toast:not(.is-visible) {
  transform: translateX(-50%) translateY(8px) scale(0.95);
}

.hud-toast__tag {
  white-space: nowrap; flex: none; /* 「チャンス！」などは改行しない（本人） */
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--lime);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* 画面に出す見出し（WAVE の名前など）は極太の Dela Gothic One（2026-11-23 本人「太めのウェイトに」） */
.hud-toast__text {
  font-family: var(--font-jp-heavy);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* Bottom-Left Vital Cluster */
.hud-vitals {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 244px;
}

.vital-card {
  padding: 7px 10px 8px;
  border: var(--border-w) solid var(--ink);
  border-radius: 14px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
}

.vital-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.athlete-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--lime);
  flex-shrink: 0;
}

.vital-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.vital-num {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.meter-track {
  position: relative;
  height: 12px;
  border-radius: 7px;
  background: #28213F;
  border: 2px solid var(--ink);
  overflow: hidden;
}

.meter-trail,
.meter-fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(1);
}

.meter-trail {
  background: var(--gold);
  transition: transform 320ms var(--ease-out);
}

.meter-fill--hp {
  background: linear-gradient(90deg, #FF3355, #FF5E6C);
  transition: transform 90ms var(--ease-out);
}

.vital-card--hp.is-low .meter-fill--hp {
  background: linear-gradient(90deg, #D90429, #FF3355);
}

.vital-card--hp.is-low {
  border-color: var(--coral);
}

.vital-actions {
  display: flex;
  gap: 7px;
  pointer-events: auto;
}

/* Dash Readiness Pill */
.dash-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 9px;
  border: var(--border-w) solid var(--ink);
  border-radius: 12px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.dash-pill__fill-wrap {
  position: absolute;
  inset: 0;
  opacity: 0.35;
}

.dash-pill__fill {
  width: 100%;
  height: 100%;
  background: var(--cyan);
  transform-origin: left center;
  transform: scaleX(1);
}

.dash-pill.is-ready .dash-pill__fill-wrap {
  opacity: 0.72;
}

.dash-pill.is-charged {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm);
}

.dash-pill.is-charged .dash-pill__fill {
  background: linear-gradient(90deg, var(--gold), var(--lime));
}

.dash-pill.is-counter-flash {
  box-shadow: 0 0 0 3px var(--gold), var(--shadow-sm);
  animation: popBump 220ms var(--ease-pop);
}

.dash-pill__text {
  position: relative;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.dash-pill .keycap {
  position: relative;
}

/* Fever Button & Meter */
.fever-btn {
  position: relative;
  flex: 1;
  height: 36px;
  padding: 0 9px;
  border: var(--border-w) solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: default;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.fever-btn__track {
  position: absolute;
  inset: 0;
  background: #272042;
}

.fever-btn__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--tangerine), var(--gold), var(--magenta));
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 110ms var(--ease-out);
}

.fever-btn__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  width: 100%;
}

.fever-btn__label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(23, 19, 38, 0.9);
  white-space: nowrap;
}

.fever-btn.is-ready {
  cursor: pointer;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm);
  animation: feverPulse 900ms var(--ease-in-out) infinite;
}

.fever-btn.is-ready .fever-btn__fill {
  background: linear-gradient(90deg, var(--gold), var(--lime), var(--cyan));
}

.fever-btn.is-ready .fever-btn__label {
  color: var(--ink);
  text-shadow: none;
}

.fever-btn.is-active {
  box-shadow: 0 0 0 2px var(--magenta), var(--shadow-sm);
}

.fever-btn.is-active .fever-btn__fill {
  background: linear-gradient(90deg, var(--magenta), var(--gold), var(--cyan));
}

.fever-btn.is-ultimate {
  box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(255, 212, 38, 0.55), var(--shadow-sm);
}

.fever-btn.is-ultimate .fever-btn__fill {
  background: linear-gradient(90deg, var(--gold), var(--tangerine), var(--magenta));
}

.fever-btn.is-ultimate .fever-btn__label {
  color: #FFFFFF;
}

.fever-btn.is-ready:active {
  transform: scale(0.96);
}

/* Bottom-Right Compact Loadout Cluster */
.hud-loadout {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.loadout-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.slot-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 2.5px solid var(--ink);
  border-radius: 11px;
  background: var(--surface-glass);
  box-shadow: var(--shadow-sm);
  font-size: 19px;
}

.slot-badge--passive {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 15px;
  background: rgba(255, 253, 247, 0.88);
}

.slot-badge--evo {
  background: linear-gradient(135deg, #FFF5B8 0%, #FFD426 55%, #FF8AD8 100%);
  box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm);
}

.slot-badge__lvl {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--font-num);
  font-size: 9px;
  font-weight: 700;
  line-height: 13px;
  text-align: center;
}

.slot-badge--evo .slot-badge__lvl {
  background: var(--magenta);
  color: #FFFFFF;
}

/* ==========================================================================
   OVERLAY BACKDROPS & MODALS
   ========================================================================== */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.overlay--title {
  background: radial-gradient(circle at 50% 35%, rgba(23, 19, 38, 0.16) 0%, rgba(23, 19, 38, 0.56) 100%);
}

.overlay--modal {
  background: var(--scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 180ms var(--ease-out) both;
}

/* ==========================================================================
   LEVEL-UP 3-CARD DRAFT MODAL
   ========================================================================== */

.modal-shell {
  width: min(860px, 100%);
  margin: auto 0;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--cream);
  box-shadow: var(--shadow-lg);
  padding: 20px 22px 22px;
  animation: modalEnter var(--dur-modal) var(--ease-out) both;
}

.modal-shell--draft {
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.96) 0%, rgba(255, 247, 224, 0.96) 100%);
  box-shadow: var(--shadow-lg), 0 18px 42px rgba(23, 19, 38, 0.34);
}

/* Lighter cinematic backdrop for Slow-Mo Level-Up so the live 3D arena gleams behind cards */
#screen-levelup.overlay--modal {
  background: rgba(23, 19, 38, 0.24);
  backdrop-filter: blur(1.2px);
  -webkit-backdrop-filter: blur(1.2px);
}

.draft-header {
  text-align: center;
  margin-bottom: 16px;
}

.draft-badge {
  display: inline-block;
  padding: 4px 14px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--gold);
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  margin-bottom: 6px;
}

.draft-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1.05;
}

.draft-sub {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}

.draft-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.draft-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  padding: 14px 15px 15px;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-ui);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  animation: draftCardPop 220ms var(--ease-pop) both;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) ease;
}

/* Non-uniform shrinking stagger (Choreograph rule: 0ms, 45ms, 80ms) */
.draft-card:nth-child(1) { animation-delay: 0ms; }
.draft-card:nth-child(2) { animation-delay: 45ms; }
.draft-card:nth-child(3) { animation-delay: 80ms; }

.draft-card--evo {
  background: linear-gradient(155deg, #FFFCE0 0%, #FFE4F4 100%);
  box-shadow: 0 0 0 3px var(--gold), var(--shadow-md);
}

@media (hover: hover) and (pointer: fine) {
  .draft-card:hover {
    transform: translateY(-4px);
    box-shadow: 6px 8px 0 var(--ink);
  }
  .draft-card--evo:hover {
    box-shadow: 0 0 0 3px var(--magenta), 6px 8px 0 var(--ink);
  }
}

.draft-card:active {
  transform: translate(2px, 2px) scale(0.97);
  box-shadow: 1px 1px 0 var(--ink);
}

.draft-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.draft-tag {
  padding: 3px 9px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.draft-tag--new {
  background: var(--lime);
  color: var(--ink);
}

.draft-tag--up {
  background: var(--cyan);
  color: var(--ink);
}

.draft-tag--evo {
  background: var(--magenta);
  color: #FFFFFF;
}

.draft-card__icon-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 10px;
}

.draft-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  background: var(--draft-accent, var(--lime));
  box-shadow: var(--shadow-sm);
  font-size: 25px;
  flex-shrink: 0;
}

.draft-card__title-wrap {
  min-width: 0;
}

.draft-card__name {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}

.draft-card__kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.draft-card__desc {
  margin: 0 0 9px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.48;
  color: var(--ink-soft);
  flex: 1;
}

.draft-synergy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  margin-bottom: 9px;
  padding: 3px 8px;
  border: 1.5px solid rgba(23, 19, 38, 0.25);
  border-radius: 8px;
  background: var(--cream-warm);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.draft-synergy--owned {
  border-color: var(--emerald);
  background: #DCFFE9;
  color: #0B5D32;
}

.draft-synergy--evo {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--gold);
}

.draft-pips {
  display: flex;
  gap: 5px;
  margin-top: auto;
}

.draft-pip {
  height: 7px;
  flex: 1;
  border-radius: 4px;
  border: 1.5px solid var(--ink);
  background: rgba(23, 19, 38, 0.1);
}

.draft-pip.is-filled {
  background: var(--draft-accent, var(--lime));
}

.draft-pip.is-next {
  background: var(--gold);
}

/* ==========================================================================
   PAUSE / SETTINGS MODAL
   ========================================================================== */

.modal-shell--pause {
  width: min(460px, 100%);
}

.pause-header {
  text-align: center;
  margin-bottom: 16px;
}

.modal-title {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

.pause-settings {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  margin-bottom: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.setting-val {
  display: inline-block;
  margin-left: 6px;
  color: var(--cobalt);
  font-size: 12px;
}

.switch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 78px;
  height: 34px;
  padding: 0 10px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--cream-warm);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}

.switch-btn[aria-checked="true"] {
  background: var(--lime);
}

.switch-btn__thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--ink);
}

.switch-btn[aria-checked="false"] .switch-btn__thumb {
  background: #FFFFFF;
}

.switch-btn:active {
  transform: scale(0.96);
}

.arcade-range {
  width: 150px;
  accent-color: var(--cobalt);
  cursor: pointer;
}

.pause-controls-box {
  padding: 11px 13px;
  border: 2px dashed rgba(23, 19, 38, 0.25);
  border-radius: 12px;
  background: var(--cream-warm);
  margin-bottom: 16px;
}

.pause-controls-title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 7px;
}

.pause-controls-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.modal-actions--stack {
  flex-direction: column;
}

.modal-actions__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ==========================================================================
   VICTORY / GAME OVER SCORECARD MODAL
   ========================================================================== */

.modal-shell--result {
  width: min(680px, 100%);
}

.modal-shell--result[data-result="victory"] {
  background: linear-gradient(180deg, #FFFDF2 0%, #FFF4BE 100%);
}

.result-header {
  text-align: center;
  margin-bottom: 16px;
}

.result-badges {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.record-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--lime), var(--gold));
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  animation: popBump 240ms var(--ease-pop);
}

.result-title {
  margin: 8px 0 4px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 38px);
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.result-sub {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

.result-body {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
}

.result-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.result-turntable-frame {
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 60%, #FFFFFF 0%, #E8F4FF 100%);
  margin-bottom: 6px;
}

.result-turntable-frame .turntable-canvas {
  width: 124px;
  height: 124px;
}

.result-athlete-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

.result-athlete-sport {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  text-transform: uppercase;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.sc-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}

.sc-stat--highlight {
  background: var(--lime);
}

.sc-stat__label {
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.sc-stat--highlight .sc-stat__label {
  color: var(--ink);
}

.sc-stat__val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
}

.result-loadout-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
}

.result-loadout-label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.result-loadout {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ==========================================================================
   MOBILE / TOUCH VIRTUAL JOYSTICK
   ========================================================================== */

.touch-controls {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.joystick-zone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 58%;
  height: 52%;
  pointer-events: auto;
}

.joystick-base {
  position: absolute;
  left: 34px;
  bottom: 78px;
  width: 108px;
  height: 108px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: rgba(23, 19, 38, 0.26);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.62;
  transition: opacity var(--dur-fast) ease;
  will-change: transform, opacity;
}

.joystick-base.is-floating {
  left: 0;
  bottom: auto;
  top: 0;
  margin-left: -54px;
  margin-top: -54px;
}

.joystick-base.is-active {
  opacity: 1;
  background: rgba(23, 19, 38, 0.36);
}

.joystick-knob {
  width: 46px;
  height: 46px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: var(--shadow-sm);
  will-change: transform;
}

.touch-actions {
  position: absolute;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.touch-btn {
  width: 66px;
  height: 66px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-fast) var(--ease-out);
}

.touch-btn--dash {
  background: var(--cyan);
  font-family: var(--font-display);
  font-size: 12px;
}

.touch-btn--fever {
  width: 72px;
  height: 72px;
  background: var(--gold);
  opacity: 0.58;
}

.touch-btn--fever.is-ready {
  opacity: 1;
  background: linear-gradient(135deg, var(--gold), var(--magenta));
  color: #FFFFFF;
  box-shadow: 0 0 0 3px var(--gold), var(--shadow-md);
}

.touch-btn:active {
  transform: scale(0.92);
}

/* Hide duplicate desktop Dash/Fever buttons when touch controls are active */
.hud.has-touch-controls .vital-actions {
  display: none;
}

.hud.has-touch-controls .hud-vitals {
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: 186px;
}

.hud.has-touch-controls .hud-loadout {
  bottom: calc(176px + env(safe-area-inset-bottom, 0px));
  right: 10px;
}

/* ==========================================================================
   KEYFRAMES (GPU Compositor Only: transform & opacity)
   ========================================================================== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes draftCardPop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes feverPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 1040px) {
  .overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 12px 14px;
  }
  .title-shell {
    gap: 10px;
  }
  .brand-title {
    font-size: clamp(28px, 4.2vw, 42px);
  }
  .brand-sub {
    font-size: 12.5px;
  }
  .athlete-grid {
    gap: 9px;
  }
  .athlete-card {
    padding: 8px 9px 9px;
    border-radius: 15px;
  }
  .athlete-card__body {
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 8px;
  }
  .turntable-stage {
    width: 94px;
    height: 94px;
  }
  .turntable-stage .turntable-canvas {
    width: 90px;
    height: 90px;
  }
  .athlete-name {
    font-size: 16px;
  }
  .athlete-title {
    font-size: 10px;
    margin-bottom: 5px;
  }
  .title-footer {
    padding: 8px 12px;
    gap: 10px;
  }
  .controls-strip {
    gap: 6px 9px;
    font-size: 11px;
  }
  .cta-btn {
    min-height: 44px;
    padding: 9px 18px;
    font-size: 15px;
  }
}

@media (max-width: 880px) {
  .athlete-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .title-footer {
    justify-content: center;
  }
  .controls-strip {
    display: none;
  }
}

@media (max-width: 640px) {
  /* Portrait Smartphone: 2x3 Compact 6-Athlete Roster + Thumb-Friendly CTA */
  .overlay {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 10px calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .title-shell {
    gap: 8px;
  }
  .title-header {
    gap: 8px;
  }
  .brand-eyebrow {
    gap: 5px;
  }
  .eyebrow-pill {
    font-size: 9.5px;
    padding: 2px 8px;
  }
  .brand-title {
    font-size: 30px;
  }
  .brand-sub {
    font-size: 11.5px;
  }
  .title-quick-tools {
    gap: 5px;
  }
  .pill-btn {
    min-height: 32px;
    padding: 4px 9px;
    font-size: 10.5px;
  }
  .athlete-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .athlete-card {
    padding: 7px 8px 8px;
    border-radius: 14px;
  }
  .athlete-card__top {
    margin-bottom: 5px;
  }
  .athlete-sport-pill {
    font-size: 8.5px;
    padding: 2px 6px;
  }
  .athlete-record-pill {
    display: none;
  }
  .athlete-card__body {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 5px;
  }
  .athlete-card__info {
    width: 100%;
    align-items: center;
    text-align: center;
  }
  .turntable-stage {
    width: 78px;
    height: 78px;
    border-radius: 10px;
  }
  .turntable-stage .turntable-canvas {
    width: 76px;
    height: 76px;
  }
  .athlete-name {
    font-size: 15px;
  }
  .athlete-title {
    font-size: 9.5px;
    margin-bottom: 4px;
  }
  .athlete-stats {
    width: 100%;
    gap: 2px;
    margin-bottom: 4px;
  }
  .athlete-ult {
    font-size: 8.5px;
    padding: 2px 5px;
  }
  .athlete-kit {
    display: none;
  }
  .title-footer {
    position: sticky;
    bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    z-index: 12;
    padding: 8px 10px;
  }
  #btn-start-match {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }
  #btn-start-match .keycap {
    display: none;
  }

  /* Portrait Smartphone Level-Up Draft: Compact 1-Column Horizontal Cards fitting 390x844! */
  .modal-shell--draft {
    padding: 12px 12px 14px;
    border-radius: 18px;
  }
  .draft-header {
    margin-bottom: 10px;
  }
  .draft-badge {
    padding: 2px 10px;
    font-size: 11px;
    margin-bottom: 3px;
  }
  .draft-title {
    font-size: 24px;
  }
  .draft-sub {
    font-size: 12px;
    margin-top: 3px;
  }
  .draft-sub__keys {
    display: none;
  }
  .draft-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .result-body {
    grid-template-columns: 1fr;
  }
  .draft-card {
    padding: 9px 11px 10px;
    border-radius: 14px;
  }
  .draft-card__top {
    margin-bottom: 6px;
  }
  .draft-card__top .keycap {
    display: none;
  }
  .draft-card__icon-row {
    gap: 9px;
    margin-bottom: 5px;
  }
  .draft-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 19px;
  }
  .draft-card__name {
    font-size: 15px;
  }
  .draft-card__desc {
    font-size: 11.5px;
    line-height: 1.32;
    margin-bottom: 6px;
  }
  .draft-synergy {
    font-size: 9.5px;
    padding: 2px 7px;
    margin-bottom: 6px;
  }

  /* Portrait Smartphone Compact HUD (Zero overlap at 360-430px width!) */
  .xp-level-pill {
    top: 12px;
    left: 6px;
    padding: 3px 7px;
    font-size: 10.5px;
  }
  .scoreboard {
    top: 10px;
    left: 52px;
    right: 78px;
    transform: none;
  }
  .scoreboard__strip {
    width: 100%;
    justify-content: space-between;
    gap: 3px;
    padding: 4px 8px;
  }
  .sb-cell {
    gap: 2px;
  }
  .sb-label {
    font-size: 7.5px;
  }
  .sb-value {
    font-size: 12px;
  }
  .sb-cell--time .sb-value {
    min-width: 34px;
  }
  .sb-cell--score .sb-value {
    min-width: 34px;
  }
  .hud-utils {
    top: 10px;
    right: 6px;
    gap: 4px;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 13px;
    border-radius: 9px;
  }
  .hud-vitals {
    width: 222px;
  }
  .dash-pill .keycap,
  .fever-btn .keycap {
    display: none;
  }
  .zone-pill {
    height: 21px;
    padding: 0 8px;
    font-size: 9.5px;
  }
  .boss-banner {
    top: 82px;
    width: calc(100vw - 20px);
    padding: 6px 10px 8px;
  }
  .ultimate-banner {
    top: 82px;
    left: 10px;
    max-width: calc(100vw - 20px);
  }
  .ultimate-banner__jp {
    font-size: 14px;
  }
  .slot-badge {
    width: 32px;
    height: 32px;
    font-size: 15px;
    border-radius: 8px;
  }
  .slot-badge--passive {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }
}

@media (max-width: 720px) and (min-width: 641px) {
  .overlay {
    padding: 10px 12px;
  }
  .draft-grid {
    grid-template-columns: 1fr;
  }
  .result-body {
    grid-template-columns: 1fr;
  }
  .scoreboard__strip {
    gap: 7px;
    padding: 5px 11px;
  }
  .sb-value {
    font-size: 14px;
  }
  .sb-label {
    font-size: 9px;
  }
  .hud-vitals {
    width: 210px;
  }
}

@media (max-height: 820px) {
  .overlay {
    align-items: flex-start;
    overflow-y: auto;
    padding: 10px 16px;
  }
  .title-shell {
    gap: 9px;
  }
  .brand-title {
    font-size: clamp(28px, 4vw, 44px);
  }
  .athlete-card {
    padding: 8px 10px 9px;
  }
  .athlete-card__body {
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 9px;
  }
  .turntable-stage {
    width: 98px;
    height: 98px;
  }
  .turntable-stage .turntable-canvas {
    width: 94px;
    height: 94px;
  }
  .title-footer {
    padding: 7px 12px;
  }
  .cta-btn {
    min-height: 44px;
    padding: 8px 20px;
  }
}

@media (max-height: 660px) {
  .title-shell {
    gap: 7px;
  }
  .brand-sub {
    display: none;
  }
  .athlete-card__body {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
  }
  .turntable-stage {
    width: 82px;
    height: 82px;
  }
  .turntable-stage .turntable-canvas {
    width: 78px;
    height: 78px;
  }
  .athlete-kit {
    display: none;
  }
}

/* ==========================================================================
   ACCESSIBILITY: REDUCED MOTION (OS Preference + In-Game Toggle)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .modal-shell,
  .title-shell,
  .boss-banner,
  .draft-card {
    animation: fadeIn 140ms ease both !important;
    animation-delay: 0ms !important;
  }
  .fever-btn.is-ready,
  .combo-pill.is-bump,
  .xp-level-pill.is-bump,
  .dash-pill.is-counter-flash,
  .radar-pin--boss .radar-pin__icon,
  .boss-banner.is-overdrive .boss-banner__tag,
  .fever-mult-pill,
  .record-badge {
    animation: none !important;
  }
  .athlete-card,
  .draft-card,
  .cta-btn,
  .pill-btn,
  .icon-btn,
  .ultimate-banner {
    transition: opacity 120ms ease, background-color 120ms ease !important;
  }
  .ultimate-banner {
    transform: none !important;
  }
}

:root.reduced-motion .modal-shell,
:root.reduced-motion .title-shell,
:root.reduced-motion .boss-banner,
:root.reduced-motion .draft-card {
  animation: fadeIn 140ms ease both !important;
  animation-delay: 0ms !important;
}

:root.reduced-motion .fever-btn.is-ready,
:root.reduced-motion .combo-pill.is-bump,
:root.reduced-motion .xp-level-pill.is-bump,
:root.reduced-motion .dash-pill.is-counter-flash,
:root.reduced-motion .radar-pin--boss .radar-pin__icon,
:root.reduced-motion .boss-banner.is-overdrive .boss-banner__tag,
:root.reduced-motion .fever-mult-pill {
  animation: none !important;
}

:root.reduced-motion .athlete-card,
:root.reduced-motion .draft-card,
:root.reduced-motion .cta-btn,
:root.reduced-motion .pill-btn,
:root.reduced-motion .icon-btn,
:root.reduced-motion .ultimate-banner {
  transition: opacity 120ms ease, background-color 120ms ease !important;
}

:root.reduced-motion .ultimate-banner {
  transform: none !important;
}

/* ==========================================================================
   入場・タイトル・選手選択（2026-11-23 組み直し）
   ========================================================================== */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.only-touch { display: none !important; }
html.is-touch .only-touch { display: revert !important; }
html.is-touch .only-key { display: none !important; }

button { -webkit-tap-highlight-color: transparent; }
.boot button, .title button, .select button, .front-tools button, .gate { touch-action: manipulation; }

/* ---------- 1. 入場（読み込み → TAP TO ENTER） ---------- */
.boot {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px calc(24px);
  color: #fff;
  background:
    repeating-linear-gradient(-62deg, rgba(255,255,255,0.025) 0 14px, transparent 14px 28px),
    radial-gradient(120% 90% at 50% 40%, #24242b 0%, #111114 70%);
  cursor: default;
}
.boot.is-ready { cursor: pointer; }
.boot__inner {
  width: min(460px, 100%);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.boot__logo { display: block; width: min(240px, 58vw); height: auto; filter: invert(1); opacity: 0.92; margin-bottom: 6px; }
.boot__eyebrow {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: 13px; letter-spacing: 0.42em; color: rgba(255,255,255,0.55);
}
.boot__track {
  position: relative; width: 100%; height: 54px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 0 4px;
  border-left: 3px solid rgba(255,255,255,0.7);
}
.boot__lane { display: block; height: 2px; background: rgba(255,255,255,0.22); }
.boot__lane:nth-child(2) { background: rgba(255,255,255,0.12); }
.boot__goal {
  position: absolute; right: 0; top: 0; bottom: 0; width: 10px;
  background: repeating-conic-gradient(#fff 0 25%, #111114 0 50%) 0 0 / 10px 10px;
  opacity: 0.85;
}
.boot__runner {
  --p: 0;
  position: absolute; top: 50%; left: calc(4px + var(--p) * (100% - 26px));
  width: 18px; height: 18px; margin-top: -9px;
}
.boot__ball {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--signal);
  box-shadow: inset -3px -3px 0 rgba(0,0,0,0.18), 0 0 0 2px #111114;
  animation: bootBounce 0.42s cubic-bezier(.4,0,.6,1) infinite alternate;
}
@keyframes bootBounce { from { transform: translateY(6px) scaleX(1.12) scaleY(0.88); } to { transform: translateY(-12px); } }
.boot__status {
  margin: 0; display: flex; align-items: baseline; gap: 12px;
  font-size: 14px; font-weight: 700; letter-spacing: 0.08em; color: rgba(255,255,255,0.78);
}
.boot__pct { font-size: 20px; color: var(--signal); min-width: 3.2em; text-align: right; }
.boot.is-ready .boot__track,
.boot.is-ready .boot__status { opacity: 0.4; transition: opacity 300ms ease; }
.boot.is-ready .boot__ball { animation-play-state: paused; }
.boot__ready {
  display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 6px;
  animation: bootReadyIn 420ms var(--ease-pop) both;
}
@keyframes bootReadyIn { from { opacity: 0; transform: translateY(14px) scale(0.94); } to { opacity: 1; transform: none; } }

.enter-btn {
  appearance: none; border: 0; cursor: pointer;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 44px 14px;
  color: #111114; background: transparent; isolation: isolate;
  animation: enterPulse 1.6s ease-in-out infinite;
}
.enter-btn::before, .enter-btn::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
}
.enter-btn::before { background: var(--signal); }
.enter-btn::after { z-index: -2; background: var(--hachimaki); transform: translate(6px, 6px); }
.enter-btn__en { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 7vw, 40px); letter-spacing: 0.06em; line-height: 1; }
.enter-btn__jp { font-weight: 700; font-size: 13px; letter-spacing: 0.2em; }
@keyframes enterPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
.enter-btn:focus-visible { outline: none; }
.enter-btn:focus-visible::after { box-shadow: 0 0 0 3px #fff; }

.sound-chip {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 6px 16px;
  border: 2px solid rgba(255,255,255,0.75); border-radius: 3px;
  background: transparent; color: #fff;
  font: 700 14px/1 var(--font-ui); letter-spacing: 0.08em;
}
.sound-chip__state { color: var(--signal); }
.sound-chip.is-muted .sound-chip__state { color: #fff; }
.sound-chip__hint { font-size: 12px; color: rgba(255,255,255,0.6); }
.sound-chip:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

/* ---------- 2. タイトル ---------- */
.title {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px 16px calc(20px);
}
.title__shade {
  /* 背景は明るいまま見せる（2026-11-23 本人）。四隅と下の案内のところだけ薄く落とす */
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(80% 70% at 50% 45%, rgba(10,10,14,0) 55%, rgba(10,10,14,0.28) 100%),
    linear-gradient(180deg, rgba(10,10,14,0) 70%, rgba(10,10,14,0.35) 100%);
}
.title__shade::after {
  content: ''; position: absolute; inset: -20% -10%;
  background: repeating-linear-gradient(-62deg, rgba(255,225,74,0.07) 0 3px, transparent 3px 46px);
  animation: titleStripes 9s linear infinite;
}
@keyframes titleStripes { to { transform: translateX(92px); } }
.title__center {
  position: relative; flex: 1; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(18px, 5vh, 44px);
}
/* PC では大きすぎたので上限を 600px に（2026-11-23 本人） */
.title__logo { margin: 0; width: min(600px, 88vw, calc((100svh - 300px) * 1.82)); min-width: min(300px, 88vw); line-height: 0; }
.logo-art {
  display: block; width: 100%; height: auto; overflow: visible;
  fill: #fff;
  filter: drop-shadow(0 0 26px rgba(0,0,0,0.45));
}
.logo-art .lg { transform-box: fill-box; transform-origin: 50% 50%; }
/* 影のずれは文字の大きさに合わせる（2026-11-23 本人：日本語はもう少しずらす・小さい英語は控えめに）。
   SVG の座標で指定するので、ロゴの表示幅に比例する（PC の 600px で日本語 約8×9.5px・英語 約3×3.3px） */
.logo-art .lg-taiiku, .logo-art .lg-surv { filter: url(#lgShJp); }
.logo-art .lg-the, .logo-art .lg-en { filter: url(#lgShEn); }
.logo-art .lg-the,
.logo-art .lg-en { fill: var(--signal); }

.title.is-intro .lg-taiiku { animation: lgSlam 520ms cubic-bezier(.2,1.4,.4,1) both; }
.title.is-intro .lg-surv { animation: lgSlide 460ms cubic-bezier(.2,1.2,.4,1) 200ms both; }
.title.is-intro .lg-the { animation: lgDrop 420ms cubic-bezier(.2,1.5,.4,1) 420ms both; }
.title.is-intro .lg-en { animation: lgWipe 520ms var(--ease-out) 600ms both; }
.title.is-intro .title__logo { animation: lgShake 300ms linear 260ms both; }
.title.is-intro .press-start { animation: fadeUpIn 420ms var(--ease-out) 1050ms both; }
.title.is-intro .title__guide,
.title.is-intro .title__foot { animation: fadeUpIn 420ms var(--ease-out) 1200ms both; }
@keyframes lgSlam { 0% { opacity: 0; transform: scale(2.2); } 60% { opacity: 1; transform: scale(0.94); } 100% { transform: scale(1); } }
@keyframes lgSlide { 0% { opacity: 0; transform: translateX(46%) skewX(-24deg); } 100% { opacity: 1; transform: none; } }
@keyframes lgDrop { 0% { opacity: 0; transform: translateY(-120%) rotate(-12deg); } 100% { opacity: 1; transform: none; } }
/* 切り取りは影の分だけ外へ広げる（inset(0) だと右と下の影が切れていた・2026-11-23） */
@keyframes lgWipe { 0% { clip-path: inset(-40% 100% -80% -10%); } 100% { clip-path: inset(-40% -10% -80% -10%); } }
@keyframes lgShake {
  0%, 100% { transform: none; } 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -3px); }
  60% { transform: translate(-3px, 2px); } 80% { transform: translate(2px, -1px); }
}
@keyframes fadeUpIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.press-start {
  appearance: none; border: 0; background: transparent; cursor: pointer; touch-action: manipulation;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 36px; color: #fff;
}
.press-start__en::after { transition: height var(--dur-fast) ease, bottom var(--dur-fast) ease; }
@media (hover: hover) and (pointer: fine) {
  .press-start:hover .press-start__en { animation-play-state: paused; opacity: 1; color: var(--signal); }
  .press-start:hover .press-start__en::after { height: 8px; bottom: -8px; }
}
.press-start__en {
  position: relative; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(22px, 4.6vw, 30px); letter-spacing: 0.22em; padding-left: 0.22em;
  text-shadow: 3px 3px 0 #111114;
  animation: pressBlink 1.3s ease-in-out infinite;
}
.press-start__en::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 5px;
  background: var(--signal); transform: skewX(-24deg);
}
.press-start__jp { font-weight: 700; font-size: 13px; letter-spacing: 0.14em; color: #fff; padding: 3px 10px; background: rgba(17,17,20,0.72); }
@keyframes pressBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.08; } }
.press-start:focus-visible { outline: none; }

.title__guide {
  position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 8px; max-width: 720px;
}
.guide-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; background: rgba(17,17,20,0.78); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.guide-item b { color: var(--signal); font-weight: 700; }
.guide-item .keycap { background: #fff; border-color: #fff; box-shadow: none; color: #111114; height: 20px; font-size: 11px; }
.title__foot {
  position: relative; margin: 14px 0 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.88);
}
.title__credit, .title__links { margin: 0; padding: 3px 10px; background: rgba(17,17,20,0.32); display: flex; align-items: center; flex-wrap: wrap; justify-content: center; text-shadow: 0 1px 2px rgba(0,0,0,0.45); }
.title__credit .bar { margin: 0 2px; opacity: 0.6; }
.title__links a + a::before { content: "/"; margin: 0 0.6em; opacity: 0.6; display: inline-block; }
.title__foot a { color: inherit; text-decoration: none; }
.title__foot a:hover { color: var(--signal); }

/* ---------- 右上の音・設定 ---------- */
.front-tools {
  position: absolute; z-index: 30; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px;
  display: flex; gap: 8px;
}
.tool-btn {
  appearance: none; cursor: pointer; border: 0;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 14px 0 12px;
  background: rgba(17,17,20,0.86); color: #fff;
  font: 700 13px/1 var(--font-ui); letter-spacing: 0.06em;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.tool-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tool-btn .ico--off { display: none; }
.tool-btn.is-muted .ico--on { display: none; }
.tool-btn.is-muted .ico--off { display: block; }
.tool-btn.is-muted { color: rgba(255,255,255,0.7); }
@media (hover: hover) and (pointer: fine) { .tool-btn:hover { background: var(--signal); color: #111114; } }
.tool-btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

/* ---------- 部室のロッカー（転換） ---------- */
.gate { position: absolute; inset: 0; z-index: 45; pointer-events: none; visibility: hidden; overflow: hidden; }
.gate.is-active { visibility: visible; pointer-events: auto; }
.gate__door {
  position: absolute; top: 0; bottom: 0; width: 50.5%;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.06), rgba(0,0,0,0.12) 60%, rgba(255,255,255,0.04)),
    linear-gradient(180deg, #4a4f5a, #34383f 55%, #2b2e34);
  box-shadow: inset 0 0 0 4px #1b1d22, inset 0 0 0 7px rgba(255,255,255,0.06);
  transition: transform 260ms cubic-bezier(.55,0,.9,.5);
}
.gate__door--l { left: 0; transform: translateX(-102%); }
.gate__door--r { right: 0; transform: translateX(102%); }
.gate.is-closing .gate__door--l, .gate.is-closed .gate__door--l { transform: translateX(0); }
.gate.is-closing .gate__door--r, .gate.is-closed .gate__door--r { transform: translateX(0); }
.gate.is-closed { animation: gateThud 260ms linear both; }
.gate.is-open .gate__door { transition: transform 460ms cubic-bezier(.2,.9,.25,1); }
.gate.is-open .gate__door--l { transform: translateX(-102%); }
.gate.is-open .gate__door--r { transform: translateX(102%); }
@keyframes gateThud { 0% { transform: none; } 30% { transform: translateY(5px); } 60% { transform: translateY(-2px); } 100% { transform: none; } }
.gate__vents {
  position: absolute; left: 22%; right: 22%; top: 9%; height: 15%;
  background: repeating-linear-gradient(180deg, #16181c 0 7px, transparent 7px 16px);
  opacity: 0.9;
}
.gate__plate {
  position: absolute; left: 50%; top: 34%; transform: translateX(-50%);
  padding: 8px 16px 9px; background: var(--signal); color: #111114;
  font-family: var(--font-jp-heavy); font-size: clamp(16px, 3.2vw, 30px); letter-spacing: 0.08em; white-space: nowrap;
  box-shadow: 3px 3px 0 #111114;
}
.gate__door--r .gate__plate { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.12em; }
.gate__handle { position: absolute; top: 46%; width: 12px; height: 18%; background: #1b1d22; border-radius: 3px; box-shadow: inset 2px 0 0 rgba(255,255,255,0.12); }
.gate__door--l .gate__handle { right: 9%; }
.gate__door--r .gate__handle { left: 9%; }

/* ---------- 3. 選手選択 ---------- */
.select {
  --athlete: #A8FF35;
  --athlete-dark: #111114;
  position: absolute; inset: 0; z-index: 20;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) clamp(14px, 3vw, 36px) calc(14px + env(safe-area-inset-bottom, 0px));
  color: #fff; overflow: hidden;
  background:
    linear-gradient(104deg, rgba(14,14,18,0.94) 0%, rgba(14,14,18,0.86) 46%, rgba(14,14,18,0.55) 100%);
}
.select__bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.select__bg::before {
  content: ''; position: absolute; left: -10%; top: 12%; width: 62%; height: 70%;
  background: var(--athlete); opacity: 0.62;
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
  transition: background-color 260ms ease;
}
.select__bg::after {
  content: ''; position: absolute; left: -10%; top: 12%; width: 62%; height: 70%;
  background: repeating-linear-gradient(-62deg, rgba(0,0,0,0.12) 0 10px, transparent 10px 22px);
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}
.select__bigword {
  position: absolute; left: 2%; bottom: 10%;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(80px, 16vw, 260px); line-height: 0.8;
  letter-spacing: -0.01em; color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,0.16);
  white-space: nowrap; transform: rotate(-6deg); transform-origin: left bottom;
}
.select__top { position: relative; display: flex; align-items: center; gap: 16px; padding-right: 120px; min-height: 44px; }
.back-btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 14px 0 8px;
  border: 2px solid rgba(255,255,255,0.7); border-radius: 3px; background: rgba(17,17,20,0.4); color: #fff;
  font: 700 13px/1 var(--font-ui); letter-spacing: 0.06em;
}
.back-btn svg, .hero__nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .back-btn:hover { background: #fff; color: #111114; } }
.back-btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.select__heading { margin: 0; display: flex; align-items: baseline; gap: 12px; }
.select__heading .en { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 3vw, 32px); letter-spacing: 0.08em; }
.select__heading .jp { font-family: var(--font-ui); font-weight: 700; font-size: 15px; color: var(--signal); letter-spacing: 0.1em; }

.select__main {
  position: relative; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center;
  gap: clamp(12px, 3vw, 48px); padding: 8px 0;
}
.hero { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; height: 100%; }
.hero__stage {
  position: relative; width: min(100%, 46vh, 420px); aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
}
.hero__num {
  position: absolute; right: 2%; top: 0;
  font-weight: 700; font-size: clamp(70px, 13vh, 150px); line-height: 1;
  color: #fff; -webkit-text-stroke: 3px #111114; paint-order: stroke fill;
  text-shadow: 5px 5px 0 #111114; opacity: 0.95;
}
.hero__canvas { position: relative; width: 100%; height: 100%; z-index: 1; filter: drop-shadow(0 8px 0 rgba(0,0,0,0.25)); transform: scale(1.18); transform-origin: 50% 70%; }
.hero__floor {
  position: absolute; left: 14%; right: 14%; bottom: 8%; height: 9%;
  background: rgba(0,0,0,0.28); border-radius: 50%;
}
.hero__nav {
  appearance: none; cursor: pointer; position: absolute; top: 50%; z-index: 2;
  width: 46px; height: 46px; margin-top: -23px;
  display: grid; place-items: center;
  border: 3px solid #111114; border-radius: 50%; background: #fff; color: #111114;
  box-shadow: 3px 3px 0 #111114;
}
.hero__nav--prev { left: 0; }
.hero__nav--next { right: 0; }
.hero__nav:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #111114; }
@media (hover: hover) and (pointer: fine) { .hero__nav:hover { background: var(--signal); } }
.hero__nav:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }

.profile {
  position: relative; align-self: center;
  max-width: 520px; max-height: 100%; overflow: auto; padding: 20px 22px 18px;
  background: var(--paper); color: #111114;
  border: 3px solid #111114; box-shadow: 8px 8px 0 #111114;
}
.profile::before {
  content: ''; position: absolute; left: -3px; right: -3px; top: -3px; height: 10px;
  background: var(--athlete); border: 3px solid #111114; border-bottom: 0;
}
.profile__row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.profile__club {
  padding: 4px 10px 5px; background: #111114; color: var(--signal);
  font-family: var(--font-jp-heavy); font-size: 14px; letter-spacing: 0.06em;
}
.profile__record { padding: 4px 8px; background: var(--hachimaki); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.profile__name {
  margin: 8px 0 0; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(40px, 5.6vw, 66px); line-height: 0.95; letter-spacing: 0.02em;
}
.profile__sub { margin: 6px 0 12px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.profile__dot { width: 5px; height: 5px; background: var(--athlete); outline: 1.5px solid #111114; }
.profile__stats { margin: 0 0 12px; display: grid; gap: 6px; }
.pstat { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); align-items: center; gap: 8px; }
.pstat dt { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.pstat dd { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) 3.2em; align-items: center; gap: 8px; }
.pstat__track { position: relative; height: 12px; background: #E3E0D6; border: 2px solid #111114; overflow: hidden; }
.pstat__fill {
  position: absolute; inset: 0; background: var(--athlete); transform-origin: left center;
  transition: transform 360ms var(--ease-out);
  background-image: repeating-linear-gradient(-62deg, rgba(0,0,0,0.12) 0 4px, transparent 4px 9px);
}
.pstat__v { font-size: 15px; font-weight: 600; text-align: right; }
.profile__block { display: grid; gap: 2px; padding: 9px 0 0; border-top: 2px dashed rgba(17,17,20,0.22); margin-top: 9px; }
.profile__label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--ink-muted); }
.profile__value { font-size: 17px; font-weight: 700; line-height: 1.35; }
.profile__block--ult .profile__value { color: var(--hachimaki); }
.profile__note { font-size: 12.5px; font-weight: 500; line-height: 1.55; color: var(--ink-soft); }

.select.is-swap .hero__canvas { animation: heroIn 320ms cubic-bezier(.2,1.4,.4,1) both; }
.select.is-swap .profile__name,
.select.is-swap .profile__sub { animation: nameIn 280ms var(--ease-out) both; }
.select.is-swap .hero__num { animation: numIn 360ms var(--ease-out) both; }
@keyframes heroIn { from { transform: translateX(-8%) scale(1.0); opacity: 0.2; } to { transform: scale(1.18); opacity: 1; } }
@keyframes nameIn { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes numIn { from { transform: translateY(-18px); opacity: 0; } to { transform: none; opacity: 0.95; } }

.select__bottom { position: relative; display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); }
.roster { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.roster-card {
  --card-accent: #fff;
  appearance: none; cursor: pointer; position: relative;
  display: grid; justify-items: center; gap: 1px;
  padding: 6px 4px 7px; min-width: 0;
  border: 2px solid rgba(255,255,255,0.25); border-radius: 3px;
  background: rgba(17,17,20,0.72); color: #fff;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.roster-card__no { position: absolute; left: 6px; top: 4px; font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.5); }
.roster-card__canvas { width: clamp(46px, 7vh, 72px); height: clamp(46px, 7vh, 72px); }
.roster-card__name { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.06em; line-height: 1.1; }
.roster-card__club { font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,0.65); }
.roster-card__rec { position: absolute; right: 4px; top: 4px; padding: 1px 4px; background: var(--hachimaki); font-size: 10px; font-weight: 700; }
.roster-card.is-selected {
  background: var(--card-accent); border-color: #111114; color: #111114;
  box-shadow: 0 0 0 3px var(--signal), 4px 4px 0 3px #111114; transform: translateY(-6px);
}
.roster-card.is-selected .roster-card__no,
.roster-card.is-selected .roster-card__club { color: rgba(17,17,20,0.7); }
@media (hover: hover) and (pointer: fine) { .roster-card:not(.is-selected):hover { border-color: var(--card-accent); transform: translateY(-2px); } }
.roster-card:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }

.cta-btn--go {
  flex: 0 0 auto; min-height: 64px; padding: 12px 30px;
  border-radius: 0; border: 3px solid #111114;
  border: 0; background: transparent; color: #111114; font-size: 19px; font-weight: 700; letter-spacing: 0.06em;
  box-shadow: none; position: relative; isolation: isolate;
}
.cta-btn--go::before, .cta-btn--go::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}
.cta-btn--go::before { background: var(--signal); }
.cta-btn--go::after { z-index: -2; background: var(--hachimaki); transform: translate(5px, 5px); }
@media (hover: hover) and (pointer: fine) {
  /* 元の .cta-btn--primary:hover の背景色（四角）を出さない。斜めの形の中だけ明るくする */
  .cta-btn--go:hover { background: transparent; box-shadow: none; transform: translate(-1px, -2px); }
  .cta-btn--go:hover::before { background: #FFEB7A; }
  .cta-btn--go:hover::after { transform: translate(7px, 7px); }
}
.cta-btn--go:active { box-shadow: none; transform: translate(2px, 2px); }
.cta-btn--go .keycap--cta { background: #111114; color: var(--signal); }

/* ---------- 設定 ---------- */
.modal-shell--settings { width: min(420px, 100%); margin: auto 0; }
.settings-list { display: grid; gap: 8px; margin: 14px 0 18px; }
.setting-pill {
  appearance: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 8px 14px;
  border: 2px solid #111114; border-radius: 3px; background: #fff; color: #111114;
  font: 700 15px/1.2 var(--font-ui);
}
.setting-pill__v { padding: 4px 10px; background: #111114; color: var(--signal); font-size: 13px; letter-spacing: 0.04em; }
@media (hover: hover) and (pointer: fine) { .setting-pill:hover { background: var(--signal); } }
.setting-pill:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- スマホ縦・狭い画面 ---------- */
@media (max-width: 760px) {
  .select { grid-template-rows: auto minmax(0, 1fr) auto; padding-left: 12px; padding-right: 12px; }
  .select__top { padding-right: 0; gap: 10px; }
  .back-btn { padding: 0 8px; }
  .back-btn span { display: none; }
  .select__heading { flex-direction: column; gap: 0; white-space: nowrap; }
  .select__heading .en { font-size: 20px; line-height: 1.1; }
  .select__heading .jp { font-size: 12px; }
  .select__main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 0.9fr) auto; gap: 6px; align-items: stretch; }
  .select__bg::before, .select__bg::after { left: -20%; top: 8%; width: 140%; height: 36%; }
  .hero { overflow: hidden; }
  .hero__stage { width: auto; height: 100%; max-height: min(68vw, 34vh); max-width: 100%; }
  .hero__num { font-size: clamp(52px, 9vh, 90px); }
  .hero__nav { width: 40px; height: 40px; margin-top: -20px; }
  .profile { max-width: none; padding: 12px 14px 12px; box-shadow: 5px 5px 0 #111114; }
  .profile__name { font-size: 34px; margin-top: 4px; }
  .profile__sub { margin: 3px 0 8px; font-size: 13px; }
  .profile__stats { gap: 4px; margin-bottom: 4px; }
  .pstat__track { height: 10px; }
  .profile__block { padding-top: 6px; margin-top: 6px; }
  .profile__value { font-size: 15px; }
  .profile__note { font-size: 12px; }
  .profile__block--ult .profile__note { display: none; }
  .select__bottom { flex-direction: column; align-items: stretch; gap: 10px; }
  .roster { gap: 5px; }
  .roster-card { padding: 4px 2px 5px; }
  .roster-card__no, .roster-card__club { display: none; }
  .roster-card__canvas { width: 44px; height: 44px; }
  .roster-card__name { font-size: 11.5px; letter-spacing: 0.02em; }
  .roster-card.is-selected { transform: translateY(-3px); }
  .cta-btn--go { min-height: 56px; font-size: 18px; }
  .front-tools { top: calc(10px + env(safe-area-inset-top, 0px)); right: 10px; }
  .tool-btn__label { display: none; }
  .tool-btn { padding: 0 12px; }
  .title { padding-top: 64px; }
  .title__guide { gap: 6px; }
  .guide-item { font-size: 12px; padding: 5px 10px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .profile__block:not(.profile__block--ult) { display: none; }
}
/* 背の低い横長の画面（PC の小さめのウィンドウ）では詰める */
@media (min-width: 761px) and (max-height: 760px) {
  .select__main { padding: 4px 0; }
  .profile { padding: 14px 18px 12px; box-shadow: 6px 6px 0 #111114; }
  .profile__name { font-size: 46px; margin-top: 4px; }
  .profile__sub { margin: 4px 0 8px; }
  .profile__stats { gap: 4px; margin-bottom: 4px; }
  .profile__block { padding-top: 6px; margin-top: 6px; }
  .profile__value { font-size: 15px; }
  .profile__note { font-size: 12px; line-height: 1.45; }
  .roster-card__canvas { width: 46px; height: 46px; }
  .roster-card__club { display: none; }
  .cta-btn--go { min-height: 56px; }
}
@media (min-width: 761px) and (max-height: 640px) {
  .profile__block--ult .profile__note { display: none; }
  .hero__stage { width: min(100%, 40vh); }
}

/* 選手選択では右上の道具を見出しと重ねない */
.app-shell[data-stage="select"] .front-tools { top: calc(14px + env(safe-area-inset-top, 0px)); }
@media (max-width: 760px) {
  .app-shell[data-stage="select"] .select__top { padding-right: 56px; }
}

/* ---------- 演出ひかえめ ---------- */
:root.reduced-motion .title.is-intro *,
:root.reduced-motion .title__shade::after,
:root.reduced-motion .enter-btn,
:root.reduced-motion .press-start__en,
:root.reduced-motion .boot__ball,
:root.reduced-motion .select.is-swap * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .title.is-intro *, .title__shade::after, .enter-btn, .press-start__en, .boot__ball, .select.is-swap * { animation: none !important; }
}

/* ==========================================================================
   オンライン協力（2026-11-23）
   ========================================================================== */
.online-btn {
  appearance: none; cursor: pointer; margin-left: auto;
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px;
  border: 2px solid var(--signal); border-radius: 3px; background: rgba(17,17,20,0.6); color: #fff;
  font: 700 13px/1 var(--font-ui); letter-spacing: 0.04em; touch-action: manipulation;
}
.online-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--signal); stroke-width: 2; stroke-linecap: round; }
.online-btn small { padding: 2px 5px; background: var(--signal); color: #111114; font: 700 10px/1 var(--font-display); letter-spacing: 0.08em; }
@media (hover: hover) and (pointer: fine) { .online-btn:hover { background: var(--signal); color: #111114; } .online-btn:hover svg { stroke: #111114; } }
.online-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.room-bar {
  position: relative; z-index: 1; margin-top: 8px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "code seats leave" "status status status";
  align-items: center; gap: 6px 14px; padding: 8px 12px;
  background: rgba(17,17,20,0.88); border: 2px solid var(--signal);
}
.room-bar__code { grid-area: code; display: flex; align-items: center; gap: 8px; }
.room-bar__k { font: 700 11px/1 var(--font-display); letter-spacing: 0.2em; color: rgba(255,255,255,0.6); }
.room-bar__code b { font-size: 26px; font-weight: 700; letter-spacing: 0.14em; color: var(--signal); }
.room-bar__btn {
  appearance: none; cursor: pointer; min-height: 34px; padding: 0 10px;
  border: 2px solid #fff; border-radius: 3px; background: transparent; color: #fff; font: 700 12px/1 var(--font-ui);
  touch-action: manipulation;
}
.room-bar__btn--leave { grid-area: leave; border-color: rgba(255,255,255,0.5); }
@media (hover: hover) and (pointer: fine) { .room-bar__btn:hover { background: #fff; color: #111114; } }
.room-seats { grid-area: seats; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.room-seat {
  --seat: rgba(255,255,255,0.18);
  display: grid; gap: 1px; padding: 4px 8px; min-width: 0;
  border-left: 0; background: rgba(255,255,255,0.06); box-shadow: inset 4px 0 0 var(--seat);
}
.room-seat__k { font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-seat__v { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-seat:not(.is-on) .room-seat__v { color: rgba(255,255,255,0.4); }
.room-seat.is-me { background: rgba(255,225,74,0.14); }
.room-seat.is-away .room-seat__v { color: rgba(255,255,255,0.55); }
.room-bar__status { grid-area: status; margin: 0; font-size: 12.5px; font-weight: 700; color: rgba(255,255,255,0.85); min-height: 1em; overflow-wrap: anywhere; }
.room-bar__status:empty { display: none; }

.select-note { margin: 0; flex: 0 1 auto; padding: 6px 10px; background: var(--hachimaki); color: #fff; font-size: 13px; font-weight: 700; }
.cta-btn--go:disabled { cursor: default; transform: none; opacity: 1; }
.cta-btn--go:disabled::before { background: #6A6A72; }
.cta-btn--go:disabled::after { background: #2E2E36; }
.cta-btn--go:disabled { color: #fff; }

.modal-shell--online { width: min(500px, 100%); margin: auto 0; }
.online-lead { margin: 6px 0 0; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.online-consent, .online-menu { display: grid; gap: 14px; margin: 14px 0 6px; }
.online-notes { margin: 0; padding: 12px 14px 12px 30px; background: var(--paper); border: 2px solid var(--ink); font-size: 13.5px; line-height: 1.65; }
.online-notes li + li { margin-top: 6px; }
.online-notes b { color: var(--hachimaki); }
.online-check { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; cursor: pointer; }
.online-check input { width: 22px; height: 22px; accent-color: #111114; }
.online-join { display: grid; gap: 6px; }
.online-join__label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.online-join__row { display: flex; gap: 8px; }
.online-code {
  flex: 1; min-width: 0; height: 48px; padding: 0 12px;
  border: 3px solid var(--ink); border-radius: 3px; background: #fff; color: var(--ink);
  font: 700 26px/1 var(--font-num); letter-spacing: 0.3em; text-transform: uppercase;
  user-select: text; -webkit-user-select: text; touch-action: manipulation;
}
.online-code:focus-visible { outline: 3px solid var(--signal); outline-offset: 1px; }
.online-status { margin: 0; min-height: 1.2em; font-size: 13px; font-weight: 700; color: var(--hachimaki); overflow-wrap: anywhere; }
.online-link { appearance: none; border: 0; background: none; padding: 0; justify-self: start; cursor: pointer; font: 700 12.5px/1.4 var(--font-ui); color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.overlay--light { background: rgba(10,10,14,0.35); backdrop-filter: none; -webkit-backdrop-filter: none; }

.coop-banner {
  position: absolute; left: 50%; top: calc(110px + env(safe-area-inset-top, 0px)); transform: translateX(-50%);
  padding: 7px 14px; background: rgba(17,17,20,0.88); color: var(--signal);
  font-family: var(--font-jp-heavy); font-size: 15px; font-weight: 400; letter-spacing: 0.04em; white-space: nowrap; pointer-events: none;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.hud.is-coop-guest .fever-btn,
.hud.is-coop-guest ~ .touch-controls .touch-btn--fever { display: none !important; }
.result-coop-note { margin: 4px 0 10px; text-align: center; font-weight: 700; font-size: 14px; color: var(--ink-soft); }

@media (max-width: 760px) {
  .online-btn span { display: none; }
  .online-btn { padding: 0 9px; }
  .room-bar { grid-template-columns: auto auto; grid-template-areas: "code leave" "seats seats" "status status"; padding: 6px 8px; gap: 5px 8px; }
  .room-bar__leave { justify-self: end; }
  .room-bar__code b { font-size: 20px; }
  .room-bar__btn--leave { justify-self: end; }
  .room-seats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .room-seat { padding: 3px 6px; }
  .select.is-room .profile__block { display: none; }
}

/* ==========================================================================
   難度（2026-11-23）
   ========================================================================== */
.select__bottom { flex-wrap: wrap; }
.diff-picker { flex: 1 0 100%; display: flex; align-items: center; gap: 6px; min-width: 0; }
.diff-picker__k { font-family: var(--font-ui); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; color: var(--signal); margin-right: 4px; white-space: nowrap; }
.diff-btn {
  appearance: none; cursor: pointer; touch-action: manipulation;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 2px solid rgba(255,255,255,0.35); border-radius: 3px; background: rgba(17,17,20,0.7); color: #fff;
  line-height: 1;
}
/* 文字は上下中央（Oswald は字面が上に寄って見えるので、少しだけ下げる） */
.diff-btn b { display: block; font-family: var(--font-display); font-weight: 700; font-size: 15px; line-height: 1; letter-spacing: 0.08em; padding-top: 2px; }
.diff-btn small { display: block; font-size: 11px; font-weight: 700; line-height: 1; color: rgba(255,255,255,0.6); }
.diff-btn[aria-checked="true"] { background: var(--signal); border-color: #111114; color: #111114; box-shadow: 3px 3px 0 #111114; }
.diff-btn[aria-checked="true"] small { color: rgba(17,17,20,0.7); }
.diff-btn[data-diff="hard"][aria-checked="true"] { background: var(--hachimaki); color: #fff; }
.diff-btn[data-diff="hard"][aria-checked="true"] small { color: rgba(255,255,255,0.85); }
.diff-btn:disabled { cursor: default; opacity: 0.55; }
.diff-btn:disabled[aria-checked="true"] { opacity: 1; }
@media (hover: hover) and (pointer: fine) { .diff-btn:not(:disabled):not([aria-checked="true"]):hover { border-color: var(--signal); } }
.diff-btn:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.diff-picker__note { margin-left: 6px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diff-chip {
  position: absolute; top: 48px; left: 14px; padding: 2px 8px;
  background: #111114; color: var(--signal); border: 2px solid #111114;
  font: 700 12px/1.3 var(--font-display); letter-spacing: 0.1em;
}
.diff-chip.is-hard { background: var(--hachimaki); color: #fff; }
@media (max-width: 760px) {
  .diff-picker { gap: 4px; }
  .diff-picker__k { display: none; }
  .diff-btn { flex: 1; justify-content: center; padding: 0 6px; min-height: 34px; }
  .diff-btn small { display: none; }
  .diff-picker__note { display: none; }
}

/* スマホの選手選択（2026-11-23 修正）：縦並びの中で難度の欄が高さいっぱい（flex: 1 0 100%）を取り、
   部員の一覧と開始ボタンが右の列へ折り返して画面の外に出ていた。折り返さずに縦1列にし、収まらなければ下へスクロール（本人「下にスクロールするのはスマホでは全然あり」） */
@media (max-width: 760px) {
  .select { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; grid-template-rows: max-content max-content max-content; -webkit-overflow-scrolling: touch; }
  .select__main { grid-template-rows: max-content max-content; min-height: auto; }
  .hero { height: auto; min-height: max-content; }
  .profile { overflow: visible; }
  .hero__stage { height: min(64vw, 34svh, 300px); max-height: none; }
  .select__bottom { flex-wrap: nowrap; padding-bottom: 4px; }
  .diff-picker { flex: none; width: 100%; }
  .roster { flex: none; width: 100%; }
  .cta-btn--go { width: 100%; }
}
/* 幅 360px 前後：見出しと右上の道具が横幅を押し広げないように詰める */
@media (max-width: 374px) {
  .select { padding-left: 10px; padding-right: 10px; }
  .select__top { gap: 8px; }
  .app-shell[data-stage="select"] .select__top { padding-right: 48px; }
  .select__heading .en { font-size: 17px; letter-spacing: 0.04em; }
  .select__heading .jp { font-size: 11px; }
  .online-btn { padding: 0 7px; }
  .online-btn small { display: none; }
}

/* ボスのゲージ：出てくるときのアニメーション（modalEnter）が translateX(-50%) を上書きして、左端が画面の中央から始まっていた（2026-11-23 本人のスマホで右にはみ出し）。
   transform を使わず left/right 0＋margin auto で中央に置く */
.boss-banner { left: 0; right: 0; margin-inline: auto; transform: none; }
/* スマホ：画面に出る案内（チャンス！ボーナスリング出現！ など）と HUD の札を小さめに */
@media (max-width: 640px) {
  .hud-toast { gap: 6px; padding: 4px 10px; max-width: calc(100vw - 28px); bottom: auto; top: 196px; }
  .hud-toast__tag { font-size: 9.5px; padding: 1px 5px; white-space: nowrap; flex: none; }
  .hud-toast__text { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .boss-banner { top: 128px; width: calc(100vw - 24px); padding: 5px 9px 7px; }
  .boss-banner__head { margin-bottom: 4px; }
  .boss-banner__name { font-size: 14px; }
  .boss-banner__tag { font-size: 9px; }
}

/* スマホの試合画面：上の経験値の帯・スコア・右上のボタン、下の体力・ボタンが画面の端に付いていた（2026-11-23 本人「余白がゼロ？」）。四辺に少し余白をとる */
@media (max-width: 640px) {
  .xp-rail { top: 4px; left: 10px; right: 10px; height: 8px; border: 2px solid var(--ink); border-radius: 6px; }
  .xp-rail__fill { border-radius: 4px; }
  .xp-level-pill { top: 10px; left: -2px; } /* 経験値の帯の中に置かれているので、帯からの位置 */
  .scoreboard { top: 16px; left: 56px; right: 84px; }
  .hud-utils { top: 16px; right: 10px; }
  .boss-banner { top: 134px; }
  .hud-toast { top: 202px; }
  .hud.has-touch-controls .hud-vitals { left: 12px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
  .touch-actions { right: 16px; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
  .hud.has-touch-controls .hud-loadout { bottom: calc(186px + env(safe-area-inset-bottom, 0px)); right: 12px; }
}
/* スマホの選手選択：部員カードの絵（ラケットなど）がカードの枠の上にはみ出ていた。背の低い画面では、スクロールなしで収まるよう上の絵を少し小さく */
.roster-card { overflow: hidden; }
@media (max-width: 760px) and (max-height: 760px) {
  .hero__stage { height: min(64vw, 22svh, 240px); }
  .select__main { gap: 4px; }
  .select__bottom { gap: 8px; }
  .profile__block:not(.profile__block--ult) { display: none; }
}

/* 案内の帯（チャンス！ボーナスリング出現！ など）は読みやすさを優先して Zen Kaku Gothic New 700（2026-11-23 本人「読みやすい文字に」。
   Dela Gothic One は小さいとつぶれる。WAVE の見出し・必殺技の帯などの大きい文字は Dela のまま） */
.hud-toast__tag { font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.04em; }
.hud-toast__text { font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.03em; }

/* オリジナルの SVG アイコン（src/ui/icons.js・2026-11-23 絵文字から置き換え） */
.ico-svg { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.18em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-svg .f { fill: currentColor; }
.slot-badge .ico-svg, .draft-icon-box .ico-svg { width: 1.25em; height: 1.25em; }
.radar-pin__icon .ico-svg { width: 18px; height: 18px; }
.touch-btn--fever .ico-svg { width: 22px; height: 22px; }
