:root {
  color-scheme: light;
  --ink: #1f2028;
  --muted: #6f665e;
  --paper: #fff8ea;
  --cream: #ffe8b3;
  --foam: #f7fff2;
  --coffee: #7b4a29;
  --green: #35b86b;
  --pink: #ff6f91;
  --yellow: #ffd34d;
  --blue: #4aa3ff;
  --shadow: 0 18px 0 rgba(31, 32, 40, 0.11);
  --line: 3px solid var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family:
    ui-rounded,
    "Hiragino Sans GB",
    "PingFang SC",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  background:
    linear-gradient(90deg, rgba(31, 32, 40, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(31, 32, 40, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 16% 18%, rgba(255, 211, 77, 0.48), transparent 24%),
    radial-gradient(circle at 92% 12%, rgba(74, 163, 255, 0.24), transparent 20%),
    linear-gradient(135deg, #fff7dd 0%, #e9ffe9 52%, #fff0f4 100%);
  background-size: 22px 22px, 22px 22px, auto, auto, auto;
}

button {
  border: 0;
  font: inherit;
}

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

.hero {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 34px;
  align-items: center;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow,
.tiny-label,
.round-label {
  margin: 0;
  color: var(--coffee);
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow {
  width: fit-content;
  padding: 7px 11px;
  border: var(--line);
  border-radius: 7px;
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-1deg);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.04;
}

h1 {
  max-width: 780px;
  margin-top: 22px;
  font-size: clamp(2.7rem, 8vw, 5.9rem);
}

.hero-text {
  max-width: 660px;
  margin: 22px 0 0;
  color: #473b34;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  line-height: 1.72;
}

.hero-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.primary-btn,
.ghost-btn {
  min-height: 48px;
  padding: 0 18px;
  border: var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 950;
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--ink);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-btn {
  background: var(--green);
}

.ghost-btn {
  background: #fff;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translate(-2px, -2px) rotate(-0.5deg);
  box-shadow: 8px 8px 0 var(--ink);
}

.primary-btn:active,
.ghost-btn:active,
.option-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.mascot-stage {
  position: relative;
  min-height: 540px;
  display: grid;
  place-items: center;
}

.pixel-sun {
  position: absolute;
  width: min(82vw, 410px);
  aspect-ratio: 1;
  border: var(--line);
  border-radius: 24px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.42) 25%, transparent 25% 50%, rgba(255, 255, 255, 0.42) 50% 75%, transparent 75%),
    var(--yellow);
  background-size: 24px 24px;
  box-shadow: var(--shadow);
  transform: rotate(5deg);
}

.mascot {
  position: relative;
  z-index: 1;
  width: min(90vw, 420px);
  height: auto;
  display: block;
  image-rendering: pixelated;
  filter: drop-shadow(0 16px 0 rgba(31, 32, 40, 0.12));
}

.mascot-float {
  animation: floaty 3.1s ease-in-out infinite;
}

.speech-bubble,
.coach-bubble {
  border: var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 7px 7px 0 var(--ink);
}

.speech-bubble {
  position: absolute;
  right: 0;
  bottom: 58px;
  z-index: 2;
  width: min(78vw, 240px);
  padding: 14px;
  transform: rotate(2deg);
}

.speech-bubble strong,
.speech-bubble span {
  display: block;
}

.speech-bubble span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.game-card,
.result-card {
  border: var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 234, 0.94);
  box-shadow: var(--shadow);
}

.game-card {
  padding: 16px;
}

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

.top-bar > div {
  min-width: 0;
  padding: 12px;
  border: var(--line);
  border-radius: 8px;
  background: #fff;
}

.top-bar strong {
  display: block;
  margin-top: 3px;
  font-size: clamp(1.05rem, 2.2vw, 1.48rem);
}

.tiny-label {
  font-size: 0.77rem;
}

.progress-track {
  height: 18px;
  margin: 16px 0;
  overflow: hidden;
  border: var(--line);
  border-radius: 999px;
  background: #fff;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.42) 0 8px, transparent 8px 16px),
    var(--pink);
  transition: width 220ms ease;
}

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

.coach-panel {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  padding: 14px;
  border: var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 211, 77, 0.7), rgba(255, 111, 145, 0.14)),
    #fff;
}

.coach-image {
  width: min(100%, 270px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.coach-image.pop {
  transform: scale(1.08) rotate(-2deg);
}

.coach-image.panic {
  animation: shake 180ms ease-in-out 3;
}

.coach-bubble {
  width: 100%;
  padding: 12px;
  color: #43372d;
  font-weight: 800;
  line-height: 1.55;
}

.question-panel {
  min-width: 0;
  padding: clamp(16px, 4vw, 28px);
  border: var(--line);
  border-radius: 8px;
  background: #fffef8;
}

.round-label {
  margin-bottom: 10px;
}

.question-panel h2,
.result-copy h2 {
  font-size: clamp(1.8rem, 6vw, 3.4rem);
}

.question-hint,
.result-copy p {
  color: #4c4038;
  line-height: 1.66;
}

.question-hint {
  margin: 12px 0 18px;
  font-size: 1rem;
}

.options {
  display: grid;
  gap: 12px;
}

.option-btn {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.option-btn:hover {
  background: #fff2c7;
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 var(--ink);
}

.option-btn:disabled {
  color: var(--ink);
  opacity: 1;
  cursor: wait;
}

.option-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--cream);
  font-size: 1.35rem;
}

.option-text {
  min-width: 0;
}

.option-title {
  display: block;
  font-weight: 950;
}

.option-subtitle {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(260px, 410px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: clamp(16px, 4vw, 34px);
}

.result-visual {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  border: var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 32, 40, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(31, 32, 40, 0.06) 1px, transparent 1px),
    #fff;
  background-size: 18px 18px;
}

.result-image {
  width: min(82vw, 340px);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  image-rendering: pixelated;
  animation: floaty 3.1s ease-in-out infinite;
}

.result-copy {
  min-width: 0;
}

.result-copy h2 {
  margin-top: 18px;
}

.result-notes {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.result-notes p {
  margin: 0;
  padding: 11px 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.share-copy {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--coffee);
  font-weight: 950;
}

[hidden] {
  display: none !important;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px) rotate(-2deg);
  }
  75% {
    transform: translateX(5px) rotate(2deg);
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 22px, 560px);
    padding-top: 14px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 14px;
  }

  h1 {
    margin-top: 16px;
    font-size: clamp(2.35rem, 12vw, 3.8rem);
  }

  .hero-actions,
  .result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }

  .mascot-stage {
    min-height: 400px;
  }

  .pixel-sun {
    width: min(88vw, 330px);
  }

  .mascot {
    width: min(88vw, 340px);
  }

  .speech-bubble {
    right: 8px;
    bottom: 30px;
  }

  .question-layout,
  .result-card {
    grid-template-columns: 1fr;
  }

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

  .coach-panel {
    grid-template-columns: minmax(128px, 34vw) minmax(0, 1fr);
    justify-items: start;
    align-items: center;
  }

  .coach-image {
    width: min(34vw, 148px);
  }

  .coach-bubble {
    font-size: 0.92rem;
  }

  .option-btn {
    grid-template-columns: 38px 1fr;
    min-height: 74px;
  }

  .option-icon {
    width: 38px;
    height: 38px;
  }

  .result-visual {
    min-height: 300px;
  }
}

@media (max-width: 390px) {
  .top-bar {
    grid-template-columns: 1fr;
  }

  .coach-panel {
    grid-template-columns: 104px minmax(0, 1fr);
    padding: 10px;
  }

  .coach-image {
    width: 104px;
  }
}
