:root {
  --ink: #20313f;
  --muted: #667987;
  --paper: #fffaf2;
  --line: #e6dccd;
  --coral: #f06f5f;
  --teal: #2fa9a0;
  --leaf: #79b767;
  --gold: #f6c85f;
  --sky: #cce9f5;
  --floor: #ecd7b7;
  --shadow: 0 16px 34px rgba(70, 51, 31, .16);
  --font: Nunito, "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #f2eee7;
  color: var(--ink);
  font-family: var(--font);
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1.4px;
}

h1, h2, p { margin: 0; }

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 30px;
  font-weight: 900;
  transform: rotate(-7deg);
}

h1 {
  margin-top: 2px;
  font-size: 34px;
  line-height: 1;
}

.score-board {
  min-width: 104px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-align: center;
  box-shadow: 0 8px 18px rgba(70, 51, 31, .08);
}

.score-board span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.score-board b {
  display: block;
  color: var(--coral);
  font-size: 31px;
  line-height: 1;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
  gap: 18px;
  align-items: stretch;
}

.stage-panel,
.quiz-panel,
.word-bank article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.stage-panel {
  padding: 10px;
}

.room {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 420px;
  overflow: hidden;
  border-radius: 6px;
  background: #dcecf4;
}

.room-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-pill {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  min-width: 108px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 250, 242, .9);
  border: 2px solid rgba(255, 255, 255, .85);
  color: var(--teal);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 8px 18px rgba(70, 51, 31, .12);
}

.in-effect {
  position: absolute;
  z-index: 2;
  width: clamp(170px, 22vw, 310px);
  aspect-ratio: 3 / 2;
  object-fit: contain;
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity .2s ease, transform .45s ease;
}

.in-effect.show {
  opacity: .95;
  animation: sparklePulse 1.2s ease-in-out infinite;
}

.bunny {
  position: absolute;
  z-index: 3;
  width: clamp(88px, 12vw, 150px);
  aspect-ratio: 1 / 1.23;
  padding: 0;
  background: transparent;
  filter: drop-shadow(0 12px 12px rgba(70, 51, 31, .24));
  transition: left .45s ease, top .45s ease, transform .45s ease;
}

.bunny img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.bunny.is-in {
  width: clamp(130px, 17vw, 230px);
}

.bunny.is-under {
  z-index: 2;
  filter: drop-shadow(0 8px 8px rgba(70, 51, 31, .18)) brightness(.9);
}

.spot {
  position: absolute;
  z-index: 2;
  min-width: 68px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 242, .9);
  color: var(--ink);
  border: 2px solid rgba(255, 255, 255, .85);
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 8px 18px rgba(70, 51, 31, .12);
}

.spot-table {
  left: 57%;
  top: 47%;
}

.spot-box {
  left: 14%;
  top: 55%;
}

.quiz-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.round-info {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8dfd3;
}

.meter div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--leaf);
  transition: width .25s;
}

.prompt-card {
  padding: 20px;
  border-radius: 8px;
  background: #f6efe4;
  border: 1px solid #eadfcc;
}

.prompt-card p {
  margin-top: 10px;
  font-size: 29px;
  font-weight: 900;
  line-height: 1.18;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  min-height: 76px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  border: 2px solid #e8dfd3;
  font-size: 22px;
  font-weight: 900;
  transition: transform .15s, border-color .15s, background .15s;
}

.choice:hover,
.choice:focus-visible {
  transform: translateY(-2px);
  border-color: var(--teal);
  outline: none;
}

.choice.correct {
  background: #eaf7e9;
  border-color: var(--leaf);
  color: #35672d;
}

.choice.wrong {
  background: #fff0ee;
  border-color: var(--coral);
  color: #9d3e32;
  animation: shake .22s linear 2;
}

.feedback {
  min-height: 46px;
  padding: 12px 14px;
  border-left: 4px solid var(--gold);
  color: var(--muted);
  background: #fff8eb;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.controls button {
  min-height: 46px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

.controls #next { background: var(--coral); }
.controls #reset {
  grid-column: 1 / -1;
  background: #dfd6ca;
  color: var(--muted);
}

.word-bank {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.word-bank article {
  padding: 15px 16px;
  text-align: center;
}

.word-bank b {
  display: block;
  color: var(--teal);
  font-size: 25px;
}

.word-bank span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.finish {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(32, 49, 63, .55);
}

.finish[hidden] { display: none; }

.finish article {
  width: min(420px, 100%);
  padding: 34px 28px;
  border-radius: 8px;
  background: var(--paper);
  text-align: center;
  box-shadow: 0 24px 60px rgba(20, 28, 35, .28);
}

.finish h2 {
  margin: 7px 0 8px;
  color: var(--coral);
  font-size: 34px;
}

.finish p {
  color: var(--muted);
  font-weight: 800;
}

.finish button {
  margin-top: 22px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 900;
}

@keyframes shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes sparklePulse {
  50% { opacity: .55; }
}

@media (prefers-reduced-motion: reduce) {
  .bunny,
  .meter div,
  .choice {
    transition: none;
  }
  .choice.wrong {
    animation: none;
  }
  .in-effect.show {
    animation: none;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 680px);
    padding: 18px 0;
  }

  .topbar {
    grid-template-columns: auto 1fr;
  }

  .score-board {
    grid-column: 1 / -1;
    justify-self: stretch;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .game-layout,
  .word-bank {
    grid-template-columns: 1fr;
  }

  .room {
    min-height: auto;
  }

  .prompt-card p {
    font-size: 25px;
  }
}

@media (max-width: 520px) {
  h1 { font-size: 28px; }

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

  .choice {
    min-height: 58px;
  }

  .spot {
    font-size: 12px;
    min-width: 54px;
    padding: 5px 8px;
  }
}
