:root {
  color-scheme: light;
  --bg: #0f172a;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --blue: #3182f6;
  --blue-dark: #0b5ed7;
  --green: #17b26a;
  --red: #f04438;
  --yellow: #fdb022;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
  font-family:
    -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(49, 130, 246, 0.42), transparent 34rem),
    linear-gradient(135deg, #101828 0%, #172554 100%);
  color: var(--ink);
}

button {
  border: 0;
  border-radius: 22px;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

.shell {
  display: grid;
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  place-items: center;
}

.phone {
  width: min(100%, 390px);
  min-height: min(760px, calc(100vh - 28px));
  overflow: hidden;
  padding: 22px 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 34px;
  background: linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.tag,
.disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  margin: 2px 0 0;
  font-size: 30px;
  letter-spacing: -0.06em;
}

h2 {
  margin: 10px 0 22px;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: -0.055em;
}

.progressText {
  min-width: 56px;
  padding: 8px 11px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.progressTrack {
  height: 8px;
  margin: 18px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.progressBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #7c3aed);
  transition: width 220ms ease;
}

.card {
  padding: 24px 20px 20px;
  border: 1px solid rgba(16, 24, 40, 0.06);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(49, 130, 246, 0.1);
}

.tag {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--blue-dark);
}

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

.choice {
  width: 100%;
  padding: 18px 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  letter-spacing: -0.03em;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.choice:active {
  transform: scale(0.985);
}

.choice.correct {
  border-color: rgba(23, 178, 106, 0.55);
  background: #ecfdf3;
}

.choice.wrong {
  border-color: rgba(240, 68, 56, 0.5);
  background: #fff1f0;
}

.feedback {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  padding: 15px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.feedback strong {
  font-size: 16px;
}

.feedback.is-correct {
  background: #ecfdf3;
  color: #067647;
}

.feedback.is-wrong {
  background: #fff7ed;
  color: #b54708;
}

.primary,
.secondary {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 12px 24px rgba(49, 130, 246, 0.24);
}

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.result {
  text-align: center;
}

.score {
  margin-top: 18px;
  color: var(--blue);
  font-size: 64px;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.result h2 {
  margin: 0 0 8px;
}

.result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.streak {
  display: inline-flex;
  margin-top: 18px !important;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff7ed;
  color: #b54708 !important;
  font-weight: 900;
}

.actions {
  margin-top: 8px;
}

.disclaimer {
  margin-top: 18px !important;
  font-size: 12px;
  font-weight: 600;
}

.debug {
  margin-top: 16px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.9);
  color: #dbeafe;
}

.debugHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.debug button {
  padding: 7px 10px;
  border-radius: 10px;
  background: #dbeafe;
  color: #172554;
  font-size: 12px;
  font-weight: 800;
}

.debug pre {
  max-height: 260px;
  overflow: auto;
  margin: 12px 0 0;
  font-size: 11px;
  white-space: pre-wrap;
}

@media (max-width: 360px) {
  .phone {
    padding-inline: 14px;
    border-radius: 26px;
  }

  h2 {
    font-size: 25px;
  }

  .choice {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  body {
    background: linear-gradient(180deg, #f9fbff 0%, #eef4ff 100%);
  }

  .shell {
    display: block;
    min-height: 100dvh;
    padding: 0;
  }

  .phone {
    width: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
