:root {
  --bg: #071018;
  --panel: rgba(8, 18, 32, 0.82);
  --text: #f4f7fb;
  --muted: #9bb0c7;
  --accent: #ffb347;
  --danger: #ff5c6c;
}

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

html {
  height: 100%;
}

body {
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  background:
    radial-gradient(circle at top, #fff3b0 0%, transparent 45%),
    linear-gradient(180deg, #ff7a3d 0%, #ffb347 55%, #ffe08a 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

header,
footer {
  text-align: center;
  max-width: 100%;
  flex-shrink: 0;
}

header h1 {
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: #1b1a2e;
}

header p,
footer p {
  color: #1b1a2e;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

/* index.html sets the Privacy Policy link's color inline (var(--accent)); override it here since
   that accent gold is low-contrast against the sunrise gradient too. */
footer a {
  color: #5b2a86 !important;
}

.workout-mode-cluster {
  display: inline-flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: auto;
}

.workout-mode-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.workout-mode-btn.active {
  color: #1a1208;
  background: linear-gradient(135deg, #ffd27a, var(--accent));
}

.workout-mode-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 0.75rem;
  min-height: 0;
}

#stage {
  position: relative;
  aspect-ratio: 3 / 4;
  height: 100%;
  width: auto;
  max-width: calc(100% - 28rem);
  max-height: 100%;
  margin-inline: 0;
  min-height: 0;
  min-width: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* This is the sky the transparent top of bg-far.png reveals during play (see
     art/skyline-dragon/README.md) -- must match the body sunrise gradient above, not the old
     dark-navy chrome color, or the canvas's transparent sky region clashes with the rest of the
     page. */
  background: linear-gradient(180deg, #ff7a3d 0%, #ffb347 55%, #ffe08a 100%);
  flex: 1 1 auto;
}

#workout-panel {
  flex: 1 1 28rem;
  max-width: 40rem;
  min-width: 22rem;
  max-height: 100%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#workout-panel h2 {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.panel-section:first-child {
  flex: 1 1 auto;
  min-height: 0;
}

.camera-preview-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 20rem;
  border-radius: 10px;
  overflow: hidden;
  background: #0a121c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#camera-preview {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 20rem;
  object-fit: cover;
  background: #0a121c;
  transform: scaleX(-1);
}

#tracking-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
  z-index: 1;
}

.tracking-hud-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.35);
}

.tracking-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a6a7a;
  box-shadow: none;
  flex-shrink: 0;
}

.tracking-dot.active {
  background: #5ce08f;
  box-shadow: 0 0 8px rgba(92, 224, 143, 0.7);
}

.depth-gauge {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.depth-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}

.depth-track {
  height: 10px;
  border-radius: 999px;
  background: #0a121c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

#depth-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #6bb6ff, var(--accent));
  transition: width 0.08s linear;
}

.range-gauge {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.range-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3d6b9a 0%, #0a121c 18%, #0a121c 82%, #9a5a3d 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.range-ideal {
  position: absolute;
  left: 25%;
  width: 33%;
  top: 0;
  bottom: 0;
  background: rgba(92, 224, 143, 0.35);
  border-left: 1px solid rgba(92, 224, 143, 0.7);
  border-right: 1px solid rgba(92, 224, 143, 0.7);
}

#range-marker {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 4px;
  margin-left: -2px;
  left: 50%;
  border-radius: 2px;
  background: #e8f4ff;
  box-shadow: 0 0 6px rgba(232, 244, 255, 0.8);
  transition: left 0.12s linear, background 0.12s linear;
}

#range-marker.zone-ideal {
  background: #5ce08f;
  box-shadow: 0 0 8px rgba(92, 224, 143, 0.85);
}

#range-marker.zone-far,
#range-marker.zone-near {
  background: #ffb347;
}

#range-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
}

#range-label.zone-ideal {
  color: #5ce08f;
}

#range-label.zone-far,
#range-label.zone-near {
  color: #ffb347;
}

.phase-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

#phase-display {
  color: var(--accent);
}

.cal-instructions {
  margin: 0 0 0.15rem 1rem;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.35;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

#workout-panel button {
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

#workout-panel button.primary {
  color: #1a1208;
  background: linear-gradient(135deg, #ffd27a, var(--accent));
  border-color: transparent;
}

#workout-panel button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}

.setting-row select {
  background: #0a121c;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0.25rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  max-width: 58%;
}

.invert-row input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

@media (max-width: 900px) {
  main {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
  }

  #stage {
    width: min(100%, calc((100dvh - 8rem) * 3 / 4));
    height: auto;
    max-width: 100%;
    max-height: 70dvh;
    flex: 0 0 auto;
  }

  #workout-panel {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
  }

  #camera-preview,
  .camera-preview-wrap {
    min-height: 16rem;
  }
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
  gap: 0.4rem;
}

#score {
  font-size: 2.4rem;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.hud-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  max-width: 92%;
}

.stat-pill {
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.stat-pill.shields {
  color: #00e5ff;
  border-color: #00e5ff;
  box-shadow: 0 4px 14px rgba(0, 229, 255, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.stat-pill.shields.pulse-recharge {
  animation: shieldRechargeAnim 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-pill.shields.pulse-hit {
  animation: shieldHitAnim 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes shieldRechargeAnim {
  0% { transform: scale(1); }
  40% {
    transform: scale(1.18);
    border-color: #00e676;
    color: #00e676;
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.85);
  }
  100% { transform: scale(1); }
}

@keyframes shieldHitAnim {
  0% { transform: scale(1); }
  40% {
    transform: scale(1.15);
    border-color: #ff9100;
    color: #ff9100;
    box-shadow: 0 0 25px rgba(255, 145, 0, 0.9);
  }
  100% { transform: scale(1); }
}

.stat-pill.level {
  color: #e040fb;
  border-color: rgba(224, 64, 251, 0.45);
}

.stat-pill.reps {
  color: #9dffc0;
  border-color: rgba(157, 255, 192, 0.4);
}

/* Reserve width via tabular numerals so a jump from "1.0x" to a large autoplay
   multiplier (see window.SigmaUpsHud in game.js) never reflows the HUD row. */
.stat-pill.speed {
  color: #ff6b35;
  border-color: rgba(255, 107, 53, 0.5);
  min-width: 3.6rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stat-pill.coach {
  color: var(--accent);
  border-color: rgba(255, 179, 71, 0.5);
  max-width: 92%;
  text-align: center;
}

.stat-pill.posture-fault {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.6);
  background: rgba(255, 107, 107, 0.14);
  max-width: 92%;
  text-align: center;
  animation: postureFaultPulse 0.4s ease;
}

@keyframes postureFaultPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

#posture-offline-chip {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent);
  background: rgba(255, 179, 71, 0.14);
  border: 1px solid rgba(255, 179, 71, 0.45);
  flex-shrink: 0;
}

#hint {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

#camera-bar {
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  z-index: 2;
}

#camera-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: #0d1520;
  background: linear-gradient(135deg, #9fd4ff, #6bb6ff);
  cursor: pointer;
  flex-shrink: 0;
}

#camera-btn.active {
  background: linear-gradient(135deg, #9dffc0, #5ce08f);
}

#camera-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#camera-status {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#hurt-flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  background: rgba(255, 0, 0, 0.55);
}

#hurt-flash.flash {
  animation: hurtFlashAnim 220ms ease-out;
}

@keyframes hurtFlashAnim {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

#overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--panel);
  backdrop-filter: blur(6px);
}

#overlay.hidden {
  display: none;
}

#overlay h2 {
  font-size: 1.8rem;
}

.overlay-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
}

#restart,
#btn-overlay-menu,
.menu-btn {
  margin-top: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

#restart,
.menu-btn.primary {
  color: #1a1208;
  background: linear-gradient(135deg, #ffd27a, var(--accent));
}

#btn-overlay-menu,
.menu-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.menu-btn.primary {
  color: #1a1208;
  border: 0;
}

#btn-hud-music,
#btn-hud-menu {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1a1208;
  background: linear-gradient(135deg, #ffd27a, var(--accent));
  cursor: pointer;
  pointer-events: auto;
}

#arcade-menu {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 10, 16, 0.78);
  backdrop-filter: blur(8px);
}

#arcade-menu.hidden {
  display: none;
}

.menu-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1.2rem 1.4rem;
  max-width: 22rem;
  text-align: center;
}

.menu-screen.hidden {
  display: none;
}

.menu-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--accent);
}

.menu-screen h2 {
  font-size: 2rem;
  letter-spacing: 0.08em;
}

.menu-tag,
.menu-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.vol-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.6rem;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 700;
}

.vol-row input[type='range'] {
  width: 100%;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  width: 100%;
  margin: 0.35rem 0 0.2rem;
}

.level-pick {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 0.55rem 0.2rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.level-pick.active {
  color: #1a1208;
  background: linear-gradient(135deg, #ffd27a, var(--accent));
  border-color: transparent;
}

.hidden {
  display: none;
}

.stat-pill.challenge {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.5);
}

.code-row {
  display: grid;
  grid-template-columns: 3.6rem 1fr;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
}

.code-row input[type='text'] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}

#overlay-share-row.code-row {
  grid-template-columns: 1fr auto auto;
}

.menu-error {
  color: #ff6b6b;
  font-size: 0.78rem;
  font-weight: 700;
}

.reset-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
}

.menu-btn.danger {
  color: #fff;
  background: rgba(255, 82, 82, 0.22);
  border-color: rgba(255, 82, 82, 0.55);
}

#restart:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* -- Store edition: gate HUD chip, cooldown, ads, skins, reminders -------------------------- */

.stat-pill.gate {
  color: #6bb6ff;
  border-color: rgba(107, 182, 255, 0.5);
}

#skin-unlock-toast {
  position: absolute;
  top: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd27a, var(--accent));
  color: #1a1208;
  font-weight: 800;
  font-size: 0.78rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.overlay-dragons-row {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
}

.overlay-dragon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.overlay-dragon canvas {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.challenge-preview-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.challenge-preview-row canvas {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

#house-ad {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.2rem;
  text-align: center;
  background: var(--panel);
  backdrop-filter: blur(6px);
}

#house-ad.hidden {
  display: none;
}

#house-ad h2 {
  font-size: 1.15rem;
  max-width: 22rem;
}

#house-ad p {
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 22rem;
}

.ad-chip {
  align-self: center;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #1a1208;
  background: var(--accent);
}

#btn-house-ad-close:disabled {
  opacity: 0.5;
  cursor: default;
}

.settings-store-row,
.reminder-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  align-items: center;
}

.settings-store-row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  margin: 0.35rem 0 0.2rem;
  max-height: 18rem;
  overflow-y: auto;
}

.skin-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 0.5rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.skin-tile canvas.skin-tile-canvas {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.skin-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 179, 71, 0.5);
}

.skin-tile.locked {
  opacity: 0.6;
}

.skin-tile-name {
  font-weight: 800;
}

.skin-tile-sub {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.62rem;
  text-align: center;
}

/* -- In-game autoplay (?autoplay=1) -------------------------------------------------------------
   #workout-panel and #camera-bar each carry their own ID-selector `display` rule above (higher
   specificity than the shared `.hidden` class, which loses that cascade regardless of source
   order), so hiding them for autoplay needs an override that also wins on specificity — hence
   `body.autoplay-mode #stage #camera-bar` / `body.autoplay-mode aside#workout-panel` (descendant
   + element+id beats a bare id) rather than `.hidden`. #header-blurb is rewritten at module
   load (not hidden) so the spectator sentence stays visible. Keying every autoplay-only layout
   change off the one body class set at game.js module load also lets #stage reclaim the aside's
   width instead of just hiding the aside inside space still reserved for it. */
body.autoplay-mode #stage {
  max-width: 100%;
}

body.autoplay-mode #stage #camera-bar,
body.autoplay-mode aside#workout-panel,
body.autoplay-mode .workout-mode-cluster {
  display: none;
}

/* -- In-game autoplay (?autoplay=1) overlay ---------------------------------------------------
   Anchored to the bottom of #stage (not the top, where #hud already lives) so it never competes
   with the score/shields/level/speed pills for space and never sits over the middle of the
   playfield the dragon actually flies through. */
#autoplay-panel {
  position: absolute;
  left: 50%;
  bottom: 0.6rem;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
  max-width: 94%;
  pointer-events: none;
}

.autoplay-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.32rem;
}

/* Source is never colour-alone — the text itself always reads JEV or CODE FALLBACK (see
   AUTOPLAY_SOURCE_LABEL in game.js); colour is a secondary reinforcement only. */
.stat-pill.autoplay-source.jev {
  color: #00e676;
  border-color: rgba(0, 230, 118, 0.55);
}

.stat-pill.autoplay-source.fallback {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.55);
}

.stat-pill.autoplay-cap {
  color: #ff5c6c;
  border-color: rgba(255, 92, 108, 0.6);
  background: rgba(255, 92, 108, 0.14);
}

#autoplay-summary {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  max-width: 22rem;
  text-align: center;
}

#autoplay-summary p {
  font-size: 0.76rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

#autoplay-summary a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
}
