:root {
  --bats-red: #BA0C2F;
  --bats-navy: #0C2340;
  --bats-gold: #FFC72C;
  --chalk-white: #F8FAFC;
  --chalkboard-green: #0F5132;
  --arcade-cabinet-bg: #07111E;
  --arcade-bezel: #16283D;
  --arcade-border: #FFC72C;
  --sandlot-clay: #DDA15E;
  --turf-green: #2D6A4F;
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ========================================================= */
/* ARCADE BODY & CABINET SHELL                               */
/* ========================================================= */
body.arcade-body {
  background: radial-gradient(circle at center, #112338 0%, #050B14 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

.arcade-cabinet {
  max-width: 940px;
  width: 100%;
  background: var(--arcade-cabinet-bg);
  border: 5px solid #1E3A5F;
  outline: 4px solid var(--bats-gold);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 199, 44, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ========================================================= */
/* ARCADE TOP MARQUEE                                        */
/* ========================================================= */
.arcade-marquee {
  background: linear-gradient(180deg, #1C3554 0%, var(--bats-navy) 100%);
  border-bottom: 4px solid var(--bats-red);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.marquee-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.marquee-logo {
  font-size: 2.2rem;
  background: var(--bats-red);
  border: 2px solid var(--bats-gold);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marquee-title {
  color: var(--chalk-white);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-shadow: 2px 2px 0px var(--bats-navy), 0 0 8px rgba(255, 199, 44, 0.4);
}

.marquee-subtitle {
  color: var(--bats-gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.marquee-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.arcade-mini-btn {
  background: #081626;
  border: 1.5px solid var(--bats-gold);
  color: #FFFFFF;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.1s ease;
}

.arcade-mini-btn:hover {
  background: var(--bats-red);
  transform: scale(1.05);
}

.arcade-mini-btn.organ {
  background: #1B3B64;
  color: var(--bats-gold);
}

.arcade-rank-badge {
  background: #0A1B2D;
  border: 1.5px solid #38BDF8;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  color: #38BDF8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.arcade-points-box {
  background: #000000;
  border: 2px solid var(--bats-gold);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pts-label {
  color: var(--bats-gold);
  font-size: 0.7rem;
  font-weight: 900;
}

.pts-val {
  color: #FFFFFF;
  font-size: 1.25rem;
  font-weight: 900;
  font-family: monospace;
}

/* ========================================================= */
/* ARCADE CRT MONITOR SCREEN (STATE MACHINE)                 */
/* ========================================================= */
.arcade-screen {
  background: #000000;
  min-height: 520px;
  position: relative;
  overflow: hidden;
}

.game-screen {
  display: none;
  width: 100%;
  height: 100%;
  padding: 16px;
  animation: screenFadeIn 0.2s ease-out;
}

.game-screen.active {
  display: flex;
  flex-direction: column;
}

@keyframes screenFadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

/* Screen Headers */
.screen-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0C1E33;
  border: 2px solid var(--bats-gold);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.screen-header-bar h2 {
  font-size: 1.15rem;
  color: var(--bats-gold);
  font-weight: 900;
}

.screen-back-btn, .derby-nav-btn {
  background: #1B3554;
  border: 1px solid #475569;
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.screen-back-btn:hover, .derby-nav-btn:hover {
  background: var(--bats-red);
  border-color: var(--bats-gold);
}

.derby-nav-btn.warning {
  background: #B91C1C;
  border-color: #F87171;
  color: #FFFFFF;
}

/* ========================================================= */
/* STATE 1: RETRO TITLE SCREEN                               */
/* ========================================================= */
.title-backdrop {
  background: radial-gradient(circle at center, #132D4C 0%, #071220 85%);
  border: 3px solid #1E3A5F;
  border-radius: var(--radius-md);
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  flex: 1;
}

.title-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-bat-mascot {
  font-size: 4.5rem;
  animation: floatMascot 2.2s ease-in-out infinite alternate;
}

@keyframes floatMascot {
  from { transform: translateY(-4px) rotate(-3deg); }
  to { transform: translateY(6px) rotate(3deg); }
}

.retro-title {
  font-size: 3.2rem;
  font-weight: 900;
  line-height: 0.95;
  color: #FFFFFF;
  letter-spacing: 2px;
  text-shadow: 4px 4px 0px var(--bats-navy), 0 0 20px rgba(186, 12, 47, 0.8);
}

.highlight-gold {
  color: var(--bats-gold);
  text-shadow: 4px 4px 0px var(--bats-navy), 0 0 20px rgba(255, 199, 44, 0.8);
}

.title-tagline {
  color: #93C5FD;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 8px;
}

.jcps-badge-pill {
  background: #083318;
  border: 2px solid #4ADE80;
  color: #86EFAC;
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.start-prompt-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.arcade-start-btn {
  background: linear-gradient(180deg, #E63946 0%, var(--bats-red) 100%);
  border: 3px solid var(--bats-gold);
  color: #FFFFFF;
  padding: 16px 36px;
  font-size: 1.35rem;
  font-weight: 900;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 199, 44, 0.5), 0 6px 0px #77051D;
  transition: all 0.1s ease;
  animation: pulseStart 1.4s ease-in-out infinite;
}

@keyframes pulseStart {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.arcade-start-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0px #77051D;
}

.start-subhint {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.start-subhint kbd {
  background: #1E293B;
  border: 1px solid #475569;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  color: #FFFFFF;
}

.title-mode-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}

.mode-shortcut-btn {
  background: #0E2239;
  border: 1.5px solid #254A78;
  color: #CBD5E1;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-shortcut-btn:hover {
  background: #1B4373;
  color: #FFFFFF;
  border-color: var(--bats-gold);
}

/* ========================================================= */
/* STATE 2: DUGOUT CHARACTER SELECT                          */
/* ========================================================= */
.dugout-subtitle {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 12px;
}

.dugout-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  overflow-y: auto;
  max-height: 380px;
  padding-right: 4px;
}

.kid-select-card {
  background: #0A1C30;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kid-select-card:hover {
  border-color: #38BDF8;
  transform: translateY(-2px);
}

.kid-select-card.selected {
  border-color: var(--bats-gold);
  background: #112844;
  box-shadow: 0 0 16px rgba(255, 199, 44, 0.4);
}

.kid-select-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kid-select-name {
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 900;
}

.kid-select-pos {
  background: var(--bats-red);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.kid-quirk-box {
  background: #061220;
  border-left: 3px solid var(--bats-gold);
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: #CBD5E1;
}

.stat-bars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 0.75rem;
  color: #94A3B8;
}

.stat-bars-grid strong {
  color: var(--bats-gold);
}

.dugout-footer-action {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.arcade-action-btn {
  background: var(--bats-red);
  color: #FFFFFF;
  border: 2px solid var(--bats-gold);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s ease;
}

.arcade-action-btn:hover {
  background: #D90429;
  transform: scale(1.03);
}

/* ========================================================= */
/* STATE 3: AT-BAT GAMEPLAY (THE BALLPARK ARENA)             */
/* ========================================================= */
.derby-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #081728;
  border: 1px solid var(--card-border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.batter-now-batting {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.batter-now-batting strong {
  color: #FFFFFF;
  margin-left: 4px;
}

.power-active-tag {
  background: #B45309;
  color: #FEF08A;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  animation: pulseStart 1s infinite;
}

.derby-nav-buttons {
  display: flex;
  gap: 8px;
}

.canvas-game-frame {
  background: #071526;
  border: 3px solid var(--bats-gold);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.derby-canvas-stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  aspect-ratio: 12 / 7;
  overflow: hidden;
  height: auto;
  background: #1B4332;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

#derby-canvas,
#derby-character-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#derby-canvas {
  touch-action: none;
}

#derby-character-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease-out;
}

#derby-character-canvas[data-ready="true"] {
  opacity: 1;
}

.announcer-speech-bar {
  background: #000000;
  border-left: 4px solid var(--bats-gold);
  color: #F8FAFC;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gamepad-control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.pitch-type-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--bats-gold);
  font-weight: 800;
}

.pitch-pill {
  background: #0A1C30;
  border: 1px solid #334155;
  color: #CBD5E1;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.pitch-pill.active {
  background: #2563EB;
  border-color: #60A5FA;
  color: #FFFFFF;
}

.gamepad-action-buttons {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.gamepad-btn {
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 900;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.gamepad-btn.blue { background: #1D4ED8; color: #FFFFFF; }
.gamepad-btn.gold { background: var(--bats-gold); color: var(--bats-navy); }
.gamepad-btn:disabled { background: #475569; color: #94A3B8; cursor: not-allowed; }

/* Backyard Baseball '97 HUD Bar */
.bb97-hud-bar {
  width: 100%;
  background: #0B4A23;
  border: 3px solid #FFFFFF;
  border-radius: 4px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  font-family: monospace, monospace;
}

.hud-inning-col {
  background: #083318;
  border-right: 3px solid #FFFFFF;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 8px;
}

.hud-inning-badge {
  background: #041F0E;
  border: 2px solid #4ADE80;
  border-radius: 4px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  color: #A7F3D0;
  font-weight: 900;
}

.hud-inning-num {
  font-size: 1.2rem;
  color: #FFFFFF;
}

.hud-teams-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-team-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 900;
  color: #FFFFFF;
}

.team-runs {
  background: #000000;
  color: #FFC72C;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.95rem;
  margin-left: auto;
}

.hud-atbat-col {
  flex: 1;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-batter-card {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-batter-avatar {
  font-size: 1.4rem;
  background: #083318;
  border: 1.5px solid #4ADE80;
  border-radius: 4px;
  padding: 2px 4px;
}

.hud-batter-details {
  display: flex;
  flex-direction: column;
}

.hud-batter-name {
  color: #FFC72C;
  font-size: 0.85rem;
  font-weight: 900;
}

.hud-batter-stat {
  color: #A7F3D0;
  font-size: 0.75rem;
  font-weight: 700;
}

.hud-count-row {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 4px;
}

.hud-count-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.count-lbl {
  color: #FFC72C;
  font-size: 0.7rem;
  font-weight: 900;
}

.dot-box {
  display: flex;
  gap: 3px;
}

.hud-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid #FFFFFF;
  background: #041F0E;
}

.hud-dot.on {
  background: #FFC72C;
  box-shadow: 0 0 6px #FFC72C;
}

.hud-action-col {
  border-left: 3px solid #FFFFFF;
  background: #083318;
  display: flex;
  align-items: center;
  padding: 4px;
}

.hud-timeout-btn {
  background: #EF4444;
  border: 2px solid #FFFFFF;
  border-radius: 4px;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.hud-timeout-btn:hover {
  background: #DC2626;
  transform: scale(1.05);
}

.timeout-hand { font-size: 1.1rem; }
.timeout-txt { font-size: 0.65rem; font-weight: 900; line-height: 1; }

/* ========================================================= */
/* STATE 4: IN-GAME TIME OUT (JCPS ADAPTIVE TESTING OVERLAY) */
/* ========================================================= */
.game-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.chalkboard-modal {
  background: #0F5132;
  border: 8px solid #8B4513;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 0 40px rgba(0,0,0,0.5);
  border-radius: var(--radius-md);
  max-width: 680px;
  width: 100%;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #FFFFFF;
}

.chalkboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #34D399;
  padding-bottom: 10px;
}

.jcps-cat-meter {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.cat-pill {
  background: #064E3B;
  color: #6EE7B7;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
}

.tier-indicator {
  background: var(--bats-gold);
  color: var(--bats-navy);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
}

.streak-indicator {
  background: #DC2626;
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 4px;
}

.chalkboard-close-btn {
  background: #1B3554;
  border: 1px solid #FFFFFF;
  color: #FFFFFF;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 800;
  cursor: pointer;
}

.chalk-q-prompt {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  color: #FEF08A;
}

.cat-options-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cat-opt-btn {
  background: #064E3B;
  border: 2px solid #059669;
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: all 0.1s ease;
}

.cat-opt-btn:hover {
  background: #047857;
  border-color: var(--bats-gold);
}

.chalk-feedback-box {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.35;
}

.chalk-feedback-box.correct {
  background: #064E3B;
  border-left: 4px solid #34D399;
  color: #D1FAE5;
}

.chalk-feedback-box.incorrect {
  background: #7F1D1D;
  border-left: 4px solid #F87171;
  color: #FEE2E2;
}

.tactile-widget-box {
  background: #093722;
  border: 1px solid #10B981;
  padding: 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.widget-title {
  color: var(--bats-gold);
  font-size: 0.75rem;
  font-weight: 800;
}

.gauge-flex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cat-slider {
  flex: 1;
  accent-color: var(--bats-gold);
  cursor: pointer;
}

.gauge-val {
  font-size: 1.1rem;
  color: var(--bats-gold);
  font-weight: 900;
  font-family: monospace;
  min-width: 50px;
}

.cat-btn-gold {
  background: var(--bats-gold);
  color: var(--bats-navy);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 900;
  cursor: pointer;
}

.gauge-fb {
  font-size: 0.8rem;
  color: #FEF08A;
}

.chalkboard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #059669;
  padding-top: 10px;
}

.cat-hint {
  font-size: 0.75rem;
  color: #A7F3D0;
}

.cat-resume-btn {
  background: var(--bats-red);
  border: 2px solid var(--bats-gold);
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ========================================================= */
/* STATE 5: PRE-K COLORING DUGOUT                            */
/* ========================================================= */
.coloring-arcade-container {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .coloring-arcade-container {
    grid-template-columns: 1fr;
  }
}

.coloring-tools-card {
  background: #081728;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coloring-tools-card h3 {
  font-size: 0.78rem;
  color: var(--bats-gold);
  letter-spacing: 0.5px;
}

.tool-btn-group, .c-action-group, .c-template-group {
  display: flex;
  gap: 6px;
  flex-direction: column;
}

.c-tool-btn, .tmpl-select-btn {
  background: #0F2238;
  border: 1px solid #28446B;
  color: #FFFFFF;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.c-tool-btn.active, .tmpl-select-btn.active {
  background: #2563EB;
  border-color: #93C5FD;
}

.c-palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.palette-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #000000;
  cursor: pointer;
}

.palette-swatch.active {
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2px var(--bats-gold);
}

.c-btn-main {
  background: var(--bats-red);
  color: #FFFFFF;
  border: none;
  padding: 8px 10px;
  border-radius: 4px;
  font-weight: 900;
  font-size: 0.8rem;
  cursor: pointer;
}

.c-btn-sub {
  background: #1B3554;
  color: var(--text-muted);
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}

.coloring-main-canvas-wrap {
  background: #081728;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  justify-content: center;
}

#coloring-canvas {
  background: #FFFFFF;
  border: 3px solid var(--sandlot-clay);
  border-radius: 4px;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}

/* Pre-K Puzzle Strips */
.prek-puzzles-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .prek-puzzles-strip {
    grid-template-columns: 1fr;
  }
}

.puzzle-strip-card {
  background: #081728;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-card-badge {
  background: #10B981;
  color: #FFFFFF;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 3px;
  width: fit-content;
}

.puzzle-strip-card h4 {
  font-size: 0.88rem;
  color: #FFFFFF;
}

.tap-balls-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  background: #000000;
  padding: 8px;
  border-radius: 4px;
}

.tap-ball-item {
  font-size: 1.8rem;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.tap-ball-item:hover { transform: scale(1.2); }
.tap-ball-item.counted { opacity: 0.25; filter: grayscale(1); pointer-events: none; }

.tap-balls-score { font-size: 0.82rem; color: var(--bats-gold); text-align: center; }

.shapes-row {
  display: flex;
  gap: 6px;
}

.shape-pick-btn {
  flex: 1;
  background: #0C1E33;
  border: 1px solid #1E3A5F;
  color: #FFFFFF;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.shape-pick-fb {
  font-size: 0.8rem;
  padding: 6px;
  border-radius: 4px;
}
.shape-pick-fb.correct { background: #064E3B; color: #A7F3D0; }
.shape-pick-fb.incorrect { background: #7F1D1D; color: #FCA5A5; }

/* ========================================================= */
/* STATE 6: FRONT OFFICE SABERMETRICS LAB                    */
/* ========================================================= */
.saber-arcade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 768px) {
  .saber-arcade-grid {
    grid-template-columns: 1fr;
  }
}

.saber-box {
  background: #081728;
  border: 2px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saber-box h3 {
  color: var(--bats-gold);
  font-size: 0.95rem;
}

.saber-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.saber-inputs {
  display: flex;
  gap: 10px;
  flex-direction: column;
}

.saber-num, .saber-dropdown {
  background: #000000;
  border: 1px solid var(--card-border);
  color: #FFFFFF;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  width: 100%;
}

.saber-btn {
  background: var(--bats-red);
  color: #FFFFFF;
  border: none;
  padding: 8px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}

.saber-result {
  background: #000000;
  border: 1px solid var(--card-border);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
}

.saber-result.gold strong { color: var(--bats-gold); }

/* ========================================================= */
/* ARCADE BOTTOM FOOTER                                      */
/* ========================================================= */
.arcade-bottom-panel {
  background: #03080E;
  border-top: 3px solid #16283D;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 700;
}

.arcade-bottom-panel kbd {
  background: #0F172A;
  border: 1px solid #334155;
  color: #E2E8F0;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
}

.hidden { display: none !important; }

/* Above both canvases, exactly at the bat's contact point (342, 360). */
.bat-contact-cue {
  position: absolute;
  left: 47.5%;
  top: 85.714%;
  z-index: 3;
  transform: translate(-50%, -140%) rotate(-12deg);
  pointer-events: none;
  padding: 14px 18px;
  background: #fff39b;
  color: #751e13;
  font-size: clamp(12px, 2.5vw, 20px);
  font-weight: 1000;
  font-style: italic;
  clip-path: polygon(50% 0,60% 20%,85% 5%,80% 30%,100% 40%,83% 55%,100% 80%,70% 75%,65% 100%,48% 82%,25% 100%,28% 75%,0 80%,17% 55%,0 35%,25% 30%,20% 5%,40% 20%);
}
