:root {
  --bg: #f5f7fb;
  --ink: #102033;
  --muted: #627084;
  --line: #dce4ef;
  --brand: #0b5cad;
  --brand-dark: #07366f;
  --accent: #f4b400;
  --green: #1f9d55;
  --orange: #f97316;
  --red: #e11d48;
  --purple: #7c3aed;
  --panel: #ffffff;
  --shadow: 0 18px 45px rgba(20, 40, 72, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, "Noto Sans Devanagari", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(11, 92, 173, .08), transparent 32%),
    linear-gradient(315deg, rgba(244, 180, 0, .14), transparent 30%),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(180deg, #082d66, #0b5cad 58%, #0a7f83);
}

.brand,
.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, .42);
  border-radius: 8px;
  background: rgba(255, 255, 255, .14);
  font-weight: 800;
}

.brand strong,
.profile-card strong {
  display: block;
  font-size: 1.05rem;
}

.brand span,
.profile-card small {
  display: block;
  color: rgba(255, 255, 255, .78);
  font-size: .85rem;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-item {
  width: 100%;
  padding: 13px 14px;
  color: #fff;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .1);
}

.nav-item.is-active,
.nav-item:hover {
  color: #082d66;
  background: #fff;
}

.profile-card {
  margin-top: auto;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-size: 1.5rem;
}

.main {
  padding: 28px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 3.2rem);
}

.stats-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.stats-strip span {
  min-width: 116px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stats-strip b {
  display: block;
  font-size: 1.35rem;
}

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(290px, 390px) minmax(0, 1fr);
  gap: 18px;
}

.panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head,
.quiz-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel-head span {
  padding: 7px 10px;
  color: var(--brand-dark);
  border-radius: 8px;
  background: #e8f1ff;
  font-size: .85rem;
  font-weight: 700;
  white-space: nowrap;
}

.field,
.control-group {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

.field span,
.control-group p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.choice,
.mode-choice,
.level-choice,
.answer-btn {
  min-height: 64px;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.choice strong,
.mode-choice strong,
.level-choice strong {
  display: block;
}

.choice small,
.mode-choice small,
.level-choice small {
  display: block;
  color: var(--muted);
  font-size: .8rem;
}

.choice.is-selected,
.mode-choice.is-selected,
.level-choice.is-selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px rgba(11, 92, 173, .14);
}

.level-list {
  display: grid;
  gap: 8px;
}

.level-choice {
  display: flex;
  align-items: center;
  gap: 10px;
}

.level-dot {
  width: 12px;
  height: 40px;
  border-radius: 999px;
  background: var(--green);
}

.level-dot.blue { background: var(--brand); }
.level-dot.orange { background: var(--orange); }
.level-dot.purple { background: var(--purple); }

.quiz-panel {
  display: flex;
  flex-direction: column;
  min-height: 560px;
}

.timer {
  display: grid;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--brand-dark);
  font-size: 1.35rem;
  font-weight: 800;
}

.answers {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}

.answer-btn {
  min-height: 58px;
  font-weight: 700;
}

.answer-btn:hover {
  border-color: var(--brand);
}

.answer-btn.is-correct {
  color: #075c2b;
  border-color: #8fd8aa;
  background: #eafaf0;
}

.answer-btn.is-wrong {
  color: #8b1234;
  border-color: #ffb2c2;
  background: #fff0f4;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.primary-btn,
.secondary-btn {
  min-height: 44px;
  padding: 11px 16px;
  border-radius: 8px;
  font-weight: 800;
}

.primary-btn {
  color: #fff;
  border: 0;
  background: var(--brand);
}

.primary-btn:hover {
  background: var(--brand-dark);
}

.secondary-btn {
  color: var(--brand-dark);
  border: 1px solid #bad1ef;
  background: #eef6ff;
}

.feedback {
  min-height: 54px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--muted);
}

.feature-grid,
.dashboard-grid,
.battle-layout,
.ai-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

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

.info-tile {
  min-height: 160px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.info-tile span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: #fff6db;
  font-size: 1.6rem;
}

.dashboard-grid {
  grid-template-columns: 1.1fr .9fr;
}

.dashboard-grid .panel:first-child {
  grid-column: 1 / -1;
}

.progress-line {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.progress-line span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--accent));
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.badge {
  display: grid;
  min-width: 92px;
  min-height: 92px;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.badge span {
  font-size: 1.8rem;
}

.leaderboard,
.coverage-list,
.plain-list {
  margin: 0;
  padding-left: 20px;
}

.leaderboard li,
.coverage-list div,
.plain-list li {
  margin-bottom: 10px;
}

.coverage-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.battle-layout,
.ai-grid {
  grid-template-columns: 1fr 1fr;
}

.arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.player-card {
  display: grid;
  min-height: 210px;
  place-items: center;
  padding: 20px;
  border-radius: 8px;
  background: #f7fbff;
  text-align: center;
}

.player-card span {
  font-size: 4rem;
}

.versus {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--red);
  font-weight: 900;
}

.chat-box {
  height: 310px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}

.ai-feature-list {
  display: grid;
  gap: 12px;
}

.ai-feature-list article {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 3px 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.ai-feature-list span {
  grid-row: span 2;
  font-size: 1.7rem;
}

.ai-feature-list p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.pricing-grid div {
  min-height: 150px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.tech-panel dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}

.tech-panel dt {
  font-weight: 800;
}

.tech-panel dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell,
  .work-grid,
  .dashboard-grid,
  .battle-layout,
  .ai-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .nav-item {
    text-align: center;
  }

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

@media (max-width: 640px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .nav-list,
  .choice-grid,
  .mode-grid,
  .pricing-grid,
  .chat-input,
  .arena {
    grid-template-columns: 1fr;
  }

  .quiz-top,
  .panel-head {
    flex-direction: column;
  }

  .timer {
    width: 54px;
    height: 54px;
  }
}
