:root {
  --bg: #f6f1e7;
  --bg-soft: #efe7d6;
  --card: #fffdf9;
  --navy: #10213f;
  --navy-2: #1a2d54;
  --gold: #d7af65;
  --gold-soft: #ead8b4;
  --ink: #0c1730;
  --ink-soft: #697287;
  --line: rgba(12, 23, 48, 0.08);
  --line-strong: rgba(12, 23, 48, 0.16);
  --danger: #934742;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow-lg: 0 26px 56px rgba(16, 33, 63, 0.12);
  --shadow-sm: 0 10px 24px rgba(16, 33, 63, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Instrument Sans", sans-serif;
  background:
    radial-gradient(circle at top center, rgba(215, 175, 101, 0.08), transparent 28%),
    linear-gradient(180deg, #faf7f0 0%, var(--bg) 100%);
}

button,
input,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.eyebrow-light {
  color: rgba(255, 255, 255, 0.68);
}

.primary-button,
.ghost-button,
.auth-tab {
  border: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button:hover,
.ghost-button:hover,
.auth-tab:hover {
  transform: translateY(-1px);
}

.primary-button {
  border-radius: 16px;
  padding: 15px 18px;
  background: linear-gradient(180deg, #ecd8b2, #dfbf86);
  color: #24170a;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.ghost-button {
  border-radius: 14px;
  padding: 12px 16px;
  background: rgba(16, 33, 63, 0.06);
  color: var(--ink);
  font-weight: 600;
}

.auth-body {
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.auth-layout {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: stretch;
}

.auth-brand,
.auth-panel,
.panel {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  padding: 38px;
  background: linear-gradient(180deg, #132544, #0a1327);
  color: white;
  position: relative;
  overflow: hidden;
}

.auth-brand::after {
  content: "";
  position: absolute;
  inset: auto -40px -40px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 175, 101, 0.26), transparent 70%);
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #2a3d66, #172544);
  color: #fff3d7;
  font-family: "Sora", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

.auth-brand h1 {
  max-width: 12ch;
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(2.5rem, 4vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.auth-panel {
  padding: 32px;
  background: var(--card);
  border: 1px solid var(--line);
}

.auth-copy p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 28px 0 20px;
}

.auth-tab {
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(16, 33, 63, 0.06);
  color: var(--ink);
  font-weight: 700;
}

.auth-tab-active {
  background: var(--navy);
  color: white;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--ink);
}

.auth-message {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(147, 71, 66, 0.08);
  color: var(--danger);
}

.app-body {
  padding: 26px 18px 40px;
}

.page-shell {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding-bottom: 24px;
  display: grid;
  gap: 18px;
}

.page-shell-game {
  width: min(100%, 760px);
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-line strong {
  display: block;
  font-size: 1.08rem;
}

.page-nav {
  display: flex;
  gap: 10px;
  margin: 18px 0 24px;
  flex-wrap: wrap;
}

.page-nav-link {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(16, 33, 63, 0.05);
  color: var(--ink-soft);
  font-weight: 700;
}

.page-nav-link-active {
  background: var(--navy);
  color: white;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.content-grid-console {
  grid-template-columns: 1.15fr 0.85fr;
}

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--card);
}

.panel-hero {
  background: linear-gradient(180deg, #132544, #0e1c36);
  color: white;
  min-height: 290px;
}

.panel-hero h2,
.page-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.page-title.light {
  color: white;
}

.panel-hero p,
.page-copy {
  margin: 14px 0 0;
  max-width: 32ch;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.8);
}

.page-copy.light {
  color: rgba(255, 255, 255, 0.78);
}

.hero-status {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0 22px;
}

.hero-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
}

.panel-soft {
  background: linear-gradient(180deg, #f3ede1, #efe6d5);
}

.panel-card {
  background: var(--card);
}

.panel-dark,
.panel-dark-small {
  background: linear-gradient(180deg, #132544, #0e1c36);
  color: white;
  border-color: rgba(255, 255, 255, 0.08);
}

.panel-dark-small .metric-subtitle,
.panel-dark .metric-subtitle {
  color: rgba(255, 255, 255, 0.74);
}

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

.section-head-start {
  align-items: flex-start;
}

.section-head h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.05em;
}

.fraction,
.metric-value {
  font-family: "Sora", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.06em;
}

.metric-value.light {
  color: white;
}

.metric-subtitle {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.streak-panel {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mini-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  color: var(--gold-soft);
  font-weight: 800;
}

.full-width {
  grid-column: 1 / -1;
}

.bottom-nav {
  position: relative;
  width: min(100%, 540px);
  margin: 24px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 22px;
  background: rgba(250, 247, 240, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 18px 32px rgba(12, 23, 48, 0.12);
  backdrop-filter: blur(14px);
  z-index: 1;
}

.bottom-nav-link {
  min-height: 62px;
  display: grid;
  place-items: center;
  gap: 6px;
  border-radius: 16px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.bottom-nav-link-active {
  background: #ece2c4;
  color: var(--ink);
}

.bottom-nav-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.week-dots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 24px;
}

.week-slot {
  text-align: center;
}

.week-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 8px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  border: 1.5px dashed rgba(16, 33, 63, 0.2);
  color: rgba(16, 33, 63, 0.4);
  background: rgba(255, 255, 255, 0.54);
  font-weight: 700;
}

.week-slot.completed .week-icon {
  border-style: solid;
  background: var(--navy);
  color: white;
}

.week-slot.future .week-icon {
  opacity: 0.5;
}

.week-label {
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.progress-metric {
  border-top: 1px solid rgba(12, 23, 48, 0.08);
  padding-top: 18px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.progress-track {
  width: 100%;
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(12, 23, 48, 0.08);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
}

.stack-list,
.question-list,
.review-list,
.leaderboard-list,
.subject-list,
.stats-grid {
  display: grid;
  gap: 14px;
}

.stack-item,
.question-card,
.review-card,
.subject-card,
.leaderboard-row,
.stats-tile {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow-sm);
}

.stack-item {
  display: grid;
  gap: 14px;
  align-content: start;
}

.stack-item-top,
.leaderboard-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.stack-item p,
.empty-state,
.review-card p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  line-height: 1.55;
}

.meta-row,
.question-meta,
.leaderboard-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stack-item > .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 2px;
}

.pill {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(16, 33, 63, 0.06);
  font-size: 0.82rem;
}

.timer-box {
  min-width: 104px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(16, 33, 63, 0.05);
  text-align: right;
}

.timer-box span {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.timer-box strong {
  font-family: "Sora", sans-serif;
  font-size: 1.8rem;
}

.question-card h3,
.review-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.option-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.option-button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16, 33, 63, 0.03);
  color: var(--ink);
  text-align: left;
}

.option-button.selected {
  border-color: rgba(215, 175, 101, 0.5);
  background: rgba(215, 175, 101, 0.12);
}

.option-letter {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--navy);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
}

.action-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}

.result-tile {
  padding: 16px;
  border-radius: 16px;
  background: rgba(16, 33, 63, 0.04);
}

.result-tile span {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.result-tile strong {
  display: block;
  margin-top: 8px;
  font-family: "Sora", sans-serif;
  font-size: 1.6rem;
}

.review-card.correct {
  border-color: rgba(16, 33, 63, 0.12);
}

.review-card.incorrect {
  border-color: rgba(147, 71, 66, 0.22);
}

.review-status {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.review-status.correct {
  background: rgba(16, 33, 63, 0.08);
  color: var(--navy);
}

.review-status.incorrect {
  background: rgba(147, 71, 66, 0.08);
  color: var(--danger);
}

.leaderboard-list {
  grid-template-columns: 1fr;
}

.leaderboard-rank {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--navy);
  color: var(--gold-soft);
  font-weight: 700;
  flex: 0 0 auto;
}

.leaderboard-body {
  flex: 1;
}

.leaderboard-body strong {
  display: block;
  margin-bottom: 4px;
}

.leaderboard-score {
  font-family: "Sora", sans-serif;
  font-size: 1.35rem;
}

.subject-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.subject-card strong {
  display: block;
  margin-bottom: 4px;
}

.subject-level {
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-tile span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.stats-tile strong {
  display: block;
  margin-top: 8px;
  font-family: "Sora", sans-serif;
  font-size: 1.7rem;
}

.empty-state {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(16, 33, 63, 0.03);
  border: 1px solid var(--line);
}

.app-body-game {
  background:
    radial-gradient(circle at top center, rgba(215, 175, 101, 0.09), transparent 28%),
    linear-gradient(180deg, #fbf7de 0%, #f7f1cf 100%);
}

.game-header {
  margin-bottom: 22px;
}

.game-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.timer-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 248, 211, 0.92);
  border: 1px solid rgba(12, 23, 48, 0.08);
  box-shadow: var(--shadow-sm);
}

.game-layout {
  display: grid;
  gap: 18px;
}

.game-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.game-progress-info {
  text-align: right;
}

.game-progress-info span {
  display: block;
  color: var(--ink-soft);
}

.game-progress-info strong {
  display: block;
  margin-top: 4px;
  font-family: "Sora", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.progress-track-large {
  height: 8px;
}

.game-question-shell {
  display: grid;
  gap: 16px;
}

.game-question-card {
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 251, 225, 0.65);
  box-shadow: var(--shadow-sm);
}

.game-question-text {
  font-family: "Instrument Sans", sans-serif;
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  line-height: 1.45;
  font-weight: 600;
}

.game-options {
  display: grid;
  gap: 16px;
}

.game-option {
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(12, 23, 48, 0.08);
  background: rgba(255, 251, 225, 0.72);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.game-option-selected {
  border: 2px solid var(--navy);
  background: white;
}

.game-option-letter {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(12, 23, 48, 0.08);
  color: #55627a;
  font-family: "Sora", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
}

.game-option-selected .game-option-letter {
  background: var(--navy);
  color: white;
}

.game-option-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  background: var(--navy);
}

.game-action-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.game-confirm-button {
  min-width: 240px;
}

@media (max-width: 920px) {
  .auth-layout,
  .content-grid,
  .content-grid-console,
  .subject-list {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .auth-panel,
  .auth-brand,
  .panel,
  .stack-item,
  .question-card,
  .review-card,
  .subject-card,
  .leaderboard-row,
  .stats-tile {
    border-radius: 20px;
  }

  .site-header,
  .section-head,
  .stack-item-top,
  .leaderboard-row,
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .result-summary,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .game-top,
  .game-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .week-dots {
    gap: 6px;
  }

  .week-icon {
    width: 46px;
    height: 46px;
  }

  .bottom-nav {
    width: 100%;
  }

  .stack-item {
    gap: 12px;
  }

  .stack-item > .primary-button {
    width: 100%;
  }
}
