:root {
  --ink: #1f2937;
  --paper: #f5f7fb;
  --panel: #ffffff;
  --line: #d8dee9;
  --blue: #2563eb;
  --green: #42a96b;
  --gold: #f6c445;
  --red: #e43d4f;
  --shadow: rgba(31, 41, 55, 0.12);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
.button-link {
  min-height: 44px;
  font-weight: 700;
  text-decoration: none;
}

.btn {
  border-radius: 10px;
  border-width: 1px;
  min-height: 44px;
  font-weight: 700;
}

.button-link.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.btn-outline-primary {
  color: var(--blue);
  border-color: var(--blue);
  background: #fff;
}

.btn-outline-secondary,
.btn-outline-danger {
  background: #fff;
}

.btn-outline-danger {
  color: #b42318;
  border-color: #f3b0aa;
}

button:hover,
button:focus-visible,
.button-link:hover,
.button-link:focus-visible {
  outline: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 12px clamp(16px, 4vw, 46px);
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(31, 41, 55, 0.05);
}

.brand {
  font-weight: 900;
  text-decoration: none;
  color: var(--blue);
}

.main-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
}

.main-nav a {
  text-decoration: none;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  color: #4b5563;
}

.main-nav a.is-active {
  color: var(--blue);
  background: #e8f0ff;
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(16px, 4vw, 38px) 42px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  max-width: 860px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  font-weight: 900;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.9rem);
  line-height: 1.15;
}

.lead {
  max-width: 760px;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.45;
  color: #4b5563;
}

.panel,
.home-card,
.slide,
.editor-panel,
.mini-game,
.art-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 28px var(--shadow);
}

.panel {
  padding: clamp(16px, 2.5vw, 24px);
}

.home-actions {
  align-items: stretch;
}

.home-card {
  min-height: 250px;
  padding: clamp(20px, 3vw, 30px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--ink);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.home-card:hover,
.home-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.15);
}

.home-card strong {
  display: block;
  font-size: clamp(2rem, 3.5vw, 3.4rem);
  line-height: 1;
}

.card-kicker {
  font-weight: 900;
  color: var(--blue);
}

.slide-shell {
  display: grid;
  gap: 14px;
}

.slide-progress {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.slide-dot {
  border: 0;
  background: #dbe3f0;
  min-height: 8px;
  box-shadow: none;
  padding: 0;
  border-radius: 999px;
}

.slide-dot.is-active {
  background: var(--gold);
}

.slide {
  min-height: 500px;
  padding: clamp(20px, 3vw, 34px);
  display: none;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.95fr);
  gap: 26px;
  align-items: center;
}

.slide.is-active {
  display: grid;
}

.slide-controls {
  display: flex;
  justify-content: space-between;
}

.checklist-panel li {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.reveal-button {
  margin-top: 18px;
}

.reveal-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--gold);
  border-radius: 8px;
  background: #fffdf4;
}

.reveal-box p {
  margin: 6px 0 0;
}

.final-reveal {
  display: grid;
  gap: 10px;
}

.game-card-grid,
.type-grid,
.need-grid {
  display: grid;
  gap: 14px;
}

.game-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-carousel {
  position: relative;
  min-height: 330px;
}

.carousel-frame {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.carousel-frame.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.game-carousel .game-card {
  height: 100%;
}

.game-carousel .game-shot {
  height: 250px;
}

.game-carousel .game-card strong {
  font-size: 1.35rem;
}

.old-games {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.game-card,
.type-card,
.need-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.need-grid > div {
  display: grid;
  gap: 8px;
}

.game-card {
  display: grid;
  gap: 8px;
}

.game-card p,
.type-card span,
.need-grid span {
  margin: 0;
  color: #4b5563;
}

.game-shot {
  position: relative;
  height: 118px;
  overflow: hidden;
  border-radius: 6px;
  background: #111827;
}

.game-shot-image {
  background: #0f172a;
}

.game-shot-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-shot span,
.game-shot i {
  position: absolute;
  display: block;
}

.roblox .game-shot {
  background: linear-gradient(#172033 0 56%, #234f31 56%);
}

.roblox .game-shot span {
  left: 16px;
  top: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #d9dde7;
  color: #111827;
  font-weight: 900;
}

.roblox .game-shot i {
  right: 20px;
  bottom: 18px;
  width: 34px;
  height: 52px;
  background: #f59e0b;
  box-shadow: -44px 6px 0 #ef4444;
}

.minecraft .game-shot {
  background:
    linear-gradient(90deg, #5b3a22 0 25%, #6b4427 25% 50%, #5b3a22 50% 75%, #6b4427 75%) 0 72px / 48px 46px,
    linear-gradient(#89c5ff 0 58%, #4b9a35 58%);
}

.minecraft .game-shot span {
  left: 34px;
  top: 42px;
  width: 42px;
  height: 42px;
  background: #4b9a35;
  box-shadow: 42px 0 0 #6b4427, 84px 0 0 #4b9a35;
}

.fifa .game-shot {
  background: linear-gradient(#2f8f42, #1f6b30);
}

.fifa .game-shot span {
  inset: 18px;
  border: 3px solid rgba(255, 255, 255, 0.72);
}

.fifa .game-shot i {
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.pacman .game-shot {
  background: #050816;
}

.pacman .game-shot span {
  left: 32px;
  top: 42px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0 82%, transparent 82%);
}

.pacman .game-shot i {
  right: 38px;
  top: 48px;
  width: 22px;
  height: 28px;
  border-radius: 12px 12px 4px 4px;
  background: #ef4444;
  box-shadow: -34px 0 0 #60a5fa, -68px 0 0 #f472b6;
}

.tetris .game-shot {
  background: #111827;
}

.tetris .game-shot span {
  left: 44px;
  top: 28px;
  width: 22px;
  height: 22px;
  background: #22c55e;
  box-shadow:
    22px 0 0 #22c55e,
    44px 0 0 #facc15,
    44px 22px 0 #facc15,
    66px 22px 0 #ef4444,
    88px 22px 0 #ef4444,
    88px 44px 0 #60a5fa;
}

.breakout .game-shot {
  background: #121a2d;
}

.breakout .game-shot span {
  left: 18px;
  top: 16px;
  width: 32px;
  height: 14px;
  background: #ef4444;
  box-shadow:
    38px 0 0 #f97316,
    76px 0 0 #facc15,
    114px 0 0 #22c55e,
    152px 0 0 #60a5fa,
    52px 68px 0 70px transparent;
}

.breakout .game-shot i {
  left: 44%;
  bottom: 18px;
  width: 72px;
  height: 10px;
  background: #fff;
}

.marioland .game-shot {
  background: linear-gradient(#bde7ff 0 62%, #7dbb4b 62%);
}

.marioland .game-shot span {
  left: 42px;
  bottom: 36px;
  width: 26px;
  height: 34px;
  background: #ef4444;
  box-shadow: 84px 16px 0 #8b5f3c, 112px -6px 0 #8b5f3c;
}

.sokoban .game-shot {
  background: #e5e7eb;
}

.sokoban .game-shot span {
  left: 28px;
  top: 28px;
  width: 28px;
  height: 28px;
  background: #8b5f3c;
  box-shadow:
    34px 0 0 #8b5f3c,
    68px 0 0 #8b5f3c,
    34px 34px 0 #facc15,
    68px 68px 0 #2563eb;
}

.type-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.type-card {
  display: grid;
  gap: 8px;
}

.type-visual {
  height: 130px;
  border-radius: 6px;
  background: #111827;
}

.type-3d .type-visual {
  background:
    linear-gradient(135deg, transparent 44%, rgba(255, 255, 255, 0.26) 45% 47%, transparent 48%),
    linear-gradient(#8fd3ff 0 52%, #6bc674 52%);
}

.type-2d .type-visual {
  background:
    linear-gradient(#8fd3ff 0 65%, #6bc674 65%);
  position: relative;
}

.type-2d .type-visual::before {
  content: "";
  position: absolute;
  left: 32px;
  bottom: 36px;
  width: 30px;
  height: 38px;
  background: var(--blue);
  box-shadow: 90px 12px 0 #8b5f3c;
}

.type-puzzle .type-visual {
  background:
    linear-gradient(90deg, #2563eb 0 25%, transparent 25% 50%, #facc15 50% 75%, transparent 75%) 0 0 / 64px 64px,
    #111827;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.choice-card {
  min-height: 300px;
}

.choice-card .mini-game {
  height: 220px;
}

.choice-shot {
  height: 220px;
}

.choice-card strong {
  font-size: 1.35rem;
}

.need-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.job-builder {
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.job-form {
  display: grid;
  gap: 12px;
}

.job-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.job-list {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
  min-height: 210px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.job-list li {
  padding: 10px 14px;
  border: 1px solid #bfd0f5;
  border-radius: 8px;
  background: #eef4ff;
  color: #183b82;
  font-size: 1.08rem;
  font-weight: 900;
}

.game-examples {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.mini-game {
  position: relative;
  height: 148px;
  overflow: hidden;
  background: #121a2d;
  border: 0;
  box-shadow: none;
}

.mini-game span {
  position: absolute;
  left: 12px;
  top: 10px;
  z-index: 2;
  color: #fff;
  font-weight: 900;
}

.space {
  background: radial-gradient(circle at 70% 30%, #fff 0 2px, transparent 3px), #11172b;
}

.ship-icon {
  position: absolute;
  left: 38px;
  bottom: 28px;
  width: 0;
  height: 0;
  border-left: 24px solid transparent;
  border-right: 24px solid transparent;
  border-bottom: 58px solid #8fd3ff;
}

.laser-icon {
  position: absolute;
  left: 59px;
  top: 45px;
  width: 6px;
  height: 58px;
  background: var(--gold);
}

.enemy-icon {
  position: absolute;
  width: 32px;
  height: 32px;
  background: var(--red);
}

.enemy-icon.one {
  right: 60px;
  top: 38px;
}

.enemy-icon.two {
  right: 110px;
  bottom: 24px;
  background: var(--green);
}

.platform {
  background: linear-gradient(#8fd3ff 0 65%, #6bc674 65%);
}

.platform-hero,
.platform-block,
.coin-icon,
.maze-player,
.maze-food,
.maze-wall {
  position: absolute;
}

.platform-hero {
  left: 42px;
  bottom: 56px;
  width: 30px;
  height: 42px;
  background: var(--blue);
}

.platform-block {
  width: 54px;
  height: 24px;
  background: #8b5f3c;
}

.platform-block.a {
  left: 120px;
  bottom: 76px;
}

.platform-block.b {
  right: 42px;
  top: 60px;
}

.coin-icon {
  left: 190px;
  top: 48px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
}

.maze {
  background: #102034;
}

.maze-wall {
  background: var(--blue);
}

.maze-wall.a {
  left: 32px;
  top: 42px;
  width: 200px;
  height: 16px;
}

.maze-wall.b {
  left: 32px;
  top: 42px;
  width: 16px;
  height: 86px;
}

.maze-wall.c {
  right: 42px;
  top: 74px;
  width: 16px;
  height: 70px;
}

.maze-player {
  left: 68px;
  bottom: 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
}

.maze-food {
  right: 94px;
  top: 74px;
  width: 14px;
  height: 14px;
  background: #fff;
}

.pixel-examples {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 24px;
  justify-content: center;
}

.example-sprite {
  --cell: 9px;
  --cols: 16;
  --rows: 16;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  grid-template-rows: repeat(var(--rows), var(--cell));
  width: max-content;
  height: max-content;
  align-self: center;
  justify-self: center;
  image-rendering: pixelated;
  filter: drop-shadow(5px 6px 0 rgba(21, 24, 33, 0.22));
}

.example-sprite.ship-demo {
  --cell: 7px;
}

.sprite-cell {
  width: var(--cell);
  height: var(--cell);
}

.juice-demo {
  display: grid;
  gap: 12px;
}

.juice-slide {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.juice-slide-text {
  max-width: 900px;
}

.juice-slide .juice-demo {
  width: 100%;
}

.juice-levels {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.space-stage {
  position: relative;
  height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #071426;
}

.juice-slide .space-stage {
  height: min(48vh, 430px);
  min-height: 330px;
}

.space-stage.juice-level-2,
.space-stage.juice-level-3,
.space-stage.juice-level-4,
.space-stage.juice-level-5,
.space-stage.juice-level-6,
.space-stage.juice-level-7 {
  background: linear-gradient(135deg, #1d4f8f 0%, #0b2446 46%, #020712 100%);
}

.star-layer {
  position: absolute;
  inset: -320px 0 0;
  display: none;
  background:
    radial-gradient(circle at 17% 18%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 54% 62%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 88% 31%, #fff 0 1px, transparent 1.5px);
  background-size: 220px 220px;
  animation: stars-scroll 4200ms linear infinite;
  opacity: 0.92;
  z-index: 1;
}

.star-layer-mid {
  background:
    radial-gradient(circle at 22% 45%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 71% 17%, #fff 0 1px, transparent 1.5px);
  background-size: 170px 170px;
  opacity: 0.72;
}

.star-layer-fast {
  background:
    radial-gradient(circle at 36% 24%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 79% 72%, #fff 0 1px, transparent 1.5px);
  background-size: 130px 130px;
  opacity: 0.6;
}

.star-field {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  z-index: 1;
}

.star-dot {
  --fall: 4200ms;
  --blink: 1600ms;
  --delay: 0ms;
  --x: 50%;
  --jitter-a: 0px;
  --jitter-b: 0px;
  --jitter-c: 0px;
  position: absolute;
  top: -12px;
  left: var(--x);
  width: 1px;
  height: 1px;
  background: #fff;
  animation:
    star-fall var(--fall) linear var(--delay) infinite,
    star-glint var(--blink) ease-in-out calc(var(--delay) * -0.35) infinite;
}

.star-dot:nth-child(1) { --x: 8%; --fall: 6400ms; --blink: 1500ms; --delay: -1300ms; --jitter-a: 4px; --jitter-b: -3px; --jitter-c: 2px; }
.star-dot:nth-child(2) { --x: 18%; --fall: 3900ms; --blink: 2100ms; --delay: -2900ms; --jitter-a: -5px; --jitter-b: 2px; --jitter-c: -1px; }
.star-dot:nth-child(3) { --x: 27%; --fall: 5100ms; --blink: 1250ms; --delay: -700ms; --jitter-a: 3px; --jitter-b: 6px; --jitter-c: -4px; }
.star-dot:nth-child(4) { --x: 36%; --fall: 7300ms; --blink: 2600ms; --delay: -4200ms; --jitter-a: -2px; --jitter-b: -6px; --jitter-c: 3px; }
.star-dot:nth-child(5) { --x: 44%; --fall: 3300ms; --blink: 1750ms; --delay: -1800ms; --jitter-a: 5px; --jitter-b: -2px; --jitter-c: 5px; }
.star-dot:nth-child(6) { --x: 53%; --fall: 5800ms; --blink: 3100ms; --delay: -5100ms; --jitter-a: -6px; --jitter-b: 4px; --jitter-c: -3px; }
.star-dot:nth-child(7) { --x: 61%; --fall: 4500ms; --blink: 1400ms; --delay: -2500ms; --jitter-a: 2px; --jitter-b: -5px; --jitter-c: 6px; }
.star-dot:nth-child(8) { --x: 69%; --fall: 6900ms; --blink: 2300ms; --delay: -800ms; --jitter-a: -4px; --jitter-b: 1px; --jitter-c: -6px; }
.star-dot:nth-child(9) { --x: 76%; --fall: 3600ms; --blink: 1900ms; --delay: -3400ms; --jitter-a: 6px; --jitter-b: 3px; --jitter-c: -2px; }
.star-dot:nth-child(10) { --x: 84%; --fall: 5400ms; --blink: 1150ms; --delay: -1500ms; --jitter-a: -3px; --jitter-b: -1px; --jitter-c: 4px; }
.star-dot:nth-child(11) { --x: 91%; --fall: 7900ms; --blink: 2750ms; --delay: -6100ms; --jitter-a: 1px; --jitter-b: -7px; --jitter-c: 2px; }
.star-dot:nth-child(12) { --x: 96%; --fall: 4200ms; --blink: 1650ms; --delay: -2200ms; --jitter-a: -5px; --jitter-b: 5px; --jitter-c: -1px; }

.star-dot:nth-child(3),
.star-dot:nth-child(7),
.star-dot:nth-child(11) {
  animation: star-fall var(--fall) linear var(--delay) infinite;
  opacity: 0.78;
}

.demo-ship {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.earth-demo {
  --cell: 5px;
  position: absolute;
  display: none;
  left: 0;
  top: 0;
  z-index: 2;
  opacity: 0.72;
  transform: translate(280px, -120px) scale(1.8);
}

.demo-flame {
  position: absolute;
  left: 28px;
  top: 109px;
  display: none;
}

.demo-flame.example-sprite {
  --cell: 7px;
}

.space-stage.juice-level-1 .flame-small,
.space-stage.juice-level-2 .flame-small {
  display: grid;
}

.space-stage.juice-level-3 .flame-small,
.space-stage.juice-level-4 .flame-small,
.space-stage.juice-level-5 .flame-small,
.space-stage.juice-level-6 .flame-small,
.space-stage.juice-level-7 .flame-small {
  display: grid;
  animation: flame-small-toggle 200ms steps(1) infinite;
}

.space-stage.juice-level-3 .flame-big,
.space-stage.juice-level-4 .flame-big,
.space-stage.juice-level-5 .flame-big,
.space-stage.juice-level-6 .flame-big,
.space-stage.juice-level-7 .flame-big {
  display: grid;
  animation: flame-big-toggle 200ms steps(1) infinite;
}

.space-stage.juice-level-4 .star-layer-slow {
  display: block;
}

.space-stage.juice-level-5 .star-field,
.space-stage.juice-level-6 .star-field,
.space-stage.juice-level-7 .star-field {
  display: block;
}

.space-stage.juice-level-6 .earth-demo,
.space-stage.juice-level-7 .earth-demo {
  display: grid;
  animation: earth-pass 14500ms linear infinite;
}

.space-stage.juice-level-7 .flame-small {
  animation: flame-small-toggle 100ms steps(1) infinite;
}

.space-stage.juice-level-7 .flame-big {
  animation: flame-big-toggle 100ms steps(1) infinite;
}

.space-stage.juice-level-7 .demo-ship {
  animation: ship-launch 2400ms cubic-bezier(0.3, 0, 0.2, 1) forwards;
}

.student-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  align-items: start;
}

.student-sidebar {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: #374151;
}

input,
select {
  width: 100%;
  border-color: var(--line);
}

.saved-list {
  display: grid;
  gap: 10px;
}

.saved-item {
  display: grid;
  grid-template-columns: 1fr 38px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  text-align: left;
  min-height: auto;
  box-shadow: none;
}

.saved-item.is-active {
  background: #fff7d6;
  border-color: var(--gold);
}

.saved-load-button {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.delete-art-button {
  color: #b42318;
}

.delete-art-button:hover {
  border-color: #f3b0aa;
  background: #fff5f4;
}

.delete-art-button svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.thumb {
  display: grid;
  grid-template-columns: repeat(16, 3px);
  grid-template-rows: repeat(16, 3px);
  border: 2px solid var(--line);
  background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 8px 8px;
}

.thumb span {
  width: 3px;
  height: 3px;
}

.editor-panel {
  padding: clamp(16px, 2.5vw, 24px);
}

.editor-header {
  display: grid;
  gap: 22px;
}

.title-field {
  display: grid;
  gap: 10px;
  max-width: 460px;
}

.editor-workspace {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 14px;
  align-items: start;
  margin-top: 18px;
}

.canvas-column {
  display: grid;
  gap: 10px;
}

.canvas-wrap {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  justify-content: center;
}

.pixel-grid {
  --pixel-size: clamp(22px, 2.3vw, 28px);
  box-sizing: border-box;
  display: grid;
  width: max-content;
  grid-template-columns: repeat(16, var(--pixel-size));
  grid-template-rows: repeat(16, var(--pixel-size));
  border: 2px solid #111827;
  background: repeating-conic-gradient(#dedede 0 25%, #fff 0 50%) 0 0 / 18px 18px;
}

.pixel-button {
  box-sizing: border-box;
  width: var(--pixel-size);
  height: var(--pixel-size);
  border: 1px solid rgba(38, 50, 71, 0.22);
  box-shadow: none;
  padding: 0;
  min-height: 0;
  border-radius: 0;
}

.tools-panel {
  padding: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}

.current-color {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}

#currentColorSwatch {
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: transparent;
}

.palette {
  display: grid;
  grid-template-columns: repeat(4, 28px);
  grid-template-rows: repeat(8, 28px);
  gap: 6px;
  width: max-content;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.color-button {
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(38, 50, 71, 0.32);
  border-radius: 4px;
  box-shadow: none;
}

.color-button.is-active {
  border-color: #000;
  outline: 3px solid var(--gold);
}

.tool-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.student-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.student-tab-panel {
  display: none;
}

.student-tab-panel.is-active {
  display: block;
}

.admin-tabs {
  margin-bottom: 18px;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.is-active {
  display: block;
}

.save-status {
  grid-column: 1 / -1;
  min-height: 24px;
  font-weight: 800;
}

.level-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.level-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.level-editor {
  display: grid;
  gap: 14px;
}

.level-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.level-tile-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  box-shadow: none;
}

.level-tile-preview {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(38, 50, 71, 0.32);
  border-radius: 4px;
  image-rendering: pixelated;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.level-tile-button.is-active {
  border-color: var(--blue);
  outline: 3px solid rgba(47, 111, 219, 0.22);
}

.level-name-field {
  max-width: 320px;
}

.level-grid-wrap {
  width: 100%;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.level-grid {
  --level-cell: 24px;
  display: grid;
  grid-template-columns: repeat(128, var(--level-cell));
  grid-template-rows: repeat(16, var(--level-cell));
  width: max-content;
  border: 2px solid #111827;
  background: repeating-conic-gradient(#dedede 0 25%, #fff 0 50%) 0 0 / 18px 18px;
}

.level-cell {
  width: var(--level-cell);
  height: var(--level-cell);
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(38, 50, 71, 0.22);
  border-radius: 0;
  box-shadow: none;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  image-rendering: pixelated;
}

.level-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.level-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.level-card h3 {
  margin: 0;
  font-size: 18px;
}

.level-card p {
  margin: 0;
}

.level-preview-mini {
  display: grid;
  grid-template-columns: repeat(128, 1fr);
  grid-template-rows: repeat(16, 1fr);
  width: 100%;
  aspect-ratio: 8 / 1;
  overflow: hidden;
  border: 2px solid #111827;
  background: #071426;
}

.level-preview-mini span {
  min-width: 0;
  min-height: 0;
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}

.admin-levels {
  margin-top: 22px;
  padding: 18px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 24px;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.admin-editor {
  display: grid;
  gap: 16px;
  padding: 18px;
  margin-bottom: 20px;
}

.admin-editor[hidden] {
  display: none;
}

.admin-editor-header,
.admin-edit-fields,
.admin-editor-workspace {
  display: grid;
  gap: 14px;
}

.admin-editor-header {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.admin-edit-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-editor-workspace {
  grid-template-columns: max-content max-content;
  align-items: start;
}

.admin-pixel-grid {
  --pixel-size: 22px;
}

.art-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.art-preview {
  display: grid;
  grid-template-columns: repeat(16, 10px);
  grid-template-rows: repeat(16, 10px);
  width: max-content;
  border: 3px solid var(--line);
  background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 18px 18px;
  margin-bottom: 12px;
}

.art-preview span {
  width: 10px;
  height: 10px;
}

.admin-edit-button {
  justify-self: start;
}

.password-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.password-backdrop[hidden] {
  display: none;
}

.password-dialog {
  width: min(360px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.password-dialog h2 {
  margin-bottom: 14px;
}

.password-error {
  min-height: 22px;
  margin: 8px 0 12px;
  color: #b42318;
  font-weight: 800;
}

.password-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@keyframes stars-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(320px); }
}

@keyframes star-fall {
  0% { transform: translate(0, -24px); }
  27% { transform: translate(var(--jitter-a), 92px); }
  58% { transform: translate(var(--jitter-b), 206px); }
  100% { transform: translate(var(--jitter-c), 356px); }
}

@keyframes star-glint {
  0%, 100% { opacity: 0.88; }
  31% { opacity: 0.22; }
  57% { opacity: 1; }
  78% { opacity: 0.48; }
}

@keyframes stars-drift-slow {
  0% { transform: translate(0, 0); }
  28% { transform: translate(2px, 95px); }
  63% { transform: translate(-1px, 215px); }
  100% { transform: translate(1px, 320px); }
}

@keyframes stars-drift-mid {
  0% { transform: translate(0, 0); }
  34% { transform: translate(-3px, 150px); }
  68% { transform: translate(2px, 300px); }
  100% { transform: translate(-1px, 420px); }
}

@keyframes stars-drift-fast {
  0% { transform: translate(0, 0); }
  24% { transform: translate(3px, 155px); }
  58% { transform: translate(-2px, 330px); }
  100% { transform: translate(2px, 540px); }
}

@keyframes stars-twinkle-soft {
  0%, 100% { opacity: 0.86; }
  45% { opacity: 0.58; }
  74% { opacity: 0.95; }
}

@keyframes stars-twinkle-mid {
  0%, 100% { opacity: 0.62; }
  38% { opacity: 0.88; }
  70% { opacity: 0.45; }
}

@keyframes stars-twinkle-fast {
  0%, 100% { opacity: 0.48; }
  31% { opacity: 0.82; }
  66% { opacity: 0.36; }
}

@keyframes earth-pass {
  from { transform: translate(430px, -185px) scale(1.8); }
  to { transform: translate(-190px, 370px) scale(1.8); }
}

@keyframes ship-launch {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -135%) scale(0.95);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -280%) scale(0.82);
  }
}

@keyframes flame-small-toggle {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes flame-big-toggle {
  0%, 49% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

@media (max-width: 900px) {
  .home-actions,
  .slide.is-active,
  .student-layout,
  .editor-header,
  .editor-workspace,
  .admin-editor-header,
  .admin-edit-fields,
  .admin-editor-workspace {
    grid-template-columns: 1fr;
  }

  .slide-progress {
    grid-template-columns: repeat(6, 1fr);
  }

  .game-card-grid,
  .old-games,
  .type-grid,
  .need-grid,
  .choice-grid {
    grid-template-columns: 1fr;
  }

  .game-carousel {
    min-height: 260px;
  }

  .game-carousel .game-shot,
  .choice-card .mini-game {
    height: 190px;
  }

  .palette {
    grid-template-columns: repeat(4, 24px);
    grid-template-rows: repeat(8, 24px);
  }

  .color-button {
    width: 24px;
    height: 24px;
  }
}
