/* ==========================================================================
   Rolling Bounce Arcade — UI Shell & Overlays (Stitch-to-DOM)
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-neutral-900);
  font-family: var(--font-body);
  color: var(--color-on-surface);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* --- Outer Arcade Cabinet Frame (Centers 16:9 Stage) --- */
.cabinet-wrapper {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, #263143 0%, #0f172a 85%);
  padding: clamp(0px, 1vw, 12px);
}

.arcade-stage {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-default);
  overflow: hidden;
  background: var(--color-neutral-900);
  border: 3px solid var(--color-neutral-800);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* --- Shared Screen / Overlay Layering --- */
.ui-screen,
.ui-hud,
.ui-modal {
  position: absolute;
  inset: 0;
  display: none;
}

.ui-screen.active,
.ui-hud.active,
.ui-modal.active {
  display: flex;
}

/* ==========================================================================
   BUTTONS & TACTILE GLOSSY PILLS (Stitch Level 2 & Level 3 Elevation)
   ========================================================================== */
.btn-arcade {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-default);
  border: 2px solid var(--color-neutral-900);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-label-lg);
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
  overflow: hidden;
}

.btn-arcade::before {
  content: '';
  position: absolute;
  inset: 0 0 48% 0;
  background: var(--grad-hud-sheen);
  pointer-events: none;
}

.btn-arcade:hover {
  transform: scale(1.03);
  filter: brightness(1.05);
}

.btn-arcade:active {
  transform: translateY(4px) scale(0.99);
}

.btn-arcade--red {
  background: var(--grad-red-gloss);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-btn-red);
}
.btn-arcade--red:active {
  box-shadow: var(--shadow-btn-red-pressed);
}

.btn-arcade--green {
  background: var(--grad-green-gloss);
  color: var(--color-on-secondary-fixed);
  box-shadow: var(--shadow-btn-green);
}
.btn-arcade--green:active {
  box-shadow: var(--shadow-btn-green-pressed);
}

.btn-arcade--gold {
  background: var(--grad-gold-gloss);
  color: var(--color-on-tertiary-fixed);
  box-shadow: var(--shadow-btn-gold);
}
.btn-arcade--gold:active {
  box-shadow: var(--shadow-btn-gold-pressed);
}

.btn-arcade--wood {
  background: var(--grad-wood-plank);
  color: #fef3c7;
  box-shadow: var(--shadow-btn-wood);
}
.btn-arcade--wood:active {
  box-shadow: var(--shadow-btn-wood-pressed);
}

.btn-arcade--surface {
  background: var(--color-surface-container-lowest);
  color: var(--color-on-surface);
  box-shadow: var(--shadow-btn-surface);
}

.btn-arcade--sm {
  padding: 0.4rem 0.85rem;
  font-size: var(--text-label-md);
  border-radius: 0.85rem;
}

.btn-arcade--lg {
  width: 100%;
  padding: 0.85rem 1.5rem;
  font-size: 18px;
}

.btn-arcade--xl {
  padding: 0.9rem 2.75rem;
  font-size: 24px;
  border-radius: var(--radius-full);
}

.btn-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-neutral-900);
  background: var(--color-surface-container-lowest);
  color: var(--color-on-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--color-neutral-900);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-icon-circle:active {
  transform: translateY(3px);
  box-shadow: none;
}
.btn-icon-circle.is-muted {
  background: var(--color-surface-dim);
  color: var(--color-primary);
}

.btn-link-muted {
  background: none;
  border: none;
  color: var(--color-on-surface-variant);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-body-sm);
  cursor: pointer;
  text-decoration: underline;
  margin-top: 0.25rem;
}
.btn-link-muted:hover {
  color: var(--color-primary);
}

/* Glossy HUD Pills */
.hud-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-neutral-900);
  box-shadow: var(--shadow-hud-pill);
  overflow: hidden;
  pointer-events: auto;
}
.hud-pill::before {
  content: '';
  position: absolute;
  inset: 0 0 50% 0;
  background: var(--grad-hud-sheen);
  pointer-events: none;
}
.hud-pill--dark {
  background: rgba(15, 23, 42, 0.86);
  color: var(--color-inverse-on-surface);
}
.hud-pill--gold {
  background: var(--color-tertiary-fixed);
  color: var(--color-on-tertiary-fixed);
}

.hud-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.icon-gold { color: var(--color-tertiary); }
.icon-green { color: var(--color-secondary-fixed); }
.text-gold { color: var(--color-tertiary); }
.text-red { color: var(--color-primary); }
.text-green { color: var(--color-secondary); }
.text-dark { color: var(--color-on-surface); }

/* ==========================================================================
   SCREEN 1: MAIN TITLE SCREEN
   ========================================================================== */
#screen-title {
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  background: var(--grad-sky);
  z-index: 10;
}

.title-bg-hills {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.title-sun {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef08a 30%, #facc15 100%);
  box-shadow: 0 0 40px rgba(250, 204, 21, 0.7);
}

.title-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  height: 36px;
}
.cloud-1 { width: 120px; top: 14%; left: 10%; animation: floatCloud 18s linear infinite; }
.cloud-2 { width: 150px; top: 22%; left: 62%; animation: floatCloud 24s linear infinite reverse; }

@keyframes floatCloud {
  0% { transform: translateX(-20px); }
  50% { transform: translateX(30px); }
  100% { transform: translateX(-20px); }
}

.title-hill {
  position: absolute;
  bottom: -18%;
  border-radius: 50% 50% 0 0;
}
.hill-back {
  left: -10%;
  width: 75%;
  height: 55%;
  background: #4ade80;
  border-top: 4px solid #16a34a;
}
.hill-front {
  right: -12%;
  width: 80%;
  height: 46%;
  background: #22c55e;
  border-top: 5px solid #15803d;
}

.title-top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-top-actions {
  display: flex;
  gap: 0.6rem;
}

.title-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: -0.5rem;
}

/* Hero Bouncing Red Ball */
.hero-ball-stage {
  position: relative;
  width: 84px;
  height: 92px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 0.4rem;
}

.hero-ball {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ff8787 0%, #ef4444 45%, #b91c1c 100%);
  border: 3px solid var(--color-neutral-900);
  box-shadow: inset -6px -8px 12px rgba(127, 29, 29, 0.5);
  animation: heroBounce 1.15s cubic-bezier(0.35, 0.05, 0.55, 0.95) infinite;
}

.hero-ball-gloss {
  position: absolute;
  top: 7px;
  left: 11px;
  width: 22px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  transform: rotate(-25deg);
}

.hero-ball-eyes {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
}

.hero-ball-eyes .eye {
  width: 13px;
  height: 15px;
  background: #ffffff;
  border: 2px solid var(--color-neutral-900);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 2px;
}

.hero-ball-eyes .pupil {
  width: 5px;
  height: 6px;
  background: var(--color-neutral-900);
  border-radius: 50%;
}

.hero-ball-smile {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 8px;
  border-bottom: 3px solid var(--color-neutral-900);
  border-radius: 0 0 12px 12px;
}

.hero-ball-shadow {
  position: absolute;
  bottom: 0;
  width: 54px;
  height: 10px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.28);
  animation: heroShadow 1.15s cubic-bezier(0.35, 0.05, 0.55, 0.95) infinite;
}

@keyframes heroBounce {
  0%, 100% { transform: translateY(0) scale(1.08, 0.92); }
  50% { transform: translateY(-28px) scale(0.95, 1.06); }
}

@keyframes heroShadow {
  0%, 100% { transform: scaleX(1.08); opacity: 0.35; }
  50% { transform: scaleX(0.65); opacity: 0.16; }
}

.title-badge {
  background: var(--color-secondary);
  color: var(--color-on-secondary);
  border: 2px solid var(--color-neutral-900);
  border-radius: var(--radius-full);
  padding: 0.15rem 0.9rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  box-shadow: 0 3px 0 var(--color-secondary-shadow);
  margin-bottom: 0.3rem;
}

.title-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(36px, 5.5vw, 62px);
  line-height: 1;
  color: var(--color-primary-bright);
  -webkit-text-stroke: 3px var(--color-neutral-900);
  text-shadow: 0 5px 0 var(--color-neutral-900), 0 8px 18px rgba(15, 23, 42, 0.35);
  letter-spacing: -0.02em;
}

.title-subtitle {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(14px, 1.8vw, 20px);
  color: #ffffff;
  -webkit-text-stroke: 1px var(--color-neutral-900);
  text-shadow: 0 2px 0 var(--color-neutral-900);
  letter-spacing: 0.16em;
  margin-bottom: 1rem;
}

.title-cta-group {
  margin-bottom: 0.75rem;
}

.title-secondary-row {
  display: flex;
  gap: 0.75rem;
}

.title-footer-hint {
  position: relative;
  z-index: 2;
  align-self: center;
  background: rgba(15, 23, 42, 0.78);
  color: var(--color-inverse-on-surface);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.key-badge {
  background: #ffffff;
  color: var(--color-neutral-900);
  border: 1.5px solid var(--color-neutral-900);
  border-radius: 5px;
  padding: 0.05rem 0.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  box-shadow: 0 2px 0 #94a3b8;
}

.hint-sep { opacity: 0.5; }

/* ==========================================================================
   SCREEN 2: LEVEL SELECT
   ========================================================================== */
#screen-level-select {
  background: linear-gradient(180deg, #bae6fd 0%, #e7eeff 100%);
  padding: clamp(0.75rem, 2vw, 1.5rem);
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.level-select-panel {
  width: 100%;
  height: 100%;
  background: var(--color-surface-container-lowest);
  border: 3px solid var(--color-neutral-900);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 0 var(--color-neutral-800);
  padding: clamp(0.75rem, 2vw, 1.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ls-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ls-world-tag {
  background: var(--color-secondary);
  color: var(--color-on-secondary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-neutral-900);
}

.ls-heading {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(18px, 2.5vw, 26px);
  color: var(--color-on-surface);
}

.ls-progress-wrap {
  background: var(--color-surface-container-low);
  border-radius: var(--radius-default);
  padding: 0.5rem 0.85rem;
  border: 2px solid var(--color-surface-dim);
}

.ls-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-on-surface-variant);
  margin-bottom: 0.3rem;
}

.ls-progress-track {
  height: 12px;
  background: var(--color-surface-dim);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1.5px solid var(--color-neutral-900);
}

.ls-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-tertiary-bright), var(--color-secondary-bright));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.level-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: clamp(0.5rem, 1.2vw, 0.9rem);
}

.level-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-default);
  border: 2.5px solid var(--color-neutral-900);
  background: var(--color-surface-container-low);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 5px 0 var(--color-surface-dim);
}

.level-node.unlocked:hover {
  transform: translateY(-3px) scale(1.03);
}

.level-node.unlocked:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--color-surface-dim);
}

.level-node.unlocked {
  background: var(--color-surface-container-lowest);
  box-shadow: 0 5px 0 var(--color-secondary-shadow);
}

.level-node.current {
  background: #fef9c3;
  box-shadow: 0 5px 0 var(--color-primary-shadow);
  border-color: var(--color-primary);
}

.level-node.locked {
  background: var(--color-surface-container);
  opacity: 0.68;
  cursor: not-allowed;
}

.level-num {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--grad-red-gloss);
  color: #ffffff;
  border: 2px solid var(--color-neutral-900);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 3px 0 var(--color-primary-shadow);
}

.level-node.locked .level-num {
  background: var(--color-steel-light);
  box-shadow: 0 3px 0 var(--color-neutral-900);
}

.level-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  color: var(--color-on-surface);
  line-height: 1.15;
}

.level-stars {
  display: flex;
  gap: 2px;
}

.level-stars .material-symbols-outlined {
  font-size: 18px;
  color: var(--color-surface-dim);
}

.level-stars .material-symbols-outlined.earned {
  color: var(--color-tertiary-bright);
  text-shadow: 0 1px 0 var(--color-tertiary);
}

/* ==========================================================================
   SCREEN 3: GAMEPLAY HUD OVERLAY
   ========================================================================== */
.ui-hud {
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(0.6rem, 1.5vw, 1.1rem);
  pointer-events: none;
  z-index: 20;
}

.hud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hud-cluster-left,
.hud-cluster-center,
.hud-cluster-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.hud-mini-ball {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ff8787, #ef4444 60%, #991b1b);
  border: 1.5px solid #ffffff;
}

.hud-hearts {
  display: flex;
  gap: 2px;
}

.hud-hearts .heart {
  font-size: 20px;
  color: #475569;
  transition: transform 0.2s ease, color 0.2s ease;
}

.hud-hearts .heart.active {
  color: var(--color-primary-bright);
  filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.65));
}

.ring-icon-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid #eab308;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #fef08a, 0 1px 0 #735c00;
}

.hud-level-badge {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
}

.hud-world-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-secondary-bright);
}

.hud-timer-pill .hud-value {
  font-size: 16px;
}

/* Checkpoint Toast */
.checkpoint-toast {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--color-secondary);
  color: #ffffff;
  border: 2px solid var(--color-neutral-900);
  border-radius: var(--radius-full);
  padding: 0.4rem 1.1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 5px 0 var(--color-secondary-shadow);
  opacity: 0;
  transform: translateY(-16px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.checkpoint-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Bottom Touch Controls */
.hud-bottom-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}

.touch-dpad {
  display: flex;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.55);
  padding: 0.4rem;
  border-radius: var(--radius-default);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.touch-jump-wrap {
  pointer-events: auto;
}

.touch-btn {
  border: 2.5px solid var(--color-neutral-900);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.touch-btn--dir {
  width: 54px;
  height: 54px;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-neutral-900);
  box-shadow: 0 4px 0 #64748b;
}

.touch-btn--dir.pressed,
.touch-btn--dir:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #64748b;
  background: #fde047;
}

.touch-btn--jump {
  height: 56px;
  padding: 0 1.4rem;
  gap: 0.35rem;
  border-radius: var(--radius-full);
  background: var(--grad-green-gloss);
  color: var(--color-on-secondary-fixed);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  box-shadow: 0 5px 0 var(--color-secondary-shadow);
}

.touch-btn--jump.pressed,
.touch-btn--jump:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--color-secondary-shadow);
}

/* ==========================================================================
   MODALS (Pause, Victory, Game Over, Skins)
   ========================================================================== */
.ui-modal {
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(5px);
  padding: 1rem;
  z-index: 40;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--color-surface-container-lowest);
  border: 4px solid var(--color-neutral-900);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal-board);
  padding: 2.2rem 1.5rem 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  text-align: center;
  animation: modalPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card--wide {
  max-width: 620px;
}

@keyframes modalPop {
  from { transform: scale(0.86); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-ribbon {
  position: absolute;
  top: -22px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.6rem;
  border-radius: var(--radius-default);
  border: 3px solid var(--color-neutral-900);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.modal-ribbon h2 {
  font-size: 20px;
  font-weight: 900;
}

.modal-ribbon--gold {
  background: var(--grad-gold-gloss);
  color: var(--color-on-tertiary-fixed);
  box-shadow: 0 4px 0 var(--color-tertiary);
}
.modal-ribbon--green {
  background: var(--grad-green-gloss);
  color: var(--color-on-secondary-fixed);
  box-shadow: 0 4px 0 var(--color-secondary-shadow);
}
.modal-ribbon--red {
  background: var(--grad-red-gloss);
  color: #ffffff;
  box-shadow: 0 4px 0 var(--color-primary-shadow);
}
.modal-ribbon--wood {
  background: var(--grad-wood-plank);
  color: #fef3c7;
  box-shadow: 0 4px 0 var(--color-wood-dark);
}

.modal-snapshot {
  width: 100%;
  background: var(--color-surface-container-low);
  border-radius: var(--radius-default);
  padding: 0.55rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
}
.snapshot-sub { color: var(--color-secondary); }

.settings-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface-container-low);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
}

.setting-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 14px;
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.slider-wrap input[type="range"] {
  width: 100px;
  accent-color: var(--color-primary-bright);
  cursor: pointer;
}
.slider-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  min-width: 36px;
  text-align: right;
}

/* Arcade Toggle Switch */
.arcade-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}
.arcade-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--color-steel-light);
  border: 2px solid var(--color-neutral-900);
  transition: background 0.2s ease;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid var(--color-neutral-900);
  transition: transform 0.2s ease;
}
.arcade-toggle input:checked + .toggle-track {
  background: var(--color-secondary-bright);
}
.arcade-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(22px);
}

.modal-actions-col {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-actions-row {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

/* Victory Stars */
.victory-stars {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.2rem;
}
.v-star {
  font-size: 46px;
  color: var(--color-surface-dim);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.v-star.earned {
  color: var(--color-tertiary-bright);
  filter: drop-shadow(0 3px 0 var(--color-tertiary));
  transform: scale(1.1);
}

.modal-desc {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-on-surface-variant);
}

.stats-bento {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.stats-bento--two {
  grid-template-columns: repeat(2, 1fr);
}
.stat-box {
  background: var(--color-surface-container-low);
  border: 2px solid var(--color-surface-dim);
  border-radius: var(--radius-default);
  padding: 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-on-surface-variant);
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

/* KO Mascot */
.ko-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-surface-container-high);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-neutral-900);
}
.ko-ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-red-gloss);
  border: 2px solid var(--color-neutral-900);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.ko-eye {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  color: #ffffff;
  text-shadow: 0 1px 0 #0f172a;
}

/* Skins Grid */
.skins-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.skin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.4rem;
  border-radius: var(--radius-default);
  border: 2.5px solid var(--color-neutral-900);
  background: var(--color-surface-container-low);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.skin-card:hover:not(.locked) { transform: translateY(-2px); }
.skin-card.selected {
  background: #fef9c3;
  border-color: var(--color-primary);
  box-shadow: 0 4px 0 var(--color-primary-shadow);
}
.skin-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}
.skin-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--color-neutral-900);
}
.skin-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
}
.skin-status {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-on-surface-variant);
}

@media (max-width: 680px) {
  .hide-sm { display: none; }
  .hud-level-badge { display: none; }
  .level-grid { grid-template-columns: repeat(5, 1fr); gap: 0.35rem; }
  .level-num { width: 32px; height: 32px; font-size: 15px; }
  .level-name { font-size: 10px; }
  .skins-grid { grid-template-columns: repeat(2, 1fr); }

  /* Keep Title Screen unclipped on compact 16:9 mobile viewports */
  #screen-title {
    padding: 0.45rem 0.75rem;
    justify-content: center;
    gap: 0.25rem;
  }
  .title-top-bar {
    position: absolute;
    top: 0.45rem;
    left: 0.65rem;
    right: 0.65rem;
  }
  .hero-ball-stage {
    width: 48px;
    height: 52px;
    margin-bottom: 0.15rem;
  }
  .hero-ball {
    width: 36px;
    height: 36px;
    border-width: 2px;
  }
  .hero-ball-eyes { top: 10px; gap: 4px; }
  .hero-ball-eyes .eye { width: 8px; height: 9px; }
  .hero-ball-eyes .pupil { width: 3px; height: 4px; }
  .hero-ball-smile { bottom: 6px; width: 10px; height: 5px; }
  .hero-ball-shadow { width: 30px; height: 6px; }
  .title-badge { font-size: 9px; padding: 0.1rem 0.55rem; margin-bottom: 0.15rem; }
  .title-logo { font-size: 26px; -webkit-text-stroke: 2px var(--color-neutral-900); }
  .title-subtitle { font-size: 10px; margin-bottom: 0.35rem; }
  .title-cta-group { margin-bottom: 0.35rem; }
  .btn-arcade--xl { padding: 0.4rem 1.4rem; font-size: 15px; }
  .btn-arcade { padding: 0.35rem 0.85rem; font-size: 12px; }
  .title-footer-hint { display: none; }
}

@media (max-height: 520px) {
  .modal-card {
    max-height: 92%;
    overflow-y: auto;
    padding: 1.6rem 1.1rem 1rem;
    gap: 0.55rem;
  }
  .modal-ribbon {
    position: static;
    margin-bottom: 0.2rem;
    padding: 0.3rem 1.1rem;
    font-size: 15px;
  }
}
