@import url("https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Space+Grotesk:wght@500;700&display=swap");

:root {
  color-scheme: only light;
  --bg: #fef6e4;
  --bg-alt: #f4ddc3;
  --ink: #2b2b2b;
  --accent: #ff6b4a;
  --accent-dark: #e24b2a;
  --mint: #4cc9a6;
  --sky: #84b6f4;
  --sun: #ffcc4d;
  --barrier: #324b7c;
  --panel: #fffdf8;
  --shadow: 0 16px 40px rgba(41, 30, 12, 0.15);
  --radius: 22px;
}

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

body {
  font-family: "Fredoka", "Trebuchet MS", sans-serif;
  background: radial-gradient(circle at top, #fff0d2 0%, #f7e1c7 48%, #f3d3ae 100%);
  color: var(--ink);
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  display: grid;
  gap: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(120deg, #fff7e7 0%, #ffe2b6 60%, #ffd49c 100%);
  padding: 24px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: floatIn 700ms ease-out both;
}

.eyebrow {
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--barrier);
  font-size: 0.75rem;
}

.hero h1 {
  font-family: "Space Grotesk", "Verdana", sans-serif;
  font-size: clamp(2rem, 2.5vw, 2.75rem);
  margin-top: 6px;
}

.lead {
  margin-top: 8px;
  max-width: 480px;
  line-height: 1.4;
}

.badge {
  background: var(--sun);
  color: #5a3b00;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 18px rgba(93, 66, 2, 0.2);
  transform: rotate(-4deg);
}

.board {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 24px;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 18px;
  box-shadow: var(--shadow);
  animation: popIn 700ms 100ms ease-out both;
}

.panel-block h2 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.panel-block ol,
.panel-block ul {
  padding-left: 18px;
  line-height: 1.5;
}

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

.level-buttons button {
  border: none;
  background: #eaf1ff;
  color: #1b3568;
  padding: 10px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.level-buttons button.active {
  background: #cfe0ff;
  box-shadow: inset 0 0 0 2px #5873d8;
}

.level-buttons button:hover {
  transform: translateY(-2px);
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

button {
  border: none;
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  background: #fff1de;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(40, 30, 10, 0.12);
}

button.primary {
  background: var(--accent);
  color: white;
}

.status {
  margin-top: 10px;
  background: #fff4f1;
  padding: 10px 12px;
  border-radius: 12px;
  color: #8b2e17;
}

.ideas ul {
  list-style: "✦ ";
}

.canvas-wrap {
  display: grid;
  gap: 12px;
  animation: popIn 700ms 200ms ease-out both;
}

canvas {
  width: 100%;
  height: 540px;
  background: linear-gradient(160deg, #fefefe 0%, #f7f2ea 65%, #f1ece2 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  touch-action: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  font-size: 0.9rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  display: inline-block;
}

.swatch.car {
  background: var(--accent);
}

.swatch.parking {
  background: var(--mint);
}

.swatch.barrier {
  background: var(--barrier);
}

.swatch.path {
  background: #5c86ff;
}

@keyframes floatIn {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes popIn {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .board {
    grid-template-columns: 1fr;
  }

  canvas {
    height: 480px;
  }
}

@media (max-width: 640px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .level-buttons {
    grid-template-columns: 1fr 1fr 1fr;
  }

  canvas {
    height: 420px;
  }
}
