/* =========================================================================
   CS · Recall — editor-themed, terminal-amber dark UI. Monospace throughout.
   No web fonts (works fully offline / file://). Polish lives in color,
   spacing, motion, and depth.
   ========================================================================= */

:root {
  --bg:        #0a0c0f;
  --bg-2:      #0d1015;
  --panel:     #12171d;
  --panel-2:   #161d25;
  --inset:     #0b0f13;
  --line:      #222b36;
  --line-soft: #1a212a;

  --ink:    #e9e7e1;   /* warm off-white */
  --muted:  #8b94a1;
  --faint:  #5a6573;

  --amber:     #ffb454;
  --amber-2:   #ffd089;
  --amber-dim: #b9823c;

  --again: #ff6b6b;
  --hard:  #ffb454;
  --good:  #7fd962;
  --easy:  #59c2ff;

  --py:    #ffb454;
  --std:   #59c2ff;
  --blk:   #7fd962;
  --pat:   #d2a6ff;
  --prob:  #ff8f73;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Source Code Pro", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --shadow: 0 18px 50px -12px rgba(0,0,0,.7);
  --maxw: 980px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: .1px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* atmosphere ------------------------------------------------------------- */
.glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 80% at 78% -10%, rgba(255,180,84,.12), transparent 55%),
    radial-gradient(90% 70% at 10% 110%, rgba(89,194,255,.07), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* app bar ---------------------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: linear-gradient(180deg, rgba(10,12,15,.92), rgba(10,12,15,.6));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.brand {
  background: none; border: 0; cursor: pointer; color: var(--ink);
  font-family: var(--mono); font-size: 15px; font-weight: 700;
  letter-spacing: 2px; display: flex; align-items: center; gap: 3px; padding: 4px 2px;
}
.brand-mark { color: var(--bg); background: var(--amber); padding: 2px 6px; border-radius: 5px; letter-spacing: 1px; }
.brand-dot  { color: var(--amber); }
.brand-word { color: var(--muted); }
.brand:hover .brand-word { color: var(--ink); }

.appbar-right { display: flex; align-items: center; gap: 18px; }
.streak {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted);
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
}
.streak-flame { color: var(--amber); transform: translateY(-1px); }
.streak.lit { color: var(--ink); border-color: var(--amber-dim); }

.tabs { display: flex; gap: 4px; }
.tab {
  background: none; border: 1px solid transparent; color: var(--muted);
  font-family: var(--mono); font-size: 13px; letter-spacing: 1px; text-transform: lowercase;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: .15s;
}
.tab:hover { color: var(--ink); background: var(--panel); }
.tab.active { color: var(--amber); border-color: var(--line); background: var(--panel); }

/* view shell ------------------------------------------------------------- */
.view { max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 40px) 90px; }

/* ===== HOME ============================================================= */
.hero { margin: 8px 0 30px; animation: rise .5s ease both; }
.hero-kicker { color: var(--faint); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; }
.hero-line { font-size: clamp(26px, 5vw, 40px); font-weight: 700; line-height: 1.15; margin: 10px 0 4px; letter-spacing: -.5px; }
.hero-line .due-n { color: var(--amber); }
.hero-line .new-n { color: var(--easy); }
.hero-sub { color: var(--muted); font-size: 14px; }

.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 26px 0 30px; animation: rise .5s ease .05s both; }
.cta {
  border: 0; cursor: pointer; font-family: var(--mono); font-weight: 700; letter-spacing: .5px;
  font-size: 15px; color: var(--bg); background: linear-gradient(180deg, var(--amber-2), var(--amber));
  padding: 14px 26px; border-radius: 12px; box-shadow: 0 10px 26px -8px rgba(255,180,84,.5);
  transition: transform .12s, box-shadow .12s; display: inline-flex; align-items: center; gap: 10px;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -8px rgba(255,180,84,.6); }
.cta:active { transform: translateY(0); }
.cta .kbd { background: rgba(0,0,0,.18); color: var(--bg); }
.cta.ghost { background: none; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.cta.ghost:hover { border-color: var(--amber-dim); color: var(--amber); }

.modeseg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.modeseg button {
  background: none; border: 0; border-right: 1px solid var(--line-soft); cursor: pointer;
  color: var(--muted); font-family: var(--mono); font-size: 13px; padding: 11px 15px; transition: .15s;
}
.modeseg button:last-child { border-right: 0; }
.modeseg button:hover { color: var(--ink); background: var(--panel); }
.modeseg button.on { color: var(--bg); background: var(--amber); font-weight: 700; }

.seg-label { color: var(--faint); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; margin-right: 2px; }

/* deck grid */
.deckgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.deck {
  position: relative; text-align: left; cursor: pointer; color: var(--ink);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px;
  transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden;
  animation: rise .5s ease both;
}
.deck::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--dk, var(--amber)); opacity: .9; }
.deck:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--dk, var(--amber)) 50%, var(--line)); box-shadow: var(--shadow); }
.deck-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deck-glyph { font-size: 13px; color: var(--bg); background: var(--dk, var(--amber)); padding: 3px 8px; border-radius: 6px; font-weight: 700; }
.deck-due { font-size: 12px; color: var(--amber); border: 1px solid var(--amber-dim); border-radius: 999px; padding: 2px 9px; }
.deck-due.zero { color: var(--faint); border-color: var(--line); }
.deck-title { font-size: 17px; font-weight: 700; margin: 13px 0 3px; letter-spacing: -.2px; }
.deck-blurb { color: var(--muted); font-size: 12.5px; min-height: 32px; }
.deck-meter { height: 5px; border-radius: 99px; background: var(--inset); margin-top: 12px; overflow: hidden; display: flex; }
.deck-meter i { display: block; height: 100%; }
.deck-meter .m-mast { background: var(--dk, var(--amber)); }
.deck-meter .m-learn { background: color-mix(in srgb, var(--dk, var(--amber)) 35%, transparent); }
.deck-stats { display: flex; gap: 12px; margin-top: 9px; font-size: 11.5px; color: var(--faint); }
.deck-stats b { color: var(--muted); font-weight: 700; }

/* ===== STUDY ============================================================ */
.study { display: flex; flex-direction: column; min-height: calc(100vh - 160px); animation: fade .35s ease both; }
.study-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.exit { background: none; border: 1px solid var(--line); color: var(--muted); cursor: pointer; border-radius: 8px; padding: 7px 11px; font-family: var(--mono); font-size: 12px; }
.exit:hover { color: var(--ink); border-color: var(--amber-dim); }
.chip { font-size: 12px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip.deck { color: var(--bg); background: var(--dk, var(--amber)); border-color: transparent; font-weight: 700; }
.counter { margin-left: auto; color: var(--faint); font-size: 13px; }
.counter b { color: var(--ink); }
.progress { height: 3px; background: var(--inset); border-radius: 99px; overflow: hidden; margin-bottom: 28px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--amber-2)); transition: width .3s ease; }

/* the card */
.cardwrap { perspective: 1600px; flex: 1; display: flex; align-items: center; justify-content: center; }
.card3d { position: relative; width: 100%; max-width: 760px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card3d.flipped { transform: rotateX(180deg); }
.face {
  backface-visibility: hidden; background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  padding: 30px clamp(22px, 4vw, 40px); min-height: 320px; display: flex; flex-direction: column;
}
.face.back { position: absolute; inset: 0; transform: rotateX(180deg); }
.card-tag { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--faint); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 18px; }
.card-tag .dotcol { width: 8px; height: 8px; border-radius: 99px; background: var(--dk, var(--amber)); }
.card-q { font-size: clamp(19px, 3vw, 25px); font-weight: 600; line-height: 1.4; letter-spacing: -.2px; }
.card-face-label { margin-top: auto; padding-top: 22px; color: var(--faint); font-size: 12px; letter-spacing: 1px; }
.ans-label { color: var(--amber); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 12px; }
.why { color: var(--muted); font-size: 13.5px; margin-top: 16px; padding-left: 12px; border-left: 2px solid var(--line); }
.traps { margin-top: 18px; }
.traps-h { color: var(--prob); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.traps ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.traps li { margin: 4px 0; }

/* code blocks */
pre.code {
  background: var(--inset); border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 16px 18px; margin: 0; overflow-x: auto; font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
}
.tok-kw { color: #ff9e64; }
.tok-bi { color: var(--easy); }
.tok-str { color: var(--good); }
.tok-com { color: var(--faint); font-style: italic; }
.tok-num { color: var(--pat); }

/* drill (pattern mode) */
.drill-row { margin-top: 16px; }
.drill-k { color: var(--amber); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.drill-v { font-size: 15px; margin-top: 3px; }
.timer { margin-left: 12px; font-size: 13px; color: var(--muted); }
.timer.urgent { color: var(--again); }

/* mcq */
.choices { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; text-align: left; cursor: pointer;
  background: var(--inset); border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px;
  color: var(--ink); font-family: var(--mono); font-size: 14.5px; transition: .13s; width: 100%;
}
.choice:hover { border-color: var(--amber-dim); background: var(--panel-2); }
.choice .key { color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; font-size: 12px; flex: none; }
.choice.correct { border-color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--inset)); }
.choice.correct .key { color: var(--good); border-color: var(--good); }
.choice.wrong { border-color: var(--again); background: color-mix(in srgb, var(--again) 12%, var(--inset)); }
.choice.wrong .key { color: var(--again); border-color: var(--again); }
.choice:disabled { cursor: default; }
.explain { margin-top: 18px; padding: 14px 16px; border-radius: 11px; background: var(--inset); border-left: 3px solid var(--amber); color: var(--muted); font-size: 13.5px; animation: fade .3s ease both; }
.explain b { color: var(--ink); }

/* controls under card */
.actions { margin-top: 26px; min-height: 60px; display: flex; align-items: center; justify-content: center; gap: 12px; }
.reveal-btn {
  border: 0; cursor: pointer; font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--bg);
  background: linear-gradient(180deg, var(--amber-2), var(--amber)); padding: 13px 30px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 10px 24px -10px rgba(255,180,84,.5);
}
.reveal-btn:hover { transform: translateY(-1px); }
.grades { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.grade {
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--ink);
  font-family: var(--mono); font-size: 14px; padding: 11px 18px; border-radius: 11px; min-width: 92px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: .13s;
}
.grade .g-key { font-size: 11px; color: var(--faint); }
.grade .g-int { font-size: 10.5px; color: var(--faint); }
.grade:hover { transform: translateY(-2px); }
.grade.again:hover { border-color: var(--again); color: var(--again); }
.grade.hard:hover  { border-color: var(--hard);  color: var(--hard); }
.grade.good:hover  { border-color: var(--good);  color: var(--good); }
.grade.easy:hover  { border-color: var(--easy);  color: var(--easy); }
.nextbtn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font-family: var(--mono); font-weight: 700; font-size: 14px; padding: 12px 26px; border-radius: 11px; }
.nextbtn:hover { border-color: var(--amber-dim); color: var(--amber); }

/* session summary */
.summary { max-width: 560px; margin: 4vh auto; text-align: center; animation: rise .4s ease both; }
.summary h2 { font-size: 26px; margin: 0 0 4px; }
.summary .sub { color: var(--muted); margin-bottom: 26px; }
.bigstat { font-size: 56px; font-weight: 700; color: var(--amber); }
.gradebars { display: flex; flex-direction: column; gap: 10px; text-align: left; margin: 26px 0; }
.gb-row { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.gb-row .gb-name { width: 64px; color: var(--muted); }
.gb-track { flex: 1; height: 10px; background: var(--inset); border-radius: 99px; overflow: hidden; }
.gb-track i { display: block; height: 100%; }
.gb-row .gb-n { width: 28px; text-align: right; color: var(--faint); }

/* ===== STATS ============================================================ */
.stats-head { margin: 6px 0 26px; animation: rise .45s ease both; }
.stats-head h1 { font-size: 28px; margin: 0; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 30px; }
.statcard { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; animation: rise .45s ease both; }
.statcard .n { font-size: 34px; font-weight: 700; }
.statcard .l { color: var(--faint); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 4px; }
.statcard.amber .n { color: var(--amber); }
.statcard.green .n { color: var(--good); }
.statcard.blue .n { color: var(--easy); }

.deckbars { display: flex; flex-direction: column; gap: 14px; }
.db-row { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.db-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.db-name { font-weight: 700; }
.db-meta { color: var(--faint); font-size: 12px; }
.db-track { height: 12px; background: var(--inset); border-radius: 99px; overflow: hidden; display: flex; }
.db-track i { display: block; height: 100%; }
.db-track .s-mast { background: var(--dk, var(--amber)); }
.db-track .s-learn { background: color-mix(in srgb, var(--dk, var(--amber)) 38%, transparent); }
.db-legend { display: flex; gap: 16px; margin-top: 8px; font-size: 11.5px; color: var(--faint); }
.db-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

.reset { margin-top: 36px; }
.reset button { background: none; border: 1px solid var(--line); color: var(--faint); cursor: pointer; font-family: var(--mono); font-size: 12px; padding: 8px 14px; border-radius: 8px; }
.reset button:hover { color: var(--again); border-color: var(--again); }

/* empty state */
.empty { text-align: center; color: var(--muted); padding: 12vh 0; }
.empty .big { font-size: 22px; color: var(--ink); margin-bottom: 8px; }

/* hint bar */
.hintbar { position: fixed; bottom: 0; left: 0; right: 0; display: none; gap: 18px; justify-content: center;
  padding: 9px; background: linear-gradient(0deg, var(--bg), transparent); color: var(--faint); font-size: 12px; z-index: 20; }
.hintbar.show { display: flex; }
.kbd { font-family: var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; color: var(--muted); background: var(--panel); font-size: 11px; }

/* motion */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== LEARN ============================================================ */
.learn-callout {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: linear-gradient(100deg, color-mix(in srgb, var(--prob) 14%, var(--panel)), var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--prob) 35%, var(--line)); border-radius: 14px;
  padding: 15px 18px; margin: 4px 0 22px; color: var(--ink); transition: transform .14s, border-color .14s;
  animation: rise .5s ease .03s both;
}
.learn-callout:hover { transform: translateY(-2px); border-color: var(--prob); }
.lc-ic { font-size: 20px; color: var(--prob); flex: none; }
.lc-text { font-size: 13.5px; color: var(--muted); }
.lc-text b { color: var(--ink); }
.lc-text u { color: var(--prob); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.lc-go { margin-left: auto; color: var(--prob); font-size: 13px; white-space: nowrap; }

.lesson-list { display: flex; flex-direction: column; gap: 11px; }
.lesson-tile {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer; color: var(--ink);
  background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line);
  border-radius: 13px; padding: 15px 18px; transition: transform .14s, border-color .14s; animation: rise .5s ease both;
}
.lesson-tile:hover { transform: translateX(4px); border-color: var(--prob); }
.lt-num { font-size: 18px; font-weight: 700; color: var(--bg); background: var(--prob); width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.lt-body { flex: 1; min-width: 0; }
.lt-title { font-size: 16px; font-weight: 700; }
.lt-pattern { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.lt-go { color: var(--faint); font-size: 13px; white-space: nowrap; }
.lesson-tile:hover .lt-go { color: var(--prob); }

.learn { animation: fade .35s ease both; }
.learn-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ghost-btn { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-family: var(--mono); font-size: 12px; padding: 7px 12px; border-radius: 8px; }
.ghost-btn:hover { color: var(--prob); border-color: var(--prob); }
.rail { display: flex; gap: 6px; }
.rail-pip { font-size: 11px; font-family: var(--mono); color: var(--faint); background: none; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; cursor: pointer; transition: border-color .12s, color .12s; }
.rail-pip:hover { color: var(--prob); border-color: var(--prob); }
.rail-pip.on { color: var(--bg); background: var(--prob); border-color: transparent; font-weight: 700; }
.rail-pip.on:hover { color: var(--bg); }
.rail-pip.done { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, var(--line)); }

/* problem switcher (jump between problems without leaving the lesson) */
.prob-switch { position: relative; }
.prob-trigger { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit; }
.prob-trigger .ps-caret { font-size: 10px; opacity: .8; transition: transform .12s; }
.prob-trigger[aria-expanded="true"] .ps-caret { transform: rotate(180deg); }
.prob-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 248px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); display: flex; flex-direction: column; gap: 2px; }
.prob-menu[hidden] { display: none; }
.prob-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.prob-item:hover { background: var(--inset); color: var(--ink); }
.prob-item.on { color: var(--prob); }
.prob-item .pi-num { flex: none; width: 18px; color: var(--faint); font-size: 11px; }
.prob-item .pi-title { flex: 1; }
.prob-item .pi-check { flex: none; color: var(--prob); }

.ov { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-bottom: 14px; }
.ov-kicker { color: var(--prob); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.ov-model { font-size: 15.5px; line-height: 1.6; margin: 0 0 16px; color: var(--ink); }
.ov-state .drill-k { color: var(--amber); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px; }
.ov-freq { margin-top: 14px; color: var(--muted); font-size: 12.5px; }
.ov-freq .streak-flame { color: var(--prob); }

.skel { background: var(--inset); border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line)); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; animation: rise .3s ease both; }
.skel-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.skel-top .drill-k { color: var(--amber); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }

.mini { background: var(--panel); border: 1px solid var(--line); color: var(--ink); cursor: pointer; font-family: var(--mono); font-size: 12px; padding: 7px 13px; border-radius: 8px; transition: .13s; }
.mini:hover { border-color: var(--amber-dim); color: var(--amber); }
.mini.show:hover { border-color: var(--good); color: var(--good); }
.mini.try:hover { border-color: var(--easy); color: var(--easy); }
.mini.ghost { background: none; color: var(--faint); }

.lvl { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.lvl-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.lvl-badge { font-size: 12px; color: var(--bg); background: var(--prob); padding: 3px 10px; border-radius: 7px; font-weight: 700; }
.lvl-name { font-size: 18px; font-weight: 700; }
.lvl-ask { color: var(--ink); font-size: 14.5px; line-height: 1.55; margin: 0 0 8px; }
.lvl-approach { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 18px; padding-left: 12px; border-left: 2px solid var(--line); }
.lvl-approach b { color: var(--amber); }

.steps { display: flex; flex-direction: column; gap: 12px; }
.step { border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; background: var(--inset); animation: rise .3s ease both; }
.step.choosing { border-color: var(--line); }
.step.trying { border-color: color-mix(in srgb, var(--easy) 40%, var(--line)); }
.step-h { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--faint); margin-bottom: 9px; }
.step.trying .step-h { color: var(--easy); }
.step-goal { color: var(--ink); font-size: 14px; line-height: 1.5; margin-bottom: 13px; }
.step-choice { display: flex; gap: 9px; }
.try-hint { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.try-hint .code { margin: 8px 0; }
.try-area { width: 100%; min-height: 96px; resize: vertical; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-family: var(--mono); font-size: 13.5px; line-height: 1.5; padding: 12px; margin-bottom: 11px; }
.try-area:focus { outline: none; border-color: var(--easy); }
.step .why { margin-top: 12px; }

.lvl-next { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.finish { margin-top: 24px; text-align: center; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.fin-enc { color: var(--good); font-size: 14.5px; margin-bottom: 6px; }
.fin-next { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.lt-blind { flex: none; background: none; border: 1px solid color-mix(in srgb, var(--again) 40%, var(--line)); color: var(--again); cursor: pointer; font-family: var(--mono); font-size: 12px; padding: 7px 11px; border-radius: 8px; transition: .13s; }
.lt-blind:hover { background: color-mix(in srgb, var(--again) 14%, transparent); border-color: var(--again); }
.ghost-btn.blind-link { margin-left: auto; color: var(--again); border-color: color-mix(in srgb, var(--again) 40%, var(--line)); }
.ghost-btn.blind-link:hover { color: var(--again); border-color: var(--again); }
.ghost-btn.blind-link + .ghost-btn { margin-left: 0; }

/* blind attempt screen */
.blind-banner { background: color-mix(in srgb, var(--again) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--again) 35%, var(--line)); border-radius: 12px; padding: 13px 16px; color: var(--ink); font-size: 13.5px; line-height: 1.5; margin-bottom: 14px; }
.blind-timer { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: 16px; padding: 22px; text-align: center; margin-bottom: 14px; }
.bt-clock { font-size: 52px; font-weight: 700; letter-spacing: 3px; color: var(--amber); line-height: 1; }
.bt-ctrls { display: flex; gap: 10px; justify-content: center; margin: 16px 0 10px; }
.bt-targets { color: var(--faint); font-size: 12px; }
.blind-do { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.bd-row { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; }
.bd-row .drill-k { color: var(--amber); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.bd-row .code { margin: 9px 0; }
.bd-row .mini { align-self: flex-start; }
.blind-spec { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.blind-spec > .drill-k { color: var(--prob); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 4px; display: block; }
.bspec { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; border-top: 1px solid var(--line-soft); cursor: pointer; }
.bspec-box { flex: none; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--good); font-size: 13px; margin-top: 2px; }
.bspec.done .bspec-box { border-color: var(--good); background: color-mix(in srgb, var(--good) 18%, transparent); }
.bspec.done .bspec-txt { opacity: .55; text-decoration: line-through; }
.bspec-ask { color: var(--muted); font-size: 13px; }
.blind-foot { margin-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bfoot-note { color: var(--faint); font-size: 12.5px; }

/* katas — read-and-debug drills */
.kata-time { flex: none; color: var(--faint); font-family: var(--mono); font-size: 12px; }
.kata-sym { margin-top: 12px; }
.kata-sym .drill-k { color: var(--again); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.kata-sym ul { margin: 8px 0 0; padding-left: 20px; }
.kata-sym li { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 6px; }
.kata-code { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.kata-code .code { max-height: 60vh; overflow: auto; }
.kata-bugs { background: linear-gradient(180deg, var(--panel), var(--panel-2)); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.kata-bugs > .drill-k { color: var(--again); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.bug-card { border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; background: var(--inset); animation: rise .3s ease both; text-align: left; }
.bug-card.hidden { display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--ink); font-family: var(--mono); font-size: 13px; border-color: color-mix(in srgb, var(--again) 35%, var(--line)); transition: .13s; width: 100%; }
.bug-card.hidden:hover { background: color-mix(in srgb, var(--again) 10%, var(--inset)); border-color: var(--again); }
.bug-card.hidden .bug-tap { margin-left: auto; color: var(--again); }
.bug-n { color: var(--faint); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.bug-cat { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.bug-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 11px; }
.bug-title { color: var(--amber); font-size: 14px; font-weight: 600; }
.bug-card .drill-k { color: var(--faint); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin: 10px 0 6px; display: block; }
.bug-card .why { margin-top: 10px; }
.bug-lesson { margin-top: 12px; color: var(--muted); font-size: 13.5px; line-height: 1.55; padding-left: 12px; border-left: 2px solid color-mix(in srgb, var(--good) 50%, var(--line)); }
.bug-lesson b { color: var(--good); }
.kata-debrief { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 6px 0 0; }
