:root {
  --bg-top: #f6c26b;
  --bg-bottom: #f18f6b;
  --panel: rgba(255, 248, 239, 0.88);
  --panel-border: rgba(110, 64, 37, 0.15);
  --ink: #412514;
  --accent: #d9593d;
  --accent-deep: #96341c;
  --grass: #7fc96d;
  --grass-dark: #51984a;
  --tom-fur: #5d6475;
  --tom-belly: #dfe4f0;
  --tom-ear: #efb3b0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.45), transparent 30%),
    radial-gradient(circle at bottom right, rgba(110, 201, 126, 0.35), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.game-shell {
  width: min(92vw, 920px);
  padding: 24px;
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 70px rgba(84, 36, 15, 0.18);
}

.hud,
.tips,
.ideas-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  color: var(--accent-deep);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.95;
}

h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1;
}

h3 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.05;
}

.subtitle,
.tips p {
  margin: 0;
  font-size: 1.05rem;
}

.score-card {
  min-width: 120px;
  padding: 16px 20px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(180deg, #fff8ed, #ffe2bf);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.05);
}

.score-card span {
  display: block;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-card strong {
  display: block;
  font-size: 2.1rem;
  line-height: 1;
}

.play-area {
  margin: 22px 0 18px;
}

.ideas {
  margin-top: 28px;
}

.mini-game-panel {
  margin-top: 18px;
  padding: 20px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.95), rgba(255, 236, 203, 0.95));
  border: 1px solid rgba(65, 37, 20, 0.08);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.04);
}

.mini-game-top,
.mini-panel-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.mini-status-card {
  min-width: 128px;
  padding: 14px 18px;
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
}

.mini-status-card span {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mini-status-card strong {
  display: block;
  font-size: 1.5rem;
}

.mini-stage {
  margin-top: 18px;
  padding: 18px;
  min-height: 280px;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.5), transparent 30%),
    linear-gradient(180deg, #fffefb, #fff3dc);
  border: 1px dashed rgba(65, 37, 20, 0.14);
}

.mini-stage-empty {
  min-height: 240px;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(65, 37, 20, 0.8);
}

.mini-feedback {
  margin: 0;
  font-size: 1rem;
}

.next-button,
.play-button,
.option-button,
.choice-chip,
.letter-button,
.control-button,
.sort-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}

.next-button,
.play-button {
  padding: 12px 18px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff8f5a, #d9593d);
  box-shadow: 0 10px 18px rgba(217, 89, 61, 0.25);
}

.next-button:hover,
.play-button:hover,
.option-button:hover,
.choice-chip:hover,
.letter-button:hover,
.control-button:hover,
.sort-button:hover {
  transform: translateY(-1px);
}

.idea-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.idea-card {
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 242, 221, 0.92));
  border: 1px solid rgba(65, 37, 20, 0.08);
  box-shadow: 0 12px 24px rgba(84, 36, 15, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.idea-card strong {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  margin-bottom: 10px;
  color: #fff;
  background: linear-gradient(135deg, #ff8f5a, #d9593d);
}

.idea-card p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.idea-card.active {
  outline: 3px solid rgba(217, 89, 61, 0.25);
  transform: translateY(-2px);
}

.idea-card.solved strong {
  background: linear-gradient(135deg, #4fb367, #2e8b57);
}

.idea-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.idea-tag {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
}

.mini-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.mini-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(217, 89, 61, 0.1);
  color: var(--accent-deep);
}

.prompt-text {
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.option-grid,
.letter-grid,
.control-pad {
  display: grid;
  gap: 12px;
}

.option-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.option-button,
.choice-chip,
.letter-button,
.sort-button {
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.05);
}

.option-button.correct,
.choice-chip.correct,
.letter-button.correct,
.sort-button.correct {
  background: linear-gradient(180deg, #cbffd7, #a2efb6);
}

.option-button.wrong,
.choice-chip.wrong,
.letter-button.wrong,
.sort-button.wrong {
  background: linear-gradient(180deg, #ffe1d8, #ffc2b1);
}

.visual-count {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.count-token {
  min-width: 64px;
  padding: 14px 12px;
  border-radius: 18px;
  text-align: center;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.88);
}

.tap-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 12px;
}

.choice-chip {
  min-height: 72px;
  font-weight: 700;
}

.status-line {
  margin-top: 14px;
  font-size: 0.95rem;
  color: rgba(65, 37, 20, 0.8);
}

.match-list,
.sort-list {
  display: grid;
  gap: 12px;
}

.match-row,
.sort-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.match-row {
  grid-template-columns: minmax(110px, 160px) 1fr;
  align-items: center;
}

.match-options,
.sort-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sequence-strip,
.spelling-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.sequence-slot {
  min-width: 60px;
  padding: 12px 14px;
  border-radius: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
  border: 1px dashed rgba(65, 37, 20, 0.2);
}

.letter-grid {
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
}

.track-board {
  display: grid;
  gap: 18px;
}

.track-line {
  display: grid;
  grid-template-columns: repeat(var(--track-count), 1fr);
  gap: 8px;
}

.track-cell {
  position: relative;
  padding: 12px 0;
  border-radius: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

.track-cell.player {
  outline: 3px solid rgba(88, 169, 255, 0.4);
}

.track-cell.goal {
  background: linear-gradient(180deg, #fff0b8, #ffd77d);
}

.maze-board {
  display: grid;
  gap: 4px;
  justify-content: start;
  margin-bottom: 16px;
}

.maze-row {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(var(--maze-cols), 54px);
}

.maze-cell {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.9);
}

.maze-cell.wall {
  background: #8ab16a;
}

.maze-cell.goal {
  background: linear-gradient(180deg, #ffe388, #ffc857);
}

.maze-cell.player {
  outline: 3px solid rgba(45, 108, 223, 0.35);
}

.control-pad {
  grid-template-columns: repeat(3, 62px);
  justify-content: start;
}

.control-button {
  height: 54px;
  border-radius: 16px;
  background: #fff;
}

.control-button.blank {
  visibility: hidden;
}

.board {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 28px;
  border: 4px solid rgba(81, 152, 74, 0.25);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.28), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(255, 255, 255, 0.2), transparent 16%),
    linear-gradient(180deg, #b9ebff 0 68%, var(--grass) 68% 100%);
}

.board::after {
  content: "";
  position: absolute;
  inset: 68% 0 0;
  background:
    linear-gradient(90deg, transparent 0 2%, rgba(255, 255, 255, 0.18) 2% 3%, transparent 3% 10%),
    linear-gradient(180deg, var(--grass) 0%, var(--grass-dark) 100%);
}

.tom,
.fish {
  position: absolute;
  transform: translate(-50%, -50%);
  user-select: none;
}

.tom {
  width: 74px;
  height: 74px;
  z-index: 2;
  transition: transform 70ms linear;
}

.cat-face {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50% 50% 44% 44%;
  background: var(--tom-fur);
  border: 3px solid rgba(19, 25, 39, 0.15);
  box-shadow: 0 8px 18px rgba(28, 26, 32, 0.25);
}

.ear {
  position: absolute;
  top: -10px;
  width: 24px;
  height: 24px;
  background: var(--tom-fur);
  border-radius: 6px 18px 8px 8px;
}

.ear::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: var(--tom-ear);
  border-radius: 4px 12px 6px 6px;
}

.ear-left {
  left: 8px;
  transform: rotate(-25deg);
}

.ear-right {
  right: 8px;
  transform: scaleX(-1) rotate(-25deg);
}

.eye,
.nose {
  position: absolute;
}

.eye {
  top: 29px;
  width: 8px;
  height: 12px;
  border-radius: 50%;
  background: #101216;
}

.eye-left {
  left: 22px;
}

.eye-right {
  right: 22px;
}

.nose {
  left: 50%;
  top: 42px;
  width: 13px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 50% 50% 70% 70%;
  background: #f2a7a3;
}

.fish {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: linear-gradient(135deg, #58a9ff, #2d6cdf);
  filter: drop-shadow(0 8px 12px rgba(33, 62, 101, 0.18));
  animation: bob 1.2s ease-in-out infinite;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  margin-right: 6px;
  padding: 5px 8px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  background: #fffdf9;
  border: 1px solid rgba(65, 37, 20, 0.15);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

@keyframes bob {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-6px);
  }
}

@media (max-width: 720px) {
  .game-shell {
    padding: 18px;
  }

  .hud,
  .tips,
  .ideas-header,
  .mini-game-top,
  .mini-panel-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .score-card {
    min-width: 0;
  }

  .match-row {
    grid-template-columns: 1fr;
  }

  .maze-row {
    grid-template-columns: repeat(var(--maze-cols), 44px);
  }

  .maze-cell {
    width: 44px;
    height: 44px;
  }
}

/* Launchpad Theme Override */
:root {
  --bg-top: #0d1726;
  --bg-bottom: #1a3550;
  --panel: rgba(10, 21, 34, 0.9);
  --panel-border: rgba(255, 255, 255, 0.14);
  --ink: #edf4e8;
  --accent: #fb5607;
  --accent-deep: #ffbe0b;
}

body {
  display: block;
  font-family: Verdana, "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 190, 11, 0.2), transparent 34%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.homeLink {
  display: inline-block;
  margin: 10px 14px 0;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-shell {
  width: min(1180px, calc(100vw - 20px));
  margin: 8px auto 18px;
  padding: 18px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.ideas {
  margin-top: 0;
}

.ideas-header {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.eyebrow {
  color: var(--accent-deep);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

h2 {
  font-size: clamp(1.9rem, 5.4vw, 2.8rem);
  line-height: 0.95;
}

h3 {
  font-size: clamp(1.4rem, 3.7vw, 2.1rem);
}

.subtitle,
.prompt-text,
.mini-feedback {
  color: #bcc9c3;
}

.mini-game-panel {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.mini-status-card {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.mini-stage {
  background: rgba(6, 14, 22, 0.62);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 14px;
}

.mini-badge {
  background: rgba(255, 190, 11, 0.13);
  color: var(--accent-deep);
}

.idea-grid {
  margin-top: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.idea-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.idea-card p,
.status-line {
  color: #c7d2cc;
}

.idea-card strong {
  background: linear-gradient(135deg, #ffbe0b, #fb5607);
  color: #1d2630;
}

.idea-card.active {
  outline-color: rgba(255, 190, 11, 0.45);
}

.next-button,
.play-button {
  color: #17222d;
  background: linear-gradient(130deg, #ffbe0b, #fb5607);
  box-shadow: 0 10px 18px rgba(251, 86, 7, 0.25);
}

.option-button,
.choice-chip,
.letter-button,
.sort-button,
.control-button,
.sequence-slot,
.count-token,
.match-row,
.sort-row,
.track-cell,
.maze-cell {
  color: #e7efe5;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.option-button.correct,
.choice-chip.correct,
.letter-button.correct,
.sort-button.correct {
  background: linear-gradient(180deg, #52c77b, #2d8f58);
}

.option-button.wrong,
.choice-chip.wrong,
.letter-button.wrong,
.sort-button.wrong {
  background: linear-gradient(180deg, #e56a7d, #b23f57);
}

.track-cell.goal,
.maze-cell.goal {
  background: linear-gradient(180deg, #ffbe0b, #fb8500);
  color: #1a2128;
}

.control-button.blank {
  border-color: transparent;
}

kbd {
  color: #dbe8df;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 720px) {
  .game-shell {
    width: calc(100vw - 16px);
    margin-top: 8px;
    padding: 12px;
    border-radius: 14px;
  }

  .ideas-header,
  .mini-game-panel,
  .mini-stage {
    border-radius: 12px;
  }
}
