:root {
  --bg: #08090d;
  --bg-2: #10131a;
  --panel: rgba(16, 19, 27, 0.78);
  --panel-solid: #12161f;
  --line: rgba(224, 179, 90, 0.16);
  --line-strong: rgba(224, 179, 90, 0.38);
  --gold: #e0b35a;
  --gold-2: #f3d48a;
  --gold-dim: rgba(224, 179, 90, 0.12);
  --teal: #3ecfc0;
  --teal-dim: rgba(62, 207, 192, 0.12);
  --rose: #e8897a;
  --rose-dim: rgba(232, 137, 122, 0.12);
  --text: #f4f1ea;
  --muted: #9b9588;
  --faint: #6b665c;
  --ok: #6ee7a8;
  --ok-dim: rgba(110, 231, 168, 0.12);
  --bad: #ff7a7a;
  --bad-dim: rgba(255, 122, 122, 0.12);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --font-d: "Syne", Georgia, serif;
  --font-b: "Manrope", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.5;
}

body { overflow-x: hidden; }

button, input { font-family: inherit; }

button { cursor: pointer; }

img { max-width: 100%; }

a { color: var(--gold); }

/* ── Atmosphere ── */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(224, 179, 90, 0.08), transparent 55%),
    radial-gradient(800px 500px at 100% 100%, rgba(62, 207, 192, 0.06), transparent 50%),
    var(--bg);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite;
}

.orb-a {
  width: 420px; height: 420px;
  background: #e0b35a;
  top: -120px; left: -80px;
  opacity: 0.14;
}

.orb-b {
  width: 380px; height: 380px;
  background: #3ecfc0;
  bottom: -80px; right: -60px;
  opacity: 0.1;
  animation-delay: -6s;
}

.orb-c {
  width: 260px; height: 260px;
  background: #8b6a2e;
  top: 40%; left: 55%;
  opacity: 0.08;
  animation-delay: -11s;
}

.grid-fade {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(224, 179, 90, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(224, 179, 90, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 75%);
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%);
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -28px) scale(1.08); }
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ── Shared chrome ── */
.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.preview-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(224, 179, 90, 0.16);
  border: 1px solid rgba(224, 179, 90, 0.4);
  color: var(--gold-2);
  font-size: 14px;
  font-weight: 600;
}

.preview-note {
  margin: 0 0 12px;
  color: var(--gold-2);
  font-size: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-align: left;
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  position: relative;
}

.mark svg { width: 42px; height: 42px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-kicker {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.brand-name {
  font-family: var(--font-d);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.18em;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(16px);
}

.user-chip .who {
  font-size: 13px;
  font-weight: 600;
}

.user-chip .role {
  font-size: 11px;
  color: var(--muted);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold), #9a6f22);
  color: #1a1408;
  font-weight: 800;
  font-size: 12px;
  font-family: var(--font-d);
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s ease;
}

.ghost:hover { border-color: var(--line-strong); color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:active { transform: translateY(1px); }

.btn-gold {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #1a1408;
  box-shadow: 0 10px 30px rgba(224, 179, 90, 0.25);
}

.btn-gold:hover { box-shadow: 0 14px 36px rgba(224, 179, 90, 0.38); }

.btn-line {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.btn-line:hover { background: var(--gold-dim); }

.btn-reset {
  border-color: rgba(255, 122, 122, 0.5);
  color: var(--bad);
}

.btn-reset:hover { background: var(--bad-dim); }

.admin-detail-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn-wide { width: 100%; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Login ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 18px 72px;
  position: relative;
}

.login-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 40px 34px 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-hero {
  text-align: center;
  margin-bottom: 28px;
}

.login-hero .mark {
  margin: 0 auto 16px;
  width: 64px;
  height: 64px;
}

.login-hero .mark svg { width: 64px; height: 64px; }

.login-hero h1 {
  font-family: var(--font-d);
  font-size: 42px;
  letter-spacing: 0.28em;
  margin: 0 0 6px;
  font-weight: 800;
}

.login-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-dim);
}

.error {
  background: var(--bad-dim);
  color: var(--bad);
  border: 1px solid rgba(255,122,122,0.25);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.hint {
  margin-top: 18px;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}

.hint code {
  color: var(--gold-2);
  background: var(--gold-dim);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
}

.license {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 18px;
  margin: 0;
  text-align: center;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.license a {
  color: var(--gold);
  text-decoration: none;
}

.license a:hover {
  color: var(--gold-2);
}

/* ── Lobby ── */
.hero-panel {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 22px;
  margin-bottom: 34px;
}

@media (max-width: 820px) {
  .hero-panel { grid-template-columns: 1fr; }
}

.welcome, .stats-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(16px);
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
}

.welcome h2 {
  font-family: var(--font-d);
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.welcome p { margin: 0; color: var(--muted); max-width: 52ch; }

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  height: 100%;
}

.stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: rgba(0,0,0,0.2);
  border-radius: 16px;
  padding: 16px 8px;
}

.stat b {
  font-family: var(--font-d);
  font-size: 28px;
  color: var(--gold-2);
}

.stat span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 16px;
}

.section-head h3 {
  font-family: var(--font-d);
  font-size: 22px;
  margin: 0;
}

.section-head span { color: var(--muted); font-size: 13px; }

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.exam-grid {
  grid-template-columns: 1fr;
  margin-bottom: 40px;
}

@media (max-width: 1100px) {
  .quiz-grid { grid-template-columns: repeat(2, 1fr); }
  .exam-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .quiz-grid { grid-template-columns: 1fr; }
}

.quiz-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.quiz-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.quiz-card.is-locked {
  opacity: 0.92;
  filter: none;
}

.quiz-card.is-locked:not(.is-fogged) {
  opacity: 0.55;
  filter: grayscale(0.15);
}

.quiz-card.is-locked:hover {
  transform: none;
  border-color: var(--line);
}

.quiz-secret {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.quiz-card.is-fogged {
  opacity: 1;
  filter: none;
}

.quiz-card.is-fogged .quiz-secret {
  filter: blur(5px);
  opacity: 0.88;
  user-select: none;
  pointer-events: none;
}

.quiz-card.is-fogged .btn {
  position: relative;
  z-index: 2;
}

.quiz-card.gold { --accent: var(--gold); --accent-dim: var(--gold-dim); }
.quiz-card.teal { --accent: var(--teal); --accent-dim: var(--teal-dim); }
.quiz-card.rose { --accent: var(--rose); --accent-dim: var(--rose-dim); }
.quiz-card.violet { --accent: #c4b5fd; --accent-dim: rgba(196, 181, 253, 0.12); }
.quiz-card.exam {
  --accent: var(--gold);
  --accent-dim: var(--gold-dim);
  min-height: 220px;
  border-color: var(--line-strong);
  background:
    linear-gradient(120deg, rgba(224, 179, 90, 0.08), transparent 42%),
    var(--panel);
}

.quiz-card::after {
  content: "";
  position: absolute;
  width: 180px; height: 180px;
  right: -50px; top: -60px;
  background: radial-gradient(circle, var(--accent-dim), transparent 70%);
  pointer-events: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, var(--gold));
  background: var(--accent-dim, var(--gold-dim));
  border-radius: 999px;
  padding: 5px 10px;
  width: fit-content;
}

.quiz-card h4 {
  font-family: var(--font-d);
  font-size: 22px;
  margin: 14px 0 8px;
  line-height: 1.2;
}

.quiz-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
  flex: 1;
}

.meta {
  display: flex;
  gap: 14px;
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 16px;
}

.done-badge {
  color: var(--ok);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* ── Leaderboard ── */
.board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.board-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.board-head h3 { margin: 0; font-family: var(--font-d); font-size: 18px; }

.row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 14px;
}

.row:last-child { border-bottom: 0; }
.row.me { background: var(--gold-dim); }
.rank { color: var(--gold); font-family: var(--font-d); font-weight: 800; }
.pts { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Quiz play ── */
.quiz-shell { max-width: 760px; margin: 0 auto; padding: 24px 18px 80px; }

.progress-wrap { margin: 8px 0 22px; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  border-radius: inherit;
  transition: width 0.35s ease;
}

.timer {
  font-variant-numeric: tabular-nums;
  color: var(--gold-2);
  font-weight: 700;
}

.timer.warn { color: var(--bad); }

.q-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 26px;
  backdrop-filter: blur(16px);
}

.q-card h2 {
  font-family: var(--font-d);
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.3;
  margin: 0 0 22px;
}

.options { display: grid; gap: 10px; }

.option {
  text-align: left;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  transition: 0.15s ease;
}

.option:hover { border-color: var(--line-strong); background: rgba(224,179,90,0.06); }

.option.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-dim);
}

.option.correct {
  border-color: var(--ok);
  background: var(--ok-dim);
}

.option.wrong {
  border-color: var(--bad);
  background: var(--bad-dim);
}

.key {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

/* ── Results ── */
.result-hero { text-align: center; padding: 12px 0 28px; }

.ring {
  width: 168px;
  height: 168px;
  margin: 0 auto 18px;
  position: relative;
}

.ring svg { transform: rotate(-90deg); }

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-d);
  font-size: 36px;
  font-weight: 800;
}

.review { display: grid; gap: 12px; margin-top: 8px; }

.review-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
}

.review-item.ok {
  border: 2px solid rgba(110, 231, 168, 0.65);
  background: rgba(110, 231, 168, 0.08);
}

.review-item.no {
  border: 2px solid rgba(255, 122, 122, 0.65);
  background: rgba(255, 122, 122, 0.08);
}

.review-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.review-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  margin-top: 1px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.review-item.ok .review-badge {
  color: #062016;
  background: var(--ok);
}

.review-item.no .review-badge {
  color: #2a0c0c;
  background: var(--bad);
}

.review-q {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  line-height: 1.45;
}

.review-q b { color: var(--muted); font-weight: 700; }

.review-pair {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.review-line {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
}

.review-k {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.review-v {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.review-line.yours {
  background: rgba(255, 90, 90, 0.22);
  border-color: rgba(255, 122, 122, 0.55);
  border-left: 5px solid var(--bad);
}

.review-item.ok .review-line.yours {
  background: rgba(110, 231, 168, 0.2);
  border-color: rgba(110, 231, 168, 0.5);
  border-left-color: var(--ok);
}

.review-line.yours .review-k { color: #ff9b9b; }
.review-item.ok .review-line.yours .review-k { color: var(--ok); }
.review-line.yours .review-v { color: #ffd0d0; }
.review-item.ok .review-line.yours .review-v { color: #d8ffe9; }

.review-line.right {
  background: rgba(70, 210, 150, 0.24);
  border-color: rgba(110, 231, 168, 0.6);
  border-left: 5px solid var(--ok);
}

.review-line.right .review-k { color: var(--ok); }
.review-line.right .review-v { color: #e7fff2; font-size: 15px; }

.score-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold-2);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wipe-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--bad);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wipe-link:hover { color: #ff9a9a; }

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(4, 5, 8, 0.72);
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: auto;
}

.admin-sheet {
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  background: var(--panel-solid);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 22px 22px 28px;
  box-shadow: var(--shadow);
}

.admin-sheet-wide {
  width: min(920px, 100%);
}

.trace-summary,
.trace-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.trace-summary > div,
.trace-grid > div {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.trace-summary span,
.trace-grid span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.trace-summary b,
.trace-grid b {
  font-size: 14px;
  font-weight: 700;
}

.trace-grid b.is-ok { color: var(--ok); }
.trace-grid b.is-bad { color: var(--bad); }

.trace-box {
  margin-top: 12px;
}

.trace-box .trace-grid {
  margin-bottom: 8px;
}

.trace-path,
.trace-empty {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .trace-summary,
  .trace-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Admin ── */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.cred {
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  padding: 16px;
  background: rgba(0,0,0,0.2);
}

.cred b { display: block; font-family: var(--font-d); margin-bottom: 8px; }
.cred span { display: block; font-size: 12px; color: var(--muted); }
.cred code { color: var(--gold-2); }

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tab {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
}

.tab.on {
  color: #1a1408;
  background: var(--gold);
  border-color: var(--gold);
}

.sched-ok {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(62, 180, 160, 0.14);
  color: var(--teal-2, #9be7d8);
  font-size: 14px;
}

.sched-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sched-card {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) 120px minmax(180px, 1fr) auto;
  gap: 14px 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.sched-card b {
  display: block;
  font-family: var(--font-d);
  font-size: 16px;
}

.sched-card span {
  color: var(--muted);
  font-size: 13px;
}

.sched-unlock,
.sched-when {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.sched-unlock {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.sched-when input[type="datetime-local"] {
  background: #12100c;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  color-scheme: dark;
}

.sched-side {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.sched-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.sched-status.is-open {
  color: #9be7d8;
  border-color: rgba(62, 180, 160, 0.45);
}

.sched-status.is-wait {
  color: var(--gold-2);
  border-color: rgba(212, 175, 55, 0.45);
}

.sched-status.is-lock {
  color: var(--muted);
  border-color: var(--line);
}

.import-err {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(220, 80, 80, 0.16);
  color: #ffb4b4;
  font-size: 14px;
}

.import-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.4fr);
  gap: 22px;
  align-items: start;
}

.import-side,
.import-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.import-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.import-label select,
.import-label input[type="number"],
.import-label input[type="file"],
.import-label textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}

.import-label textarea {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  min-height: 280px;
  resize: vertical;
}

.import-meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.import-meta b {
  color: var(--gold-2);
  font-size: 22px;
  font-family: var(--font-d);
}

.import-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.import-help {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.footer-note {
  margin-top: 28px;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.ctrl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.online-count {
  color: var(--teal-2, #9be7d8);
  font-size: 13px;
  font-weight: 700;
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.switch-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.switch-card.is-open { border-color: rgba(62, 180, 160, 0.45); }
.switch-card.is-lock { opacity: 0.85; }

.switch-card b {
  display: block;
  font-family: var(--font-d);
  font-size: 18px;
}

.switch-card span, .switch-card em {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
}

.switch-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ctrl-h {
  margin: 22px 0 10px;
  font-size: 15px;
}

.dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: lowercase;
}

.dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
}

.dot.on { color: #9be7d8; }
.dot.on::before { background: #3eb4a0; }
.dot.off { color: var(--muted); }

.dossier-quizzes { display: flex; flex-direction: column; gap: 8px; }

.dossier-q {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.dossier-q b { display: block; }
.dossier-q span { color: var(--muted); font-size: 12px; }

.dossier-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.access-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.access-log li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.access-log span { color: var(--muted); }

@media print {
  .atmosphere, .topbar .ghost, .btn, .tabs { display: none !important; }
  body { background: #fff !important; color: #111; }
  .cred {
    border-color: #ccc;
    break-inside: avoid;
    color: #111;
  }
  .cred span, .cred code { color: #111 !important; }
  .welcome { border: 0; background: none; }
}

@media (max-width: 900px) {
  .sched-card {
    grid-template-columns: 1fr 1fr;
  }
  .sched-side { justify-content: flex-start; grid-column: 1 / -1; }
  .import-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .brand-name { font-size: 18px; letter-spacing: 0.12em; }
  .login-card { padding: 28px 22px 24px; }
  .login-hero h1 { font-size: 34px; letter-spacing: 0.16em; }
  .user-chip { padding-left: 10px; }
  .sched-card { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  * { transition: none !important; }
  .quiz-card.is-fogged .quiz-secret {
    filter: blur(6px);
    opacity: 0.7;
    transform: none;
  }
}
