:root {
  color-scheme: light;
  --ink: #24304f;
  --muted: #667085;
  --line: #cdddf2;
  --paper: #ffffff;
  --bg: #fff8e8;
  --green: #0f8f72;
  --green-2: #dffaf0;
  --blue: #2563eb;
  --blue-2: #dbeafe;
  --red: #c2415a;
  --gold: #c47a00;
  --sun: #ffef99;
  --rose: #ffd6e3;
  --mint: #c9f7e5;
  --lilac: #e6dcff;
  --sky: #cfeeff;
  --coral: #ffb4a2;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(620px 320px at 7% 2%, rgba(255, 239, 153, .95), transparent),
    radial-gradient(560px 300px at 92% 6%, rgba(207, 238, 255, .95), transparent),
    radial-gradient(520px 280px at 72% 92%, rgba(230, 220, 255, .8), transparent),
    radial-gradient(460px 260px at 5% 84%, rgba(201, 247, 229, .82), transparent),
    linear-gradient(180deg, #fff8e8 0%, #f4fbff 48%, #fff2f7 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: none;
}

button, input, select { font: inherit; }
button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 750;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button.primary {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: white;
  border-color: #2563eb;
}
button.warn { border-color: #f7b7c2; color: var(--red); background: #fff3f5; }
button:disabled { opacity: .55; cursor: not-allowed; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  width: 100%;
}
textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.45;
}

.shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(167, 195, 236, .8);
  background: rgba(255,255,255,.76);
  backdrop-filter: blur(16px);
}
.brand { display: flex; flex-direction: column; gap: 1px; }
.brand strong { color: #253b8f; font-size: 18px; }
.brand span, .muted { color: var(--muted); font-size: 13px; }
.nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav button {
  background: #fff9ef;
  border-color: #f4d6a3;
  color: #38466f;
}
.nav button.active {
  background: #dff3ff;
  border-color: #69b7ff;
  color: #174ea6;
  box-shadow: 0 5px 14px rgba(37, 99, 235, .16);
}
.main { width: min(1160px, calc(100vw - 28px)); margin: 22px auto 42px; }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.card {
  background: rgba(255, 255, 255, .9);
  border: 2px solid rgba(205, 221, 242, .9);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 28px rgba(87, 100, 143, .1);
}
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
.card h2, .card h3 { margin: 0 0 10px; }
.metric { font-size: 30px; font-weight: 750; letter-spacing: 0; }
.card .metric { color: #1d4ed8; }
.card:nth-child(4n + 1) { border-color: #b8d8ff; }
.card:nth-child(4n + 2) { border-color: #b8ecd6; }
.card:nth-child(4n + 3) { border-color: #f8d4a6; }
.card:nth-child(4n) { border-color: #decfff; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 11px; }
.split { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; background: #fff0b8; color: #795000; font-size: 12px; font-weight: 850; }
.list { display: grid; gap: 8px; }
.item {
  border: 2px solid #dbe7ef;
  border-radius: 7px;
  padding: 10px;
  background: #fffdf7;
}

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.auth-card { width: min(430px, 100%); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
.tabs button.active { background: var(--green); color: white; border-color: var(--green); }
.error { color: var(--red); font-size: 13px; min-height: 18px; }

.game-shell {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.game-world {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-screen {
  width: min(768px, 100%);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.auth-game .game-screen {
  max-width: 768px;
}

.hero-card {
  position: relative;
  width: min(576px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 38px;
  border: 4px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(135deg, rgba(255, 228, 230, 0.82), rgba(240, 249, 255, 0.96), rgba(237, 233, 254, 0.88));
  padding: 20px;
  box-shadow: 0 22px 48px rgba(96, 165, 250, 0.2);
}

.soft-light,
.hero-float {
  position: absolute;
  pointer-events: none;
}

.soft-light {
  border-radius: 999px;
  filter: blur(26px);
}

.light-left {
  left: -32px;
  top: 56px;
  width: 80px;
  height: 80px;
  background: rgba(190, 242, 100, 0.2);
}

.light-right {
  right: -32px;
  top: 32px;
  width: 96px;
  height: 96px;
  background: rgba(125, 211, 252, 0.22);
}

.light-bottom {
  right: 40px;
  bottom: -32px;
  width: 80px;
  height: 80px;
  background: rgba(252, 211, 77, 0.25);
}

.hero-float {
  font-size: 30px;
  z-index: 1;
}

.star-one { left: 24px; top: 78px; animation: sparkle 2.6s ease-in-out infinite; }
.star-two { right: 24px; top: 110px; animation: floatSlow 3.8s ease-in-out infinite; }
.star-three { left: 32px; bottom: 108px; animation: sparkle 3.1s ease-in-out infinite; }

.hero-intro {
  position: relative;
  z-index: 2;
  text-align: center;
}

.logo-card {
  width: 192px;
  height: 192px;
  margin: 20px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 34px;
  border: 4px solid #ddd6fe;
  background: white;
  box-shadow: 0 16px 34px rgba(168, 85, 247, 0.2);
  animation: float 3.2s ease-in-out infinite;
  transition: transform 0.2s ease;
}

.logo-card:hover {
  animation: jelly 0.55s ease both;
}

.logo-card img {
  width: 164px;
  height: 164px;
  object-fit: contain;
}

.hero-title {
  margin: 22px 0 0;
  font-size: clamp(2.75rem, 11vw, 3.3rem);
  line-height: 0.92;
  letter-spacing: 0;
  font-weight: 900;
}

.hero-title > span {
  display: block;
}

.sky { color: #0369a1; text-shadow: 0 2px 10px rgba(56, 189, 248, 0.25); }
.amber { color: #d97706; }

.rainbow-text {
  margin-top: 4px;
  background: linear-gradient(90deg, #f97316, #ec4899, #8b5cf6, #0ea5e9, #22c55e);
  background-size: 220% auto;
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  text-shadow: 0 2px 10px rgba(244, 114, 182, 0.3);
  animation: rainbowShift 4s linear infinite;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 24px;
}

.feature-card {
  border: 2px solid;
  border-radius: 24px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition: transform 0.18s ease;
}

.feature-card:hover { transform: translateY(-4px) scale(1.02); }
.feature-rose { border-color: #fecdd3; background: linear-gradient(180deg, #fff1f2, rgba(255, 237, 213, 0.86)); }
.feature-sky { border-color: #bae6fd; background: linear-gradient(180deg, #f0f9ff, rgba(207, 250, 254, 0.86)); }
.feature-violet { border-color: #ddd6fe; background: linear-gradient(180deg, #f5f3ff, rgba(250, 232, 255, 0.86)); }

.feature-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  margin-bottom: 8px;
  font-size: 30px;
}

.feature-rose .feature-icon { background: rgba(254, 205, 211, 0.85); }
.feature-sky .feature-icon { background: rgba(186, 230, 253, 0.85); }
.feature-violet .feature-icon { background: rgba(221, 214, 254, 0.85); }

.feature-card p {
  margin: 0;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 900;
}

.login-panel {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  border-radius: 28px;
  border: 4px solid #e0f2fe;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.18);
  backdrop-filter: blur(10px);
}

.login-heading { margin-bottom: 18px; }
.login-heading p {
  margin: 0;
  color: #0284c7;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.login-heading h2 {
  margin: 4px 0 0;
  color: #1e293b;
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

.google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #dadce0;
  border-radius: 12px;
  background: #fff;
  padding: 12px 16px;
  color: #3c4043;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.google-btn:hover:not(:disabled) { background: #f8fafc; }
.google-btn:disabled {
  background: #f8fafc;
  box-shadow: none;
}
.google-icon { width: 20px; height: 20px; flex: 0 0 20px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.divider div { height: 1px; flex: 1; background: #e2e8f0; }
.divider span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.login-form {
  display: grid;
  gap: 12px;
}
.login-form label > span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.login-form input {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 11px 12px;
  color: #334155;
  font-size: 16px;
  font-weight: 800;
  outline: none;
}
.login-form input:focus { border-color: #38bdf8; }

.password-wrap {
  position: relative;
}
.password-wrap input { padding-right: 48px; }
.password-wrap button {
  position: absolute;
  right: 8px;
  top: 50%;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  padding: 0;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.form-error {
  border: 2px solid #fecdd3;
  border-radius: 12px;
  background: #fff1f2;
  padding: 10px 12px;
  color: #be123c;
  font-size: 14px;
  font-weight: 800;
}
.demo-note {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.login-submit {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  padding: 13px 16px;
  color: white;
  font-size: 16px;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.35);
  transition: filter 0.18s ease, transform 0.18s ease;
}
.login-submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.auth-switch {
  margin: 16px 0 0;
  color: #64748b;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}
.auth-switch button {
  border: 0;
  background: transparent;
  color: #0284c7;
  padding: 0 0 0 4px;
  font-weight: 950;
}

.hero-footer {
  width: min(576px, 100%);
  margin: 16px auto 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  padding: 7px 16px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(147, 197, 253, 0.18);
}
.hero-footer p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

@keyframes twinkle {
  from { opacity: 0.32; }
  to { opacity: 0.72; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  50% { transform: scale(1.16) rotate(8deg); opacity: 1; }
}

@keyframes rainbowShift {
  0% { background-position: 0% center; }
  100% { background-position: 220% center; }
}

@keyframes jelly {
  0%, 100% { transform: scale(1, 1); }
  25% { transform: scale(1.04, 0.96); }
  50% { transform: scale(0.98, 1.04); }
  75% { transform: scale(1.02, 0.98); }
}

.float-a { animation: float 3s ease-in-out infinite; }
.float-b { animation: float 3.3s ease-in-out infinite 0.4s; }
.sparkle { animation: sparkle 2.4s ease-in-out infinite; }

.exam-layout { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.exam-card { min-height: 560px; }
.exam-nav h3 { margin: 0; }
.timer {
  font-size: 30px;
  font-weight: 800;
  color: #2563eb;
}
.timer.danger { color: var(--red); }
.passage {
  border-left: 5px solid #7dd3fc;
  padding: 10px 12px;
  margin: 10px 0 14px;
  background: #f0f9ff;
  line-height: 1.55;
}
.prompt { font-size: 18px; line-height: 1.45; margin: 12px 0; }
.math-frac {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  min-width: 1.1em;
  margin: 0 .12em;
  line-height: 1;
  vertical-align: middle;
}
.math-frac span {
  display: block;
  padding: 0 .12em;
}
.math-frac span:first-child {
  border-bottom: 1px solid currentColor;
  padding-bottom: .08em;
}
.math-frac span:last-child {
  padding-top: .08em;
}
.question-assets {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 12px 0;
}
.question-asset {
  margin: 0 auto;
  max-width: 100%;
  overflow: auto;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.question-asset img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
.question-table-wrap {
  max-width: 100%;
  margin: 0 auto;
  overflow-x: auto;
}
.question-table {
  width: auto;
  margin: 0 auto;
  min-width: min(420px, 100%);
  border-collapse: collapse;
  background: #fff;
}
.question-table th,
.question-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}
.question-table th {
  background: #eaf2ff;
  color: #174ea6;
  font-weight: 750;
}
.question-table-caption {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}
.options { display: grid; gap: 8px; margin: 12px 0; }
.option {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: start;
  gap: 8px;
  width: 100%;
  text-align: left;
}
.option {
  border-width: 2px;
  background: linear-gradient(180deg, #ffffff, #fffdf6);
}
.option.selected { border-color: #0f8f72; background: #dffaf0; color: #075f4c; }
.answer-input { max-width: 320px; }
.exam-step-actions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px dashed #cdddf2;
}
.exam-step-actions #nextBtn {
  margin-left: auto;
  min-width: 120px;
}
.exam-submit-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 22px;
  padding: 12px;
  border: 2px solid #f8b7c3;
  border-radius: 8px;
  background: #fff1f4;
}
.exam-submit-zone div {
  display: grid;
  gap: 2px;
}
.exam-submit-zone strong {
  color: var(--red);
}
.exam-submit-zone span {
  color: var(--muted);
  font-size: 13px;
}
.submit-test-button {
  flex: 0 0 auto;
  border-color: #f3a3b1;
  background: #ffffff;
  color: var(--red);
  font-weight: 800;
}
.palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); gap: 6px; }
.qdot {
  min-height: 38px;
  padding: 6px 0;
  text-align: center;
  background: #fffdf7;
  border-color: #d4e0ef;
  color: #52616b;
  font-weight: 750;
}
.qdot.unanswered { background: #fffdf7; border-color: #d4e0ef; }
.qdot.answered { background: #dffaf0; border-color: #7ad8ad; color: #075f4c; }
.qdot.current { outline: 3px solid #2563eb; }
.qdot.flag-unanswered {
  background: #fff1d6;
  border-color: #d9822b;
  color: #8a430d;
  box-shadow: inset 0 0 0 2px #f6bf6b;
  font-weight: 900;
}
.qdot.flag-answered {
  background: #e6f3ff;
  border-color: #4f9ad8;
  color: #15527e;
  box-shadow: inset 0 0 0 2px #93c5fd;
  font-weight: 900;
}
.qdot.flag-unanswered::after,
.qdot.flag-answered::after {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 4px;
  border-radius: 999px;
  background: #d94b1f;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.qdot.flag-answered::after { background: #1d72b8; }
.palette-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.palette-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.legend-dot {
  width: 14px;
  height: 14px;
  border: 1px solid #d5dde0;
  border-radius: 4px;
  flex: 0 0 auto;
  background: #fff;
}
.legend-answered { background: #e8f6ef; border-color: #95c7ae; }
.legend-flag-unanswered { background: #fff1d6; border-color: #d9822b; }
.legend-flag-answered { background: #e6f3ff; border-color: #4f9ad8; }
.flag-active {
  border-color: #d69416;
  background: #fff3c4;
  color: #7a4b00;
  font-weight: 800;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 28, 36, .42);
}
.confirm-modal {
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(20, 31, 40, .24);
  padding: 20px;
}
.confirm-modal h2 { margin: 0 0 4px; }
.submit-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.submit-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfa;
}
.submit-summary strong {
  display: block;
  font-size: 26px;
  color: var(--green);
}
.submit-summary span {
  color: var(--muted);
  font-size: 12px;
}
.submit-warning {
  border-left: 4px solid #d9822b;
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #fff8ed;
  color: #7a3e0c;
}
.submit-warning.soft {
  border-left-color: #4f9ad8;
  background: #eff7ff;
  color: #15527e;
}
.submit-ready {
  border-left: 4px solid var(--green);
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #effaf4;
  color: #174f3d;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.danger-primary {
  background: var(--red);
  border-color: var(--red);
}
.review-correct { border-color: #a6ccb8; background: #f2fbf6; }
.review-wrong { border-color: #e6b6b6; background: #fff7f7; }
.results-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 150px auto auto;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}
.exam-start {
  display: grid;
  gap: 16px;
}
.training-start {
  display: grid;
  gap: 16px;
}
.training-hero {
  background:
    linear-gradient(135deg, rgba(201, 247, 229, .96), rgba(255, 255, 255, .9) 48%, rgba(255, 239, 153, .86));
}
.exam-start-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border: 2px solid #b8d8ff;
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(207, 238, 255, .96), rgba(255, 255, 255, .9) 44%, rgba(255, 214, 227, .86));
  box-shadow: 0 16px 36px rgba(37, 99, 235, .15);
}
.exam-start-copy h2 {
  margin: 4px 0 6px;
  color: #1d4ed8;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}
.exam-start-copy p {
  max-width: 680px;
  margin: 0;
  color: #475467;
  font-size: 16px;
}
.mini-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  padding: 4px 9px;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.exam-start-badge {
  min-width: 126px;
  border: 2px solid #f7c948;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  background: #fff6bf;
}
.exam-start-badge strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  color: #a16207;
}
.exam-start-badge span {
  color: #7c5c12;
  font-size: 12px;
  font-weight: 850;
}
.admin-preview-wrap,
.paper-picker {
  border: 2px solid rgba(205, 221, 242, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  padding: 16px;
  box-shadow: 0 10px 28px rgba(31, 41, 55, .07);
}
.admin-preview-wrap {
  margin-top: 8px;
}
.paper-picker {
  display: grid;
  gap: 16px;
}
.empty-picker {
  min-height: 130px;
  place-items: center;
}
.pick-stage {
  display: grid;
  gap: 10px;
}
.pick-stage-head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.pick-stage-head span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #0f8f72);
  color: #fff;
  font-weight: 950;
}
.pick-stage-head h3 {
  margin: 0;
  font-size: 18px;
}
.choice-row,
.subject-grid,
.test-grid,
.topic-card-grid {
  display: grid;
  gap: 10px;
}
.choice-row {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.subject-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.test-grid {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.topic-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.choice-chip,
.subject-card,
.test-card,
.topic-card,
.count-chip {
  min-height: 54px;
  text-align: left;
  border: 2px solid #d8e6fa;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.choice-chip {
  text-align: center;
  font-size: 16px;
}
.choice-chip.selected,
.subject-card.selected,
.test-card.selected,
.topic-card.selected,
.count-chip.selected {
  border-color: #2563eb;
  background: linear-gradient(180deg, #dff3ff, #eef2ff);
  color: #174ea6;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .14);
}
.subject-card {
  display: grid;
  gap: 4px;
  padding: 14px;
}
.subject-card strong {
  color: #253b8f;
  font-size: 20px;
}
.subject-card span,
.test-card span,
.test-card small {
  color: var(--muted);
  font-size: 12px;
}
.test-card {
  display: grid;
  gap: 5px;
  padding: 12px;
}
.topic-card {
  display: grid;
  gap: 7px;
  padding: 14px;
}
.topic-card strong {
  color: #253b8f;
  font-size: 17px;
}
.topic-card span {
  color: var(--muted);
  font-size: 12px;
}
.topic-card:nth-child(4n + 1) { background: linear-gradient(180deg, #ffffff, #e8fff4); border-color: #a7ebcb; }
.topic-card:nth-child(4n + 2) { background: linear-gradient(180deg, #ffffff, #fff7d6); border-color: #f8dd8f; }
.topic-card:nth-child(4n + 3) { background: linear-gradient(180deg, #ffffff, #e8f7ff); border-color: #b6dfff; }
.topic-card:nth-child(4n) { background: linear-gradient(180deg, #ffffff, #f8e9ff); border-color: #e6c7ff; }
.topic-card.selected {
  background: linear-gradient(180deg, #dff3ff, #eef2ff);
}
.skill-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.skill-card strong {
  color: #0f766e;
}
.skill-card:nth-child(3n + 1) { background: linear-gradient(180deg, #ffffff, #e8fff4); border-color: #a7ebcb; }
.skill-card:nth-child(3n + 2) { background: linear-gradient(180deg, #ffffff, #e8f7ff); border-color: #b6dfff; }
.skill-card:nth-child(3n) { background: linear-gradient(180deg, #ffffff, #fff7d6); border-color: #f8dd8f; }
.skill-card.selected {
  background: linear-gradient(180deg, #dff3ff, #eef2ff);
}
.test-card strong {
  color: #0f766e;
  font-size: 22px;
}
.test-card:nth-child(3n + 1) { background: linear-gradient(180deg, #ffffff, #fff7d6); border-color: #f8dd8f; }
.test-card:nth-child(3n + 2) { background: linear-gradient(180deg, #ffffff, #e8f7ff); border-color: #b6dfff; }
.test-card:nth-child(3n) { background: linear-gradient(180deg, #ffffff, #f2eaff); border-color: #d7c6ff; }
.test-card.selected {
  background: linear-gradient(180deg, #dff3ff, #eef2ff);
}
.selected-paper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 2px solid #8fe6bd;
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(135deg, #e8fff4, #fffde8);
}
.selected-paper strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}
.selected-paper p {
  margin: 4px 0 0;
  color: var(--muted);
}
.big-start {
  min-width: 144px;
  min-height: 50px;
  font-size: 16px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, .2);
}
.training-action {
  border-color: #a7ebcb;
  background: linear-gradient(135deg, #e8fff4, #fff7d6);
}
.quick-test-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.count-row {
  display: flex;
  gap: 6px;
}
.count-chip {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
  color: #253b8f;
}
.result-table-card { padding: 0; overflow: hidden; }
.result-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.result-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}
.result-table th,
.result-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.result-table th {
  background: #f6faf8;
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.form-success {
  margin: 10px 0 0;
  color: var(--green);
  font-weight: 700;
}
.user-create-form { margin-top: 14px; }
.user-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.user-search {
  display: flex;
  gap: 8px;
  min-width: min(520px, 100%);
}
.user-search input { min-width: 280px; }
.user-table-card { padding: 0; overflow: hidden; }
.user-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.user-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}
.user-table th,
.user-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.user-table th {
  background: #f6faf8;
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.table-input {
  width: 220px;
  padding: 8px 9px;
}
.table-badge {
  display: inline-block;
  margin-left: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 6px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 11px;
}
.pager {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px;
  background: #fbfcfa;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}
.topic-analysis {
  margin-top: 14px;
}
.topic-analysis-head {
  align-items: flex-start;
}
.topic-pie {
  width: 128px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 18px #fff;
  flex: 0 0 auto;
}
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.topic-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.topic-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.topic-row-top span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
}
.topic-row-top i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.topic-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.topic-questions button {
  min-width: 42px;
  padding: 5px 7px;
  font-size: 12px;
}
.admin-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  align-items: start;
}
.admin-question-list {
  max-height: calc(100vh - 150px);
  overflow: auto;
  display: grid;
  gap: 6px;
}
.admin-qrow {
  display: grid;
  gap: 3px;
  width: 100%;
  text-align: left;
}
.admin-qrow.active {
  border-color: var(--green);
  background: var(--green-2);
}
.admin-qrow small {
  color: var(--muted);
}
.admin-editor textarea,
.admin-editor input,
.admin-editor select {
  font-family: inherit;
}
.source-box {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}
.source-box pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  color: #475569;
  font-size: 12px;
}

@media (max-width: 860px) {
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .exam-layout, .admin-layout { grid-template-columns: 1fr; }
  .results-toolbar { grid-template-columns: 1fr; }
  .user-toolbar, .user-search { align-items: stretch; flex-direction: column; }
  .user-search input { min-width: 0; }
  .topic-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; gap: 10px; flex-direction: column; }
  .nav { width: 100%; }
  .submit-summary { grid-template-columns: repeat(2, 1fr); }
  .exam-start-card, .selected-paper { align-items: stretch; flex-direction: column; }
  .exam-start-badge { width: 100%; }
  .big-start { width: 100%; }
  .quick-test-controls { align-items: stretch; flex-direction: column; }
  .count-row { display: grid; grid-template-columns: repeat(3, 1fr); }
  .count-chip { width: 100%; }
}

@media (max-width: 560px) {
  .game-screen { padding: 18px 12px 30px; }
  .hero-card { border-radius: 30px; padding: 16px; }
  .logo-card { width: 164px; height: 164px; border-radius: 30px; }
  .logo-card img { width: 138px; height: 138px; }
  .feature-grid { gap: 8px; }
  .feature-card { border-radius: 18px; padding: 10px 7px; }
  .feature-icon { width: 48px; height: 48px; border-radius: 15px; font-size: 26px; }
  .feature-card p { font-size: 11px; line-height: 1.2; }
  .login-panel { border-radius: 24px; padding: 17px; }
  .login-heading h2 { font-size: 27px; }
  .star-three { bottom: 92px; }
  .confirm-modal { padding: 16px; }
  .exam-step-actions #nextBtn { margin-left: 0; }
  .exam-step-actions button { flex: 1 1 100%; }
  .exam-submit-zone { align-items: stretch; flex-direction: column; }
  .submit-test-button { width: 100%; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
}
