:root {
  --bg-outer: #03060f;
  --bg-card: rgba(13, 21, 40, 0.88);
  --border: rgba(148, 163, 184, 0.32);
  --text-main: #ffffff;
  --text-sub: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-green: #22c55e;
  --accent-gold: #fbbf24;
  --accent-red: #f43f5e;
  --rank-ss: #fde047;
  --rank-s: #fbbf24;
  --rank-a: #f43f5e;
  --rank-b: #fb923c;
  --rank-c: #38bdf8;
  --rank-d: #34d399;
  --rank-e: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at top, #172554 0%, var(--bg-outer) 72%);
  color: var(--text-main);
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  touch-action: manipulation;
}

#app {
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  background: linear-gradient(180deg, #0b1428 0%, #050914 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Sakibare (先バレ告知ランプ) Bar */
#sakibare-lamp {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 7px;
  z-index: 97;
  opacity: 0;
  pointer-events: none;
}
#sakibare-lamp.red {
  opacity: 1;
  background: linear-gradient(90deg, #ef4444, #fde047, #ef4444);
  box-shadow: 0 0 26px 8px rgba(244, 63, 94, 0.95);
  animation: lampBlink 0.16s linear infinite;
}
#sakibare-lamp.rainbow {
  opacity: 1;
  background: linear-gradient(90deg, #f43f5e, #fbbf24, #22c55e, #38bdf8, #a855f7);
  box-shadow: 0 0 30px 10px rgba(253, 224, 71, 0.95);
  animation: lampBlink 0.12s linear infinite;
}

.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: calc(env(safe-area-inset-top, 2px) + 6px) 10px calc(env(safe-area-inset-bottom, 4px) + 8px);
  overflow: hidden;
  position: relative;
}
.screen.active { display: flex; }

/* Top-Right Utility Controls */
.util-controls {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: 10px;
  z-index: 65;
  display: flex;
  gap: 6px;
}
.util-btn {
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, rgba(16, 25, 48, 0.92), rgba(7, 11, 24, 0.94));
  color: #f8fafc;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 3px 10px rgba(0, 0, 0, 0.45);
}
.util-btn.speed-fast {
  border-color: rgba(56, 189, 248, 0.85);
  color: #7dd3fc;
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.92), rgba(12, 74, 110, 0.94));
}
.util-btn.speed-hyper {
  border-color: rgba(253, 224, 71, 0.92);
  color: #fde047;
  background: linear-gradient(180deg, rgba(161, 98, 7, 0.94), rgba(113, 63, 18, 0.96));
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.45);
}
.util-btn.speed-locked {
  opacity: 0.72;
}
.util-btn:active { transform: scale(0.92); }
.btn-ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Animations */
@keyframes lampBlink { 0%, 100% { filter: brightness(1.35); } 50% { filter: brightness(0.6); } }
@keyframes shakeLight {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
}
@keyframes shakeHeavy {
  0%, 100% { transform: translate(0, 0); }
  12% { transform: translate(-9px, 5px) rotate(-0.8deg); }
  25% { transform: translate(9px, -5px) rotate(0.8deg); }
  40% { transform: translate(-7px, -4px) rotate(-0.5deg); }
  55% { transform: translate(7px, 4px) rotate(0.5deg); }
  75% { transform: translate(-4px, 2px); }
}
@keyframes feverPulse {
  0%, 100% { box-shadow: inset 0 0 26px rgba(251, 191, 36, 0.45); }
  50% { box-shadow: inset 0 0 54px rgba(245, 158, 11, 0.85); }
}
@keyframes superPulse {
  0% { box-shadow: inset 0 0 42px rgba(244, 63, 94, 0.8); }
  33% { box-shadow: inset 0 0 54px rgba(251, 191, 36, 0.9); }
  66% { box-shadow: inset 0 0 54px rgba(56, 189, 248, 0.9); }
  100% { box-shadow: inset 0 0 42px rgba(168, 85, 247, 0.8); }
}
@keyframes rainbowBorder {
  0% { border-color: #f43f5e; box-shadow: 0 0 24px rgba(244, 63, 94, 0.85), inset 0 0 18px rgba(244, 63, 94, 0.35); }
  25% { border-color: #fbbf24; box-shadow: 0 0 26px rgba(251, 191, 36, 0.9), inset 0 0 18px rgba(251, 191, 36, 0.35); }
  50% { border-color: #22c55e; box-shadow: 0 0 26px rgba(34, 197, 94, 0.9), inset 0 0 18px rgba(34, 197, 94, 0.35); }
  75% { border-color: #38bdf8; box-shadow: 0 0 26px rgba(56, 189, 248, 0.9), inset 0 0 18px rgba(56, 189, 248, 0.35); }
  100% { border-color: #c084fc; box-shadow: 0 0 26px rgba(192, 132, 252, 0.9), inset 0 0 18px rgba(192, 132, 252, 0.35); }
}
@keyframes flashBurst { 0% { opacity: 0.9; } 100% { opacity: 0; } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes slotScroll { 0% { transform: translateY(-7px); opacity: 0.45; } 50% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(7px); opacity: 0.45; } }
@keyframes lightningFlash { 0%, 100% { opacity: 0; } 12%, 30% { opacity: 1; } 20% { opacity: 0.2; } 52% { opacity: 0.85; } }
@keyframes zoomSlam { 0% { transform: scale(1.75); opacity: 0; } 65% { transform: scale(0.95); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes statPop { 0% { transform: scale(1); } 45% { transform: scale(1.18); color: #fde047; } 100% { transform: scale(1); } }
@keyframes goalPop { 0% { transform: scale(0.6); opacity: 0; } 50% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes shimmerGold { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }

.shake-light { animation: shakeLight 0.25s ease-out; }
.shake-heavy { animation: shakeHeavy 0.46s ease-out; }
.fever-frame { animation: feverPulse 1.15s infinite ease-in-out; }
.super-frame { animation: superPulse 0.85s infinite linear; }

/* Flash Layer */
#flash-layer { position: absolute; inset: 0; pointer-events: none; z-index: 98; opacity: 0; }
#flash-layer.flash-gold { background: radial-gradient(circle, rgba(253, 224, 71, 0.92), rgba(245, 158, 11, 0.35)); animation: flashBurst 0.52s ease-out forwards; }
#flash-layer.flash-blue { background: radial-gradient(circle, rgba(56, 189, 248, 0.8), rgba(37, 99, 235, 0.25)); animation: flashBurst 0.42s ease-out forwards; }
#flash-layer.flash-red { background: radial-gradient(circle, rgba(244, 63, 94, 0.88), rgba(159, 18, 57, 0.32)); animation: flashBurst 0.48s ease-out forwards; }
#flash-layer.flash-rainbow { background: linear-gradient(135deg, rgba(244, 63, 94, 0.9), rgba(251, 191, 36, 0.9), rgba(56, 189, 248, 0.9), rgba(168, 85, 247, 0.9)); animation: flashBurst 0.7s ease-out forwards; }
#flash-layer.flash-glitch { background: linear-gradient(125deg, rgba(244, 63, 94, 0.78), rgba(251, 191, 36, 0.72), rgba(56, 189, 248, 0.78)); animation: flashGlitch 0.14s linear forwards; }
@keyframes flashGlitch {
  0% { opacity: 0.75; }
  100% { opacity: 0; }
}

/* Dramatic Fullscreen Freeze / Revival / Goal Overlay (Tap anywhere to skip!) */
#dramatic-overlay {
  position: absolute;
  inset: 0;
  z-index: 95;
  background: #000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  overflow: hidden;
  cursor: pointer;
}
#dramatic-overlay.active { display: flex; }
.dramatic-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s ease; z-index: 1; }
.dramatic-bg-img.loaded { opacity: 0.72; }
.dramatic-scrim { position: absolute; inset: 0; background: radial-gradient(circle, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.86) 100%); z-index: 2; }
.dramatic-bolt {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(115deg, transparent 43%, rgba(253, 224, 71, 0.95) 49%, #fff 50%, rgba(56, 189, 248, 0.95) 51%, transparent 57%);
  opacity: 0;
}
.dramatic-bolt.strike { animation: lightningFlash 0.52s ease-out; }
.dramatic-content { position: relative; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dramatic-kicker { font-size: 16px; font-weight: 900; letter-spacing: 0.14em; color: #fde047; text-shadow: 0 0 18px rgba(253, 224, 71, 0.95); }
.dramatic-title {
  font-size: clamp(28px, 7.8vw, 40px);
  font-weight: 900;
  line-height: 1.22;
  color: #fff;
  text-shadow: 0 0 30px rgba(56, 189, 248, 0.95), 0 4px 14px #000;
  white-space: pre-line;
  text-wrap: balance;
  line-break: strict;
  animation: zoomSlam 0.3s ease-out;
}
#dramatic-overlay.is-freeze .dramatic-title {
  background: linear-gradient(180deg, #ffffff 12%, #fef08a 52%, #f59e0b 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.96)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.78));
}
#dramatic-overlay.is-super .dramatic-title {
  background: linear-gradient(90deg, #ff7ac6, #fff066, #6ee7b7, #67e8f9, #e879f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.96)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.78));
}
#dramatic-overlay.is-freeze .dramatic-sub,
#dramatic-overlay.is-super .dramatic-sub {
  color: #fef08a;
}
.dramatic-sub { font-size: 17px; font-weight: 800; color: #f8fafc; text-shadow: 0 2px 10px #000; max-width: 96%; line-height: 1.5; white-space: pre-line; text-wrap: balance; line-break: strict; }
.dramatic-skip-hint { margin-top: 12px; font-size: 13px; font-weight: 800; color: rgba(255, 255, 255, 0.72); }

/* Toast */
#toast {
  position: absolute;
  bottom: 84px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(15, 23, 42, 0.96);
  border: 2px solid #38bdf8;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

#turn-gain-burst {
  position: fixed;
  left: 50%;
  top: 43%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  z-index: 960;
  pointer-events: none;
  opacity: 0;
  text-align: center;
  white-space: nowrap;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  padding: 10px 24px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 45%, rgba(6, 10, 22, 0.88), rgba(6, 10, 22, 0.55) 75%, transparent);
}
#turn-gain-burst.show {
  animation: turnGainPop 1.15s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.tgb-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #cbd5e1;
  text-shadow: 0 2px 8px #000;
}
.tgb-num {
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-size: 56px;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0.03em;
  text-shadow: 0 5px 18px rgba(0, 0, 0, 0.95);
}
.tgb-sign-ghost { visibility: hidden; pointer-events: none; }
#turn-gain-burst.tier-0 {
  padding: 7px 18px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
}
#turn-gain-burst.tier-0.show {
  animation: turnGainSlump 0.9s ease-out forwards;
}
#turn-gain-burst.tier-0 .tgb-kicker { font-size: 10px; color: #94a3b8; letter-spacing: 0.14em; }
#turn-gain-burst.tier-0 .tgb-num { font-size: 32px; color: #64748b; text-shadow: 0 2px 8px #000; }
#turn-gain-burst.tier-0.decline { border-color: rgba(248, 113, 113, 0.45); }
#turn-gain-burst.tier-0.decline .tgb-kicker { color: #fda4af; }
#turn-gain-burst.tier-0.decline .tgb-num { color: #f87171; }
@keyframes turnGainSlump {
  0% { opacity: 0; transform: translate(-50%, -56%) scale(0.92); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 0.95; transform: translate(-50%, -46%) scale(0.98); }
  100% { opacity: 0; transform: translate(-50%, -38%) scale(0.94); }
}
#turn-gain-burst.tier-1 { padding: 6px 16px; }
#turn-gain-burst.tier-1.show { animation-duration: 0.85s; }
#turn-gain-burst.tier-1 .tgb-kicker { font-size: 10px; opacity: 0.85; color: #7dd3fc; }
#turn-gain-burst.tier-1 .tgb-num { font-size: 30px; color: #38bdf8; text-shadow: 0 2px 0 #000, 0 4px 10px rgba(0, 0, 0, 0.85); }
#turn-gain-burst.tier-2 { padding: 8px 20px; }
#turn-gain-burst.tier-2.show { animation-duration: 0.95s; }
#turn-gain-burst.tier-2 .tgb-kicker { font-size: 11px; color: #86efac; }
#turn-gain-burst.tier-2 .tgb-num { font-size: 38px; color: #4ade80; text-shadow: 0 2px 0 #000, 0 4px 12px rgba(0, 0, 0, 0.88); }
#turn-gain-burst.tier-3 .tgb-kicker { font-size: 12px; color: #facc15; }
#turn-gain-burst.tier-3 .tgb-num { font-size: 46px; color: #facc15; text-shadow: 0 2px 0 #000, 0 5px 14px rgba(0, 0, 0, 0.9); }
#turn-gain-burst.tier-4 {
  padding: 10px 24px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 45%, rgba(28, 10, 18, 0.96), rgba(6, 10, 22, 0.92));
  border: 1.5px solid rgba(251, 113, 133, 0.82);
  box-shadow: 0 0 30px rgba(244, 63, 94, 0.55);
}
#turn-gain-burst.tier-4.show { animation-duration: 1.15s; }
#turn-gain-burst.tier-4 .tgb-kicker { font-size: 13px; color: #fda4af; text-shadow: 0 2px 0 #000; }
#turn-gain-burst.tier-4 .tgb-num { font-size: 62px; color: #fb7185; text-shadow: 0 3px 0 #000, 0 6px 14px rgba(0, 0, 0, 0.92); }
#turn-gain-burst.tier-5 {
  padding: 15px 32px;
  border-radius: 22px;
  background: #140d03;
  border: 3px solid #fbbf24;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.96), 0 0 28px rgba(245, 158, 11, 0.58);
}
#turn-gain-burst.tier-5.show { animation-duration: 1.35s; }
#turn-gain-burst.tier-5 .tgb-kicker { font-size: 15px; letter-spacing: 0.18em; color: #fde68a; text-shadow: 0 2px 0 #000; }
#turn-gain-burst.tier-5 .tgb-num {
  font-size: 78px;
  line-height: 0.98;
  color: #fde047;
  text-shadow: 0 3px 0 #000, 0 6px 12px rgba(0, 0, 0, 0.92);
}
#turn-gain-burst.tier-6 {
  padding: 16px 22px;
  max-width: 94vw;
  border-radius: 22px;
  background: #070b17;
  border: 3px solid #fde047;
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.96), 0 0 32px rgba(253, 224, 71, 0.62), 0 0 64px rgba(56, 189, 248, 0.35);
}
#turn-gain-burst.tier-6.show { animation-duration: 1.5s; }
#turn-gain-burst.tier-6 .tgb-kicker {
  display: inline-block;
  padding: 0 10px;
  font-size: clamp(11px, 3.2vw, 16px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.11em;
  white-space: nowrap;
  color: #fde047;
  text-shadow: 0 2px 0 #000;
}
#turn-gain-burst.tier-6 .tgb-num {
  display: inline-block;
  padding: 0 14px;
  font-size: 88px;
  font-weight: 900;
  font-style: italic;
  line-height: 1.02;
  background: linear-gradient(90deg, #ff7ac6, #fff066, #6ee7b7, #67e8f9, #e879f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.96)) drop-shadow(0 6px 12px rgba(0, 0, 0, 0.72));
}
#turn-gain-burst.slump-break {
  border: 1.5px solid rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.45);
}
#turn-gain-burst.slump-break .tgb-kicker {
  color: #7dd3fc;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.85), 0 2px 6px #000;
}
#shatter-overlay {
  position: fixed;
  inset: 0;
  z-index: 995;
  pointer-events: none;
  display: none;
  overflow: hidden;
  background: rgba(2, 4, 12, 0.96);
}
#shatter-overlay.blackout,
#shatter-overlay.cracking,
#shatter-overlay.shattering {
  display: block;
}
.shatter-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.22s ease-out;
}
#shatter-overlay.shattering .shatter-bg-img.loaded {
  opacity: 0.94;
  filter: brightness(1.06) contrast(1.12);
}
.shatter-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.28) 46%, rgba(2, 6, 23, 0.88));
  transition: opacity 0.16s ease-out;
}
#shatter-overlay.blackout .shatter-backdrop,
#shatter-overlay.cracking .shatter-backdrop {
  opacity: 1;
  background: rgba(2, 4, 12, 0.94);
}
#shatter-overlay.shattering .shatter-backdrop { opacity: 1; }
.shatter-shockwave {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(253, 224, 71, 0.9);
  box-shadow: 0 0 28px rgba(253, 224, 71, 0.85);
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
}
#shatter-overlay.shattering .shatter-shockwave {
  animation: shatterRing 0.55s cubic-bezier(0.16, 0.88, 0.32, 1) forwards;
}
@keyframes shatterRing {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(14); }
}
.shatter-crack-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transform: scale(0.92);
}
#shatter-overlay.cracking .shatter-crack-img {
  opacity: 1;
  transform: scale(1);
  animation: shatterCrackImpact 0.22s cubic-bezier(0.12, 0.9, 0.28, 1) forwards;
}
#shatter-overlay.shattering .shatter-crack-img {
  opacity: 0;
  transform: scale(1.16);
  transition: opacity 0.16s ease-out, transform 0.24s ease-out;
}
@keyframes shatterCrackImpact {
  0% { opacity: 0.25; transform: scale(0.86); filter: brightness(1.9) contrast(1.3); }
  55% { opacity: 1; transform: scale(1.03); filter: brightness(1.35) contrast(1.15); }
  100% { opacity: 1; transform: scale(1); filter: brightness(1.08) contrast(1.08); }
}
.shatter-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.shatter-text {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 92%;
  z-index: 4;
  text-align: center;
  transform: translate(-50%, -44%);
  opacity: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
#shatter-overlay.shattering .shatter-text {
  opacity: 1;
  transform: translate(-50%, -50%);
  transition: transform 0.22s ease-out, opacity 0.18s ease-out;
}
.shatter-kicker {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: #fde047;
  text-shadow: 0 2px 0 #000;
}
.shatter-title {
  font-size: 48px;
  font-weight: 900;
  line-height: 1.12;
  background: linear-gradient(180deg, #ffffff 12%, #fef08a 55%, #f59e0b 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.96)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.78));
}
.shatter-sub {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 800;
  color: #e2e8f0;
  text-shadow: 0 2px 8px #000;
}
@keyframes turnGainPop {
  0% { opacity: 0; transform: translate(-50%, -38%); }
  14% { opacity: 1; transform: translate(-50%, -52%); }
  26% { opacity: 1; transform: translate(-50%, -50%); }
  74% { opacity: 1; transform: translate(-50%, -52%); }
  100% { opacity: 0; transform: translate(-50%, -62%); }
}

/* Tournament Match Result Cut-in Overlay (WIN / DRAW / LOSE / CHAMPION) */
#match-result-banner {
  position: absolute;
  inset: 0;
  z-index: 88;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 16, 0.72);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
#match-result-banner.open { display: flex; }
.mrb-band {
  position: relative;
  width: 100%;
  padding: 24px 16px 20px;
  text-align: center;
  overflow: hidden;
  border-top: 2px solid rgba(255, 255, 255, 0.75);
  border-bottom: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.92);
  animation: mrbSlam 0.28s cubic-bezier(0.16, 1.18, 0.3, 1) forwards;
}
@keyframes mrbSlam {
  0% { opacity: 0; transform: scale(1.18) skewX(-4deg); }
  100% { opacity: 1; transform: scale(1) skewX(0deg); }
}
.mrb-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 0.25s ease, transform 0.9s ease-out;
  z-index: 0;
  pointer-events: none;
}
.mrb-bg-img.loaded { opacity: 0.62; transform: scale(1.0); }
#match-result-banner.type-lose .mrb-bg-img.loaded { opacity: 0.48; filter: saturate(0.45) contrast(1.12); }
#match-result-banner.type-champ .mrb-bg-img.loaded { opacity: 0.78; filter: brightness(1.08) contrast(1.08); }
.mrb-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
#match-result-banner.type-win .mrb-scrim {
  background: linear-gradient(90deg, rgba(5, 20, 14, 0.90) 0%, rgba(180, 83, 9, 0.56) 50%, rgba(5, 20, 14, 0.90) 100%);
}
#match-result-banner.type-champ .mrb-scrim {
  background: linear-gradient(120deg, rgba(127, 29, 29, 0.62), rgba(217, 119, 6, 0.52), rgba(14, 116, 144, 0.55), rgba(88, 28, 135, 0.62));
}
#match-result-banner.type-draw .mrb-scrim {
  background: linear-gradient(90deg, rgba(8, 15, 32, 0.90) 0%, rgba(3, 105, 161, 0.56) 50%, rgba(8, 15, 32, 0.90) 100%);
}
#match-result-banner.type-lose .mrb-scrim {
  background: linear-gradient(90deg, rgba(8, 10, 20, 0.93) 0%, rgba(127, 29, 29, 0.62) 50%, rgba(8, 10, 20, 0.93) 100%);
}
.mrb-sheen {
  position: absolute;
  top: -20%; left: -60%;
  width: 45%; height: 140%;
  z-index: 2;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.42) 50%, transparent 80%);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: mrbSheenSweep 0.85s ease-out 0.1s forwards;
}
@keyframes mrbSheenSweep {
  0% { left: -60%; opacity: 0.9; }
  100% { left: 130%; opacity: 0; }
}
#match-result-banner.type-lose .mrb-sheen { display: none; }
.mrb-inner { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; }
.mrb-kicker {
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
  padding: 2px 12px;
  border-radius: 999px;
  background: rgba(6, 10, 22, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #e2e8f0;
  margin-bottom: 6px;
}
#match-result-banner.type-win .mrb-band {
  border-color: #fde047;
  box-shadow: 0 0 48px rgba(251, 191, 36, 0.65), inset 0 0 32px rgba(253, 224, 71, 0.25);
}
#match-result-banner.type-champ .mrb-band {
  border-color: #fef08a;
  box-shadow: 0 0 64px rgba(253, 224, 71, 0.95), inset 0 0 40px rgba(254, 240, 138, 0.35);
}
#match-result-banner.type-draw .mrb-band {
  border-color: #7dd3fc;
  box-shadow: 0 0 36px rgba(56, 189, 248, 0.5);
}
#match-result-banner.type-lose .mrb-band {
  border-color: #fb7185;
  box-shadow: 0 0 38px rgba(244, 63, 94, 0.55);
}
.mrb-title {
  position: relative;
  display: inline-block;
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-size: 64px;
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow: 0 5px 22px rgba(0, 0, 0, 0.98), 0 0 26px rgba(255, 255, 255, 0.35);
}
.mrb-punct {
  position: absolute;
  left: 100%;
  bottom: 0;
  padding-left: 2px;
}
#match-result-banner.type-win .mrb-title,
#match-result-banner.type-champ .mrb-title {
  background: linear-gradient(180deg, #ffffff 10%, #fef08a 52%, #f59e0b 95%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.96)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.72));
}
#match-result-banner.type-draw .mrb-title { color: #bae6fd; text-shadow: 0 5px 18px rgba(0, 0, 0, 0.96), 0 0 20px rgba(56, 189, 248, 0.55); }
#match-result-banner.type-lose .mrb-title { color: #fda4af; text-shadow: 0 5px 18px rgba(0, 0, 0, 0.98), 0 0 18px rgba(244, 63, 94, 0.5); }
.mrb-score {
  margin-top: 6px;
  padding: 4px 14px;
  max-width: 96%;
  border-radius: 999px;
  background: rgba(6, 10, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mrb-sub {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 900;
  color: #f8fafc;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.98);
}
.mrb-hint {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}
/* Hall of Fame Rich Card List */
.hof-list { display: flex; flex-direction: column; gap: 8px; }
.hof-card {
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.hof-card.rank-1 {
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.45), rgba(15, 23, 42, 0.95));
  border-color: rgba(253, 224, 71, 0.82);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.25);
}
.hof-card.rank-2 {
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.55), rgba(15, 23, 42, 0.95));
  border-color: rgba(203, 213, 225, 0.72);
}
.hof-card.rank-3 {
  background: linear-gradient(135deg, rgba(124, 45, 18, 0.42), rgba(15, 23, 42, 0.95));
  border-color: rgba(251, 146, 60, 0.68);
}
.hof-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hof-left { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; }
.hof-medal { font-size: 19px; line-height: 1; flex-shrink: 0; width: 24px; text-align: center; font-weight: 900; color: #94a3b8; }
.hof-ident { min-width: 0; flex: 1; }
.hof-name-row { display: flex; align-items: center; gap: 5px; }
.hof-name { font-size: 15px; font-weight: 900; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hof-sub { font-size: 11px; font-weight: 700; color: #94a3b8; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hof-ovr-box { text-align: right; flex-shrink: 0; }
.hof-ovr-num { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 24px; font-weight: 700; line-height: 1; }
.hof-ovr-lbl { font-size: 10px; font-weight: 900; color: #cbd5e1; letter-spacing: 0.06em; }
.hof-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.hof-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.9);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.hof-chip.wc { background: rgba(234, 179, 8, 0.18); border-color: rgba(253, 224, 71, 0.45); color: #fef08a; }
.hof-chip.earn { background: rgba(16, 185, 129, 0.16); border-color: rgba(52, 211, 153, 0.42); color: #a7f3d0; }
.hof-chip.stat { background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.35); color: #bae6fd; }
#match-result-banner.type-champ .mrb-title { font-size: 48px; }

/* Buttons (Extra Large Thumb Targets) */
.btn-primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 60px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 15px;
  background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
  color: #fff;
  font-size: 19.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  transition: transform 0.08s;
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary.gold {
  border-color: rgba(254, 240, 138, 0.52);
  background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -2px 0 rgba(0, 0, 0, 0.28);
}
.btn-primary.blue {
  border-color: rgba(125, 211, 252, 0.48);
  background: linear-gradient(180deg, #0ea5e9 0%, #0369a1 100%);
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.btn-primary.red {
  border-color: rgba(253, 164, 175, 0.48);
  background: linear-gradient(180deg, #f43f5e 0%, #be123c 100%);
  box-shadow: 0 6px 26px rgba(244, 63, 94, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.btn-primary.rainbow {
  border-color: rgba(255, 255, 255, 0.65);
  background: linear-gradient(90deg, #f43f5e, #f59e0b, #22c55e, #0ea5e9, #a855f7);
  box-shadow: 0 6px 28px rgba(251, 191, 36, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.58), inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.btn-sakibare-hot {
  animation: sakibareHotPulse 0.88s ease-in-out infinite !important;
  border-color: #fecdd3 !important;
  color: #fff1f2 !important;
}
.btn-sakibare-rainbow {
  background-size: 220% 220% !important;
  animation: sakibareRainbowPulse 0.72s ease-in-out infinite !important;
  border-color: #ffffff !important;
}
@keyframes sakibareHotPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.72), 0 0 34px rgba(251, 113, 133, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }
  50% {
    transform: scale(1.018);
    box-shadow: 0 0 26px rgba(244, 63, 94, 0.96), 0 0 48px rgba(251, 191, 36, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  }
}
@keyframes sakibareRainbowPulse {
  0%, 100% {
    transform: scale(1);
    background-position: 0% 50%;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.85), 0 0 40px rgba(232, 121, 249, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  }
  50% {
    transform: scale(1.022);
    background-position: 100% 50%;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.95), 0 0 54px rgba(244, 63, 94, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
}
.btn-primary.gold::before,
.btn-primary.red::before,
.btn-primary.rainbow::before {
  content: "";
  position: absolute;
  top: -20%; left: -45%;
  width: 34%; height: 140%;
  background: linear-gradient(105deg, transparent 15%, rgba(255, 255, 255, 0.26) 50%, transparent 85%);
  transform: skewX(-18deg);
  pointer-events: none;
  animation: btnShimmer 4.2s ease-in-out infinite;
}
@keyframes btnShimmer {
  0%, 72% { left: -45%; opacity: 0; }
  78% { opacity: 1; }
  100% { left: 135%; opacity: 0; }
}
.btn-primary:not(.in-choice)::after {
  content: "›";
  font-family: "Oswald", sans-serif;
  font-size: 22px;
  line-height: 1;
  opacity: 0.78;
  margin-left: 2px;
  margin-top: -2px;
}
.btn-secondary {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(34, 46, 66, 0.96), rgba(18, 26, 42, 0.98));
  color: #f1f5f9;
  font-size: 16.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.35);
}
.btn-secondary:active { transform: scale(0.98); }
.modal-actions .btn-primary:not(:only-child),
.modal-actions .btn-secondary:not(:only-child) {
  border-left: 4px solid rgba(148, 163, 184, 0.7);
  height: 48px;
  font-size: 15px;
}
.modal-actions .btn-primary.gold:not(:only-child) { border-left: 4px solid #fde047; }
.modal-actions .btn-primary.blue:not(:only-child) { border-left: 4px solid #7dd3fc; }
.modal-actions .btn-primary.red:not(:only-child) { border-left: 4px solid #fda4af; }
.modal-actions .btn-primary.rainbow:not(:only-child) { border-left: 4px solid #ffffff; }

/* ================= 1. MAJESTIC WORLD CUP TITLE SCREEN ================= */
#screen-title {
  justify-content: space-between;
  padding-top: calc(env(safe-area-inset-top, 8px) + 10px);
  padding-bottom: calc(env(safe-area-inset-bottom, 8px) + 10px);
  background: #050b18;
}
.title-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 52%;
  object-fit: cover;
  object-position: center 62%;
  opacity: 0;
  filter: brightness(1.16) contrast(1.06) saturate(1.18);
  transition: opacity 0.45s ease;
  z-index: 0;
}
.title-bg-img.loaded { opacity: 1; }
.title-godrays {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 8, 20, 0.52) 0%, rgba(4, 8, 20, 0.14) 18%, rgba(4, 8, 20, 0.0) 36%, rgba(5, 11, 24, 0.45) 47%, rgba(5, 11, 24, 0.96) 54%, #050b18 100%);
}
.title-layer { position: relative; z-index: 2; }

.title-hero { text-align: center; padding-top: 22px; }
.title-logo {
  display: inline-block;
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(34px, 10.2vw, 48px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: 0.08em;
  padding-left: 0.08em;
  white-space: nowrap;
  background: linear-gradient(180deg, #ffffff 8%, #fef9c3 44%, #f59e0b 78%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.92)) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.9));
}
.title-divider {
  width: 136px;
  height: 2px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, rgba(253, 224, 71, 0.92), transparent);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.65);
}
.title-dock {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
}
.title-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 1px;
}
.title-footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  opacity: 0.85;
}
.title-footer-links a:hover { color: #fef08a; text-decoration: underline; }
.title-reset-link {
  background: none;
  border: none;
  padding: 0;
  color: rgba(248, 113, 113, 0.78);
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  opacity: 0.85;
}
.title-reset-link:hover { color: #fca5a5; text-decoration: underline; }

.records-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 0; }
.record-box {
  background: rgba(9, 15, 30, 0.78);
  border: 1px solid rgba(253, 224, 71, 0.32);
  border-radius: 12px;
  padding: 6px 4px;
  text-align: center;
  backdrop-filter: blur(6px);
}
.record-label { font-size: 12px; color: #e2e8f0; font-weight: 700; letter-spacing: 0.04em; }
.record-val { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 25px; font-weight: 700; margin-top: 1px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.record-sub { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 11px; letter-spacing: 0.08em; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 15px; }

.collection-row { display: grid; grid-template-columns: 1.04fr 0.78fr 1.18fr; gap: 6px; margin-top: 0; }
.collection-btn {
  height: 40px;
  border-radius: 11px;
  border: 1px solid rgba(253, 224, 71, 0.48);
  background: linear-gradient(180deg, rgba(19, 30, 56, 0.9), rgba(9, 15, 30, 0.92));
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 4px 12px rgba(0, 0, 0, 0.4);
}
.collection-btn .btn-ico { color: #fde047; width: 14px; height: 14px; }
.col-num {
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-style: normal;
  font-size: 13.5px;
  font-weight: 700;
  color: #fde047;
  letter-spacing: 0.03em;
}
.collection-btn:active { transform: scale(0.97); }
.new-b11-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.28);
  border: 1px solid #34d399;
  color: #a7f3d0;
}
/* 4-4-2 Pitch Board for Best Eleven Modal */
.pitch-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(253, 224, 71, 0.4);
  font-size: 12px;
  font-weight: 900;
  color: #e2e8f0;
}
.pitch-summary strong { color: #fde047; font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 16px; }
.pitch-board {
  position: relative;
  border-radius: 12px;
  padding: 10px 6px 10px;
  background: repeating-linear-gradient(
    180deg,
    #14532d 0px,
    #14532d 26px,
    #166534 26px,
    #166534 52px
  );
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.pitch-board::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1.5px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}
.pitch-board::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 64px; height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  pointer-events: none;
}
.pitch-line {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.pitch-slot {
  flex: 1;
  max-width: 106px;
  min-width: 0;
  border-radius: 9px;
  padding: 5px 4px;
  text-align: center;
  background: rgba(6, 12, 26, 0.88);
  border: 1.5px solid rgba(253, 224, 71, 0.55);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
}
.pitch-slot.empty {
  background: rgba(6, 12, 26, 0.48);
  border: 1.5px dashed rgba(255, 255, 255, 0.32);
  box-shadow: none;
}
.pitch-slot.champ {
  border-color: #fde047;
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.65);
}
.ps-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 900;
}
.ps-pos {
  padding: 0 4px;
  border-radius: 4px;
  color: #fff;
  font-size: 9px;
}
.ps-ovr {
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.05;
}
.ps-name {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 900;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-meta {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pitch-slot.empty .ps-name { color: rgba(255, 255, 255, 0.58); font-size: 10px; }
.pitch-hint {
  margin-top: 7px;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
  line-height: 1.4;
}

.setup-card {
  background: rgba(9, 15, 30, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
}
.field-label { font-size: 15px; font-weight: 900; color: #fff; margin-bottom: 5px; display: flex; justify-content: space-between; align-items: center; }
.name-row { display: flex; gap: 8px; }
.name-input {
  flex: 1;
  height: 48px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(6, 10, 22, 0.92);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  padding: 0 12px;
  outline: none;
  user-select: text;
}
.name-input:focus { border-color: #fde047; box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.3); }
.dice-btn {
  width: 52px;
  height: 48px;
  border-radius: 11px;
  border: 1px solid rgba(253, 224, 71, 0.48);
  background: linear-gradient(180deg, rgba(30, 41, 69, 0.96), rgba(15, 23, 42, 0.98));
  color: #fde047;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 3px 10px rgba(0, 0, 0, 0.35);
}
.dice-btn:active { transform: scale(0.95); }
.dice-btn .btn-ico { width: 20px; height: 20px; }
.pos-selector { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pos-chip {
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}
.pos-chip.selected {
  background: linear-gradient(180deg, #64748b, #334155);
  border-color: #e2e8f0;
  color: #fff;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.42);
}
.pos-chip[data-pos="FW"].selected {
  background: linear-gradient(180deg, #f43f5e, #be123c);
  border-color: #fda4af;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.52);
}
.pos-chip[data-pos="MF"].selected {
  background: linear-gradient(180deg, #22c55e, #15803d);
  border-color: #86efac;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.5);
}
.pos-chip[data-pos="DF"].selected {
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  border-color: #93c5fd;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.52);
}
.pos-chip[data-pos="GK"].selected {
  background: linear-gradient(180deg, #f59e0b, #b45309);
  border-color: #fde68a;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
}

/* ================= 2. GAME SCREEN (EXTRA LARGE TEXT) ================= */
#screen-game { gap: 5px; }

.game-ambient-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
  z-index: 0;
  filter: blur(2px) brightness(0.42);
  pointer-events: none;
}
.game-ambient-img.loaded { opacity: 0.48; }
.game-layer { position: relative; z-index: 2; }

.top-bar { display: flex; align-items: center; gap: 7px; padding-right: 112px; flex-shrink: 0; }
.age-pill {
  display: flex;
  align-items: baseline;
  gap: 3px;
  background: rgba(11, 18, 36, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-radius: 11px;
  padding: 4px 8px;
  flex-shrink: 0;
}
.age-num { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 28px; font-weight: 700; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.age-unit { font-size: 13px; color: #7dd3fc; font-weight: 900; }
.stage-info { flex: 1; min-width: 0; }
.stage-cat-row { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 5px; min-width: 0; }
.stage-cat { font-size: 11.5px; font-weight: 900; color: #fde047; line-height: 1.2; text-shadow: 0 1px 4px #000; white-space: normal; }
.trend-pill {
  display: none;
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.22);
  border: 1px solid rgba(125, 211, 252, 0.72);
  color: #e0f2fe;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.trend-pill.show { display: inline-block; }
.stage-cat-row .stage-club { min-width: 0; flex: 0 1 auto; }
.stage-club { font-size: clamp(13px, 3.6vw, 16px); font-weight: 900; color: #fff; line-height: 1.18; white-space: normal; text-shadow: 0 1px 4px #000; }

.player-card {
  background: rgba(11, 18, 36, 0.92);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.player-meta { flex: 1; min-width: 0; }
.player-name-line { display: flex; align-items: center; gap: 6px; }
.pos-badge { font-size: 13px; font-weight: 900; padding: 2px 7px; border-radius: 6px; color: #fff; flex-shrink: 0; }
.pos-FW { background: #e11d48; }
.pos-MF { background: #16a34a; }
.pos-DF { background: #2563eb; }
.pos-GK { background: #d97706; }
.player-name { font-size: 20px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talent-pill {
  display: none;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.trait-popover {
  position: absolute;
  top: 108px;
  left: 12px;
  right: 12px;
  z-index: 84;
  background: rgba(8, 14, 28, 0.96);
  border: 1.5px solid rgba(253, 224, 71, 0.72);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(8px);
}
.trait-popover.open { display: flex; }
.trait-pop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trait-pop-title { font-size: 14px; font-weight: 900; color: #fef08a; }
.trait-pop-rate {
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.65);
  color: #bae6fd;
}
.trait-pop-effect { font-size: 13px; font-weight: 800; color: #4ade80; line-height: 1.38; }
.trait-pop-desc { font-size: 12px; font-weight: 700; color: #cbd5e1; line-height: 1.38; }
.talent-pill.show { display: inline-block; }
.talent-pill.t-R { background: rgba(14, 165, 233, 0.25); border: 1px solid rgba(56, 189, 248, 0.75); color: #bae6fd; }
.talent-pill.t-SR { background: rgba(249, 115, 22, 0.28); border: 1px solid rgba(251, 146, 60, 0.85); color: #fed7aa; }
.talent-pill.t-SSR { background: rgba(234, 179, 8, 0.3); border: 1px solid rgba(253, 224, 71, 0.9); color: #fef08a; box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
.talent-pill.t-UR {
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.75), rgba(245, 158, 11, 0.75), rgba(34, 197, 94, 0.75), rgba(56, 189, 248, 0.75), rgba(168, 85, 247, 0.75));
  border: 1px solid #fff;
  color: #fff;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.75);
}
.talent-pill.t-early { background: rgba(251, 191, 36, 0.2); border: 1px solid rgba(251, 191, 36, 0.75); color: #fef08a; }
.talent-pill.t-late { background: rgba(16, 185, 129, 0.24); border: 1px solid rgba(52, 211, 153, 0.8); color: #a7f3d0; }
.title-tag-btn {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 999px;
  padding: 2px 9px;
  color: #fef08a;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ovr-box {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  background: rgba(5, 9, 20, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 11px;
  padding: 5px 11px 6px;
  flex-shrink: 0;
}
.ovr-rank { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 24px; font-weight: 700; line-height: 0.96; min-width: 24px; text-align: center; padding-bottom: 1px; }
.ovr-num-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ovr-label { font-family: "Oswald", sans-serif; font-size: 10px; letter-spacing: 0.10em; color: var(--text-sub); font-weight: 700; line-height: 1; }
.ovr-val { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 32px; font-weight: 700; line-height: 0.94; font-variant-numeric: tabular-nums; }

/* Cohort Ranking + Fever Strip */
.cohort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: linear-gradient(90deg, rgba(13, 22, 44, 0.96), rgba(30, 58, 138, 0.72));
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 10px;
  padding: 5px 10px;
  flex-shrink: 0;
}
.cohort-bar.fever-on {
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.96), rgba(220, 38, 38, 0.92), rgba(217, 119, 6, 0.96));
  border-color: #fde047;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.58);
}
.cohort-bar.super-on {
  background: linear-gradient(90deg, #be123c, #d97706, #0284c7, #7e22ce);
  border-color: #fef08a;
  box-shadow: 0 0 22px rgba(253, 224, 71, 0.85);
}
.cohort-left { font-size: 14px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cohort-rank-num { font-size: 19px; color: #fde047; font-weight: 900; }
.cohort-right { font-size: 14px; font-weight: 900; color: #7dd3fc; white-space: nowrap; }
.cohort-bar.fever-on .cohort-right { color: #fef08a; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.65); }
.cohort-bar.super-on .cohort-right {
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.85), 0 0 10px rgba(253, 224, 71, 0.95);
  letter-spacing: 0.03em;
}
.cohort-right.ct-apex {
  background: linear-gradient(90deg, #ff4da6, #fde047, #4ade80, #38bdf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
}
.cohort-right.ct-gold { color: #fde047; text-shadow: 0 0 8px rgba(250, 204, 21, 0.55); }
.cohort-right.ct-red { color: #fb7185; text-shadow: 0 0 8px rgba(244, 63, 94, 0.45); }
.cohort-right.ct-orange { color: #fb923c; }
.cohort-right.ct-sky { color: #38bdf8; }
.cohort-right.ct-emerald { color: #4ade80; }
.cohort-right.ct-teal { color: #5eead4; }
.cohort-right.ct-slate { color: #e2e8f0; }
.cohort-right.ct-dim { color: #94a3b8; }
.scout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 10px;
  border-radius: 9px;
  background: rgba(9, 15, 30, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 11px;
  font-weight: 800;
  color: #cbd5e1;
  flex-shrink: 0;
}
.scout-bar.tier-hot { border-color: rgba(251, 191, 36, 0.55); background: rgba(42, 24, 6, 0.72); }
.scout-bar.tier-mid { border-color: rgba(56, 189, 248, 0.45); }
.scout-grade-pill {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: rgba(51, 65, 85, 0.85);
  color: #e2e8f0;
}
.scout-bar.tier-hot .scout-grade-pill { background: linear-gradient(90deg, #f59e0b, #ef4444); color: #fff; }
.scout-bar.tier-mid .scout-grade-pill { background: rgba(14, 165, 233, 0.28); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.5); }
.record-chase-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(90deg, rgba(180, 83, 9, 0.72), rgba(220, 38, 38, 0.62));
  border: 1px solid rgba(251, 191, 36, 0.75);
  color: #fef9c3;
  flex-shrink: 0;
}
.record-chase-bar.show { display: flex; }
.record-chase-bar.broken {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.9), rgba(245, 158, 11, 0.85));
  border-color: #fef08a;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.55);
}

/* 6 Stats Grid (Extra Bold & Prominent) */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; flex-shrink: 0; border-radius: 12px; transition: box-shadow 0.35s ease; }
.stats-grid.grit-mid {
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.35), inset 0 0 10px rgba(168, 85, 247, 0.16);
}
.stats-grid.grit-high {
  animation: gritAuraPulse 1.3s ease-in-out infinite;
}
@keyframes gritAuraPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(192, 132, 252, 0.55), 0 0 28px rgba(244, 63, 94, 0.28); }
  50% { box-shadow: 0 0 24px rgba(244, 63, 94, 0.72), 0 0 38px rgba(168, 85, 247, 0.45); }
}
.career-timeline {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 16px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(9, 15, 30, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.22);
  flex-shrink: 0;
}
.career-timeline.in-result {
  margin: 2px 0 6px;
  padding: 5px 10px;
  min-height: 20px;
}
.tl-label {
  font-size: 9px;
  font-weight: 900;
  color: #94a3b8;
  letter-spacing: 0.04em;
  margin-right: 3px;
  flex-shrink: 0;
}
.tl-seg {
  flex: 1 1 0;
  min-width: 3px;
  height: 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-sizing: border-box;
}
.career-timeline.in-result .tl-seg { height: 9px; }
.tl-seg.slump { background: rgba(100, 116, 139, 0.62); border-color: rgba(148, 163, 184, 0.35); }
.tl-seg.normal { background: #38bdf8; border-color: transparent; opacity: 0.88; }
.tl-seg.good { background: #4ade80; border-color: transparent; box-shadow: 0 0 5px rgba(74, 222, 128, 0.45); }
.tl-seg.hot {
  background: linear-gradient(180deg, #fde047, #f59e0b);
  border-color: transparent;
  box-shadow: 0 0 7px rgba(251, 191, 36, 0.72);
}
.tl-seg.rainbow {
  background: linear-gradient(90deg, #ff5cad, #fde047, #4ade80, #38bdf8, #e879f9);
  background-size: 200% 100%;
  border-color: transparent;
  box-shadow: 0 0 9px rgba(232, 121, 249, 0.85);
  animation: tlRainbowGlow 1.6s linear infinite;
}
@keyframes tlRainbowGlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 6px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.stat-item.rolling {
  border-color: rgba(56, 189, 248, 0.75);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35), inset 0 0 8px rgba(56, 189, 248, 0.18);
}
.stat-item.rolling .stat-val { color: #7dd3fc; }
.stat-item.land-zero {
  border-color: rgba(148, 163, 184, 0.22);
  opacity: 0.88;
}
/* パチスロ式 6段階ヒートカラー（青 → 緑 → 黄 → 赤 → 金 → 🌈虹） */
.stat-item.heat-blue {
  border-color: rgba(56, 189, 248, 0.72);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.34), inset 0 0 8px rgba(56, 189, 248, 0.14);
}
.stat-item.heat-green {
  border-color: #4ade80;
  box-shadow: 0 0 13px rgba(74, 222, 128, 0.44), inset 0 0 9px rgba(74, 222, 128, 0.18);
}
.stat-item.heat-yellow {
  border-color: #fde047;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.56), inset 0 0 10px rgba(250, 204, 21, 0.22);
}
.stat-item.heat-red {
  border-color: #f43f5e;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.75), inset 0 0 14px rgba(244, 63, 94, 0.3);
}
.stat-item.heat-gold {
  border-color: #fbbf24;
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.42), rgba(13, 21, 40, 0.92));
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.88), inset 0 0 16px rgba(253, 224, 71, 0.36);
}
.stat-item.heat-rainbow {
  background: linear-gradient(135deg, rgba(190, 18, 60, 0.34), rgba(217, 119, 6, 0.3), rgba(2, 132, 199, 0.34), rgba(126, 34, 206, 0.34));
  animation: rainbowBorder 0.65s linear infinite;
}
.stat-item.pop-sm { animation: statCardPop 0.22s ease-out; }
.stat-item.pop-big { animation: statCardPopBig 0.28s cubic-bezier(0.22, 1.5, 0.36, 1); }
.stat-item.stat-overdrive {
  border-color: rgba(253, 224, 71, 0.95) !important;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.78), inset 0 0 12px rgba(255, 255, 255, 0.32) !important;
}
.stat-item.heat-rainbow.pop-big {
  animation: rainbowBorder 0.65s linear infinite, statCardPopBig 0.28s cubic-bezier(0.22, 1.5, 0.36, 1);
}
@keyframes statCardPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.045); }
  100% { transform: scale(1); }
}
@keyframes statCardPopBig {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.stat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 2px; }
.stat-name { font-size: 15px; font-weight: 900; color: #f8fafc; white-space: nowrap; }
.stat-right { display: flex; align-items: baseline; gap: 3px; }
.stat-delta { font-size: 14px; font-weight: 900; min-width: 30px; text-align: right; }
.delta-blue { color: #38bdf8; }
.delta-green { color: #4ade80; }
.delta-yellow { color: #fde047; text-shadow: 0 0 8px rgba(250, 204, 21, 0.55); }
.delta-red { color: #fb7185; font-size: 15px; text-shadow: 0 0 10px rgba(244, 63, 94, 0.85); animation: statPop 0.32s ease-out; }
.delta-gold { color: #fef08a; font-size: 16px; text-shadow: 0 0 12px rgba(251, 191, 36, 0.95); animation: statPop 0.36s ease-out; }
.delta-rainbow {
  font-size: 16px;
  background: linear-gradient(90deg, #fb7185, #fde047, #4ade80, #38bdf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 #000) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.85));
  animation: statPop 0.38s ease-out;
}
.delta-down { color: #fb7185; }
.stat-rank { font-size: 18px; font-weight: 900; width: 24px; text-align: center; }
.stat-val { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.stat-bar-bg { width: 100%; height: 7px; border-radius: 999px; background: rgba(5, 9, 20, 0.95); overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 999px; transition: width 0.2s ease-out; }

/* Rank colors */
.rank-SS { color: #fde047; text-shadow: 0 0 10px rgba(253, 224, 71, 0.95); }
.rank-S { color: var(--rank-s); }
.rank-A { color: var(--rank-a); }
.rank-B { color: var(--rank-b); }
.rank-C { color: var(--rank-c); }
.rank-D { color: var(--rank-d); }
.rank-E { color: var(--rank-e); }
.fill-SS { background: linear-gradient(90deg, #f59e0b, #fde047, #38bdf8); }
.fill-S { background: linear-gradient(90deg, #d97706, #fbbf24); }
.fill-A { background: linear-gradient(90deg, #be123c, #f43f5e); }
.fill-B { background: linear-gradient(90deg, #ea580c, #fb923c); }
.fill-C { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.fill-D { background: linear-gradient(90deg, #059669, #34d399); }
.fill-E { background: #64748b; }

/* Slot & Event Stage */
.event-stage {
  flex: 1;
  min-height: 0;
  border-radius: 14px;
  border: 2px solid rgba(148, 163, 184, 0.4);
  background: #0b1428;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 9px 11px;
  cursor: pointer;
}
.aura-blue { border-color: #38bdf8; box-shadow: 0 0 16px rgba(56, 189, 248, 0.45), inset 0 0 14px rgba(56, 189, 248, 0.2); }
.aura-green { border-color: #22c55e; box-shadow: 0 0 18px rgba(34, 197, 94, 0.58), inset 0 0 16px rgba(34, 197, 94, 0.25); }
.aura-red { border-color: #f43f5e; box-shadow: 0 0 22px rgba(244, 63, 94, 0.75), inset 0 0 20px rgba(244, 63, 94, 0.32); }
.aura-gold { border-color: #fbbf24; box-shadow: 0 0 26px rgba(251, 191, 36, 0.9), inset 0 0 24px rgba(251, 191, 36, 0.42); }
.aura-rainbow { animation: rainbowBorder 0.58s linear infinite; }

.event-bg-fallback { position: absolute; inset: 0; z-index: 0; background: linear-gradient(150deg, #13203d 0%, #090e1c 100%); }
.event-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s ease; z-index: 1; }
.event-bg-img.loaded { opacity: 0.68; }
.event-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 9, 20, 0.28) 0%, rgba(5, 9, 20, 0.86) 100%); z-index: 2; }
.event-content { position: relative; z-index: 3; display: flex; flex-direction: column; height: 100%; justify-content: space-between; gap: 4px; }
.event-header-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.event-tag {
  font-size: 16px;
  font-weight: 900;
  padding: 5px 13px;
  border-radius: 9px;
  background: rgba(10, 16, 32, 0.9);
  border: 1.5px solid rgba(56, 189, 248, 0.72);
  color: #e0f2fe;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  line-height: 1.15;
}
.event-tag.tag-green {
  border-color: rgba(52, 211, 153, 0.85);
  color: #bbf7d0;
  background: rgba(6, 34, 24, 0.9);
}
.event-tag.tag-red {
  border-color: rgba(251, 113, 133, 0.9);
  color: #ffe4e6;
  background: rgba(68, 12, 26, 0.92);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.45);
}
.event-tag.tag-gold {
  font-size: 17px;
  border-color: #fde047;
  color: #fef08a;
  background: linear-gradient(135deg, rgba(146, 64, 14, 0.95), rgba(30, 18, 6, 0.95));
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.65);
}
.event-tag.tag-rainbow {
  font-size: 17.5px;
  border-color: #ffffff;
  color: #ffffff;
  background: linear-gradient(90deg, rgba(225, 29, 72, 0.92), rgba(217, 119, 6, 0.92), rgba(14, 165, 233, 0.92), rgba(147, 51, 234, 0.92));
  box-shadow: 0 0 22px rgba(253, 224, 71, 0.85);
}
.season-stats-pill {
  font-size: 12.5px;
  font-weight: 900;
  color: #fff;
  background: rgba(10, 16, 32, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 7px;
  padding: 4px 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.event-headline {
  font-size: clamp(19px, 5.2vw, 22px);
  font-weight: 900;
  color: #fff;
  line-height: 1.22;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}
.event-body {
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.38;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.event-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  color: #e2e8f0;
  border-top: 1px solid rgba(148, 163, 184, 0.26);
  padding-top: 4px;
}
.mini-retire-btn {
  background: rgba(159, 18, 57, 0.65);
  border: 1px solid rgba(251, 113, 133, 0.8);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.bottom-controls { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* ================= 3. WORLD CUP SCREEN (LIVE STADIUM DRAMA!) ================= */
#screen-wc {
  gap: 7px;
  background: #050a1a;
}
.wc-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
  filter: brightness(0.45);
}
.wc-bg-img.loaded { opacity: 0.55; }
.wc-layer { position: relative; z-index: 2; }

.wc-header { padding-right: 98px; }
.wc-kicker { font-size: 13px; font-weight: 900; color: #fde047; letter-spacing: 0.1em; }
.wc-title { font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px #000; }

.wc-scoreboard {
  background: linear-gradient(135deg, rgba(23, 37, 84, 0.92), rgba(11, 18, 36, 0.95));
  border: 2px solid rgba(253, 224, 71, 0.65);
  border-radius: 15px;
  padding: 10px 12px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.wc-top-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.wc-round-badge {
  font-size: 14px;
  font-weight: 900;
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.25);
  border: 1px solid rgba(253, 224, 71, 0.6);
  color: #fef08a;
}
.wc-clock {
  font-size: 16px;
  font-weight: 900;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid rgba(74, 222, 128, 0.4);
}
.wc-matchup { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.wc-team { flex: 1; font-size: 18px; font-weight: 900; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.wc-team-flag { font-size: 30px; line-height: 1; }
.wc-team-bar { display: none; width: 44px; height: 3px; border-radius: 999px; margin-top: 2px; }
.wc-team-bar.show { display: block; }
.wc-team-bar.my { background: linear-gradient(90deg, #38bdf8, #fde047); box-shadow: 0 0 8px rgba(56, 189, 248, 0.7); }
.wc-team-bar.opp { background: linear-gradient(90deg, #fb7185, #f97316); box-shadow: 0 0 8px rgba(244, 63, 94, 0.7); }
.wc-score { font-size: 38px; font-weight: 900; color: #fde047; font-variant-numeric: tabular-nums; min-width: 96px; text-shadow: 0 0 18px rgba(253, 224, 71, 0.55); }
.wc-score.goal-flash { animation: goalPop 0.35s ease-out; color: #fff; }

/* PK Shootout Live Dots */
.wc-pk-board {
  display: none;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  flex-direction: column;
  gap: 4px;
}
.wc-pk-board.active { display: flex; }
.pk-row { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 900; }
.pk-dots { display: flex; gap: 6px; font-size: 16px; }
.wc-pk-line { margin-top: 4px; font-size: 15px; font-weight: 900; color: #7dd3fc; min-height: 20px; }

.wc-table-wrap { background: rgba(11, 18, 36, 0.9); border: 1px solid var(--border); border-radius: 12px; padding: 7px 9px; flex-shrink: 0; }
.wc-table-title { font-size: 13px; font-weight: 900; color: var(--text-sub); margin-bottom: 4px; display: flex; justify-content: space-between; }
table.wc-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.wc-table th { color: var(--text-muted); font-weight: 800; padding: 3px 3px; border-bottom: 1px solid rgba(148, 163, 184, 0.25); text-align: center; }
.wc-table th:first-child, .wc-table td:first-child { text-align: left; }
.wc-table td { padding: 4px 3px; text-align: center; font-weight: 800; border-bottom: 1px solid rgba(148, 163, 184, 0.1); }
.wc-table tr.is-japan { background: rgba(37, 99, 235, 0.42); color: #fff; }
.wc-table tr.qualify td:first-child { border-left: 4px solid #22c55e; padding-left: 6px; }

.wc-ko-bracket { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wc-ko-step {
  background: rgba(11, 18, 36, 0.88);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--text-muted);
}
.wc-ko-step.current { border-color: #fde047; background: rgba(251, 191, 36, 0.24); color: #fef08a; }
.wc-ko-step.cleared { border-color: #22c55e; background: rgba(34, 197, 94, 0.24); color: #86efac; }

.wc-log-box {
  flex: 1;
  min-height: 0;
  background: rgba(9, 15, 30, 0.9);
  border: 2px solid rgba(56, 189, 248, 0.35);
  border-radius: 13px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
}
.wc-log-box.goal-banner { border-color: #fde047; box-shadow: 0 0 22px rgba(253, 224, 71, 0.55); }
.wc-log-box.danger-banner { border-color: #f43f5e; box-shadow: 0 0 22px rgba(244, 63, 94, 0.55); }
.wc-live-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wc-feed-item {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.38;
  color: #f1f5f9;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.55);
  animation: popIn 0.2s ease-out;
}
.wc-feed-item.goal { background: rgba(217, 119, 6, 0.38); border-left: 4px solid #fde047; color: #fef9c3; font-size: 17px; }
.wc-feed-item.opp-goal { background: rgba(190, 18, 60, 0.35); border-left: 4px solid #fb7185; color: #ffe4e6; }
.wc-me-name {
  display: inline-block;
  padding: 0 5px;
  margin: 0 1px;
  border-radius: 5px;
  background: #0c4a6e;
  border: 1px solid #38bdf8;
  color: #ffffff;
  font-weight: 900;
}
.wc-player-line { font-size: 14px; font-weight: 900; color: #fde047; border-top: 1px solid rgba(148, 163, 184, 0.24); padding-top: 5px; }

/* ================= 4. RESULT SCREEN (OVR-TIERED PLAYER CARD + COLLAPSIBLE STATS) ================= */
#screen-result { gap: 6px; }
.result-hero {
  position: relative;
  flex: 1 1 220px;
  min-height: 205px;
  max-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 9px 11px 9px;
  transition: min-height 0.2s ease;
}
#screen-result.chapters-open .result-hero {
  flex: 0 0 auto;
  min-height: 150px;
  max-height: 168px;
}
/* OVR連動 6段階カード豪華さ（E/D → C銅 → B銀 → A紅 → S金 → SS虹金ホログラム） */
.result-hero.tier-SS {
  background: radial-gradient(circle at 75% 20%, #f59e0b 0%, #7c2d12 45%, #1e1b4b 100%);
  border-color: #fef08a;
  box-shadow: 0 0 28px rgba(253, 224, 71, 0.72), inset 0 0 18px rgba(254, 240, 138, 0.28);
  animation: rainbowBorder 2.4s linear infinite;
}
.result-hero.tier-S {
  background: radial-gradient(circle at 75% 20%, #d97706 0%, #78350f 48%, #0f172a 100%);
  border-color: #fbbf24;
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.52), inset 0 0 14px rgba(251, 191, 36, 0.2);
}
.result-hero.tier-A {
  background: radial-gradient(circle at 75% 20%, #be123c 0%, #4c0519 52%, #0f172a 100%);
  border-color: #fb7185;
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.45), inset 0 0 12px rgba(251, 113, 133, 0.18);
}
.result-hero.tier-B {
  background: radial-gradient(circle at 75% 20%, #0284c7 0%, #1e293b 55%, #090e1c 100%);
  border-color: #7dd3fc;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.36);
}
.result-hero.tier-C {
  background: radial-gradient(circle at 75% 20%, #b45309 0%, #3b2213 55%, #0b1120 100%);
  border-color: #d97706;
}
.result-hero.tier-D,
.result-hero.tier-E {
  background: radial-gradient(circle at 75% 20%, #334155 0%, #1e293b 55%, #090e1c 100%);
  border-color: rgba(148, 163, 184, 0.48);
}
.card-foil-sheen {
  display: none;
  position: absolute;
  inset: -40%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 36%, rgba(255, 255, 255, 0.22) 48%, rgba(254, 240, 138, 0.18) 52%, transparent 64%);
  animation: cardSheenSweep 3.4s ease-in-out infinite;
}
.result-hero.tier-SS .card-foil-sheen,
.result-hero.tier-S .card-foil-sheen,
.result-hero.tier-A .card-foil-sheen { display: block; }
@keyframes cardSheenSweep {
  0% { transform: translateX(-65%); }
  55%, 100% { transform: translateX(75%); }
}
.result-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; opacity: 0; transition: opacity 0.3s ease; z-index: 1; }
.result-hero-img.loaded { opacity: 0.94; }
.result-hero-fallback-icon { position: absolute; top: 8px; right: 12px; font-size: 46px; opacity: 0.22; z-index: 0; }
.result-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 10, 22, 0.28) 0%, rgba(6, 10, 22, 0.06) 36%, rgba(6, 10, 22, 0.72) 66%, rgba(6, 10, 22, 0.94) 100%);
  z-index: 2;
}
.result-hero-content { position: relative; z-index: 3; display: flex; flex-direction: column; justify-content: space-between; height: 100%; gap: 6px; }
.result-hero-bottom { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.fut-top { display: flex; align-items: center; gap: 10px; }
.fut-ovr-emblem {
  min-width: 72px;
  padding: 5px 7px;
  border-radius: 11px;
  background: rgba(5, 9, 20, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.28);
  text-align: center;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.fut-ovr-num {
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0.02em;
}
.fut-ovr-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 3px;
}
.fut-rank-tag { font-family: "Oswald", sans-serif; font-size: 13px; font-weight: 700; }
.fut-pos-tag { font-size: 10px; font-weight: 900; padding: 1px 5px; border-radius: 4px; color: #fff; }
.fut-info { flex: 1; min-width: 0; }
.fut-stats-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}
.fut-stat-cell {
  background: rgba(5, 9, 20, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 7px;
  padding: 3px 2px;
  text-align: center;
  backdrop-filter: blur(3px);
}
.fut-stat-lbl { font-size: 10px; font-weight: 800; color: #cbd5e1; line-height: 1.1; }
.fut-stat-val { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 15px; font-weight: 700; line-height: 1.15; }
.result-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 2px;
}
.result-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.28);
  border: 1px solid rgba(251, 191, 36, 0.78);
  color: #fef08a;
}
.result-new-badges { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.new-rec-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.75);
  animation: newPillPulse 1.2s ease-in-out infinite;
}
.new-title-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #06b6d4, #6366f1);
  color: #fff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}
@keyframes newPillPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.result-name { font-size: 22px; font-weight: 900; line-height: 1.12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-sub { font-size: 12px; font-weight: 800; color: #e2e8f0; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.result-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; flex-shrink: 0; }
.total-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 5px 3px; text-align: center; }
.total-label { font-size: 12px; color: var(--text-sub); font-weight: 800; }
.total-val { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 23px; font-weight: 700; margin-top: 1px; font-variant-numeric: tabular-nums; }

.result-titles-strip {
  background: rgba(19, 28, 49, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 900;
  color: #fef08a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.result-punchline {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.94));
  border-left: 4px solid #fde047;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.35;
  flex-shrink: 0;
}
.result-salary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex-shrink: 0;
}
.salary-box {
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.42), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 11px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.salary-label { font-size: 11px; font-weight: 800; color: #fde68a; letter-spacing: 0.03em; }
.salary-val {
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fef08a;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.salary-sub { font-size: 11px; font-weight: 800; color: #cbd5e1; line-height: 1.1; }

.chapters-box {
  flex: 0 0 auto;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#screen-result.chapters-open .chapters-box {
  flex: 1;
  min-height: 110px;
}
.chapters-head {
  width: 100%;
  background: transparent;
  border: none;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 900;
  color: #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
}
#screen-result.chapters-open .chapters-head {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.chapters-head-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
  font-weight: 800;
}
.chapters-chevron { color: #fde047; font-size: 13px; transition: transform 0.18s ease; }
#screen-result.chapters-open .chapters-chevron { transform: rotate(180deg); }
.chapters-scroll { display: none; flex: 1; overflow-y: auto; padding: 4px 9px 6px; }
#screen-result.chapters-open .chapters-scroll { display: block; }
table.chapter-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.chapter-table th { color: var(--text-muted); font-size: 13px; padding: 4px 3px; text-align: right; border-bottom: 1px solid rgba(148, 163, 184, 0.16); }
.chapter-table th:first-child, .chapter-table td:first-child { text-align: left; }
.chapter-table td { padding: 5px 3px; text-align: right; font-weight: 800; border-bottom: 1px solid rgba(148, 163, 184, 0.08); }
.ch-age { font-size: 12px; color: var(--text-muted); display: block; }
.ch-club { font-weight: 900; color: #fff; font-size: 14px; }

.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex-shrink: 0; }
.btn-share {
  height: 44px;
  border-radius: 11px;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(14, 116, 144, 0.38);
  color: #e0f2fe;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.btn-share.x-share {
  border-color: rgba(248, 250, 252, 0.55);
  background: linear-gradient(180deg, #1f2937, #09090b);
  color: #ffffff;
}
.btn-share.img-save { border-color: rgba(251, 191, 36, 0.7); background: rgba(180, 83, 9, 0.45); color: #fef08a; }
.replay-row { display: grid; grid-template-columns: 1.65fr 1fr; gap: 6px; flex-shrink: 0; }

/* ================= BOTTOM-ANCHORED RAPID-TAP MODAL ================= */
#overlay-modal {
  position: absolute;
  inset: 0;
  z-index: 82;
  background: rgba(3, 6, 14, 0.84);
  backdrop-filter: blur(5px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 10px calc(env(safe-area-inset-bottom, 6px) + 10px);
}
#overlay-modal.open { display: flex; }
.modal-card {
  width: 100%;
  max-height: 86dvh;
  background: #0f182d;
  border: 2px solid rgba(253, 224, 71, 0.45);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.85);
  animation: popIn 0.16s ease-out;
}
.modal-visual {
  position: relative;
  height: 162px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px;
  overflow: hidden;
  flex-shrink: 0;
}
.cutin-dusk { background: linear-gradient(135deg, #c2410c 0%, #7c2d12 45%, #1e1b4b 100%); }
.cutin-tunnel { background: linear-gradient(135deg, #1d4ed8 0%, #0f172a 55%, #020617 100%); }
.cutin-coach { background: linear-gradient(135deg, #047857 0%, #064e3b 50%, #0f172a 100%); }
.cutin-manager { background: linear-gradient(135deg, #db2777 0%, #701a75 50%, #1e1b4b 100%); }
.cutin-rival { background: linear-gradient(135deg, #b91c1c 0%, #450a0a 55%, #0f172a 100%); }
.cutin-freeze { background: linear-gradient(135deg, #f59e0b 0%, #1d4ed8 50%, #020617 100%); }
.cutin-gold { background: linear-gradient(135deg, #d97706 0%, #92400e 50%, #172554 100%); }

.modal-visual-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.22s ease; z-index: 1; }
.modal-visual-img.loaded { opacity: 0.88; }
.modal-visual-icon { position: absolute; right: 16px; top: 12px; font-size: 56px; opacity: 0.3; z-index: 0; }
.modal-visual-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6, 10, 22, 0.1) 0%, rgba(6, 10, 22, 0.92) 100%); z-index: 2; }
.modal-visual-text { position: relative; z-index: 3; }
.modal-kicker { font-size: 13px; font-weight: 900; color: #fde047; letter-spacing: 0.08em; }
.modal-title { font-size: 23px; font-weight: 900; color: #fff; margin-top: 2px; line-height: 1.2; text-shadow: 0 2px 10px #000; text-wrap: balance; line-break: strict; }
.modal-body { padding: 12px 14px; font-size: 16px; font-weight: 700; line-height: 1.5; color: #f8fafc; white-space: pre-line; overflow-y: auto; }
.choice-cards { display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.choice-card {
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.choice-card.youth { border-left: 4px solid #38bdf8; }
.choice-card.strong { border-left: 4px solid #fbbf24; }
.choice-card.normal { border-left: 4px solid #34d399; }
.choice-card.selectable {
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.choice-card.selectable:active { transform: scale(0.985); }
.choice-card.selectable.selected {
  background: rgba(30, 41, 59, 0.98);
  border-color: rgba(253, 224, 71, 0.85);
  outline: 2px solid #fde047;
  outline-offset: 1px;
  box-shadow: 0 0 18px rgba(253, 224, 71, 0.32);
}
.dex-wrap { display: flex; flex-direction: column; gap: 12px; white-space: normal; }
.dex-milestone-card {
  padding: 9px 11px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(253, 224, 71, 0.38);
  font-size: 12px;
  line-height: 1.5;
  color: #fef08a;
}
.dex-milestone-card b { color: #ffffff; }
.dex-ms-sub { font-size: 11px; color: #cbd5e1; margin-top: 2px; }
.dex-section { display: flex; flex-direction: column; gap: 4px; }
.dex-tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.dex-tier-head.rarity-N { color: #cbd5e1; border-left: 4px solid #94a3b8; }
.dex-tier-head.rarity-R { color: #60a5fa; border-left: 4px solid #3b82f6; }
.dex-tier-head.rarity-SR { color: #f87171; border-left: 4px solid #ef4444; }
.dex-tier-head.rarity-SSR { color: #fbbf24; border-left: 4px solid #f59e0b; text-shadow: 0 0 8px rgba(251, 191, 36, 0.35); }
.dex-tier-head.rarity-UR {
  border-left: 4px solid #e879f9;
  background: linear-gradient(90deg, rgba(244, 114, 182, 0.14), rgba(56, 189, 248, 0.14), rgba(192, 132, 252, 0.14));
}
.dex-tier-head.rarity-UR .dex-tier-label {
  background: linear-gradient(90deg, #f472b6, #fde047, #4ade80, #38bdf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dex-tier-count { font-size: 12px; font-weight: 800; color: #94a3b8; }
.dex-row { font-size: 14px; font-weight: 700; line-height: 1.45; padding: 2px 4px; color: #f8fafc; }
.dex-row.locked { color: #64748b; }
.dex-num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: #94a3b8; margin-right: 4px; }
.dex-hint { font-size: 12px; font-weight: 600; color: #94a3b8; margin-left: 4px; }
.dex-row.locked .dex-hint { color: #64748b; }
.choice-head { font-size: 15px; font-weight: 900; color: #fff; }
.choice-pro { font-size: 13px; font-weight: 800; color: #4ade80; line-height: 1.35; }
.choice-con { font-size: 13px; font-weight: 800; color: #fb7185; line-height: 1.35; }
.pos-hint-line {
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 12px;
  font-weight: 800;
  color: #e2e8f0;
  line-height: 1.35;
}
.nearmiss-wrap { white-space: normal; display: flex; flex-direction: column; gap: 9px; }
.nearmiss-lead { font-size: 15px; font-weight: 700; color: #f8fafc; line-height: 1.48; }
.nearmiss-box {
  background: rgba(10, 17, 34, 0.92);
  border: 1px solid rgba(251, 146, 60, 0.55);
  border-radius: 12px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nearmiss-box.close { border-color: rgba(253, 224, 71, 0.82); box-shadow: 0 0 14px rgba(251, 191, 36, 0.22); }
.nearmiss-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; font-weight: 900; }
.nearmiss-grade { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.nearmiss-grade.hot { background: rgba(251, 191, 36, 0.24); color: #fef08a; border: 1px solid rgba(253, 224, 71, 0.7); }
.nearmiss-grade.mid { background: rgba(249, 115, 22, 0.24); color: #fed7aa; border: 1px solid rgba(251, 146, 60, 0.7); }
.nearmiss-grade.low { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.5); }
.nearmiss-bar { position: relative; height: 12px; border-radius: 999px; background: rgba(30, 41, 59, 0.95); overflow: hidden; border: 1px solid rgba(148, 163, 184, 0.28); }
.nearmiss-fill { height: 100%; border-radius: 999px; transition: width 0.35s ease; }
.nearmiss-fill.hot { background: linear-gradient(90deg, #f97316, #fde047); }
.nearmiss-fill.mid { background: linear-gradient(90deg, #ef4444, #fb923c); }
.nearmiss-fill.low { background: linear-gradient(90deg, #64748b, #94a3b8); }
.nearmiss-diff { font-size: 14px; font-weight: 900; color: #fde047; }
.nearmiss-diff.low { color: #cbd5e1; }
.nearmiss-tail { font-size: 14px; font-weight: 800; color: #cbd5e1; line-height: 1.45; }
.modal-actions { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.modal-actions .choice-option-btn {
  opacity: 0.78;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.modal-actions .choice-option-btn.selected {
  opacity: 1;
  outline: 2px solid #fde047;
  outline-offset: 1px;
  box-shadow: 0 0 16px rgba(253, 224, 71, 0.38);
  transform: translateY(-1px);
}
.modal-actions .choice-confirm-btn {
  margin-top: 6px;
  background: linear-gradient(180deg, #10b981, #047857);
  border-color: #6ee7b7;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: opacity 0.15s ease, filter 0.15s ease;
}
.modal-actions .choice-confirm-btn:disabled {
  opacity: 0.42;
  filter: grayscale(0.75);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
.tg-summary { display: flex; flex-direction: column; gap: 10px; white-space: normal; }
.tg-lead { font-size: 14px; font-weight: 800; color: #e2e8f0; }
.tg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
}
.tg-chip-val { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 16px; font-weight: 700; }
.tg-total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  line-height: 1.1;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.3);
}
.tg-total-box.down {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(127, 29, 29, 0.28);
}
.tg-total-lbl { font-size: 16px; font-weight: 900; color: #e2e8f0; line-height: 1.2; }
.tg-total-num { font-family: "Oswald", "Noto Sans JP", sans-serif; font-size: 32px; font-weight: 700; line-height: 1; }
.formation-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}
.formation-chip {
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.9);
  color: #cbd5e1;
  font-family: "Oswald", "Noto Sans JP", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.formation-chip.selected {
  background: linear-gradient(180deg, #0284c7, #0369a1);
  border-color: #7dd3fc;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.42);
}
