/* dars.aslsmm.uz — terminal estetikasi.
   Interfeys monospace, uzun matn o'qishga qulay shriftda. */

:root {
  --bg: #070a0d;
  --bg-raised: #0c1116;
  --bg-hover: #121a21;
  --bg-sunk: #05080a;
  --line: #1a2530;
  --line-soft: #131c24;

  --text: #d7e3ea;
  --text-dim: #7d94a3;
  --text-faint: #4d6273;

  --accent: #4ee08a;          /* fosfor yashil, lekin toza #0f0 emas */
  --accent-dim: #1d7a4a;
  --accent-glow: rgba(78, 224, 138, 0.13);
  --amber: #e8b45c;
  --err: #ff6b6b;
  --cyan: #5fd7e8;

  --radius: 4px;
  --radius-sm: 3px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --sidebar-w: 320px;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", "DejaVu Sans Mono", Consolas, monospace;
  --read: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

/* Mualliflik display qoidalari [hidden] dan ustun kelmasligi uchun */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}

/* Juda yengil skanerlash chizig'i — o'qishga xalaqit bermaydi */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px);
}

button, input, select, textarea { font: inherit; color: inherit; }

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: transform 150ms var(--ease-out), background-color 150ms ease, color 150ms ease;
}
button:active { transform: scale(0.97); }

::selection { background: var(--accent-dim); color: #fff; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg-sunk); }
::-webkit-scrollbar-thumb { background: #1c2a35; }
::-webkit-scrollbar-thumb:hover { background: #273948; }

.caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ------------------------------------------------------------------ kirish */

.gate { min-height: 100%; display: grid; place-items: center; padding: 24px; }

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 0 26px;
  position: relative;
}

/* Terminal oyna sarlavhasi */
.gate-card::before {
  content: "● ● ●   auth — dars.aslsmm.uz";
  display: block;
  padding: 9px 14px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunk);
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.gate-card > *:not(::before) { margin-left: 26px; margin-right: 26px; }

.gate-langs { display: flex; gap: 2px; justify-content: flex-end; margin-bottom: 12px; }
.gate-langs button { padding: 3px 8px; border-radius: var(--radius-sm); font-size: 11px; color: var(--text-faint); }
.gate-langs button:hover { color: var(--text); }
.gate-langs button.on { color: var(--accent); background: var(--bg-hover); }

.gate-card h1 {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.gate-card h1::before { content: "$ "; color: var(--accent); }

.gate-card .sub { margin: 0 0 22px; color: var(--text-dim); font-size: 12.5px; }

.field { margin-bottom: 12px; }

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field input {
  width: 100%;
  padding: 9px 11px;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field input:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 2px var(--accent-glow); }

.btn-primary {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: var(--accent);
  color: #04180f;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: var(--radius-sm);
}
.btn-primary:hover { background: #62eb9b; }

.gate-switch { margin-top: 15px; text-align: center; font-size: 12px; color: var(--text-faint); }
.gate-switch button { color: var(--accent); }
.gate-switch button:hover { text-decoration: underline; }

.oauth { margin-top: 18px; }

.oauth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--text-faint);
  font-size: 11px;
}
.oauth-or::before, .oauth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.oauth-btns { display: grid; gap: 6px; }

.oauth-btn {
  display: block;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-sunk);
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}
.oauth-btn:hover { border-color: var(--accent-dim); color: var(--text); background: var(--bg-hover); }
.oauth-btn[data-p="google"]::before { content: "G  "; font-weight: 700; }
.oauth-btn[data-p="github"]::before { content: "⌥  "; font-weight: 700; }

.tier {
  padding: 2px 7px;
  border: 1px solid;
  border-radius: 2px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gate-err {
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(255, 107, 107, 0.08);
  border-left: 2px solid var(--err);
  color: #ffa8a8;
  font-size: 12px;
}
.gate-err::before { content: "! "; font-weight: 700; }

/* ------------------------------------------------------------------- karkas */

.app { display: none; height: 100%; grid-template-rows: 46px 1fr 24px; }
.app.on { display: grid; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-raised);
}

.brand { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 600; }

.topbar .spacer { flex: 1; }

.langs { display: flex; gap: 1px; }

.langs button {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}
.langs button:hover { color: var(--text); background: var(--bg-hover); }
.langs button.on { color: var(--accent); background: var(--bg-hover); box-shadow: inset 0 -2px 0 var(--accent); }

.icon-btn { padding: 5px 10px; border-radius: var(--radius-sm); font-size: 12px; color: var(--text-dim); }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }

.body { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 0; }

/* tmux uslubidagi holat satri */
.statusbar {
  display: flex;
  align-items: center;
  gap: 0;
  border-top: 1px solid var(--line);
  background: var(--bg-sunk);
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  white-space: nowrap;
}
.statusbar .seg { padding: 0 11px; line-height: 23px; border-right: 1px solid var(--line); }
.statusbar .seg.hi { background: var(--accent-dim); color: #eafff3; font-weight: 600; }
.statusbar .seg.grow { flex: 1; border-right: none; overflow: hidden; text-overflow: ellipsis; }
.statusbar .seg.right { border-right: none; border-left: 1px solid var(--line); color: var(--text-dim); }

/* ------------------------------------------------------------------ yon panel */

.sidebar { border-right: 1px solid var(--line); overflow-y: auto; padding: 10px 8px 30px; background: var(--bg-sunk); }

.course { margin-bottom: 12px; }

.course-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.course-head:hover { background: var(--bg-hover); }
.course-title { flex: 1; }

.chev { color: var(--text-faint); font-size: 9px; transition: transform 170ms var(--ease-out); }
.course.open .chev, .sec.open .chev { transform: rotate(90deg); }

.lock { font-size: 10px; }

.ring { width: 18px; height: 18px; flex-shrink: 0; }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: #182530; }
.ring .fill {
  stroke: var(--accent);
  stroke-linecap: butt;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dasharray 400ms var(--ease-out);
}

.sections { display: none; margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--line-soft); }
.course.open .sections { display: block; }

.sec { margin-bottom: 2px; }

.sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-dim);
  font-size: 12px;
}
.sec-head:hover { background: var(--bg-hover); color: var(--text); }
.sec-title { flex: 1; }

.lessons { display: none; margin-left: 9px; padding-left: 8px; border-left: 1px solid var(--line-soft); }
.sec.open .lessons { display: block; }

.lesson {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 12px;
  color: var(--text-dim);
}
.lesson::before { content: "·"; color: var(--text-faint); }
.lesson:hover { background: var(--bg-hover); color: var(--text); }
.lesson.seen::before { content: "▸"; color: var(--amber); }
.lesson.done::before { content: "✓"; color: var(--accent); }
.lesson.on {
  background: var(--bg-hover);
  color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}

.lesson-title { flex: 1; line-height: 1.45; }
.lesson-time { font-size: 10.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.quiz-link {
  display: block;
  width: 100%;
  margin: 3px 0 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: var(--amber);
  text-align: left;
}
.quiz-link::before { content: "? "; }
.quiz-link:hover { background: var(--bg-hover); }
.quiz-link.passed { color: var(--accent); }
.quiz-link.passed::before { content: "✓ "; }

/* -------------------------------------------------------------------- asosiy */

.main { overflow-y: auto; min-height: 0; }

.empty { height: 100%; display: grid; place-items: center; color: var(--text-faint); font-size: 12.5px; }
.empty::before { content: "$ "; color: var(--accent-dim); }

.stage { max-width: 1200px; margin: 0 auto; padding: 18px 22px 50px; }

.crumb { font-size: 11px; color: var(--text-faint); margin-bottom: 6px; letter-spacing: 0.03em; }

.stage h1 {
  margin: 0 0 16px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.stage h1::before { content: "> "; color: var(--accent); }

.player-row { display: grid; grid-template-columns: 1fr 390px; gap: 18px; align-items: start; }

.player-wrap { background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.screen { position: relative; }

video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; }

.gear {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #cfdde7;
  background: rgba(6, 10, 13, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0.5;
  transition: opacity 150ms ease, background-color 150ms ease, transform 200ms var(--ease-out);
}
.screen:hover .gear, .gear.on { opacity: 1; }
.gear:hover { background: rgba(6, 10, 13, 0.92); }
.gear.on { transform: rotate(35deg); border-color: var(--accent-dim); color: var(--accent); }

.settings {
  position: absolute;
  top: 47px;
  right: 9px;
  z-index: 5;
  min-width: 244px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 12, 16, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  transform-origin: top right;
  opacity: 1;
  transform: scale(1);
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
}
@starting-style { .settings { opacity: 0; transform: scale(0.96); } }

.set-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; }

.set-label {
  flex: 1;
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}

.chips { display: flex; gap: 2px; }

.chips button {
  min-width: 33px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
}
.chips button:hover { background: rgba(255, 255, 255, 0.09); color: var(--text); }
.chips button.on { background: var(--accent); color: #04180f; font-weight: 700; }

.switch { width: 36px; height: 19px; border-radius: 2px; background: #22303c; padding: 2px; transition: background-color 170ms ease; }
.switch span { display: block; width: 15px; height: 15px; border-radius: 1px; background: #b9c9d6; transition: transform 170ms var(--ease-out), background-color 170ms ease; }
.switch.on { background: var(--accent-dim); }
.switch.on span { transform: translateX(17px); background: var(--accent); }

.set-action {
  display: block;
  width: 100%;
  margin-top: 3px;
  padding: 8px;
  border-top: 1px solid var(--line);
  text-align: left;
  font-size: 11.5px;
  color: var(--text-dim);
}
.set-action::before { content: "⧉ "; }
.set-action:hover { background: var(--bg-hover); color: var(--text); }

.player-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- transkript */

.tx { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-raised); display: flex; flex-direction: column; max-height: 340px; }

.tx-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunk);
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.toggle { padding: 3px 8px; border-radius: var(--radius-sm); color: var(--text-faint); font-size: 10.5px; letter-spacing: 0.05em; }
.toggle:hover { background: var(--bg-hover); color: var(--text); }
.toggle.on { color: var(--accent); background: var(--accent-glow); }

.tx-list { overflow-y: auto; padding: 5px; }

/* Tez-tez bosiladigan qatorlar — animatsiyasiz, faqat rang */
.tx-line {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  text-align: left;
  font-family: var(--read);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  transition: background-color 110ms ease, color 110ms ease;
}
.tx-line:hover { background: var(--bg-hover); color: var(--text); }
.tx-line.now { background: var(--accent-glow); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.tx-line.now .tx-t { color: var(--accent); }

.tx-t { flex-shrink: 0; font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); padding-top: 2px; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------------- tablar */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }

.tab {
  padding: 8px 14px;
  font-size: 11.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); background: var(--bg-hover); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

.pane { display: none; padding-top: 20px; }
.pane.on { display: block; }

/* --------------------------------------------------------------------- matn */

.note { max-width: 750px; font-family: var(--read); font-size: 15px; line-height: 1.72; }

.note h2 {
  font-family: var(--mono);
  font-size: 12px;
  margin: 30px 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.note h2::before { content: "## "; color: var(--accent-dim); }

.note h3 { font-family: var(--mono); font-size: 13px; margin: 22px 0 8px; color: var(--text-dim); }
.note p { margin: 0 0 14px; }
.note ul { margin: 0 0 14px; padding-left: 18px; list-style: none; }
.note li { margin-bottom: 7px; position: relative; }
.note li::before { content: "▸"; position: absolute; left: -16px; color: var(--accent-dim); }
.note strong { color: #fff; font-weight: 600; }
.note hr { border: none; border-top: 1px dashed var(--line); margin: 26px 0; }

.note code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-sunk); border: 1px solid var(--line); padding: 1px 5px; border-radius: 2px; color: var(--accent); }

.note pre {
  position: relative;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  padding: 14px 15px 13px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.note pre code { background: none; border: none; padding: 0; color: #a9e9c6; font-size: 12.5px; line-height: 1.65; }

.note table { border-collapse: collapse; width: 100%; margin: 0 0 16px; font-family: var(--mono); font-size: 12px; }
.note th, .note td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.note th { background: var(--bg-sunk); color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; }

/* --------------------------------------------------------------------- test */

.quiz { max-width: 700px; }

.q { border: 1px solid var(--line); border-left: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-raised); padding: 16px 18px; margin-bottom: 12px; }

.q-prompt { font-family: var(--read); font-size: 15px; margin-bottom: 13px; font-weight: 550; line-height: 1.55; }

.opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-align: left;
  font-family: var(--read);
  font-size: 14px;
  color: var(--text-dim);
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease,
              transform 150ms var(--ease-out);
}
.opt:hover { border-color: #27384a; background: var(--bg-hover); color: var(--text); }
.opt.right { border-color: var(--accent-dim); background: var(--accent-glow); color: var(--text); }
.opt.wrong { border-color: rgba(255, 107, 107, 0.4); background: rgba(255, 107, 107, 0.07); color: #ffa8a8; }
.opt:disabled { cursor: default; }
.opt:disabled:active { transform: none; }

.opt-key { font-family: var(--mono); font-size: 11px; color: var(--text-faint); padding-top: 3px; }
.opt.right .opt-key { color: var(--accent); }
.opt.wrong .opt-key { color: var(--err); }

.explain {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2px solid var(--accent-dim);
  background: var(--bg-sunk);
  font-family: var(--read);
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.6;
  opacity: 1;
  transition: opacity 200ms ease;
}
@starting-style { .explain { opacity: 0; } }

/* ----------------------------------------------------------------- reyting */

.board { max-width: 580px; margin: 0 auto; padding: 28px 22px; }
.board h2 { font-size: 13px; margin: 0 0 16px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; }
.board h2::before { content: "## "; color: var(--accent-dim); }

.row { display: flex; align-items: center; gap: 12px; padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 5px; background: var(--bg-raised); font-size: 12.5px; }
.row.me { border-color: var(--accent-dim); background: var(--accent-glow); }

.rank { width: 26px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.row:nth-child(1) .rank { color: var(--amber); }

.who { flex: 1; font-family: var(--read); font-size: 14px; color: var(--text); }
.pts { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; }
.lessons-n { font-size: 11px; color: var(--text-faint); }

/* ------------------------------------------------------------ kirish animatsiyasi */

.stagger > * { opacity: 0; transform: translateY(5px); animation: rise 260ms var(--ease-out) forwards; }
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 35ms; }
.stagger > *:nth-child(3) { animation-delay: 70ms; }
.stagger > *:nth-child(4) { animation-delay: 105ms; }
.stagger > *:nth-child(n+5) { animation-delay: 140ms; }

@keyframes rise { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  .stagger > * { animation: fade 200ms ease forwards; transform: none; }
  @keyframes fade { to { opacity: 1; } }
  button:active { transform: none; }
  .chev, .gear { transition: none; }
  .caret { animation: none; }
  body::after { display: none; }
}

@media (max-width: 1100px) {
  .player-row { grid-template-columns: 1fr; }
  .tx { max-height: 320px; }
}

@media (max-width: 820px) {
  .body { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.show { display: block; position: fixed; inset: 46px 0 24px 0; z-index: 20; width: 100%; }
  .statusbar .seg.opt-hide { display: none; }
}


/* ============================ BOSHQARUV PANELI ============================ */

.nav { display: grid; gap: 2px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  text-align: left; font-size: 12.5px; color: var(--text-dim);
}
.nav-item .ni { color: var(--text-faint); font-size: 11px; transition: color 150ms ease; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.on {
  background: linear-gradient(90deg, var(--accent-glow), transparent);
  color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item.on .ni { color: var(--accent); }

.view { display: none; }
.view.on { display: block; }

.dash { max-width: 1240px; margin: 0 auto; padding: 22px 24px 56px; }

.hello { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; margin-bottom: 22px; }
.hello h1 { margin: 0; font-family: var(--read); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.hello h1 b { color: var(--accent); font-weight: 700; }
.muted { color: var(--text-faint); margin: 4px 0 0; font-size: 12px; }
.muted.sm { font-size: 11px; margin: 0; }

.level-card {
  display: flex; align-items: center; gap: 16px;
  min-width: 340px; flex: 1; max-width: 560px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(78, 224, 138, 0.10), transparent 55%),
    linear-gradient(180deg, #101922, #0a1015);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(0, 0, 0, 0.4);
}

.lvl-ring {
  width: 62px; height: 62px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--accent) var(--p, 0%), #16212b 0);
  position: relative;
}
.lvl-ring::after {
  content: attr(data-lvl);
  position: absolute; inset: 5px;
  border-radius: 50%;
  background: #0b1117;
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700; color: var(--text);
  box-shadow: inset 0 0 14px rgba(78, 224, 138, 0.14);
}

.lvl-body { flex: 1; min-width: 0; }
.lvl-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.tier-name { font-size: 15px; font-weight: 700; text-transform: capitalize; }
.tier-chip {
  padding: 2px 8px; border-radius: 3px; font-size: 9.5px;
  text-transform: uppercase; letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.07); color: var(--text-dim);
}

.bar { height: 6px; border-radius: 99px; background: #16212b; overflow: hidden; }
.bar.sm { height: 4px; }
.bar i {
  display: block; height: 100%; width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  box-shadow: 0 0 12px rgba(78, 224, 138, 0.5);
  transition: width 600ms var(--ease-out);
}

.lvl-foot { display: flex; justify-content: space-between; margin-top: 7px; font-size: 11px; color: var(--text-faint); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }

.tile {
  position: relative; overflow: hidden;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #101922, #0a1015);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 8px 22px rgba(0, 0, 0, 0.35);
  transition: transform 200ms var(--ease-out), box-shadow 200ms ease, border-color 200ms ease;
}
.tile::before {
  content: ""; position: absolute; inset: -40% 55% 40% -40%;
  background: radial-gradient(circle, var(--tint, rgba(78, 224, 138, 0.16)), transparent 70%);
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  .tile:hover { transform: translateY(-2px); border-color: var(--edge, var(--accent-dim)); }
}

.tile-ico {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; font-size: 15px;
  background: var(--tint, rgba(78, 224, 138, 0.16));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  margin-bottom: 12px;
}
.tile-n { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-l { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

.t-xp     { --tint: rgba(124, 131, 255, 0.18); --edge: #5b64d8; }
.t-rank   { --tint: rgba(232, 180, 92, 0.18);  --edge: #a8813c; }
.t-streak { --tint: rgba(255, 122, 80, 0.18);  --edge: #b5542f; }
.t-solved { --tint: rgba(78, 224, 138, 0.18);  --edge: var(--accent-dim); }

.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: start; }
.col { display: grid; gap: 14px; }

.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #0e1620, #0a1015);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 14px 16px 16px;
}
.panel.glow { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 28px rgba(78, 224, 138, 0.07); }

.panel-h {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 13px; font-size: 10.5px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.panel-h::before { content: "//"; color: var(--accent-dim); }

.resume {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 12px 14px; border-radius: 8px; text-align: left;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(78, 224, 138, 0.07), transparent);
  transition: border-color 180ms ease, transform 180ms var(--ease-out);
}
.resume:hover { border-color: var(--accent-dim); }
.resume-body { flex: 1; min-width: 0; display: grid; gap: 7px; }
.resume-title { font-family: var(--read); font-size: 14.5px; font-weight: 600; }
.resume-go {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 13px;
  color: #04180f; background: var(--accent);
  box-shadow: 0 0 18px rgba(78, 224, 138, 0.45);
}

.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 11px; height: 11px; border-radius: 2px; background: #111b23; }
.heat i.l1 { background: #16603f; }
.heat i.l2 { background: #1d8a56; }
.heat i.l3 { background: #2fb972; }
.heat i.l4 { background: var(--accent); box-shadow: 0 0 7px rgba(78, 224, 138, 0.55); }

.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.hl { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.hl.l1 { background: #16603f; } .hl.l2 { background: #1d8a56; }
.hl.l3 { background: #2fb972; } .hl.l4 { background: var(--accent); }

.news { display: grid; gap: 9px; }
.news-item { padding: 10px 12px; border-left: 2px solid var(--accent-dim); background: var(--bg-sunk); border-radius: 0 6px 6px 0; }
.news-item.pin { border-left-color: var(--amber); }
.news-t { font-family: var(--read); font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.news-b { font-family: var(--read); font-size: 12.5px; color: var(--text-dim); line-height: 1.55; }
.news-d { font-size: 10px; color: var(--text-faint); margin-top: 5px; }

.prog-row { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; }
.prog-row .bar { flex: 1; }
.prog-row .num { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 54px; text-align: right; }

.tx-toggle {
  display: flex; align-items: center; gap: 9px; width: 100%;
  margin-top: 10px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-raised);
  text-align: left; font-size: 11.5px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.tx-toggle:hover { background: var(--bg-hover); color: var(--text); border-color: #24333f; }
.tx-toggle.open .chev { transform: rotate(90deg); }
.tx-toggle .chev { transition: transform 180ms var(--ease-out); }

.side-col { min-width: 0; }

@media (max-width: 1240px) { .tiles { grid-template-columns: repeat(2, 1fr); } .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .level-card { min-width: 0; } }


/* =================================== CTF =================================== */

.ctf-wrap { max-width: 900px; margin: 0 auto; padding: 24px 24px 56px; }
.ctf-wrap h2 { font-size: 13px; margin: 0 0 4px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; }
.ctf-wrap h2::before { content: "## "; color: var(--accent-dim); }
.ctf-wrap > .muted { margin-bottom: 20px; }

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

.ctf-card {
  position: relative; overflow: hidden;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #101922, #0a1015);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 180ms ease;
}
.ctf-card::before {
  content: ""; position: absolute; inset: -50% 60% 50% -50%;
  background: radial-gradient(circle, rgba(232, 180, 92, 0.13), transparent 70%);
  pointer-events: none;
}
.ctf-card:hover { border-color: #263644; }
.ctf-card.solved { border-color: var(--accent-dim); }
.ctf-card.solved::before { background: radial-gradient(circle, rgba(78, 224, 138, 0.14), transparent 70%); }

.ctf-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctf-t { font-family: var(--read); font-size: 16px; font-weight: 650; flex: 1; }

.diff {
  padding: 3px 8px; border-radius: 3px;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.09em;
  border: 1px solid;
}
.d-easy   { color: var(--accent); border-color: var(--accent-dim); background: rgba(78, 224, 138, 0.08); }
.d-medium { color: var(--amber);  border-color: #6b5222; background: rgba(232, 180, 92, 0.08); }
.d-hard   { color: var(--err);    border-color: #6e2f2f; background: rgba(255, 107, 107, 0.08); }
.d-insane { color: #c78bff;       border-color: #4d2f6b; background: rgba(199, 139, 255, 0.08); }

.ctf-mine { font-size: 11.5px; color: var(--accent); font-variant-numeric: tabular-nums; }

.ctf-i { font-family: var(--read); font-size: 13.5px; color: var(--text-dim); margin: 10px 0 0; line-height: 1.6; }

.ctf-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 11px; color: var(--text-faint); }
.ctf-meta .tp { color: var(--text-dim); }

.ctf-link {
  display: inline-block; margin-top: 12px;
  padding: 7px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-sunk);
  color: var(--text-dim); font-size: 11.5px; text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease;
}
.ctf-link::after { content: " ↗"; }
.ctf-link:hover { border-color: var(--accent-dim); color: var(--accent); }

.flag-row { display: flex; align-items: center; gap: 8px; margin-top: 13px; flex-wrap: wrap; }

.flag-row input {
  flex: 1; min-width: 200px;
  padding: 9px 11px;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 12.5px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.flag-row input:focus { border-color: var(--accent-dim); box-shadow: 0 0 0 2px var(--accent-glow); }

.flag-go {
  padding: 9px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: #04180f;
  font-size: 12px; font-weight: 700; letter-spacing: 0.03em;
}
.flag-go:hover { background: #62eb9b; }

.flag-msg { font-size: 11.5px; }
.flag-msg.ok { color: var(--accent); }
.flag-msg.bad { color: var(--err); }
