:root {
  --ink: #213047;
  --muted: #6a758a;
  --line: rgba(255, 255, 255, .74);
  --gold: #ffc400;
  --gold-deep: #ff9f1c;
  --mint: #48d89b;
  --sky: #78d6ff;
  --rose: #ff8ab4;
  --leaf: #a7d950;
  --mx: 0;
  --my: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Jua", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(125deg, #fff8d7 0%, #e8fbff 42%, #fff1f7 78%, #f4ffe7 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: 0;
  pointer-events: none;
}

body::before {
  left: -8vw;
  right: -8vw;
  bottom: -12vh;
  height: 46vh;
  background:
    linear-gradient(170deg, transparent 0 26%, rgba(255, 255, 255, .76) 26% 44%, transparent 44%),
    linear-gradient(12deg, transparent 0 34%, rgba(255, 196, 0, .2) 34% 54%, transparent 54%),
    linear-gradient(160deg, rgba(72, 216, 155, .18), rgba(120, 214, 255, .2));
  transform: translate3d(calc(var(--mx) * -16px), calc(var(--my) * 10px), 0);
}

body::after {
  left: -16vw;
  top: 8vh;
  width: 132vw;
  height: 26vh;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 196, 0, .14), rgba(120, 214, 255, .18), rgba(255, 138, 180, .13));
  transform: rotate(-8deg) translate3d(calc(var(--mx) * 20px), calc(var(--my) * -18px), 0);
  filter: blur(.2px);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: clamp(12px, 3.5vw, 46px);
  isolation: isolate;
  perspective: 1400px;
}

.world-stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  transform-style: preserve-3d;
}

.sky-ribbon,
.road-track {
  position: absolute;
  pointer-events: none;
}

.sky-ribbon {
  width: 72vw;
  height: 8vh;
  border-radius: 999px;
  opacity: .68;
  filter: blur(.2px);
}

.ribbon-a {
  left: 8vw;
  top: 12vh;
  background: linear-gradient(90deg, transparent, rgba(255, 196, 0, .35), rgba(255, 138, 180, .18), transparent);
  transform: rotate(-12deg) translate3d(calc(var(--mx) * 18px), calc(var(--my) * -8px), 0);
  animation: ribbonDrift 8s ease-in-out infinite;
}

.ribbon-b {
  right: -10vw;
  bottom: 22vh;
  background: linear-gradient(90deg, transparent, rgba(120, 214, 255, .35), rgba(72, 216, 155, .18), transparent);
  transform: rotate(10deg) translate3d(calc(var(--mx) * -20px), calc(var(--my) * 8px), 0);
  animation: ribbonDrift 9s ease-in-out infinite reverse;
}

.road-track {
  left: 50%;
  bottom: clamp(20px, 7vh, 86px);
  width: min(1040px, 116vw);
  height: clamp(70px, 10vw, 112px);
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0 4%, rgba(255,255,255,.72) 4% 9%, transparent 9% 17%, rgba(255,255,255,.72) 17% 22%, transparent 22%),
    linear-gradient(180deg, rgba(255, 196, 0, .72), rgba(255, 159, 28, .58));
  box-shadow: 0 28px 46px rgba(133, 93, 0, .15);
  transform: translateX(-50%) rotateX(56deg) rotateZ(-2deg);
}

.stage-character {
  position: absolute;
  object-fit: contain;
  user-select: none;
  filter: drop-shadow(0 28px 34px rgba(92, 56, 0, .18));
  will-change: transform;
}

.scooter-character {
  width: clamp(190px, 25vw, 390px);
  left: clamp(-22px, 6vw, 110px);
  bottom: clamp(4px, 4vh, 52px);
  transform: translate3d(calc(var(--mx) * 22px), calc(var(--my) * 12px), 80px) rotate(calc(var(--mx) * 4deg));
  animation: scooterIdle 4.2s ease-in-out infinite;
}

.fluffy-character {
  width: clamp(140px, 19vw, 290px);
  right: clamp(2px, 9vw, 140px);
  bottom: clamp(28px, 9vh, 120px);
  transform: translate3d(calc(var(--mx) * -24px), calc(var(--my) * 16px), 120px) rotate(calc(var(--mx) * -5deg));
  animation: fluffyIdle 3.6s ease-in-out infinite;
}

body.is-card-hover .scooter-character,
body.is-card-hover .fluffy-character {
  filter: drop-shadow(0 34px 40px rgba(255, 159, 28, .28)) saturate(1.18);
}

body.is-card-hover .scooter-character {
  animation: scooterReady .7s ease-in-out infinite alternate;
}

body.is-card-hover .fluffy-character {
  animation: fluffyReady .6s ease-in-out infinite alternate;
}

.survey-console {
  position: relative;
  z-index: 5;
  display: grid;
  gap: clamp(18px, 3vw, 28px);
  width: min(900px, calc(100vw - 24px));
  min-height: auto;
  padding: clamp(24px, 4.5vw, 42px);
  border-radius: clamp(30px, 5vw, 48px);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .66)),
    linear-gradient(135deg, rgba(255, 196, 0, .12), rgba(120, 214, 255, .15) 48%, rgba(255, 138, 180, .1));
  box-shadow: 0 34px 90px rgba(65, 45, 4, .18);
  backdrop-filter: blur(22px);
  overflow: hidden;
  transform-style: preserve-3d;
}

.survey-console::before {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  top: -22%;
  height: 38%;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(90deg, rgba(255, 196, 0, .2), rgba(120, 214, 255, .16), rgba(72, 216, 155, .13));
  transform: translate3d(calc(var(--mx) * 10px), calc(var(--my) * 10px), 0);
}

.selector-board,
.survey-area {
  position: relative;
  z-index: 3;
}

.selector-board {
  display: grid;
  gap: 14px;
  transition: transform .26s ease, filter .26s ease;
}

.selector-board.is-changing {
  transform: translateY(-2px) scale(1.01);
  filter: saturate(1.12);
}

.radio-section {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

.radio-section legend {
  padding: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1;
}

.radio-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-choice {
  position: relative;
  display: inline-grid;
}

.radio-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.radio-choice span {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid rgba(255, 196, 0, .36);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: var(--ink);
  box-shadow: 0 12px 22px rgba(73, 45, 4, .08);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.radio-choice:hover span {
  transform: translateY(-2px);
  box-shadow: 0 18px 28px rgba(255, 159, 28, .16);
}

.radio-choice input:checked + span {
  color: white;
  border-color: rgba(255, 255, 255, .72);
  background:
    radial-gradient(circle at 28% 20%, rgba(255,255,255,.36), transparent 28%),
    linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 18px 34px rgba(255, 159, 28, .28);
  transform: translateY(-2px) scale(1.04);
}

.radio-choice input:focus-visible + span {
  outline: 4px solid rgba(120, 214, 255, .5);
  outline-offset: 3px;
}

.elementary-band {
  overflow: hidden;
  max-height: 92px;
  opacity: 1;
  transform: translateY(0);
  transition: max-height .26s ease, opacity .2s ease, transform .26s ease;
}

.elementary-band.is-hidden {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.survey-area {
  display: grid;
  gap: clamp(14px, 2.4vw, 20px);
}

.survey-console.is-celebrating {
  animation: consoleCheer 1.45s cubic-bezier(.12, .86, .14, 1);
}

.step-dots {
  position: absolute;
  z-index: 6;
  top: 22px;
  right: 22px;
  display: flex;
  gap: 8px;
}

.dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 196, 0, .28);
  background: rgba(255, 255, 255, .72);
  color: #967c3f;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 9px 16px rgba(72, 45, 4, .08);
}

.dot.is-active {
  color: white;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  animation: dotPop .42s ease both;
}

.dot.is-done {
  color: white;
  background: linear-gradient(135deg, var(--mint), #13ae78);
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  align-content: center;
  gap: clamp(18px, 4vw, 28px);
  padding: clamp(74px, 10vw, 102px) clamp(20px, 6vw, 62px) clamp(24px, 6vw, 58px);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 18px, -90px) rotateY(8deg) scale(.96);
  transition: opacity .32s ease, transform .5s cubic-bezier(.18, .88, .21, 1);
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) rotateY(0) scale(1);
}

.screen h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(26px, 5vw, 44px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
}

select {
  width: min(100%, 420px);
  min-height: 72px;
  margin: 0 auto;
  padding: 0 26px;
  border: 3px solid rgba(255, 196, 0, .7);
  border-radius: 26px;
  outline: none;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  box-shadow: 0 18px 36px rgba(73, 45, 4, .11);
  font-size: clamp(23px, 4vw, 32px);
  font-weight: 400;
  text-align: center;
}

select:focus {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 8px rgba(255, 196, 0, .18), 0 18px 36px rgba(73, 45, 4, .11);
}

.primary-action,
.mini-action {
  justify-self: center;
  border-radius: 999px;
  font-weight: 400;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.primary-action {
  min-width: min(100%, 250px);
  min-height: 62px;
  padding: 0 34px;
  color: white;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 18px 34px rgba(255, 159, 28, .28);
  font-size: 22px;
}

.mini-action {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 196, 0, .28);
  background: rgba(255, 255, 255, .74);
  color: #7b5a00;
  font-size: 14px;
}

.primary-action:hover,
.mini-action:hover {
  transform: translateY(-2px) scale(1.03);
  filter: saturate(1.1);
}

.survey-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.survey-head h2 {
  text-align: left;
  font-size: clamp(20px, 3.8vw, 30px);
  font-weight: 400;
}

.survey-card-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  perspective: 1200px;
}

.survey-card-grid::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -12px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(103, 75, 0, .16), transparent 68%);
  pointer-events: none;
  transform: translateY(10px);
}

.survey-card {
  position: relative;
  min-height: 230px;
  padding: 0;
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, .94);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 245, 203, .92)),
    radial-gradient(circle at var(--px, 50%) var(--py, 24%), rgba(255, 255, 255, .98), transparent 34%);
  color: var(--ink);
  box-shadow:
    0 26px 46px rgba(73, 45, 4, .16),
    inset 0 0 0 1px rgba(255, 196, 0, .2);
  transform-style: preserve-3d;
  overflow: hidden;
  transition: transform .24s cubic-bezier(.18, .88, .21, 1), box-shadow .2s ease, filter .2s ease, opacity .2s ease;
}

.survey-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 0;
  border-radius: 24px;
  border: 1px dashed rgba(255, 196, 0, .42);
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,.9) 0 10px, transparent 11px),
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.78) 0 15px, transparent 16px),
    linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.survey-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(115deg, transparent 0 34%, rgba(255,255,255,.82) 42%, transparent 50%),
    radial-gradient(circle at var(--px, 50%) var(--py, 30%), rgba(255,255,255,.68), transparent 24%);
  opacity: .42;
  mix-blend-mode: screen;
  pointer-events: none;
}

.survey-card:hover {
  box-shadow:
    0 34px 60px rgba(255, 159, 28, .24),
    inset 0 0 0 1px rgba(255, 196, 0, .28);
  filter: saturate(1.1);
}

.survey-card.card-tone-1 {
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(255,244,193,.94)),
    linear-gradient(180deg, rgba(255,196,0,.18), rgba(120,214,255,.16));
}

.survey-card.card-tone-2 {
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(230,252,255,.94)),
    linear-gradient(180deg, rgba(120,214,255,.18), rgba(255,138,180,.13));
}

.survey-card.card-tone-3 {
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(240,255,222,.94)),
    linear-gradient(180deg, rgba(167,217,80,.2), rgba(255,196,0,.14));
}

.survey-card.is-complete {
  background:
    radial-gradient(circle at var(--px, 50%) var(--py, 24%), rgba(255, 255, 255, .98), transparent 30%),
    linear-gradient(150deg, rgba(225, 255, 242, .96), rgba(238, 252, 255, .96));
}

.survey-card.is-flipping {
  animation: flipTap .52s cubic-bezier(.18, .88, .21, 1);
}

.card-face {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 14px;
  height: 100%;
  min-height: 226px;
  padding: 12px;
  border-radius: 28px;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform .48s cubic-bezier(.18, .88, .21, 1);
}

.card-front {
  grid-template-rows: minmax(128px, 1fr) auto;
}

.card-back {
  position: absolute;
  inset: 0;
  place-items: center;
  align-content: center;
  gap: 16px;
  border: 2px solid rgba(255, 255, 255, .8);
  background:
    radial-gradient(circle at 50% 28%, rgba(255,255,255,.92), transparent 36%),
    linear-gradient(145deg, rgba(231, 255, 241, .98), rgba(231, 251, 255, .94));
  transform: rotateY(180deg);
}

.survey-card.is-complete .card-front {
  transform: rotateY(-180deg);
}

.survey-card.is-complete .card-back {
  transform: rotateY(0);
}

.card-art {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 128px;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(255,255,255,.92) 0 18%, transparent 19%),
    conic-gradient(from 0deg, rgba(255,196,0,.72), rgba(120,214,255,.55), rgba(255,138,180,.52), rgba(167,217,80,.58), rgba(255,196,0,.72));
  transform: translateZ(34px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.62);
}

.card-art::before,
.card-art::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255,255,255,.64);
}

.card-art::before {
  width: 92px;
  height: 34px;
  left: -22px;
  bottom: 20px;
  transform: rotate(-12deg);
}

.card-art::after {
  width: 70px;
  height: 28px;
  right: -14px;
  top: 22px;
  transform: rotate(10deg);
}

.card-number {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 24px;
  color: white;
  background:
    linear-gradient(135deg, rgba(255,255,255,.2), transparent),
    linear-gradient(135deg, var(--gold), var(--gold-deep));
  box-shadow: 0 15px 26px rgba(255, 159, 28, .3);
  font-family: "Nunito", "Jua", sans-serif;
  font-size: 36px;
  font-weight: 900;
  transform: translateZ(44px) rotate(-4deg);
}

.card-title {
  position: relative;
  z-index: 2;
  display: block;
  margin: 15px 4px 4px;
  padding: 12px 8px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 400;
  line-height: 1.08;
  text-align: center;
  transform: translateZ(26px);
}

.card-status {
  position: absolute;
  z-index: 2;
  left: 18px;
  top: 18px;
  display: inline-grid;
  place-items: center;
  min-width: 72px;
  min-height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  color: transparent;
  font-size: 12px;
  font-weight: 400;
  transform: translateZ(50px) rotate(-5deg);
}

.card-status:empty {
  opacity: 0;
  transform: translateZ(50px) rotate(-5deg) scale(.72);
}

.survey-card.is-complete .card-status {
  color: #08775b;
  background: #def9ef;
  opacity: 1;
}

.complete-title {
  color: var(--ink);
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.08;
  text-align: center;
}

@keyframes scooterIdle {
  0%, 100% { translate: 0 0; rotate: -1deg; }
  50% { translate: 10px -12px; rotate: 3deg; }
}

@keyframes fluffyIdle {
  0%, 100% { translate: 0 0; rotate: 1deg; }
  50% { translate: -4px -15px; rotate: -4deg; }
}

@keyframes scooterReady {
  from { translate: -4px 0; rotate: -4deg; }
  to { translate: 12px -10px; rotate: 6deg; }
}

@keyframes fluffyReady {
  from { translate: 0 0; scale: 1; }
  to { translate: 0 -14px; scale: 1.05; }
}

@keyframes ribbonDrift {
  0%, 100% { opacity: .48; }
  50% { opacity: .84; }
}

@keyframes consoleCheer {
  0%, 100% { transform: translateZ(0) rotate(0); }
  28% { transform: translateZ(70px) rotate(-1.2deg); }
  54% { transform: translateZ(40px) rotate(1.1deg); }
}

@keyframes dotPop {
  0% { transform: scale(.72); }
  70% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes flipTap {
  0% { transform: translateY(0) scale(1); }
  38% { transform: translateY(-8px) scale(1.025); }
  100% { transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .scooter-character {
    width: 230px;
    left: -24px;
    bottom: 0;
  }

  .fluffy-character {
    width: 160px;
    right: 8px;
    bottom: 42px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    align-items: start;
    padding: 12px;
  }

  .survey-console {
    width: 100%;
    min-height: calc(100vh - 24px);
    padding: 24px 16px 22px;
    border-radius: 30px;
  }

  .selector-board {
    gap: 12px;
  }

  .radio-options {
    gap: 8px;
  }

  .radio-choice span {
    min-height: 42px;
    padding: 0 13px;
    font-size: 16px;
  }

  .elementary-band {
    max-height: 88px;
  }

  .step-dots {
    top: 18px;
    right: 18px;
  }

  .screen {
    padding: 94px 18px 24px;
  }

  .screen h2 {
    font-size: 34px;
  }

  select {
    min-height: 68px;
    font-size: 26px;
    border-radius: 24px;
  }

  .primary-action {
    width: 100%;
    min-height: 60px;
  }

  .survey-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .survey-card-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .survey-card {
    min-height: 148px;
    border-radius: 26px;
  }

  .card-face {
    min-height: 144px;
    border-radius: 24px;
  }

  .card-front {
    grid-template-columns: 118px 1fr;
    grid-template-rows: none;
    align-items: center;
    gap: 12px;
  }

  .card-title {
    margin: 0;
  }

  .card-art {
    min-height: 112px;
  }

  .card-number {
    width: 62px;
    height: 62px;
  }

  .scooter-character {
    width: 142px;
    left: -32px;
    bottom: 4px;
    opacity: .72;
  }

  .fluffy-character {
    width: 102px;
    right: -6px;
    bottom: 42px;
    opacity: .78;
  }

  .road-track {
    bottom: 8px;
    width: 140vw;
  }

  .sky-ribbon {
    display: none;
  }
}

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