:root {
  --bg: #0b1020;
  --panel: #151b30;
  --panel-2: #1c2440;
  --border: #283150;
  --text: #e8ecf6;
  --muted: #93a0c0;
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --good: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1b234a 0, transparent 60%), var(--bg);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .4em; }
.muted { color: var(--muted); }

/* layout */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.nav .brand { font-weight: 700; letter-spacing: .3px; }
.nav .brand span { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav .links { display: flex; gap: 18px; align-items: center; }
.container { max-width: 1100px; margin: 0 auto; padding: 24px 22px 60px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) { .grid.cols-2, .grid.cols-4 { grid-template-columns: 1fr; } }

/* cards */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}
.stat { text-align: center; }
.stat .num { font-size: 30px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }

/* forms */
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
input, select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  font-size: 15px;
}
textarea { min-height: 90px; resize: vertical; }
button, .btn {
  cursor: pointer; border: none; border-radius: 10px; padding: 11px 16px;
  font-size: 15px; font-weight: 600; color: white;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
button.secondary, .btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
button:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }

/* auth screens */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .logo { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 4px; }
.auth-card .logo span { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-card .tagline { text-align: center; color: var(--muted); margin-bottom: 18px; }

/* misc */
.msg { margin-top: 12px; font-size: 14px; min-height: 18px; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--good); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.easy { background: rgba(22,163,74,.18); color: #4ade80; }
.pill.medium { background: rgba(245,158,11,.18); color: #fbbf24; }
.pill.hard { background: rgba(239,68,68,.18); color: #f87171; }
.pill.builtin { background: rgba(99,102,241,.18); color: #a5b4fc; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.scenario { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--panel-2); display: flex; flex-direction: column; gap: 8px; }
.scenario h3 { margin: 0; }
.scenario .obj { font-size: 13px; color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.timer { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 700; }

/* password checklist */
.pw-check { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.pw-check li { color: var(--muted); display: flex; align-items: center; gap: 8px; padding: 2px 0; transition: color .15s; }
.pw-check li.ok { color: var(--good); }
.pw-check .pw-ic { display: inline-grid; place-items: center; width: 16px; height: 16px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--panel-2); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(4,8,18,.7); display: grid; place-items: start center; padding: 30px 16px; overflow-y: auto; z-index: 50; }
.modal-card { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-x { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); width: 34px; height: 34px; border-radius: 8px; padding: 0; font-size: 16px; }
.score-big { font-size: 42px; font-weight: 800; line-height: 1; }
.dim { margin: 8px 0; }
.dim .dim-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 3px; }
.bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.coach-list { margin: 6px 0 14px; padding-left: 18px; }
.coach-list li { margin: 3px 0; font-size: 14px; }
.transcript { background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; max-height: 280px; overflow-y: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.6; }
.transcript b { color: var(--brand); }
audio { width: 100%; margin: 8px 0; }
