:root {
  color-scheme: light;
  --background: #f7f7fb;
  --surface: #fff;
  --ink: #211c34;
  --muted: #625d72;
  --line: #e6e3ee;
  --purple: #5f42bb;
  --purple-dark: #493095;
  --lavender: #eee8fb;
  --mint: #e2f3ec;
  --green: #216b51;
  --peach: #f9ebdf;
  --orange: #814925;
  --shadow: 0 2px 8px #26145208;
  --round: 21px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { min-height: 100svh; margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid #9479e5;
  outline-offset: 3px;
}
h1, h2, p { margin: 0; }
h1, h2 { letter-spacing: -.032em; line-height: 1.12; }
h1:focus, h2:focus, main:focus { outline: none; }
p { color: var(--muted); line-height: 1.6; }
ul { list-style: none; margin: 0; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.skip-link { position: absolute; z-index: 3; top: 7px; left: 11px; transform: translateY(-150%); background: #fff; padding: 8px 14px; }
.skip-link:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1240px; height: 72px; margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px;
}
.brand {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.33rem; font-weight: 790; letter-spacing: -.055em;
}
.mark {
  height: 34px; width: 34px; border-radius: 11px; background: #6450bc;
  display: inline-grid; place-items: center; position: relative;
}
.mark i { position: absolute; width: 14px; height: 13px; border: 1.8px solid #fff; border-radius: 5px 5px 5px 2px; transform: translate(-3px, -2px); }
.mark i + i { transform: translate(3px, 3px); border-color: #e7dafe; background: #6450bc; border-radius: 5px 5px 2px 5px; }
.nav { display: flex; gap: 5px; align-items: center; }
.nav a { padding: 9px 14px; border-radius: 9px; color: var(--muted); font-size: .92rem; font-weight: 650; }
.nav a:hover { background: #f5f2fb; }
.nav a[aria-current="page"] { color: var(--purple-dark); background: var(--lavender); }
.profile { position: relative; justify-self: end; min-width: 0; }
.profile summary { display: flex; align-items: center; gap: 9px; list-style: none; }
summary::-webkit-details-marker { display: none; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: inline-grid; place-items: center; background: #eee8fb; color: var(--purple-dark); font-size: .87rem; font-weight: 740;
}
.profile-name { font-size: .87rem; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 140px; }
.profile-menu {
  position: absolute; z-index: 2; min-width: 155px; right: 0; top: calc(100% + 10px);
  display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 12px; box-shadow: 0 10px 22px #211c3418;
}
.profile-menu strong { overflow-wrap: anywhere; font-size: .9rem; }
.signout { color: var(--purple-dark); background: var(--lavender); border-radius: 8px; border: 0; text-align: left; padding: 8px 10px; font-weight: 680; font-size: .83rem; }
.shell { max-width: 1240px; margin: 0 auto; padding: 31px 28px 42px; }
.hero {
  overflow: hidden; position: relative; min-height: 310px; border-radius: 25px;
  padding: 37px 46px; isolation: isolate; background: linear-gradient(110deg, #29204c 10%, #3b2b70 75%, #473582 100%);
}
.hero-copy { position: relative; z-index: 1; max-width: 630px; }
.hero .eyebrow { color: #ddcffc; font-weight: 690; letter-spacing: .07em; text-transform: uppercase; font-size: .74rem; margin-bottom: 13px; }
.hero h1 { color: #fffaf4; font-size: clamp(2.7rem, 5.4vw, 5rem); font-weight: 800; letter-spacing: -.075em; line-height: 1.04; }
.hero p { color: #e8e0f9; max-width: 485px; font-size: 1.05rem; margin-top: 13px; }
.hero .eyebrow { margin-top: 0; }
.hero .button { margin-top: 26px; }
.orbital {
  position: absolute; inset: 0 0 0 auto; width: 44%; height: 100%; overflow: hidden;
  background: radial-gradient(circle at 66% 53%, #6952ab 0, #55418d66 36%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.orbital i, .orbital b, .orbital em { position: absolute; display: block; }
.orbital i {
  top: 48%; left: 57%; width: clamp(240px, 37vw, 520px); aspect-ratio: 1.65;
  transform: translate(-50%, -50%) rotate(-29deg); border: 1px solid #c9b8ff70; border-radius: 50%;
}
.orbital i:nth-child(2) { transform: translate(-50%, -50%) rotate(35deg) scale(.94); }
.orbital i:nth-child(3) { transform: translate(-50%, -50%) rotate(89deg) scale(.87); }
.orbital em {
  top: 47%; left: 58%; width: 118px; height: 118px; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 33% 27%, #efcefe, #a47be7 38%, #6e55ba 76%, #48337d 100%);
  box-shadow: 0 0 57px #b28bf552, inset -3px -5px 18px #32236b77;
}
.orbital b { z-index: 1; height: 12px; width: 12px; border-radius: 50%; background: #f2bdac; box-shadow: 0 0 15px #edbae1; top: 21%; left: 81%; }
.orbital b:nth-of-type(2) { width: 8px; height: 8px; top: 78%; left: 38%; background: #e2d7ff; }
.orbital b:nth-of-type(3) { width: 6px; height: 6px; top: 53%; left: 17%; background: #cfc0ff; }
.button {
  min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; font-size: .9rem;
  font-weight: 720; line-height: 1.3; text-align: center; transition: background .16s, border-color .16s, color .16s;
}
.button.primary { color: #fff; background: var(--purple); padding-inline: 17px; }
.button.primary:hover { background: var(--purple-dark); }
.button.light { background: #fffafc; color: #362560; padding-inline: 17px; }
.button.light:hover { background: #eadfff; }
.button.secondary { color: var(--purple-dark); background: #f6f2fd; border-color: #ece5fa; }
.button.secondary:hover { background: #eee6fc; }
.button.quiet { color: var(--muted); background: transparent; }
.button.quiet:hover { background: #f2eff8; color: var(--ink); }
.button:disabled, .button:disabled:hover { background: #f3f1f6; color: #625d72; border-color: #e8e4ef; opacity: .75; }
.arrow { font-size: 1.17em; line-height: 1; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin: 19px 0 27px; }
.metric { display: flex; gap: 13px; align-items: center; min-width: 0; padding: 13px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.metric strong, .metric span:not(.icon) { display: block; }
.metric strong { font-size: 1.36rem; font-weight: 780; line-height: 1.15; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric span:not(.icon) { color: var(--muted); font-size: .79rem; margin-top: 2px; }
.icon { display: inline-grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; font-size: 1.35rem; line-height: 1; font-weight: 690; flex: 0 0 auto; }
.lavender { background: var(--lavender); color: var(--purple-dark); }
.mint { background: var(--mint); color: var(--green); }
.peach { background: var(--peach); color: var(--orange); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(250px, 1fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--round); box-shadow: var(--shadow); }
.config { padding: 24px; scroll-margin-top: 15px; }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 23px; }
.section-title h2 { font-size: 1.43rem; }
.section-title p { font-size: .87rem; margin-top: 2px; }
.config legend { color: var(--ink); font-size: .87rem; font-weight: 730; margin-bottom: 10px; }
.config fieldset + fieldset { margin-top: 23px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  min-height: 39px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); border-radius: 9px; padding: 6px 9px; font-size: .82rem; font-weight: 645;
}
.chip span { color: var(--purple); font-size: 1.06rem; }
.chip:hover, .level:hover { border-color: #baaae2; }
.chip[aria-pressed="true"], .level[aria-pressed="true"] { background: #f1ebfc; border-color: #9c83de; color: var(--purple-dark); }
.levels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.level {
  display: grid; justify-items: center; gap: 4px; align-content: center; min-height: 62px; padding: 4px 2px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); min-width: 0;
}
.level strong { font-size: 1.24rem; line-height: 1.05; letter-spacing: -.02em; color: var(--ink); }
.level[aria-pressed="true"] strong { color: var(--purple-dark); }
.level span { font-size: clamp(.61rem, 1vw, .78rem); font-weight: 650; }
.field-hint { font-size: .81rem; margin-top: 7px; }
.config-actions { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.config-actions > span { font-size: .78rem; color: var(--muted); text-align: right; }
.config-actions > div { display: flex; flex-wrap: wrap; gap: 3px; }
.side-stack { display: grid; gap: 14px; }
.side-card { padding: 19px 20px; }
.side-card .icon { width: 32px; height: 32px; border-radius: 9px; }
.side-card h2 { margin-top: 9px; font-size: 1.2rem; }
.side-card p { font-size: .86rem; margin: 5px 0 12px; }
.side-card .button { min-height: 39px; font-size: .82rem; }
.duo-card { background: #fffdfa; }
.footer {
  display: flex; justify-content: space-between; gap: 12px; margin: 0 auto; max-width: 1184px;
  color: var(--muted); border-top: 1px solid var(--line); padding: 16px 0 25px; font-size: .8rem;
}
.footer:empty { display: none; }
.footer span:first-child { font-weight: 740; }
.page-heading { padding: 12px 0 2px; }
.page-heading h1 { font-size: clamp(2rem, 4.5vw, 3.3rem); }
.page-heading p { margin-top: 8px; }
.progress-panel { padding: 23px; }
.progress-panel h2 { font-size: 1.29rem; }
.progress-panel p { margin-top: 7px; font-size: .9rem; }
.topics-progress { display: grid; gap: 13px; margin-top: 20px; }
.topics-progress li { display: grid; grid-template-columns: minmax(160px, 1.35fr) minmax(60px, 1fr) 76px; align-items: center; gap: 8px; }
.topic-label { font-size: .84rem; font-weight: 650; }
.topic-label span { display: inline-block; width: 21px; color: var(--purple); }
.topics-progress small { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
progress { appearance: none; width: 100%; height: 7px; background: #eeebf5; border: 0; border-radius: 20px; overflow: hidden; }
progress::-webkit-progress-bar { background: #eeebf5; border-radius: 20px; }
progress::-webkit-progress-value { background: #7e63d0; border-radius: 20px; }
progress::-moz-progress-bar { background: #7e63d0; border-radius: 20px; }
.week-progress { margin-top: 14px; display: grid; gap: 7px; }
.week-progress li { display: grid; grid-template-columns: 1fr 25px; gap: 8px; align-items: center; }
.week-progress li > div { display: grid; grid-template-columns: 25px 1fr; align-items: center; gap: 6px; text-align: right; }
.week-progress li span, .week-progress small { color: var(--muted); font-size: .75rem; }
.history { margin-top: 17px; }
.result-list, .score-list, .answer-list { margin-top: 12px; }
.result-list li + li, .score-list li + li, .answer-list li + li { border-top: 1px solid var(--line); }
.listed-round {
  display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 14px;
  background: transparent; border: 0; color: var(--ink); text-align: left; padding: 10px 7px;
}
.listed-round:hover { background: #f9f6fe; }
.listed-round strong, .listed-round small { display: block; }
.listed-round small { margin-top: 4px; color: var(--muted); }
.listed-round > span:last-child { color: var(--purple-dark); flex-shrink: 0; font-weight: 730; font-variant-numeric: tabular-nums; }
.listed-round .arrow { margin-left: 5px; }
.duo-hero { min-height: 280px; }
.score-panel { margin-top: 19px; }
.score-list li { display: flex; align-items: center; gap: 11px; padding: 12px 0; }
.score-list strong { overflow-wrap: anywhere; }
.score-list small { display: block; margin-top: 2px; color: var(--muted); font-size: .77rem; }
.score-list strong small { display: inline; }
.score { margin-left: auto; flex-shrink: 0; font-size: 1.12rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); }
.game-wrap { max-width: 810px; margin-inline: auto; }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.game-top .quiet { padding-left: 4px; }
.game-top > span { font-size: .88rem; font-weight: 670; text-align: right; }
.question-counter { display: flex; justify-content: space-between; font-size: .82rem; font-weight: 680; color: var(--muted); }
.round-progress { display: block; margin: 8px 0 16px; height: 7px; }
.game-panel { padding: clamp(19px, 4vw, 40px); }
.question-topic { color: var(--purple-dark); font-weight: 700; font-size: .83rem; margin-bottom: 12px; }
.game-panel h1 { font-size: clamp(1.55rem, 4.9vw, 2.58rem); overflow-wrap: anywhere; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.choice {
  display: flex; align-items: center; gap: 11px; background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px; min-height: 65px; min-width: 0; text-align: left; font-weight: 625; font-size: .95rem; overflow-wrap: anywhere;
}
button.choice:hover { border-color: #b39cde; background: #faf7ff; }
.choice-letter { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #f0edf6; flex-shrink: 0; color: #504663; font-size: .82rem; }
.right-choice { border-color: #91c4af; background: #eff9f3; }
.right-choice .choice-letter { background: #d8f0e2; color: #14553d; }
.wrong-choice { border-color: #d99a9c; background: #fff3f4; }
.wrong-choice .choice-letter { background: #fae0e2; color: #902b37; }
.answer-feedback { margin-top: 15px; border-radius: 11px; border-left: 3px solid #689e84; background: #eef7f2; padding: 13px 14px; }
.answer-feedback h2 { font-size: 1.08rem; }
.answer-feedback p { margin-top: 5px; font-size: .9rem; color: var(--ink); }
.wrong-feedback { background: #faf1e8; border-color: #ba855b; }
.round-actions { display: flex; justify-content: flex-end; margin-top: 15px; }
.recall { border-radius: 12px; background: #f7f4fd; padding: 17px; margin-top: 18px; }
.recall p { margin-bottom: 10px; }
.result-banner { text-align: center; padding: 29px 18px; }
.result-banner .icon { margin-bottom: 12px; }
.result-banner h1 { font-size: clamp(1.65rem, 4vw, 2.6rem); }
.result-score { margin-top: 10px; font-size: 3.45rem; font-weight: 800; letter-spacing: -.058em; color: var(--purple-dark); }
.result-score span { color: var(--muted); font-size: .62em; font-weight: 650; }
.result-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 15px; }
.answer-list summary { display: flex; align-items: center; gap: 10px; list-style: none; padding: 10px 0; font-size: .88rem; }
.answer-list summary > strong { overflow-wrap: anywhere; }
.correct-mark, .wrong-mark { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; }
.correct-mark { color: #20664b; background: #e5f4eb; }
.wrong-mark { color: #8a3241; background: #fae7eb; }
.disclosure { margin-left: auto; color: var(--muted); }
.answer-list details[open] .disclosure { transform: rotate(180deg); }
.answer-list details div { padding: 0 0 11px 35px; }
.answer-list details p { overflow-wrap: anywhere; }
.login-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 17px; align-items: stretch; }
.login-hero { display: flex; align-items: center; min-height: 370px; }
.login-hero .orbital { opacity: .4; width: 62%; }
.login-panel { padding: clamp(20px, 4vw, 36px); align-content: center; }
.login-panel h2 { font-size: 1.8rem; }
.login-panel p { margin: 8px 0 18px; }
:is(#login-form, #register-form, #account-form) { display: grid; gap: 13px; }
:is(#login-form, #register-form, #account-form) label { display: grid; gap: 5px; font-weight: 680; font-size: .88rem; }
:is(#login-form, #register-form, #account-form) input { width: 100%; border: 1px solid var(--line); min-height: 45px; border-radius: 9px; padding: 8px 10px; color: var(--ink); background: #fff; font-size: 1rem; }
:is(#login-form, #register-form, #account-form) .button { justify-self: start; margin-top: 4px; }
.loading { padding: 30px 0; color: var(--muted); }
.notice {
  position: fixed; z-index: 3; right: 16px; bottom: 16px; max-width: min(390px, calc(100% - 32px));
  border-radius: 12px; box-shadow: 0 8px 26px #211c344d; padding: 13px 16px; font-weight: 650; font-size: .9rem;
  color: #fff; background: #392b61;
}
@media (max-width: 1240px) {
  .footer { margin-inline: 28px; }
}
@media (max-width: 850px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-grid .side-stack { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero { min-height: 285px; padding: 35px 29px; }
  .hero-copy { max-width: 75%; }
  .hero p { max-width: 440px; }
  .orbital { opacity: .78; }
  .hero h1 { font-size: clamp(2.7rem, 7vw, 4.15rem); }
  .level span { font-size: .75rem; }
}
@media (max-width: 560px) {
  .header-inner { height: auto; min-height: 64px; grid-template-columns: 1fr 1fr; gap: 0; padding: 11px 15px 8px; }
  .brand { font-size: 1.22rem; }
  .nav { grid-row: 2; grid-column: span 2; justify-content: space-between; margin-top: 7px; }
  .nav a { flex: 1; text-align: center; padding: 7px 6px; font-size: .84rem; }
  .profile { grid-row: 1; grid-column: 2; }
  .profile-name { max-width: 93px; }
  .shell { padding: 16px 13px 27px; }
  .hero { min-height: 235px; padding: 25px 18px; border-radius: 19px; }
  .hero-copy { max-width: 100%; }
  .hero h1 { font-size: clamp(2.38rem, 9vw, 3rem); }
  .hero p { font-size: .92rem; max-width: 87%; }
  .hero .eyebrow { font-size: .65rem; }
  .hero .button { margin-top: 17px; }
  .orbital { width: 58%; opacity: .44; }
  .orbital em { width: 70px; height: 70px; }
  .metrics { margin: 12px 0 16px; gap: 6px; }
  .metric { padding: 8px 5px; gap: 4px; flex-direction: column; align-items: start; border-radius: 10px; }
  .metric strong { font-size: 1.06rem; }
  .metric span:not(.icon) { font-size: .68rem; }
  .metric .icon { width: 25px; height: 25px; font-size: .99rem; border-radius: 7px; }
  .home-grid .side-stack, .login-grid { grid-template-columns: 1fr; }
  .home-grid { gap: 12px; }
  .config, .progress-panel, .side-card { padding: 15px; }
  .config .section-title { margin-bottom: 16px; }
  .config fieldset + fieldset { margin-top: 17px; }
  .levels { grid-template-columns: repeat(3, 1fr); }
  .level { min-height: 49px; }
  .config-actions { align-items: start; flex-direction: column; }
  .config-actions > span { text-align: left; }
  .topics-progress li { grid-template-columns: minmax(108px, 1.3fr) minmax(25px, 1fr) 54px; gap: 5px; }
  .topic-label { font-size: .75rem; }
  .topic-label span { width: 16px; }
  .topics-progress small { font-size: .68rem; }
  .choices { grid-template-columns: 1fr; gap: 7px; margin-top: 17px; }
  .choice { min-height: 53px; font-size: .9rem; }
  .game-top { margin-bottom: 5px; }
  .footer { margin-inline: 13px; font-size: .72rem; padding-block: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
.settings-grid { margin-top: 18px; }
.invite-panel .button { margin-top: 13px; }
.invite-label { display: grid; gap: 6px; padding-top: 14px; font-weight: 690; font-size: .87rem; }
.invite-label input { width: 100%; min-height: 43px; border: 1px solid var(--line); border-radius: 9px; padding: 9px; color: var(--ink); }
:is(#login-form, #register-form, #account-form) small { font-weight: 500; color: var(--muted); }

#account-form { margin-top: 15px; }
#account-form .account-lock { display: flex; align-items: center; gap: 8px; }
#account-form .account-lock input { width: 18px; min-height: 18px; accent-color: var(--purple); }
.account-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.managed-profile > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.managed-profile .button { margin-left: auto; flex-shrink: 0; }
@media (max-width: 850px) {
  .home-grid.settings-grid .side-stack { grid-template-columns: 1fr; }
}
