:root {
  --bg-top: #f6efe3;
  --bg-bottom: #f3d8ac;
  --panel: rgba(255, 250, 240, 0.82);
  --panel-border: rgba(143, 90, 45, 0.18);
  --ink: #4f301a;
  --muted: #7d5c43;
  --accent: #cb5b2d;
  --accent-soft: #f3b46d;
  --glow: #f7d985;
  --shadow: 0 20px 45px rgba(106, 61, 28, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 26%),
    radial-gradient(circle at bottom right, rgba(255, 218, 159, 0.65), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 44px;
}

.hero,
.playground {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  padding: 28px;
  align-items: center;
}

.hero-copy h1,
.section-heading h2,
.solution-note h3 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  line-height: 0.95;
}

.hero-copy h1 {
  font-size: clamp(2.4rem, 4vw, 4.5rem);
  max-width: 10ch;
}

.intro,
.status-text,
.solution-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.intro {
  max-width: 55ch;
  margin-top: 14px;
  font-size: 1.05rem;
}

.eyebrow {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--accent);
}

.hero-card,
.board-wrap {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 245, 229, 0.95));
  border-radius: 24px;
  border: 1px solid rgba(165, 111, 56, 0.16);
  overflow: hidden;
}

.two-up {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
}

.practice-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: stretch;
}

.practice-box {
  background: rgba(238, 226, 231, 0.82);
  border: 6px dashed rgba(128, 44, 36, 0.86);
  border-radius: 18px;
  padding: 16px;
  min-height: 260px;
}

.practice-title {
  text-align: center;
  font-family: "Baloo 2", cursive;
  font-size: 1.6rem;
  color: #6c3920;
  margin-bottom: 4px;
}

.practice-placeholder {
  font-family: "Baloo 2", cursive;
  font-size: 1.25rem;
  fill: rgba(125, 92, 67, 0.6);
}

#five-target-layer {
  transition: opacity 220ms ease;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 0;
  font-weight: 800;
}

.tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(251, 217, 135, 0.38);
  color: #8b5729;
  font-size: 0.85rem;
}

.match-scene {
  width: 100%;
  height: auto;
  display: block;
}

.playground {
  margin-top: 28px;
  padding: 28px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.status-text {
  max-width: 28ch;
  font-weight: 700;
}

.board {
  min-height: 300px;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.tap-hint {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  color: #fffaf5;
  background: linear-gradient(180deg, #c56233, #a34b21);
  box-shadow: 0 12px 25px rgba(163, 75, 33, 0.24);
}

button.secondary {
  background: linear-gradient(180deg, #f0d28f, #dbaf57);
  color: #603b16;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

.solution-note {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 248, 233, 0.9);
  border: 1px solid rgba(192, 147, 71, 0.24);
}

.solution-note h3 {
  font-size: 1.7rem;
  margin-bottom: 4px;
}

.shadow-line {
  opacity: 0.18;
  stroke: #6a421f;
}

.target-slot {
  fill: none;
  stroke: rgba(240, 181, 98, 0.9);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 10 12;
  filter: drop-shadow(0 0 12px rgba(251, 213, 126, 0.7));
  cursor: pointer;
  transition: stroke 180ms ease, opacity 180ms ease;
}

.target-number {
  font-family: "Baloo 2", cursive;
  font-size: 1.35rem;
  fill: #b45a2d;
  pointer-events: none;
}

.target-ring {
  fill: rgba(255, 246, 220, 0.9);
  stroke: rgba(223, 161, 73, 0.9);
  stroke-width: 3;
  pointer-events: none;
}

.move-arrow {
  fill: none;
  stroke: rgba(230, 158, 63, 0.9);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 9 10;
  opacity: 0.9;
  pointer-events: none;
}

.match.highlight .wood {
  filter: drop-shadow(0 0 8px rgba(255, 205, 98, 0.95));
}

.match {
  cursor: default;
  transform-origin: center;
  transition: transform 280ms ease, opacity 320ms ease;
}

.match.movable {
  cursor: pointer;
}

.match.highlight:hover .wood,
.match.highlight.active .wood {
  filter: drop-shadow(0 0 14px rgba(255, 213, 90, 1));
}

.match.removable {
  cursor: pointer;
}

.match.removed {
  opacity: 0.09;
  pointer-events: none;
}

.match.removed .wood,
.match.removed .shadow-line,
.match.removed .tip-left,
.match.removed .tip-right {
  opacity: 0.15;
}

.target-slot.filled {
  opacity: 0.18;
}

.board.solved .move-arrow,
.board.solved .target-number,
.board.solved .target-ring {
  opacity: 0;
}

.solved-illustration {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 420ms ease, transform 420ms ease;
}

.face-fill {
  stroke-width: 2;
}

.face-label {
  font-family: "Baloo 2", cursive;
  font-size: 1.05rem;
  fill: #72421f;
}

.face-label.hidden {
  fill: #9a6a44;
}

.solved-illustration.visible {
  opacity: 1;
  transform: translateY(0);
}

.board.solved .flat-layout {
  opacity: 0.12;
}

.board.solved .target-slot {
  opacity: 0;
}

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

  .section-heading {
    flex-direction: column;
    align-items: start;
  }

  .status-text {
    max-width: unset;
  }

  .two-up {
    grid-template-columns: 1fr;
  }

  .practice-layout {
    grid-template-columns: 1fr;
  }
}
