:root {
  --bg-top: #06110c;
  --bg-bottom: #021607;
  --panel: rgba(6, 30, 14, 0.84);
  --scan: rgba(153, 255, 153, 0.08);
  --line: #6af868;
  --text: #c8ffc8;
  --accent: #ffd166;
  --danger: #ff5c5c;
  --start-pane-height: clamp(330px, calc(100vh - 215px), 520px);
  --progress-label-color: #5df75d;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Share Tech Mono", monospace;
  color: var(--text);
  background: radial-gradient(circle at 20% 10%, #123821 0%, transparent 34%),
    radial-gradient(circle at 80% 90%, #0f2f28 0%, transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  overflow: hidden;
}

.crt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    var(--scan) 3px,
    transparent 4px
  );
  opacity: 0.6;
  animation: flicker 0.12s steps(2) infinite;
}

@keyframes flicker {
  0% { opacity: 0.55; }
  50% { opacity: 0.62; }
  100% { opacity: 0.58; }
}

.app {
  position: relative;
  width: min(1120px, 96vw);
  margin: 4px auto;
  padding: 8px 10px 10px;
  border: 1px solid #1a5e40;
  box-shadow: inset 0 0 0 1px rgba(10, 49, 30, 0.9), 0 0 0 1px rgba(20, 110, 72, 0.25);
  min-height: calc(100vh - 8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen {
  display: none;
  width: 100%;
  text-align: center;
  animation: rise-in 240ms ease-out;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen.active {
  display: block;
}

#start-screen.screen.active {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
}

.title {
  font-family: "Cinzel", serif;
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: 1.05;
  margin: 0;
  color: var(--line);
  text-shadow: 0 0 16px rgba(106, 248, 104, 0.45);
}

.title.small {
  font-size: clamp(1.1rem, 2vw, 1.6rem);
}

.subtitle {
  margin: 0.55rem 0 0;
  font-family: "Cinzel", serif;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
  opacity: 0.9;
}

.panel {
  margin: 0;
  max-width: none;
  display: grid;
  gap: 0.62rem;
  background: rgba(2, 22, 14, 0.65);
  border: 1px solid #3a8f4b;
  box-shadow: inset 0 0 24px rgba(8, 44, 24, 0.42);
  padding: 0.9rem;
}

label {
  text-align: left;
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 0.26rem;
  font-family: "Share Tech Mono", monospace;
  font-variant: normal;
  font-feature-settings: "smcp" 0, "c2sc" 0;
  font-size: 1.08rem;
}

select,
.btn {
  width: 100%;
  border: 1px solid #2ea470;
  background: rgba(7, 34, 17, 0.82);
  color: var(--line);
  font-family: "Share Tech Mono", monospace;
  font-variant: normal;
  font-feature-settings: "smcp" 0, "c2sc" 0;
  font-size: 1rem;
  padding: 0.52rem 0.68rem;
}

select:disabled,
.cbx-item input[type="checkbox"]:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cbx-item input[type="checkbox"]:disabled + span {
  opacity: 0.55;
}

.btn {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  letter-spacing: 0.06em;
}

.btn[hidden] {
  display: none;
}

.btn-secondary {
  border-color: #4ecf95;
  color: #9bf8cb;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(142, 255, 142, 0.2);
}

.legend {
  opacity: 0.88;
}

/* ── Start screen two-column layout ─────────────────────────────────────── */
.start-layout {
  display: grid;
  grid-template-columns: minmax(240px, 270px) minmax(0, 1fr);
  gap: 0.8rem;
  width: 100%;
  justify-content: center;
  align-items: stretch;
  margin: 1rem auto 0;
  max-width: 100%;
  min-height: var(--start-pane-height);
  text-align: left;
}

.setup-panel {
  align-self: stretch;
  height: var(--start-pane-height);
  overflow: auto;
}

/* Remove extra grid-gap space between section labels and their option card groups */
.setup-panel .group-label + .option-cards {
  margin-top: -0.62rem;
}

/* Keep Theme and Start button visually matched and adjacent */
.setup-panel #theme-select,
.setup-panel #start-btn,
.setup-panel #resume-btn {
  height: 42px;
}

.setup-panel #start-btn {
  margin-top: -0.62rem;
}

.setup-panel #resume-btn {
  margin-top: -0.62rem;
}

.legend-inline {
  font-size: 0.78rem;
  opacity: 0.78;
  margin: 0;
  line-height: 1.3;
}

.group-label {
  margin: 0;
  font-family: "Share Tech Mono", monospace;
  font-variant: normal;
  font-feature-settings: "smcp" 0, "c2sc" 0;
  font-size: 1.08rem;
  color: #88efb8;
}

.form-row {
  display: block;
}

.hidden-control {
  display: none;
}

.option-cards {
  display: grid;
  gap: 0.42rem;
}

.mode-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.layout-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.option-card {
  min-height: 74px;
  border: 1px solid #2ea470;
  background: rgba(9, 39, 22, 0.72);
  color: #79e8ac;
  font-family: "Share Tech Mono", monospace;
  font-variant: normal;
  font-feature-settings: "smcp" 0, "c2sc" 0;
  font-size: 0.92rem;
  padding: 0.42rem 0.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.35rem;
  transition: box-shadow 150ms ease, border-color 150ms ease, background 150ms ease;
}

.option-card:hover {
  border-color: #66f2b3;
}

.option-card.active {
  border-color: #a7ffd2;
  background: linear-gradient(180deg, rgba(99, 255, 178, 0.24), rgba(14, 64, 39, 0.7));
  box-shadow: 0 0 0 1px rgba(167, 255, 210, 0.35), 0 0 14px rgba(99, 255, 178, 0.2);
}

.card-icon {
  font-size: 1.12rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.card-icon-svg {
  width: 22px;
  height: 22px;
}

.card-label {
  line-height: 1.05;
  text-align: center;
}

/* ── Checkbox panel ──────────────────────────────────────────────────────── */
.checkbox-panel {
  min-width: 0;
  background: rgba(2, 22, 14, 0.6);
  border: 1px solid #3a8f4b;
  box-shadow: inset 0 0 24px rgba(24, 82, 36, 0.3);
  padding: 0.85rem 1rem;
  height: 100%;
  overflow: auto;
}

.cbx-heading {
  font-family: "Share Tech Mono", monospace;
  font-variant: normal;
  font-feature-settings: "smcp" 0, "c2sc" 0;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0.03em;
  color: var(--line);
  margin: 0 0 0.62rem;
  text-shadow: 0 0 10px rgba(106, 248, 104, 0.45);
}

.cbx-section-title {
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #5df75d;
  border-bottom: 1px solid #225b3a;
  margin: 0.72rem 0 0.48rem;
  padding-bottom: 0.36rem;
}

.cbx-section-title:first-of-type {
  margin-top: 0;
}

.cbx-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem 0.85rem;
}

.cbx-item {
  display: flex;
  align-items: flex-start;
  gap: 0.48rem;
  cursor: pointer;
  padding: 0.05rem 0;
}

.cbx-item input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  border: 1px solid #63dca2;
  background: #061a0b;
  cursor: pointer;
  position: relative;
  transition: background 100ms;
}

.cbx-item input[type="checkbox"]:checked {
  background: #86f2bd;
}

.cbx-item input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  position: absolute;
  top: 1px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: 2px solid #061a0b;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.cbx-item input[type="checkbox"]:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.cbx-item span {
  font-family: "Share Tech Mono", monospace;
  font-variant: normal;
  font-feature-settings: "smcp" 0, "c2sc" 0;
  font-size: 0.82rem;
  line-height: 1.2;
}

.cbx-item span em {
  opacity: 0.7;
  font-style: normal;
  display: block;
  font-size: 0.72rem;
}

.mode-panel {
  min-width: 0;
  height: 100%;
  border: 1px dashed rgba(58, 143, 75, 0.45);
  background: rgba(2, 22, 14, 0.35);
  display: block;
  text-align: left;
  padding: 1.2rem;
  overflow: auto;
}

.right-pane-stage {
  position: relative;
  min-width: 0;
  height: var(--start-pane-height);
}

.right-pane-stage > .checkbox-panel,
.right-pane-stage > .mode-panel {
  position: absolute;
  inset: 0;
}

.mode-options-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
  align-items: end;
}

.mode-option-row {
  min-width: 0;
}

.mode-option-row.is-ghost,
.mode-option-action.is-ghost {
  visibility: hidden;
  pointer-events: none;
}

.mode-option-action {
  align-self: end;
}

#mode-legend {
  grid-column: 1 / -1;
}

.progress-dashboard {
  display: grid;
  gap: 0.32rem;
  min-height: 100%;
}

.progress-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.42rem 0.55rem;
  border: 1px solid rgba(96, 220, 158, 0.28);
  background:
    radial-gradient(circle at top left, rgba(106, 248, 168, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(11, 45, 28, 0.92), rgba(5, 24, 15, 0.92));
  box-shadow: inset 0 0 18px rgba(79, 184, 124, 0.08);
}

.progress-glyph {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(122, 240, 175, 0.4);
  display: grid;
  place-items: center;
  color: #8ef7c2;
  background: rgba(9, 38, 24, 0.8);
}

.progress-glyph svg {
  width: 17px;
  height: 17px;
}

.progress-hero-title {
  margin: 0;
  color: var(--line);
  font-family: "Share Tech Mono", monospace;
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-shadow: 0 0 10px rgba(106, 248, 104, 0.45);
}

.progress-hero-copy {
  margin: 0.12rem 0 0;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.15;
}

.progress-hero-badge {
  justify-self: end;
  padding: 0.2rem 0.34rem;
  border: 1px solid #2ea470;
  color: var(--line);
  background: rgba(8, 34, 21, 0.78);
  font-size: 0.82rem;
}

.progress-primary-grid,
.progress-secondary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.progress-card {
  padding: 0.28rem 0.36rem;
  border: 1px solid rgba(96, 220, 158, 0.26);
  background: linear-gradient(180deg, rgba(9, 37, 23, 0.92), rgba(4, 22, 13, 0.92));
  box-shadow: inset 0 0 16px rgba(79, 184, 124, 0.05);
}

.progress-card-wide {
  grid-column: span 2;
}

.progress-card-label {
  margin: 0;
  color: var(--progress-label-color);
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.progress-card-value {
  margin: 0.12rem 0 0;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1;
}

.progress-card-note {
  margin: 0.1rem 0 0;
  color: #6eb892;
  font-size: 0.56rem;
}

.progress-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0.55rem;
}

.progress-list {
  display: grid;
  gap: 0.14rem;
  margin-top: 0.12rem;
}

.progress-list-item {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  padding-bottom: 0.12rem;
  border-bottom: 1px solid rgba(60, 129, 91, 0.3);
}

.progress-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.progress-list-key {
  color: #c8ffc8;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.progress-list-value {
  color: var(--text);
  font-size: 0.82rem;
  text-align: right;
}

.progress-empty {
  padding: 0.32rem 0.4rem;
  border: 1px dashed rgba(96, 220, 158, 0.24);
  color: #79c79b;
  background: rgba(8, 30, 20, 0.72);
  font-size: 0.7rem;
  line-height: 1.3;
}

.hud {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  text-align: left;
}

.game-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.action-btn {
  border: 1px solid #ffd166;
  background: #2b1e04;
  color: #ffd166;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.92rem;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.18);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid #8eff8e;
  background: #07220e;
  color: var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(142, 255, 142, 0.15);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.hud-item {
  background: rgba(3, 22, 10, 0.9);
  border: 1px solid #2e6a39;
  padding: 0.42rem;
  min-height: 2.5rem;
}

.hud-item-lives {
  grid-column: 1 / -1;
}

.hud-item-speed {
  background:
    linear-gradient(
      180deg,
      hsl(var(--speed-hue, 120) 100% 66%) 0%,
      hsl(var(--speed-hue, 120) 100% 55%) 42%,
      hsl(var(--speed-hue, 120) 100% 40%) 100%
    );
  border-color: hsl(var(--speed-hue, 120) 100% 72%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 0 12px hsla(var(--speed-hue, 120) 100% 55% / 0.38);
}

.hud.speed-level-blink .hud-item-speed {
  animation: speed-level-blink 300ms ease-in-out 3;
}

@keyframes speed-level-blink {
  0%,
  100% {
    filter: brightness(1);
    transform: scale(1);
  }

  50% {
    filter: brightness(1.9);
    transform: scale(1.04);
  }
}

.life-track {
  margin-top: 0.35rem;
  width: 100%;
  height: 10px;
  border: 1px solid #2e6a39;
  background: rgba(4, 18, 8, 0.95);
  overflow: hidden;
}

.life-fill {
  height: 100%;
  background: linear-gradient(90deg, #7dff8d 0%, #3bd75c 70%, #1ea63f 100%);
  transition: width 120ms linear;
}

.hud-key {
  font-size: 0.68rem;
  opacity: 0.8;
}

.hud-value {
  font-size: 0.92rem;
  color: #9cff9c;
}

#game-canvas {
  width: 100%;
  height: auto;
  border: 2px solid #4dd14d;
  background: linear-gradient(180deg, #04150c 0%, #011006 100%);
  box-shadow: inset 0 0 0 2px #133b20, 0 0 22px rgba(43, 170, 69, 0.25);
}

#final-score,
#final-stats {
  font-size: 1.1rem;
}

@media (max-width: 1200px) {
  .title {
    font-size: clamp(1.85rem, 4.2vw, 3.1rem);
  }

  .subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
  }

  .start-layout {
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
    gap: 0.6rem;
  }

  .cbx-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkbox-panel {
    padding: 0.75rem 0.85rem;
  }

  .mode-options-panel {
    gap: 0.45rem;
  }

  .progress-primary-grid,
  .progress-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hud {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .game-actions {
    flex-wrap: wrap;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 760px) {
  .app {
    width: min(760px, 99vw);
    padding: 4px 6px 6px;
    min-height: 0;
  }

  .start-layout {
    grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
    gap: 0.4rem;
  }

  .right-pane-stage,
  .setup-panel,
  .checkbox-panel,
  .mode-panel {
    height: var(--start-pane-height);
  }

  .panel,
  .checkbox-panel,
  .mode-panel {
    padding: 0.55rem 0.6rem;
  }

  .group-label,
  label,
  .cbx-heading,
  .cbx-section-title {
    font-size: 0.86rem;
  }

  select,
  .btn {
    font-size: 0.88rem;
    padding: 0.36rem 0.5rem;
  }

  .option-card {
    min-height: 54px;
    font-size: 0.8rem;
    padding: 0.28rem 0.24rem;
  }

  .card-icon {
    font-size: 0.92rem;
    width: 20px;
    height: 20px;
  }

  .card-icon-svg {
    width: 18px;
    height: 18px;
  }

  .cbx-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.28rem 0.48rem;
  }

  .cbx-item span {
    font-size: 0.72rem;
  }

  .mode-options-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.32rem;
  }

  .progress-hero {
    grid-template-columns: 1fr;
  }

  .progress-hero-badge {
    justify-self: start;
  }

  .progress-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cbx-item span em {
    font-size: 0.64rem;
  }
}

@media (max-width: 640px) {
  .start-layout {
    grid-template-columns: 1fr;
    margin-top: 0.68rem;
    min-height: 0;
  }

  .right-pane-stage {
    position: relative;
    height: auto;
    min-height: var(--start-pane-height);
  }

  .right-pane-stage > .checkbox-panel,
  .right-pane-stage > .mode-panel {
    position: absolute;
    inset: 0;
  }

  .mode-cards,
  .cbx-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .option-card {
    min-height: 66px;
  }

  .title {
    font-size: clamp(1.75rem, 9.5vw, 2.8rem);
  }

  .subtitle,
  .cbx-item span,
  select,
  .btn,
  .group-label,
  label,
  .mode-panel-copy,
  .cbx-section-title,
  .cbx-heading {
    font-size: clamp(0.86rem, 3.2vw, 1rem);
  }

  .mode-options-panel {
    grid-template-columns: 1fr;
  }

  .progress-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* THEME DEFINITIONS */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Retro (DOS) - Default */
body.theme-retro {
  --bg-top: #06110c;
  --bg-bottom: #021607;
  --panel: rgba(6, 30, 14, 0.84);
  --scan: rgba(153, 255, 153, 0.08);
  --line: #6af868;
  --text: #c8ffc8;
  --accent: #ffd166;
  --danger: #ff5c5c;
  font-family: "VT323", monospace;
}

body.theme-retro #start-screen {
  background:
    radial-gradient(circle at 20% 10%, #123821 0%, transparent 34%),
    radial-gradient(circle at 80% 90%, #0f2f28 0%, transparent 28%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

/* Minecraft */
body.theme-minecraft {
  --bg-top: #1a1a1a;
  --bg-bottom: #0a0a0a;
  --panel: rgba(42, 32, 20, 0.88);
  --scan: rgba(139, 111, 71, 0.08);
  --line: #7fbf3f;
  --text: #c9d4a8;
  --accent: #ff9f43;
  --danger: #d32f2f;
  font-family: "Press Start 2P", cursive;
}

body.theme-minecraft #start-screen {
  background:
    repeating-linear-gradient(
      0deg,
      #5fa147 0px,
      #5fa147 16px,
      #7fbf3f 16px,
      #7fbf3f 32px
    ),
    repeating-linear-gradient(
      90deg,
      #8b6f47 0px,
      #8b6f47 16px,
      #a0804e 16px,
      #a0804e 32px
    ),
    linear-gradient(180deg, #87ceeb 0%, #1a1a1a 100%);
  background-size: 100% 100%, 32px, 100%;
  background-position: 0 0, 0 0, 0 0;
}

body.theme-minecraft .title,
body.theme-minecraft .cbx-heading {
  color: var(--line);
  text-shadow: 0 0 8px rgba(127, 191, 63, 0.6);
}

body.theme-minecraft .panel,
body.theme-minecraft .checkbox-panel {
  border-color: #8b6f47;
  box-shadow: 0 0 0 2px rgba(139, 111, 71, 0.25), inset 0 0 24px rgba(107, 68, 35, 0.35);
}

body.theme-minecraft select,
body.theme-minecraft .btn {
  border-color: #9a8b5f;
  background: #3d2e1f;
  color: var(--line);
  font-family: "Press Start 2P", cursive;
}

body.theme-minecraft .cbx-item input[type="checkbox"]:checked {
  background: #7fbf3f;
}

body.theme-minecraft .hud-item {
  background: rgba(42, 32, 20, 0.9);
  border-color: #6b4423;
}

body.theme-minecraft #game-canvas {
  border-color: #7fbf3f;
  background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
  box-shadow: inset 0 0 0 2px #4a7c47, 0 0 22px rgba(127, 191, 63, 0.2);
}

/* Super Mario */
body.theme-mario {
  --bg-top: #1a1a2e;
  --bg-bottom: #0f0f1e;
  --panel: rgba(30, 20, 40, 0.88);
  --scan: rgba(255, 100, 100, 0.06);
  --line: #ff6b6b;
  --text: #ffb3b3;
  --accent: #ffff00;
  --danger: #ff3333;
  font-family: "Fredoka One", sans-serif;
}

body.theme-mario #start-screen {
  background:
    radial-gradient(circle 300px at 20% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle 250px at 80% 40%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
    linear-gradient(180deg, #87ceeb 0%, #1a1a2e 60%, #0f0f1e 100%);
}

body.theme-mario .title,
body.theme-mario .cbx-heading {
  color: var(--line);
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.7), 2px 2px 0 #000;
}

body.theme-mario .panel,
body.theme-mario .checkbox-panel {
  border-color: #ff6b6b;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.25), inset 0 0 24px rgba(200, 50, 50, 0.3);
}

body.theme-mario select,
body.theme-mario .btn {
  border-color: #ff9999;
  background: #2a1a2a;
  color: var(--line);
  font-family: "Fredoka One", sans-serif;
}

body.theme-mario .cbx-item input[type="checkbox"]:checked {
  background: #ff6b6b;
}

body.theme-mario .hud-item {
  background: rgba(30, 20, 40, 0.9);
  border-color: #993333;
}

body.theme-mario #game-canvas {
  border-color: #ff6b6b;
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%);
  box-shadow: inset 0 0 0 2px #cc2222, 0 0 22px rgba(255, 107, 107, 0.2);
}

/* Aladdin */
body.theme-aladdin {
  --bg-top: #2d1f0f;
  --bg-bottom: #1a0f00;
  --panel: rgba(50, 35, 15, 0.88);
  --scan: rgba(255, 200, 100, 0.08);
  --line: #ffd700;
  --text: #ffe8a8;
  --accent: #ff9500;
  --danger: #ff4444;
  font-family: "Scheherazade New", serif;
}

body.theme-aladdin #start-screen {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(218, 165, 32, 0.1) 0px,
      rgba(218, 165, 32, 0.1) 3px,
      transparent 3px,
      transparent 6px
    ),
    radial-gradient(circle at 15% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 25%),
    radial-gradient(circle at 85% 15%, rgba(255, 215, 0, 0.08) 0%, transparent 30%),
    linear-gradient(180deg, #d4a574 0%, #8b4513 50%, #2d1f0f 100%);
}

body.theme-aladdin .title,
body.theme-aladdin .cbx-heading {
  color: var(--line);
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.5);
}

body.theme-aladdin .panel,
body.theme-aladdin .checkbox-panel {
  border-color: #d4a574;
  box-shadow: 0 0 0 2px rgba(212, 165, 116, 0.25), inset 0 0 24px rgba(139, 100, 50, 0.4);
}

body.theme-aladdin select,
body.theme-aladdin .btn {
  border-color: #e8a76d;
  background: #3d2a10;
  color: var(--line);
  font-family: "Scheherazade New", serif;
}

body.theme-aladdin .cbx-item input[type="checkbox"]:checked {
  background: #ffd700;
}

body.theme-aladdin .cbx-item input[type="checkbox"]:checked::after {
  border-color: #1a0f00;
}

body.theme-aladdin .hud-item {
  background: rgba(50, 35, 15, 0.9);
  border-color: #8b6434;
}

body.theme-aladdin #game-canvas {
  border-color: #ffd700;
  background: linear-gradient(180deg, #2d1f0f 0%, #1a0f00 100%);
  box-shadow: inset 0 0 0 2px #b8860b, 0 0 22px rgba(255, 215, 0, 0.25);
}

/* Lord of the Rings */
body.theme-lotr {
  --bg-top: #0f1f1a;
  --bg-bottom: #050d0a;
  --panel: rgba(10, 25, 20, 0.88);
  --scan: rgba(168, 230, 184, 0.06);
  --line: #7bd69d;
  --text: #a8e6b8;
  --accent: #c9e8d1;
  --danger: #d64545;
  font-family: "IM Fell English", serif;
}

body.theme-lotr #start-screen {
  background:
    radial-gradient(ellipse at 50% 120%, rgba(123, 214, 157, 0.15) 0%, transparent 35%),
    radial-gradient(circle at 25% 80%, rgba(60, 100, 80, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 75% 85%, rgba(60, 100, 80, 0.2) 0%, transparent 40%),
    linear-gradient(180deg, #0f1f1a 0%, #0a1a0f 50%, #050d0a 100%);
}

body.theme-lotr .title,
body.theme-lotr .cbx-heading {
  color: var(--line);
  text-shadow: 0 0 10px rgba(123, 214, 157, 0.8), 1px 1px 3px rgba(0, 0, 0, 0.7);
  font-family: "IM Fell English", serif;
}

body.theme-lotr .panel,
body.theme-lotr .checkbox-panel {
  border-color: #3a8f5f;
  box-shadow: 0 0 0 2px rgba(58, 143, 95, 0.25), inset 0 0 24px rgba(20, 60, 40, 0.4);
}

body.theme-lotr select,
body.theme-lotr .btn {
  border-color: #5fb88f;
  background: #0d1a14;
  color: var(--line);
  font-family: "IM Fell English", serif;
}

body.theme-lotr .cbx-item input[type="checkbox"]:checked {
  background: #7bd69d;
}

body.theme-lotr .cbx-item input[type="checkbox"]:checked::after {
  border-color: #050d0a;
}

body.theme-lotr .hud-item {
  background: rgba(10, 25, 20, 0.9);
  border-color: #2d6a4f;
}

body.theme-lotr #game-canvas {
  border-color: #7bd69d;
  background: linear-gradient(180deg, #0f1f1a 0%, #050d0a 100%);
  box-shadow: inset 0 0 0 2px #3d7d5d, 0 0 22px rgba(123, 214, 157, 0.2);
}
