:root {
  color-scheme: dark;
  --navy: #0c1730;
  --navy-soft: #111f3f;
  --card: rgba(20, 36, 70, 0.83);
  --card-solid: #142446;
  --line: rgba(148, 176, 228, 0.2);
  --muted: #9eb0d0;
  --text: #f7faff;
  --mint: #5ef0c3;
  --mint-dark: #1fc998;
  --yellow: #ffd868;
  --red: #ff7186;
  --blue: #7aa7ff;
  font-family: Pretendard, 'Noto Sans KR', 'Apple SD Gothic Neo', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--navy); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 5%, rgba(87, 122, 255, 0.2), transparent 29rem),
    radial-gradient(circle at 4% 48%, rgba(54, 233, 183, 0.09), transparent 26rem),
    linear-gradient(160deg, #0a142a 0%, #0e1a35 52%, #09152b 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: '';
  opacity: 0.22;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 34px 34px;
}

button, select { font: inherit; }
button { color: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.hidden { display: none !important; }

.app-shell { position: relative; width: min(1120px, calc(100% - 40px)); min-height: 100vh; margin: auto; }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 92px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid rgba(94,240,195,.35); border-radius: 15px; background: rgba(94,240,195,.11); font-size: 24px; box-shadow: inset 0 0 20px rgba(94,240,195,.06); }
.brand span:last-child { display: grid; }
.brand strong { font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 18px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 600; }
.ghost-button { border: 1px solid var(--line); border-radius: 12px; padding: 10px 15px; background: rgba(255,255,255,.04); cursor: pointer; }
.ghost-button:hover { border-color: var(--mint); background: rgba(94,240,195,.08); }

.screen { animation: reveal .35s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(7px); } }

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 330px;
  min-height: 340px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(120deg, rgba(25,44,83,.96), rgba(19,37,74,.76));
  box-shadow: 0 28px 80px rgba(0,0,0,.25);
}
.hero-card::after { position: absolute; width: 340px; height: 340px; right: -70px; top: -80px; border-radius: 50%; background: radial-gradient(circle, rgba(122,167,255,.28), transparent 69%); content: ''; }
.hero-copy { z-index: 1; align-self: center; padding: 52px 60px; }
.eyebrow, .step-label { margin: 0 0 12px; color: var(--mint); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .18em; }
h1, h2, p { word-break: keep-all; }
.hero-copy h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); line-height: 1.12; letter-spacing: -.055em; }
.hero-copy h1 em { color: var(--yellow); font-style: normal; }
.hero-description { max-width: 570px; margin: 20px 0 24px; color: #bdcbe4; font-size: 16px; line-height: 1.8; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-tags span { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: #dce7fa; background: rgba(255,255,255,.035); font-size: 12px; font-weight: 600; }

.demo-speaker { z-index: 1; position: relative; align-self: center; justify-self: center; display: grid; width: 190px; height: 190px; place-items: center; border: 1px solid rgba(94,240,195,.42); border-radius: 50%; background: radial-gradient(circle, rgba(94,240,195,.21), rgba(94,240,195,.05) 64%, transparent 65%); cursor: pointer; }
.demo-speaker::after { position: absolute; inset: 24px; border: 1px solid rgba(94,240,195,.25); border-radius: inherit; content: ''; }
.demo-speaker:hover { transform: scale(1.025); }
.speaker-icon { z-index: 2; font-size: 50px; filter: drop-shadow(0 10px 18px rgba(0,0,0,.25)); }
.demo-speaker small { position: absolute; top: calc(100% + 17px); width: 180px; color: var(--muted); font-size: 11px; font-weight: 600; }
.sound-rings, .sound-rings i { position: absolute; inset: 0; border: 1px solid rgba(94,240,195,.15); border-radius: inherit; }
.sound-rings i:nth-child(1) { inset: -17px; }
.sound-rings i:nth-child(2) { inset: -34px; opacity: .65; }
.sound-rings i:nth-child(3) { inset: -51px; opacity: .32; }
.demo-speaker.speaking .sound-rings i { animation: sound-wave 1.1s ease-out infinite; }
.demo-speaker.speaking .sound-rings i:nth-child(2) { animation-delay: .18s; }
.demo-speaker.speaking .sound-rings i:nth-child(3) { animation-delay: .36s; }
@keyframes sound-wave { 0% { transform: scale(.9); opacity: .1; } 45% { opacity: .8; } 100% { transform: scale(1.13); opacity: 0; } }

.dashboard-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 20px; margin-top: 20px; }
.card { border: 1px solid var(--line); border-radius: 25px; background: var(--card); box-shadow: 0 20px 50px rgba(0,0,0,.16); backdrop-filter: blur(14px); }
.setup-card, .stats-card { padding: 30px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; }
.section-heading h2, .stats-card h2 { margin: -3px 0 23px; font-size: 23px; letter-spacing: -.035em; }
.word-count { border-radius: 999px; padding: 6px 11px; color: var(--mint); background: rgba(94,240,195,.1); font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 11px; font-weight: 800; }
fieldset { min-width: 0; margin: 0 0 19px; padding: 0; border: 0; }
legend { margin-bottom: 9px; color: #c7d5ec; font-size: 12px; font-weight: 700; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5,12,28,.45); }
.segmented button { border: 0; border-radius: 10px; padding: 10px 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.segmented button:hover { color: white; }
.segmented button.active { color: #071a17; background: var(--mint); box-shadow: 0 6px 18px rgba(31,201,152,.2); }
select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 42px 12px 13px; color: var(--text); background: #101d39; cursor: pointer; }
.setup-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.primary-button, .secondary-button, .review-button, .resume-button { width: 100%; min-height: 50px; border-radius: 13px; cursor: pointer; font-weight: 800; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 14px; border: 0; color: #06241c; background: linear-gradient(110deg, var(--mint), #8bf7d7); box-shadow: 0 12px 26px rgba(31,201,152,.18); }
.primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.primary-button b { font-size: 20px; }
.review-button, .resume-button, .secondary-button { margin-top: 9px; border: 1px solid var(--line); color: #dce8fb; background: rgba(255,255,255,.035); }
.review-button:hover, .resume-button:hover, .secondary-button:hover { border-color: var(--blue); background: rgba(122,167,255,.08); }
.review-button strong { color: var(--yellow); }
.availability { min-height: 17px; margin: 10px 0 0; color: var(--muted); text-align: center; font-size: 11px; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats-grid > div { display: grid; min-height: 96px; place-content: center; border: 1px solid var(--line); border-radius: 16px; text-align: center; background: rgba(7,15,32,.3); }
.stats-grid span { color: var(--muted); font-size: 11px; }
.stats-grid strong { margin-top: 3px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 27px; }
.stats-grid small { color: #7588a9; font-size: 10px; }
.tip-box { display: flex; align-items: center; gap: 12px; margin-top: 17px; border-radius: 16px; padding: 14px 16px; background: rgba(255,216,104,.075); }
.tip-box > span { font-size: 24px; }
.tip-box p { margin: 0; color: #bfcae0; font-size: 11px; line-height: 1.6; }
.tip-box strong { color: var(--yellow); }

.quiz-header { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 11px 20px; width: min(800px, 100%); margin: 14px auto 20px; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 700; }
.progress-copy strong { color: var(--yellow); }
.progress-track { grid-column: 1; height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.progress-track i { display: block; width: 10%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint-dark), var(--mint)); transition: width .3s ease; }
.streak-pill { grid-column: 2; grid-row: 1 / 3; align-self: center; border: 1px solid rgba(255,216,104,.24); border-radius: 99px; padding: 8px 12px; color: #ffd868; background: rgba(255,216,104,.07); font-size: 12px; font-weight: 800; }

.question-card { width: min(800px, 100%); min-height: 650px; margin: 0 auto; border: 1px solid var(--line); border-radius: 28px; padding: 32px; text-align: center; background: linear-gradient(160deg, rgba(22,39,76,.93), rgba(13,27,56,.96)); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.question-kicker { margin: 0 0 22px; color: #c2cfe5; font-size: 14px; font-weight: 700; }
.listen-button { display: flex; width: min(390px, 100%); min-height: 114px; align-items: center; justify-content: center; gap: 18px; margin: 0 auto; border: 1px solid rgba(94,240,195,.38); border-radius: 23px; background: radial-gradient(circle at 30%, rgba(94,240,195,.16), rgba(94,240,195,.045)); cursor: pointer; }
.listen-button:hover { border-color: var(--mint); background-color: rgba(94,240,195,.08); }
.listen-button.speaking .listen-icon { animation: pulse .7s ease infinite alternate; }
@keyframes pulse { to { transform: scale(1.16); filter: drop-shadow(0 0 14px rgba(94,240,195,.7)); } }
.listen-icon { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 50%; background: var(--mint); font-size: 28px; }
.listen-button > span:last-child { display: grid; text-align: left; }
.listen-button strong { font-size: 17px; }
.listen-button small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.speech-message { min-height: 19px; margin: 10px 0 8px; color: var(--muted); font-size: 11px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-button { position: relative; min-height: 74px; border: 1px solid var(--line); border-radius: 16px; padding: 14px 20px 14px 50px; color: white; background: rgba(255,255,255,.035); cursor: pointer; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.choice-button:hover:not(:disabled) { border-color: var(--blue); transform: translateY(-2px); background: rgba(122,167,255,.08); }
.choice-button kbd { position: absolute; left: 15px; top: 50%; display: grid; width: 25px; height: 25px; place-items: center; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.16); border-radius: 7px; color: var(--muted); background: rgba(0,0,0,.16); font-size: 11px; box-shadow: none; }
.choice-button.correct { border-color: var(--mint); color: var(--mint); background: rgba(94,240,195,.11); }
.choice-button.wrong { border-color: var(--red); color: #ff9bab; background: rgba(255,113,134,.1); }
.choice-button:disabled { cursor: default; opacity: .58; }
.choice-button.correct, .choice-button.wrong { opacity: 1; }
.feedback { display: grid; grid-template-columns: auto 1fr; gap: 13px; margin-top: 16px; border-radius: 17px; padding: 16px 20px; text-align: left; background: rgba(5,13,29,.44); }
.feedback-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: #06241c; background: var(--mint); font-size: 20px; font-weight: 900; }
.feedback.wrong .feedback-icon { color: white; background: var(--red); }
.feedback p { margin: 0; color: var(--mint); font-size: 12px; font-weight: 700; }
.feedback.wrong p { color: #ff9bab; }
.feedback h2 { margin: 1px 0; color: white; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 24px; }
.feedback h2 button { border: 0; padding: 3px; background: transparent; cursor: pointer; font-size: 16px; }
.feedback #answerMeaning { color: #e7eefb; font-family: 'Noto Sans KR', sans-serif; font-size: 14px; }
.feedback small { display: block; margin-top: 5px; color: var(--muted); }
.next-button { max-width: 310px; margin: 15px auto 0; }

.result-card { width: min(700px, 100%); margin: 25px auto; padding: 45px; text-align: center; }
.result-burst { font-size: 54px; }
.result-card h1 { margin: 4px 0 6px; font-size: clamp(29px, 5vw, 43px); letter-spacing: -.04em; }
.result-card > p:not(.eyebrow) { color: var(--muted); }
.score-circle { display: grid; width: 146px; height: 146px; margin: 28px auto; place-content: center; border: 8px solid rgba(94,240,195,.16); border-top-color: var(--mint); border-radius: 50%; background: rgba(94,240,195,.06); }
.score-circle strong { font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 43px; line-height: 1; }
.score-circle span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0; }
.result-stats > div { display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 15px; padding: 15px; background: rgba(0,0,0,.12); }
.result-stats span { color: var(--muted); font-size: 11px; }
.result-stats strong { font-size: 20px; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-actions .secondary-button { margin: 0; }

footer { display: flex; justify-content: center; gap: 8px; padding: 28px 0 34px; color: #627595; font-size: 10px; }
footer a { color: #8196b8; text-decoration: none; }

@media (max-width: 760px) {
  .app-shell { width: min(100% - 24px, 560px); }
  .topbar { min-height: 76px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
  .hero-card { display: block; min-height: auto; border-radius: 24px; }
  .hero-copy { padding: 34px 27px 138px; }
  .hero-copy h1 { font-size: 38px; }
  .hero-description { font-size: 13px; }
  .demo-speaker { position: absolute; right: 38px; bottom: 27px; width: 94px; height: 94px; }
  .demo-speaker::after { inset: 12px; }
  .demo-speaker .speaker-icon { font-size: 32px; }
  .demo-speaker small, .sound-rings i:nth-child(2), .sound-rings i:nth-child(3) { display: none; }
  .sound-rings i:nth-child(1) { inset: -10px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .setup-card, .stats-card { padding: 23px; }
  .question-card { min-height: calc(100vh - 150px); border-radius: 23px; padding: 25px 17px; }
  .choice-grid { grid-template-columns: 1fr; gap: 9px; }
  .choice-button { min-height: 60px; font-size: 18px; }
  .listen-button { min-height: 94px; }
  .quiz-header { margin-top: 3px; }
  .result-card { padding: 32px 19px; }
}

@media (max-width: 410px) {
  .hero-copy h1 { font-size: 34px; }
  .hero-tags span:nth-child(2) { display: none; }
  .setup-row { grid-template-columns: 1fr; gap: 0; }
  .segmented button { padding-inline: 3px; }
  .result-stats { gap: 5px; }
  .result-stats > div { padding: 12px 5px; }
  .result-actions { grid-template-columns: 1fr; }
}

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