:root {
  color-scheme: light;
  --ink: #17243b;
  --ink-soft: #45536a;
  --paper: #fffaf0;
  --cream: #f5e8cf;
  --orange: #f45b22;
  --orange-dark: #c73812;
  --blue: #1458c8;
  --blue-dark: #0f306d;
  --yellow: #ffc928;
  --green: #22a06b;
  --red: #df3f47;
  --pink: #ef6fa7;
  --line: 3px solid var(--ink);
  --shadow: 7px 7px 0 var(--ink);
  --shadow-small: 4px 4px 0 var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--cream);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.92), transparent 33rem),
    linear-gradient(135deg, #f8edd9 0%, #f1dfbe 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 4px;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.14;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.23'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 34vw;
  height: 34vw;
  min-width: 260px;
  min-height: 260px;
  border: 4px solid var(--ink);
  opacity: 0.08;
  transform: rotate(18deg);
}

.ambient-one {
  top: 20vh;
  left: -18vw;
  background: var(--orange);
}

.ambient-two {
  right: -18vw;
  bottom: -15vw;
  border-radius: 50%;
  background: var(--blue);
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  border: var(--line);
  border-radius: 50% 46% 42% 52%;
  background: var(--orange);
  color: white;
  box-shadow: var(--shadow-small);
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
  transform: rotate(-6deg);
}

.brand-copy {
  display: grid;
  line-height: 1;
}

.brand-copy strong {
  font-size: 19px;
  font-weight: 1000;
  letter-spacing: -0.04em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--orange-dark);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: var(--line);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 20px;
  font-weight: 1000;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.icon-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.icon-button:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

#app {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 max(44px, env(safe-area-inset-bottom));
}

#app:focus {
  outline: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 28px;
  height: 4px;
  background: currentColor;
  content: "";
}

.display-title {
  max-width: 720px;
  margin: 0;
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 1000;
  letter-spacing: -0.075em;
  line-height: 0.92;
}

.display-title .scribble {
  position: relative;
  display: inline-block;
  color: var(--orange);
  transform: rotate(-2deg);
}

.display-title .scribble::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 5px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  content: "";
  transform: rotate(-1deg);
}

.lede {
  max-width: 580px;
  margin: 23px 0 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 650;
  line-height: 1.65;
}

.hero {
  display: grid;
  min-height: 665px;
  grid-template-columns: minmax(0, 1.02fr) minmax(400px, 0.98fr);
  align-items: center;
  gap: 48px;
  padding: 16px 0 34px;
}

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

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.primary-button,
.secondary-button,
.danger-button {
  position: relative;
  min-height: 58px;
  padding: 14px 24px;
  border: var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-small);
  font-weight: 950;
  cursor: pointer;
  transition: transform 110ms ease, box-shadow 110ms ease, filter 110ms ease;
}

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

.secondary-button {
  background: var(--paper);
}

.danger-button {
  background: #ffe0dc;
  color: #9c251e;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
  filter: saturate(1.1);
}

.primary-button:active,
.secondary-button:active,
.danger-button:active {
  transform: translate(4px, 4px);
  box-shadow: none;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.55;
  transform: none;
  box-shadow: 2px 2px 0 var(--ink);
}

.button-label {
  display: flex;
  align-items: center;
  gap: 14px;
}

.button-label small {
  opacity: 0.75;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.hero-stage {
  position: relative;
  min-height: 590px;
}

.hero-sunburst {
  position: absolute;
  inset: 5% -8% 3% 0;
  border: var(--line);
  border-radius: 48% 52% 45% 55%;
  background:
    repeating-conic-gradient(from 5deg, rgba(255, 201, 40, 0.98) 0 13deg, #ffed9a 13deg 26deg);
  box-shadow: 10px 12px 0 var(--ink);
  transform: rotate(2deg);
}

.hero-sunburst::after {
  position: absolute;
  inset: 9%;
  border: 3px dashed rgba(23, 36, 59, 0.45);
  border-radius: inherit;
  content: "";
}

.hero-mascot {
  position: absolute;
  z-index: 2;
  right: 1%;
  bottom: -2%;
  width: min(90%, 500px);
  max-height: 625px;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(11px 12px 0 rgba(23, 36, 59, 0.22));
}

.challenge-sticker {
  position: absolute;
  z-index: 3;
  top: 9%;
  left: -4%;
  display: grid;
  width: 135px;
  height: 135px;
  place-items: center;
  border: var(--line);
  border-radius: 50%;
  background: var(--blue);
  color: white;
  box-shadow: var(--shadow-small);
  text-align: center;
  transform: rotate(-10deg);
}

.challenge-sticker strong {
  font-size: 27px;
  font-weight: 1000;
  line-height: 0.98;
}

.challenge-sticker small {
  display: block;
  margin-top: 6px;
  color: var(--yellow);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.progress-ticket {
  position: absolute;
  z-index: 4;
  right: -2%;
  bottom: 3%;
  min-width: 205px;
  padding: 15px 18px;
  border: var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow-small);
  transform: rotate(3deg);
}

.progress-ticket small {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.progress-ticket strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 1000;
}

.difficulty-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 27px;
}

.difficulty-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 8px 13px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.84);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}

.difficulty-chip::before {
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--difficulty-color, var(--green));
  content: "";
}

.difficulty-chip:hover:not(:disabled) {
  transform: translateY(-2px);
}

.difficulty-chip.active {
  background: var(--ink);
  color: white;
}

.difficulty-chip:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.45;
}

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

.section-heading h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 1000;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.section-heading p {
  max-width: 420px;
  margin: 0;
  color: var(--ink-soft);
  font-weight: 650;
  line-height: 1.6;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 950;
  cursor: pointer;
}

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

.level-card {
  position: relative;
  min-height: 245px;
  padding: 24px;
  overflow: hidden;
  border: var(--line);
  border-radius: 24px 20px 27px 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.level-card::after {
  position: absolute;
  right: -35px;
  bottom: -44px;
  width: 145px;
  height: 145px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--stage-color);
  content: "";
  opacity: 0.18;
}

.level-card:hover:not(:disabled) {
  transform: translate(-3px, -4px) rotate(-0.4deg);
  box-shadow: 11px 13px 0 var(--ink);
}

.level-card:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.54;
}

.level-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-number {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--stage-color);
  color: white;
  font-weight: 1000;
  transform: rotate(-5deg);
}

.level-icon {
  font-size: 45px;
  filter: drop-shadow(2px 3px 0 rgba(23, 36, 59, 0.22));
}

.level-card h2 {
  margin: 23px 0 8px;
  font-size: 28px;
  font-weight: 1000;
  letter-spacing: -0.04em;
}

.level-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.level-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.skill-tag {
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: white;
  font-size: 11px;
  font-weight: 900;
}

.mini-grade {
  color: var(--stage-color);
  font-size: 31px;
  font-weight: 1000;
  -webkit-text-stroke: 1.5px var(--ink);
  transform: rotate(7deg);
}

.briefing-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.18fr);
  gap: 26px;
  align-items: stretch;
}

.briefing-poster,
.briefing-copy,
.result-card,
.help-card {
  border: var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.briefing-poster {
  position: relative;
  display: grid;
  min-height: 510px;
  place-items: center;
  overflow: hidden;
  border-radius: 36px 22px 32px 25px;
  background: var(--stage-color);
}

.briefing-poster::before {
  position: absolute;
  inset: -28%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.55) 0 10deg, transparent 10deg 22deg);
  content: "";
  animation: slow-spin 22s linear infinite;
}

.briefing-icon {
  position: relative;
  z-index: 2;
  font-size: clamp(110px, 17vw, 210px);
  filter: drop-shadow(8px 10px 0 rgba(23, 36, 59, 0.35));
  transform: rotate(-5deg);
}

.briefing-number {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 3;
  font-size: 18px;
  font-weight: 1000;
}

.briefing-copy {
  display: flex;
  min-height: 510px;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 62px);
  border-radius: 22px 34px 24px 31px;
}

.briefing-copy h1 {
  margin: 0;
  font-size: clamp(46px, 7vw, 76px);
  font-weight: 1000;
  letter-spacing: -0.07em;
  line-height: 0.95;
}

.briefing-rule {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 680;
  line-height: 1.7;
}

.control-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 27px 0;
}

.control-preview span {
  padding: 9px 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff3d5;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.briefing-tip {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
  padding: 13px 15px;
  border-left: 5px solid var(--stage-color);
  background: #f3eddf;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.5;
}

.game-shell {
  width: min(940px, 100%);
  margin: 0 auto;
}

.game-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.hud-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 1000;
}

.hud-stage span {
  font-size: 28px;
}

.hud-mode {
  justify-self: center;
  padding: 7px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0.08em;
}

.hud-exit {
  justify-self: end;
  padding: 7px 11px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--paper);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.game-frame {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 32px 25px 36px 24px;
  background: var(--paper);
  box-shadow: 9px 10px 0 var(--ink);
}

.timer-track {
  position: absolute;
  z-index: 15;
  top: 0;
  right: 0;
  left: 0;
  height: 13px;
  border-bottom: 3px solid var(--ink);
  background: #ded6c7;
}

.timer-fill {
  width: 100%;
  height: 100%;
  background: var(--stage-color, var(--orange));
  transform-origin: left;
}

.stage-root {
  min-height: 610px;
}

.countdown-overlay {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(4px);
}

.countdown-number {
  color: var(--orange);
  font-size: clamp(110px, 22vw, 220px);
  font-weight: 1000;
  letter-spacing: -0.08em;
  line-height: 1;
  text-shadow: 7px 8px 0 var(--ink);
  -webkit-text-stroke: 4px var(--ink);
  animation: count-pop 560ms cubic-bezier(0.18, 1.45, 0.36, 1) both;
}

.game-layout {
  display: grid;
  min-height: 610px;
  grid-template-rows: minmax(0, 1fr) auto;
  padding-top: 13px;
}

.play-field {
  position: relative;
  display: grid;
  min-height: 440px;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)),
    var(--stage-bg, #ffe9ae);
}

.stage-score {
  position: absolute;
  z-index: 6;
  top: 24px;
  left: 24px;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: white;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 13px;
  font-weight: 1000;
}

.stage-callout {
  position: absolute;
  z-index: 8;
  top: 25px;
  right: 24px;
  padding: 8px 12px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 13px;
  font-weight: 1000;
  transform: rotate(2deg);
}

.stage-callout.danger {
  background: var(--red);
  color: white;
  animation: balance-danger 260ms ease-in-out infinite alternate;
}

.control-deck {
  display: grid;
  grid-template-columns: repeat(var(--control-count, 3), minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border-top: 4px solid var(--ink);
  background: #f0e3c9;
}

.control-button {
  position: relative;
  min-height: 92px;
  padding: 13px 9px 10px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--button-color, var(--orange));
  box-shadow: 0 7px 0 var(--ink);
  color: white;
  font-size: clamp(16px, 3vw, 23px);
  font-weight: 1000;
  line-height: 1.05;
  cursor: pointer;
  text-shadow: 0 2px 0 rgba(23, 36, 59, 0.28);
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.control-button::before {
  position: absolute;
  top: 7px;
  left: 10px;
  color: rgba(255, 255, 255, 0.72);
  content: attr(data-key);
  font-size: 10px;
  font-weight: 900;
}

.control-button:hover {
  filter: brightness(1.06);
}

.control-button:active,
.control-button.pressed {
  transform: translateY(7px);
  box-shadow: none;
}

.control-button:disabled {
  cursor: default;
  filter: grayscale(0.5);
  opacity: 0.58;
}

.reaction-lanes {
  display: grid;
  width: min(650px, 100%);
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.reaction-lane {
  position: relative;
  display: grid;
  min-height: 275px;
  place-items: end center;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 50% 50% 18px 18px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 -15px 0 rgba(23, 36, 59, 0.07);
}

.reaction-lane.active {
  background: var(--yellow);
  box-shadow: 0 0 0 7px rgba(244, 91, 34, 0.26), inset 0 -15px 0 rgba(23, 36, 59, 0.07);
}

.tickle-foot {
  position: absolute;
  bottom: 25px;
  font-size: clamp(80px, 13vw, 130px);
  opacity: 0;
  transform: translateY(80px) rotate(-10deg);
  transition: opacity 80ms ease, transform 160ms cubic-bezier(0.2, 1.3, 0.4, 1);
}

.reaction-lane.active .tickle-foot {
  opacity: 1;
  transform: translateY(0) rotate(5deg);
}

.feather-swipe {
  position: absolute;
  right: 8%;
  bottom: 32%;
  font-size: 58px;
  opacity: 0;
}

.reaction-lane.hit .feather-swipe {
  animation: feather-hit 230ms ease-out;
}

.rps-arena {
  display: grid;
  width: min(700px, 100%);
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.rps-card {
  display: grid;
  min-height: 250px;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 35px 25px 31px 22px;
  background: white;
  box-shadow: 7px 8px 0 var(--ink);
  font-size: clamp(90px, 16vw, 155px);
}

.rps-card.left {
  transform: rotate(-3deg);
}

.rps-card.right {
  transform: rotate(3deg) scaleX(-1);
}

.versus-badge {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 21px;
  font-style: italic;
  font-weight: 1000;
  transform: rotate(-8deg);
}

.round-pips {
  position: absolute;
  bottom: 20px;
  display: flex;
  gap: 6px;
}

.round-pip {
  width: 13px;
  height: 13px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: white;
}

.round-pip.done {
  background: var(--green);
}

.round-pip.wrong {
  background: var(--red);
}

.balance-scene {
  position: relative;
  display: grid;
  width: min(650px, 100%);
  height: 360px;
  place-items: center;
}

.sleepy-body {
  position: absolute;
  bottom: 5px;
  width: 165px;
  height: 165px;
  border: 4px solid var(--ink);
  border-radius: 48% 48% 18% 18%;
  background: var(--blue);
  box-shadow: 8px 8px 0 var(--ink);
}

.sleepy-head {
  position: absolute;
  z-index: 2;
  bottom: 125px;
  left: 50%;
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 48% 52% 45% 55%;
  background: #ffc79f;
  box-shadow: 7px 8px 0 var(--ink);
  font-size: 94px;
  transform: translateX(-50%);
  transform-origin: 50% 92%;
  will-change: left, transform;
}

.balance-meter {
  position: absolute;
  top: 10px;
  width: min(430px, 82%);
  height: 22px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--yellow) 28%, var(--green) 44% 56%, var(--yellow) 72%, var(--red));
}

.balance-needle {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 26px;
  background: var(--ink);
  transform: translateX(-50%);
}

.zzz {
  position: absolute;
  z-index: 3;
  color: var(--blue-dark);
  font-size: 27px;
  font-weight: 1000;
  animation: float-z 1.5s ease-in-out infinite;
}

.zzz:nth-child(1) { top: 100px; right: 25%; }
.zzz:nth-child(2) { top: 61px; right: 20%; animation-delay: 0.35s; font-size: 20px; }

.orders {
  display: grid;
  width: min(720px, 100%);
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 18px;
}

.cone-order {
  display: grid;
  justify-items: center;
}

.order-number {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: white;
  box-shadow: 3px 4px 0 var(--ink);
  font-size: 24px;
  font-weight: 1000;
  transition: opacity 200ms ease;
}

.order-number.hidden {
  opacity: 0.12;
}

.scoop-stack {
  display: flex;
  min-height: 230px;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-start;
  padding-top: 12px;
}

.scoop {
  width: 74px;
  height: 61px;
  margin-bottom: -13px;
  border: 3px solid var(--ink);
  border-radius: 50% 50% 42% 42%;
  background: var(--scoop-color);
  box-shadow: inset -9px -5px 0 rgba(23, 36, 59, 0.1);
  animation: scoop-drop 220ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.cone {
  width: 80px;
  height: 95px;
  border: 3px solid var(--ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background:
    linear-gradient(55deg, transparent 42%, rgba(23, 36, 59, 0.18) 43% 48%, transparent 49%),
    linear-gradient(-55deg, transparent 42%, rgba(23, 36, 59, 0.18) 43% 48%, transparent 49%),
    #e7a84f;
}

.bomb-rack {
  display: grid;
  width: min(760px, 100%);
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.bomb-unit {
  display: grid;
  min-height: 310px;
  place-items: center;
  padding: 18px;
  border: 3px solid var(--ink);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.5);
}

.bomb-body {
  position: relative;
  display: grid;
  width: 146px;
  height: 146px;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: #27344b;
  box-shadow: 8px 8px 0 var(--ink);
  color: white;
  font-size: 29px;
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
}

.bomb-body::before {
  position: absolute;
  top: -32px;
  right: 14px;
  width: 39px;
  height: 36px;
  border: 4px solid var(--ink);
  border-bottom: 0;
  border-radius: 50% 50% 0 0;
  content: "";
  transform: rotate(18deg);
}

.bomb-unit.stopped .bomb-body {
  background: var(--green);
}

.bomb-unit.danger .bomb-body {
  animation: bomb-pulse 190ms ease-in-out infinite alternate;
  background: var(--red);
}

.bomb-unit.exploded {
  background: var(--red);
  animation: screen-shake 330ms ease-out;
}

.bomb-rating {
  min-height: 28px;
  font-size: 13px;
  font-weight: 1000;
}

.egg-field {
  display: grid;
  width: min(720px, 100%);
  height: 395px;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.egg-lane {
  position: relative;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 18px 18px 35px 35px;
  background: rgba(255, 255, 255, 0.5);
}

.catch-line {
  position: absolute;
  right: 0;
  bottom: 16%;
  left: 0;
  height: 8px;
  border-block: 2px solid var(--ink);
  background: #22b7df;
  box-shadow: 0 0 0 6px rgba(34, 183, 223, 0.16);
}

.pan {
  position: absolute;
  bottom: 5%;
  left: 50%;
  font-size: 54px;
  transform: translateX(-50%);
}

.falling-egg {
  position: absolute;
  top: 0;
  left: 50%;
  font-size: 42px;
  filter: drop-shadow(2px 3px 0 rgba(23, 36, 59, 0.22));
  transform: translate(-50%, -50%);
  will-change: top;
}

.egg-lives {
  display: flex;
  gap: 6px;
  font-size: 24px;
}

.result-wrap {
  display: grid;
  min-height: 670px;
  place-items: center;
  padding: 30px 0;
}

.result-card {
  position: relative;
  display: grid;
  width: min(760px, 100%);
  grid-template-columns: 220px 1fr;
  gap: 35px;
  align-items: center;
  padding: clamp(28px, 5vw, 54px);
  overflow: hidden;
  border-radius: 35px 23px 31px 27px;
}

.result-card::after {
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 360px;
  height: 360px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: var(--grade-color);
  content: "";
  opacity: 0.12;
}

.grade-stamp {
  position: relative;
  z-index: 2;
  display: grid;
  width: 210px;
  height: 210px;
  place-items: center;
  border: 8px solid var(--ink);
  border-radius: 50%;
  background: var(--grade-color);
  box-shadow: 10px 11px 0 var(--ink);
  color: white;
  font-size: 132px;
  font-weight: 1000;
  letter-spacing: -0.1em;
  line-height: 1;
  text-shadow: 5px 6px 0 rgba(23, 36, 59, 0.35);
  transform: rotate(-7deg);
  animation: grade-arrive 540ms cubic-bezier(0.12, 1.5, 0.34, 1) both;
}

.result-copy {
  position: relative;
  z-index: 2;
}

.result-copy h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 67px);
  font-weight: 1000;
  letter-spacing: -0.065em;
  line-height: 0.95;
}

.result-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 5px;
}

.result-stat strong {
  color: var(--grade-color);
  font-size: 52px;
  font-weight: 1000;
  letter-spacing: -0.06em;
  -webkit-text-stroke: 1.5px var(--ink);
}

.result-stat span {
  font-size: 14px;
  font-weight: 900;
}

.result-detail {
  margin: 0 0 20px;
  color: var(--ink-soft);
  font-weight: 750;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.result-tip {
  margin-top: 22px;
  padding-top: 17px;
  border-top: 2px dashed #b6aa96;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 720;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 25, 43, 0.72);
  backdrop-filter: blur(8px);
}

.help-card {
  width: min(620px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
  padding: 34px;
  border-radius: 25px;
}

.help-card h2 {
  margin: 0 0 16px;
  font-size: 39px;
  font-weight: 1000;
  letter-spacing: -0.05em;
}

.help-card p,
.help-card li {
  color: var(--ink-soft);
  font-weight: 650;
  line-height: 1.7;
}

.help-card kbd {
  padding: 2px 7px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: white;
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font-weight: 900;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 16px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--orange);
  color: white;
  font-size: 13px;
  font-weight: 850;
  animation: toast-in 220ms ease-out both;
}

.screen-enter {
  animation: screen-enter 300ms ease-out both;
}

.hit-flash {
  animation: hit-flash 180ms ease-out;
}

.miss-flash {
  animation: miss-flash 260ms ease-out;
}

@keyframes slow-spin { to { transform: rotate(1turn); } }
@keyframes count-pop { from { opacity: 0; transform: scale(1.65) rotate(8deg); } to { opacity: 1; transform: scale(1) rotate(-2deg); } }
@keyframes feather-hit { 0% { opacity: 0; transform: translate(30px, 22px) rotate(-15deg); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(-42px, -30px) rotate(18deg); } }
@keyframes float-z { 0%, 100% { opacity: 0.2; transform: translateY(8px) rotate(-5deg); } 50% { opacity: 1; transform: translateY(-7px) rotate(5deg); } }
@keyframes balance-danger { to { transform: rotate(-2deg) scale(1.06); } }
@keyframes scoop-drop { from { opacity: 0; transform: translateY(-50px) scale(1.3); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes bomb-pulse { to { transform: scale(1.055); filter: brightness(1.18); } }
@keyframes screen-shake { 20% { transform: translateX(-11px) rotate(-2deg); } 40% { transform: translateX(10px) rotate(2deg); } 60% { transform: translateX(-7px); } 80% { transform: translateX(5px); } }
@keyframes grade-arrive { from { opacity: 0; transform: scale(2.2) rotate(22deg); } to { opacity: 1; transform: scale(1) rotate(-7deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(15px); } }
@keyframes screen-enter { from { opacity: 0; transform: translateY(12px); } }
@keyframes hit-flash { 50% { background: #bcf5d7; } }
@keyframes miss-flash { 25%, 75% { background: #ffc5c7; transform: translateX(-4px); } 50% { transform: translateX(4px); } }

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .hero-stage {
    min-height: 490px;
    order: -1;
  }

  .hero-sunburst {
    inset: 1% 3% 0;
  }

  .hero-mascot {
    right: 8%;
    max-height: 510px;
  }

  .challenge-sticker { left: 5%; }
  .progress-ticket { right: 3%; }
  .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .briefing-layout { grid-template-columns: 0.78fr 1.22fr; }
  .briefing-copy { padding: 34px; }
}

@media (max-width: 680px) {
  .topbar,
  #app {
    width: min(100% - 22px, 1180px);
  }

  .brand-copy small { display: none; }
  .topbar { padding-top: 14px; }
  #app { padding-top: 10px; }

  .hero-stage {
    min-height: 390px;
  }

  .hero-mascot {
    right: 4%;
    width: 90%;
    max-height: 405px;
  }

  .challenge-sticker {
    top: 6%;
    width: 100px;
    height: 100px;
  }

  .challenge-sticker strong { font-size: 20px; }
  .progress-ticket { min-width: 170px; padding: 11px 13px; }
  .progress-ticket strong { font-size: 19px; }

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

  .primary-button,
  .secondary-button,
  .danger-button { width: 100%; }

  .section-heading {
    display: block;
  }

  .section-heading p { margin-top: 14px; }
  .level-grid { grid-template-columns: 1fr; }
  .level-card { min-height: 215px; }

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

  .briefing-poster { min-height: 290px; }
  .briefing-copy { min-height: auto; }

  .game-frame,
  .stage-root,
  .game-layout { min-height: calc(100svh - 155px); }

  .play-field {
    min-height: 0;
    padding: 24px 13px;
  }

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

  .hud-mode { display: none; }
  .control-deck { gap: 7px; padding: 11px; }
  .control-button { min-height: 78px; border-radius: 14px; }
  .reaction-lanes { gap: 7px; }
  .reaction-lane { min-height: 250px; }
  .tickle-foot { font-size: 84px; }

  .rps-arena { gap: 9px; }
  .rps-card { min-height: 180px; font-size: 78px; border-radius: 24px; }
  .versus-badge { width: 48px; height: 48px; font-size: 15px; }

  .orders,
  .bomb-rack { gap: 7px; }
  .scoop { width: 58px; height: 50px; }
  .cone { width: 62px; height: 77px; }
  .bomb-unit { min-height: 235px; padding: 6px; }
  .bomb-body { width: 92px; height: 92px; font-size: 20px; }

  .result-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .grade-stamp { width: 170px; height: 170px; font-size: 105px; }
  .result-stat { justify-content: center; }
}

@media (max-width: 410px) {
  .display-title { font-size: 43px; }
  .hero-stage { min-height: 340px; }
  .hero-mascot { max-height: 350px; }
  .challenge-sticker { width: 82px; height: 82px; }
  .challenge-sticker small { display: none; }
  .progress-ticket { min-width: 145px; }
  .reaction-lane { min-height: 210px; }
  .bomb-body { width: 80px; height: 80px; font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
