/* ============================================================
   LINUX.ACADEMY · terminal-brutalist
   Hard borders. Offset shadows. CRT scan-lines. Monospace life.
   ============================================================ */

:root {
  /* Palette — easier on the eyes: warm dark gray + desaturated sage */
  --ink:        #d4cdb6;     /* warm cream, softened */
  --paper:      #16191c;     /* warm dark gray, NOT pure black */
  --paper-2:    #1d2125;     /* surface */
  --paper-3:    #262b30;     /* raised */
  --rule:       #2e333a;     /* hairlines */
  --rule-2:     #3a414a;
  --dim:        #8b91a0;
  --faint:      #5a6070;

  /* THE accent — muted sage green (no more flashlight neon) */
  --acid:    #82c98c;
  --acid-2:  #a3d8ab;
  --acid-dim:#5fa86d;

  /* Supporting (sparing use) — desaturated */
  --amber:   #d4b16a;     /* warnings/levels */
  --crimson: #d47780;     /* errors only */
  --pulse:   #d49570;     /* streak heat */

  /* Tertiary — kept for legacy callsites but tuned down */
  --magenta: #b8a0c4;
  --cyan:    #8dc0d4;

  /* Fonts — distinctive monospace stack */
  --display: 'Major Mono Display', 'Courier New', monospace;
  --crt:     'VT323', 'Courier New', monospace;
  --mono:    'JetBrains Mono', 'IBM Plex Mono', 'Menlo', monospace;

  /* Spacing — 4px grid */
  --s1:  4px;  --s2:  8px;  --s3: 12px;
  --s4: 16px;  --s5: 24px;  --s6: 32px;
  --s7: 48px;  --s8: 64px;

  /* Brutalist hard offset shadows */
  --shadow-1: 4px 4px 0 var(--ink);
  --shadow-2: 6px 6px 0 var(--ink);
  --shadow-3: 8px 8px 0 var(--ink);
  --shadow-acid: 6px 6px 0 var(--acid);
  --shadow-amber: 6px 6px 0 var(--amber);
  --shadow-magenta: 6px 6px 0 var(--magenta);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--s7);
  overflow-x: hidden;
  position: relative;
}

/* CRT scan-lines — subtle but everywhere */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.018) 0,
      rgba(255,255,255,0.018) 1px,
      transparent 1px,
      transparent 3px
    );
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

/* Grid noise — adds tactile feel */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(130,201,140,0.03) 0%, transparent 35%),
    radial-gradient(circle at 85% 95%, rgba(184,160,196,0.025) 0%, transparent 40%);
  pointer-events: none;
  z-index: -1;
}

button { font-family: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }

/* ============================================================
   TOPBAR — flat brutalist
   ============================================================ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-right: 2px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
}

.logo {
  font-size: 22px;
  line-height: 1;
  filter: hue-rotate(0deg) saturate(1.2);
}

.brand h1 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: lowercase;
  color: var(--acid);
}

.sparkle { display: none; }   /* dropping cutesy sparkle */

.brand h1::after {
  content: '_';
  animation: blink 1s steps(2) infinite;
  margin-left: 2px;
  color: var(--acid);
}
@keyframes blink { 50% { opacity: 0; } }

.stats {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.stat {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-left: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-label {
  font-size: 10px;
  color: var(--dim);
  font-weight: 500;
}

.stat-val {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}

.stat-rank {
  color: var(--acid);
  font-size: 11px;
  background: transparent;
  padding: 2px 8px;
  font-weight: 700;
  border: 1.5px solid var(--acid);
  text-transform: lowercase;
}

/* XP bar — ASCII-style */
.xp-bar-wrap {
  position: relative;
  width: 220px;
  height: 22px;
  background: var(--paper);
  border: 2px solid var(--rule-2);
  overflow: hidden;
}

.xp-bar {
  height: 100%;
  width: 0%;
  background: var(--acid);
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.xp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  z-index: 2;
}

.reset-btn {
  background: var(--paper);
  border: none;
  border-left: 1px solid var(--rule);
  color: var(--dim);
  width: 48px;
  cursor: pointer;
  font-size: 18px;
  transition: all 150ms;
}
.reset-btn:hover {
  background: var(--crimson);
  color: var(--paper);
}

/* ============================================================
   TABS — brutalist nav strip
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  background: var(--paper);
  border: none;
  border-right: 2px solid var(--ink);
  color: var(--ink);
  padding: var(--s3) var(--s5);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 1px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 120ms;
  position: relative;
}

.tab:hover {
  background: var(--ink);
  color: var(--paper);
}

.tab.active {
  background: var(--ink);
  color: var(--acid);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--acid);
}

/* ============================================================
   MAIN
   ============================================================ */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--s7) var(--s5) 0;
}

.mode {
  animation: bootIn 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes bootIn {
  0%   { opacity: 0; transform: translateY(16px); clip-path: inset(0 100% 0 0); }
  100% { opacity: 1; transform: translateY(0); clip-path: inset(0 0 0 0); }
}

/* Section divider — ASCII rule used inside modes */
.rule {
  border: none;
  border-top: 2px solid var(--ink);
  margin: var(--s6) 0;
  position: relative;
}

/* ============================================================
   HOME
   ============================================================ */
.hero {
  padding: var(--s7) 0 var(--s6);
  position: relative;
  text-align: left;
}

.hero h2 {
  font-family: var(--display);
  font-size: clamp(40px, 8vw, 96px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -2px;
  text-transform: lowercase;
  color: var(--ink);
  margin-bottom: var(--s5);
}

.hero h2::before {
  content: '> ';
  color: var(--acid);
}

.hero h2 .accent-1 { color: var(--acid); }
.hero h2 .accent-2 { color: var(--magenta); }

.tagline {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--dim);
  max-width: 620px;
  border-left: 4px solid var(--acid);
  padding-left: var(--s4);
}

.tagline::before { content: '// '; color: var(--acid); }

/* Mode cards — flat brutalist tiles, no grid bg to bleed through */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s3);
  margin: var(--s7) 0 var(--s7);
  background: transparent;
  border: none;
}

.mode-card {
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  padding: var(--s5);
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  font-family: inherit;
  transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mode-card:hover {
  background: var(--acid);
  color: var(--paper);
  border-color: var(--acid);
  transform: translate(-3px, -3px);
  box-shadow: 4px 4px 0 var(--acid-dim);
  z-index: 2;
}
.mode-card:hover h3,
.mode-card:hover p { color: var(--paper); }
.mode-card:hover .mc-xp { background: var(--paper); color: var(--acid); border-color: var(--paper); }
.mode-card:hover::before { color: var(--paper); opacity: 0.7; }

/* Card number badge */
.mode-card::before {
  content: '[' attr(data-num) ']';
  position: absolute;
  top: var(--s3);
  right: var(--s4);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  letter-spacing: 1px;
  font-weight: 700;
}

.mc-icon {
  font-size: 40px;
  margin-bottom: var(--s4);
  display: block;
  line-height: 1;
}

.mode-card h3 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: var(--s3);
  text-transform: lowercase;
  letter-spacing: -0.5px;
  line-height: 1;
}

.mode-card p {
  font-size: 13px;
  color: var(--dim);
  line-height: 1.55;
  margin-bottom: var(--s4);
  flex: 1;
}
.mode-card:hover p { color: var(--paper); }

.mc-xp {
  display: inline-block;
  font-size: 11px;
  background: var(--ink);
  color: var(--acid);
  padding: 4px 10px;
  font-family: var(--mono);
  font-weight: 700;
  border: 1.5px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 1px;
  align-self: flex-start;
}

/* Progress block */
.progress-summary {
  border: 1px solid var(--rule-2);
  padding: 0;
  margin-bottom: var(--s6);
  background: var(--paper);
}

.progress-summary h3 {
  background: var(--paper-2);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  padding: var(--s3) var(--s4);
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid var(--rule-2);
}
.progress-summary h3::before { content: '┃ '; color: var(--acid); }

.prog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1px;
  background: var(--rule);
}

.prog-item {
  background: var(--paper);
  padding: var(--s4) var(--s5);
  transition: background 120ms;
}
.prog-item:hover { background: var(--paper-2); }

.pi-label {
  font-size: 10px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: var(--s2);
}
.pi-label::before { content: '> '; color: var(--acid); }

.pi-val {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 400;
  color: var(--acid);
  letter-spacing: -1px;
  line-height: 1;
}

/* ============================================================
   COUNTER PILL
   ============================================================ */
.counter {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  background: var(--paper);
  padding: 5px 10px;
  border: 1.5px solid var(--ink);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============================================================
   FLASHCARDS — looks like a terminal output
   ============================================================ */
.cards-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s5);
  flex-wrap: wrap;
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 2px dashed var(--rule-2);
}

.cat-pick {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: var(--dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cat-pick::before { content: '$'; color: var(--acid); margin-right: 4px; }

.cat-pick select {
  background: var(--paper);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  text-transform: uppercase;
}

.card-stage {
  display: flex;
  justify-content: center;
  padding: var(--s5) 0;
  perspective: 1600px;
}

.flashcard {
  width: 100%;
  max-width: 680px;
  height: 380px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.flashcard.flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 2px solid var(--ink);
  padding: var(--s6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.card-front {
  background: var(--paper);
  box-shadow: var(--shadow-2);
}

.card-back {
  background: var(--ink);
  color: var(--paper);
  transform: rotateY(180deg);
  box-shadow: var(--shadow-magenta);
}

.card-cat-tag {
  position: absolute;
  top: var(--s3);
  left: var(--s4);
  background: var(--acid);
  color: var(--paper);
  font-size: 10px;
  padding: 3px 8px;
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.card-back .card-cat-tag {
  background: var(--magenta);
  color: var(--paper);
}

.card-term {
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 400;
  color: var(--ink);
  margin-bottom: var(--s3);
  word-break: break-word;
  letter-spacing: -1px;
  line-height: 1;
  text-transform: lowercase;
}

.card-hint {
  position: absolute;
  bottom: var(--s4);
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.card-hint::before { content: '[ '; color: var(--acid); }
.card-hint::after { content: ' ]'; color: var(--acid); }

.card-explain {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.6;
  color: var(--paper);
  margin-bottom: var(--s4);
  max-width: 520px;
}

.card-vibe {
  font-family: var(--crt);
  font-size: 22px;
  color: var(--acid);
  padding: var(--s2) var(--s4);
  background: var(--paper);
  border: 1.5px solid var(--acid);
  letter-spacing: 0.5px;
}

.card-controls {
  display: flex;
  justify-content: center;
  gap: var(--s2);
  margin-top: var(--s5);
  flex-wrap: wrap;
}

/* ============================================================
   BUTTONS — brutalist
   ============================================================ */
.btn {
  border: 2px solid var(--ink);
  padding: 10px 18px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 120ms;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover { background: var(--ink); color: var(--acid); transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(0); box-shadow: none; }

.btn.primary {
  background: var(--acid);
  color: var(--paper);
}
.btn.primary:hover {
  background: var(--paper);
  color: var(--acid);
  box-shadow: var(--shadow-acid);
  transform: translate(-3px, -3px);
}

.btn.ghost {
  background: var(--paper);
  color: var(--ink);
}

.btn.small { padding: 6px 12px; font-size: 10.5px; }

.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ============================================================
   QUIZ
   ============================================================ */
.quiz-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--s4);
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 2px dashed var(--rule-2);
}

.quiz-card {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: var(--s6);
  box-shadow: var(--shadow-3);
}

.quiz-q {
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.15;
  margin-bottom: var(--s5);
  font-weight: 400;
  letter-spacing: -0.8px;
  text-transform: lowercase;
  color: var(--ink);
}
.quiz-q::before { content: '? '; color: var(--magenta); font-family: var(--mono); font-weight: 700; }

.quiz-options {
  display: grid;
  gap: var(--s2);
  margin-bottom: var(--s4);
}

.opt {
  background: var(--paper);
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 14px 18px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 14px;
  text-align: left;
  transition: all 120ms;
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-weight: 500;
  position: relative;
  counter-increment: opt;
}

.opt::before {
  content: counter(opt, upper-alpha);
  width: 28px;
  height: 28px;
  background: var(--ink);
  color: var(--acid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.quiz-options { counter-reset: opt; }

.opt:hover:not(:disabled) {
  background: var(--ink);
  color: var(--acid);
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 var(--acid);
}
.opt:hover:not(:disabled)::before { background: var(--acid); color: var(--paper); }

.opt.correct {
  background: var(--acid);
  border-color: var(--ink);
  color: var(--paper);
  transform: none;
  box-shadow: var(--shadow-2);
}
.opt.correct::before { background: var(--paper); color: var(--acid); }
.opt.correct::after { content: '✓'; margin-left: auto; font-weight: 900; font-size: 18px; }

.opt.wrong {
  background: var(--crimson);
  border-color: var(--ink);
  color: var(--paper);
  transform: none;
  box-shadow: var(--shadow-2);
}
.opt.wrong::before { background: var(--paper); color: var(--crimson); }
.opt.wrong::after { content: '✗'; margin-left: auto; font-weight: 900; font-size: 18px; }

.opt:disabled { cursor: default; }

.quiz-feedback {
  margin: var(--s4) 0;
  padding: var(--s4) var(--s5);
  font-size: 13.5px;
  line-height: 1.55;
  border: 2px solid var(--ink);
}

.quiz-feedback.good {
  background: var(--acid);
  color: var(--paper);
}
.quiz-feedback.bad {
  background: var(--crimson);
  color: var(--paper);
}

.quiz-feedback strong { font-weight: 700; display: block; margin-bottom: 4px; font-family: var(--display); font-size: 16px; text-transform: lowercase; }

.quiz-done {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: var(--s7) var(--s6);
  text-align: center;
  box-shadow: var(--shadow-acid);
}

.quiz-done h2 {
  font-family: var(--display);
  font-size: 56px;
  margin-bottom: var(--s4);
  color: var(--ink);
  letter-spacing: -2px;
  text-transform: lowercase;
}
.quiz-done h2::before { content: '* '; color: var(--magenta); }
.quiz-done h2::after  { content: ' *'; color: var(--magenta); }

.quiz-done p { margin-bottom: var(--s5); font-size: 15px; color: var(--dim); }
.quiz-done p strong { color: var(--acid); font-weight: 700; }

/* ============================================================
   TERMINAL
   ============================================================ */
.term-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--s3);
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 2px dashed var(--rule-2);
}

.term-task {
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s3);
  display: flex;
  gap: var(--s3);
  align-items: center;
  box-shadow: var(--shadow-amber);
}

.task-label {
  color: var(--paper);
  background: var(--amber);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 8px;
  font-weight: 700;
  flex-shrink: 0;
}

.task-text { font-size: 14px; line-height: 1.5; }

.terminal {
  background: var(--paper);
  border: 2px solid var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  position: relative;
}

/* Title bar — terminal-like */
.terminal::before {
  content: '● ● ● ─── alice@fakeOS:~ ───────────────────────────';
  display: block;
  background: var(--ink);
  color: var(--acid);
  letter-spacing: 1px;
  font-size: 11px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-weight: 600;
}

.term-output {
  padding: var(--s4) var(--s4) var(--s2);
  min-height: 300px;
  max-height: 440px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.term-line { display: block; }
.term-line.user { color: var(--ink); }
.term-line.cmd  { color: var(--cyan); }
.term-line.ok   { color: var(--acid); }
.term-line.err  { color: var(--crimson); }
.term-line.sys  { color: var(--dim); }

.term-input-line {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-top: 2px solid var(--ink);
  background: var(--paper);
}

.prompt {
  color: var(--acid);
  font-weight: 700;
  user-select: none;
  font-size: 13px;
}

.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--mono);
  color: var(--ink);
  font-size: 13px;
  caret-color: var(--acid);
}

.hint-text {
  margin-top: var(--s3);
  padding: var(--s3) var(--s4);
  background: var(--amber);
  color: var(--paper);
  border: 2px solid var(--ink);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 500;
}

/* ============================================================
   BASH GYM
   ============================================================ */
.bash-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s4);
  flex-wrap: wrap;
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 2px dashed var(--rule-2);
}

.bash-meta { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.bash-nav { display: flex; gap: var(--s1); }

.level-tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 1.5px solid var(--ink);
}

.level-tag.beginner     { background: var(--acid);    color: var(--paper); }
.level-tag.intermediate { background: var(--amber);   color: var(--paper); }
.level-tag.advanced     { background: var(--magenta); color: var(--paper); }

.bash-card {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: var(--s6);
  box-shadow: var(--shadow-3);
}

.bash-title {
  font-family: var(--display);
  font-size: 32px;
  margin-bottom: var(--s3);
  color: var(--ink);
  font-weight: 400;
  letter-spacing: -1px;
  text-transform: lowercase;
}
.bash-title::before { content: '> '; color: var(--acid); }

.bash-task {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--dim);
  margin-bottom: var(--s5);
  padding-left: var(--s4);
  border-left: 2px solid var(--acid);
}

.bash-editor-wrap { margin-bottom: var(--s4); }

.editor-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  margin-bottom: var(--s2);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.editor-label::before { content: '┌── '; color: var(--acid); }
.editor-label::after  { content: ' ───────'; color: var(--rule-2); }

.bash-editor {
  width: 100%;
  min-height: 180px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: var(--s4);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  caret-color: var(--acid);
  transition: all 120ms;
}

.bash-editor:focus {
  outline: none;
  box-shadow: var(--shadow-acid);
  transform: translate(-2px, -2px);
}

.bash-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.bash-feedback {
  padding: var(--s4) var(--s5);
  margin-top: var(--s3);
  font-size: 13.5px;
  line-height: 1.55;
  border: 2px solid var(--ink);
}

.bash-feedback.good { background: var(--acid);    color: var(--paper); }
.bash-feedback.bad  { background: var(--crimson); color: var(--paper); }
.bash-feedback.info { background: var(--cyan);    color: var(--paper); }

.bash-feedback strong { font-weight: 700; display: inline; }

.bash-explain {
  margin-top: var(--s3);
  padding: var(--s4) var(--s5);
  background: var(--paper);
  border: 2px solid var(--acid);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}
.bash-explain strong { color: var(--acid); font-weight: 700; }
.bash-explain::before { content: '// EXPLANATION'; display: block; font-size: 10px; color: var(--acid); margin-bottom: var(--s2); letter-spacing: 2px; font-weight: 700; }

/* ============================================================
   PORTS MATCH
   ============================================================ */
.ports-head {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
  margin-bottom: var(--s5);
  padding-bottom: var(--s3);
  border-bottom: 2px dashed var(--rule-2);
}

.ports-head .instr {
  flex: 1;
  min-width: 260px;
  font-size: 13px;
  color: var(--dim);
}
.ports-head .instr::before { content: '$ '; color: var(--acid); font-weight: 700; }

.ports-board {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--s5);
}

.ports-col h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--acid);
  margin-bottom: var(--s3);
  font-weight: 700;
}
.ports-col h4::before { content: '┃ '; color: var(--ink); }

.ports-col > div {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.port-num {
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: var(--s4);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 120ms;
  letter-spacing: 1px;
  position: relative;
}
.port-num::before { content: '['; position: absolute; left: 12px; color: var(--acid); font-weight: 400; }
.port-num::after  { content: ']'; position: absolute; right: 12px; color: var(--acid); font-weight: 400; }

.port-num:hover {
  background: var(--ink);
  color: var(--acid);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-acid);
}

.port-num.selected {
  background: var(--acid);
  color: var(--paper);
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-2);
}
.port-num.selected::before, .port-num.selected::after { color: var(--paper); }

.port-num.matched {
  opacity: 0.3;
  cursor: default;
  background: var(--paper);
  color: var(--dim);
}
.port-num.matched:hover { transform: none; box-shadow: none; background: var(--paper); }

.port-srv {
  background: var(--paper);
  border: 2px dashed var(--ink);
  padding: var(--s4);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: all 120ms;
}

.port-srv:hover {
  background: var(--ink);
  color: var(--magenta);
  border-style: solid;
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-magenta);
}

.port-srv.matched {
  background: var(--acid);
  color: var(--paper);
  border-style: solid;
}
.port-srv.matched .srv-port { color: var(--paper); opacity: 0.85; }

.port-srv.wrong-flash {
  animation: shake 360ms;
  background: var(--crimson);
  color: var(--paper);
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%  { transform: translateX(-8px); }
  40%  { transform: translateX(8px); }
  60%  { transform: translateX(-5px); }
  80%  { transform: translateX(5px); }
}

.srv-port {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  display: block;
  margin-top: 4px;
  font-weight: 500;
  text-transform: lowercase;
}
.srv-port::before { content: '// '; }

.ports-feedback {
  margin-top: var(--s4);
  font-size: 13px;
  min-height: 24px;
  color: var(--ink);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* ============================================================
   FILESYSTEM
   ============================================================ */
.fs-head { margin-bottom: var(--s4); padding-bottom: var(--s3); border-bottom: 2px dashed var(--rule-2); }
.fs-head .instr { color: var(--dim); font-size: 13px; margin-bottom: var(--s2); }
.fs-head .instr::before { content: '$ '; color: var(--acid); font-weight: 700; }

.fs-breadcrumb {
  font-family: var(--mono);
  color: var(--paper);
  background: var(--acid);
  font-size: 13px;
  padding: 5px 12px;
  display: inline-block;
  font-weight: 700;
  border: 2px solid var(--ink);
  letter-spacing: 0.5px;
}
.fs-breadcrumb::before { content: 'pwd: '; color: var(--paper); opacity: 0.6; font-weight: 500; }

.fs-board {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  border: 2px solid var(--ink);
}

.fs-tree-col h4, .fs-info-col h4 {
  display: none;
}

.fs-tree-col {
  border-right: 2px solid var(--ink);
  background: var(--paper);
}

.fs-tree {
  padding: var(--s3);
  max-height: 600px;
  overflow-y: auto;
}

.fs-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 100ms;
  position: relative;
}

.fs-item:hover { background: var(--ink); color: var(--acid); }
.fs-item.active { background: var(--acid); color: var(--paper); font-weight: 700; }
.fs-item.visited:not(.active) { color: var(--acid); }
.fs-item.visited::after { content: ' [✓]'; color: var(--amber); font-size: 10px; }
.fs-item.active.visited::after { content: ''; }
.fs-item.indent { padding-left: 32px; font-size: 12px; color: var(--dim); }
.fs-item.indent::before { content: '└─ '; position: absolute; left: 10px; color: var(--rule-2); }
.fs-item.indent:hover::before { color: var(--acid); }

.fs-info-col {
  background: var(--paper-2);
}

.fs-card {
  padding: var(--s6);
  min-height: 280px;
}

.fs-path {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: var(--s4);
  letter-spacing: -1px;
  text-transform: lowercase;
}
.fs-path::before { content: '> '; color: var(--acid); font-family: var(--mono); }

.fs-summary {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: var(--s4);
}

.fs-vibe {
  font-family: var(--crt);
  font-size: 22px;
  color: var(--acid);
  padding: var(--s3) var(--s4);
  background: var(--paper);
  border: 2px solid var(--acid);
  letter-spacing: 0.5px;
}

.fs-vibe:empty { display: none; }

/* ============================================================
   TOAST + MODAL
   ============================================================ */
.toast {
  position: fixed;
  bottom: var(--s5);
  left: 50%;
  transform: translateX(-50%) translateY(140px);
  background: var(--ink);
  color: var(--acid);
  padding: 12px 22px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-acid);
  opacity: 0;
  transition: all 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 200;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.toast::before { content: '> '; color: var(--acid); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.toast.bad {
  color: var(--crimson);
  box-shadow: 6px 6px 0 var(--crimson);
}
.toast.xp {
  background: var(--acid);
  color: var(--paper);
  box-shadow: 6px 6px 0 var(--paper);
  border-color: var(--paper);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: bootIn 240ms;
  padding: var(--s4);
}

.modal-content {
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: var(--s7) var(--s6);
  text-align: center;
  box-shadow: var(--shadow-magenta);
  animation: pop 480ms cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 460px;
  width: 100%;
}

@keyframes pop {
  0%   { transform: scale(0.7) rotate(-2deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.modal-content h2 {
  font-family: var(--display);
  font-size: 56px;
  color: var(--ink);
  margin-bottom: var(--s4);
  letter-spacing: -2px;
  font-weight: 400;
  text-transform: lowercase;
}
.modal-content h2::before { content: '> '; color: var(--magenta); }

.modal-content p { color: var(--dim); margin-bottom: var(--s2); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }

.big-rank {
  font-family: var(--crt);
  font-size: 44px;
  color: var(--acid);
  margin: var(--s3) 0 var(--s2) !important;
  font-weight: 400;
  letter-spacing: 1px;
  background: var(--paper);
  border: 2px solid var(--acid);
  padding: 6px var(--s4);
  display: inline-block;
  text-transform: none !important;
}

.big-rank-lvl {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--amber);
  margin-bottom: var(--s5) !important;
  font-weight: 700;
}

.hidden { display: none !important; }

/* ============================================================
   STREAK PULSE
   ============================================================ */
.streak-pulse {
  animation: pulse-streak 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
  color: var(--pulse) !important;
}

@keyframes pulse-streak {
  0%, 100% { transform: scale(1); }
  40%      { transform: scale(1.3); }
}

/* ============================================================
   HUD — restructured topbar
   ============================================================ */
.hud {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex: 1;
}
.hud-cell {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-left: 1px solid var(--rule);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
  position: relative;
}
.hud-label {
  font-size: 10px;
  color: var(--dim);
  font-weight: 600;
  letter-spacing: 1.5px;
}
.hud-level { gap: var(--s2); }
.hud-lvl-num {
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -1px;
}
.hud-rank {
  font-size: 10.5px;
  color: var(--acid);
  border: 1.5px solid var(--acid);
  padding: 2px 8px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 1px;
}
.hud-xp { flex: 1; min-width: 180px; }
.hud-streak { gap: var(--s2); }
.streak-flame {
  display: inline-block;
  font-size: 16px;
  animation: flicker 1.2s ease-in-out infinite alternate;
  transform-origin: center bottom;
}
.streak-count {
  font-family: var(--display);
  font-size: 20px;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -1px;
}
.streak-cold .streak-flame { filter: grayscale(1) opacity(0.4); animation: none; }
.streak-warm .streak-flame { filter: drop-shadow(0 0 4px rgba(212,149,112,0.35)); }
.streak-hot .streak-flame  { filter: drop-shadow(0 0 7px rgba(212,149,112,0.55)); }
.streak-inferno .streak-flame { filter: drop-shadow(0 0 10px rgba(212,120,90,0.7)); animation: flicker 0.6s ease-in-out infinite alternate; }
@keyframes flicker {
  0% { transform: scale(1) rotate(-2deg); }
  100% { transform: scale(1.1) rotate(2deg); }
}
.hud-actions { gap: var(--s2); }
.icon-btn {
  background: transparent;
  border: 1.5px solid var(--rule-2);
  color: var(--ink);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms;
  border-radius: 0;
}
.icon-btn:hover {
  background: var(--acid);
  color: var(--paper);
  border-color: var(--acid);
}
.icon-btn.off { color: var(--dim); border-color: var(--rule); }

/* ============================================================
   FLASHCARD UPGRADES
   ============================================================ */
.flashcard {
  transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms, box-shadow 250ms;
  will-change: transform;
}
.flashcard.learned::after {
  content: '✓ learned';
  position: absolute;
  top: var(--s3);
  right: var(--s4);
  background: var(--acid);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  letter-spacing: 1.5px;
  z-index: 3;
}
.kbd-hint {
  margin-top: var(--s4);
  text-align: center;
  font-size: 10.5px;
  color: var(--faint);
  font-family: var(--mono);
  letter-spacing: 1.5px;
  text-transform: lowercase;
}

/* ============================================================
   QUIZ EXTRAS — combo, progress
   ============================================================ */
.quiz-progress {
  height: 4px;
  background: var(--rule);
  margin-bottom: var(--s5);
  overflow: hidden;
  border: 1px solid var(--rule-2);
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--acid-dim), var(--acid));
  transition: width 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 8px rgba(130, 201, 140, 0.25);
}
.combo-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--paper-2);
  border: 1.5px solid var(--pulse);
  color: var(--pulse);
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: combo-pop 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.combo-pill.combo-5  { border-color: var(--amber); color: var(--amber); box-shadow: 0 0 8px rgba(212,177,106,0.25); }
.combo-pill.combo-10 { border-color: var(--acid);  color: var(--acid);  box-shadow: 0 0 12px rgba(130,201,140,0.35); }
@keyframes combo-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}

.quiz-done-score {
  font-family: var(--display);
  font-size: 72px;
  color: var(--acid);
  letter-spacing: -3px;
  line-height: 1;
  margin: var(--s4) 0;
}
.quiz-done-score span {
  font-size: 32px;
  color: var(--dim);
}
.quiz-done-msg {
  font-size: 14px;
  color: var(--dim);
  margin-bottom: var(--s4);
}
.quiz-done-combo {
  display: inline-block;
  margin: 0 0 var(--s4);
  padding: 4px 12px;
  border: 1.5px solid var(--pulse);
  color: var(--pulse);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: 700;
}

/* ============================================================
   LEVEL UP MODAL UPGRADES
   ============================================================ */
.modal-content.level-up {
  border-color: var(--acid);
  box-shadow: var(--shadow-acid), 0 0 30px rgba(130,201,140,0.18);
  position: relative;
  overflow: hidden;
}
.modal-content.level-up::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(130,201,140,0.08), transparent 60%);
  animation: ripple 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes ripple {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}
.modal-burst {
  font-size: 56px;
  line-height: 1;
  margin-bottom: var(--s3);
  animation: burst 700ms cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
@keyframes burst {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.modal-sub {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: var(--s2);
}

/* ============================================================
   FOOTER SIGNATURE
   ============================================================ */
.footsig {
  max-width: 1280px;
  margin: var(--s7) auto 0;
  padding: var(--s5) var(--s5) var(--s6);
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 1.5px;
  text-transform: lowercase;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  text-align: center;
}
.footsig a {
  color: var(--acid);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid var(--acid);
  padding-bottom: 1px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 880px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .brand { border-right: none; border-bottom: 2px solid var(--rule); padding: var(--s3) var(--s4); }
  .stats { flex-wrap: wrap; overflow-x: auto; }
  .stat { padding: var(--s2) var(--s3); }
  .hud { flex-wrap: wrap; }
  .hud-cell { border-left: none; border-top: 1px solid var(--rule); padding: var(--s2) var(--s3); flex: 1 1 50%; }
  .hud-xp { flex-basis: 100%; }
  .hud-actions { flex-basis: 100%; justify-content: flex-end; }
  .footsig { padding: var(--s4) var(--s4) var(--s5); margin-top: var(--s5); }
  .xp-bar-wrap { width: 160px; height: 20px; }
  main { padding: var(--s5) var(--s4) 0; }
  .hero { padding: var(--s5) 0 var(--s4); }
  .mode-grid { grid-template-columns: 1fr 1fr; gap: var(--s2); }
  .mode-card { min-height: 180px; padding: var(--s4); }
  .ports-board, .fs-board { grid-template-columns: 1fr; }
  .fs-tree-col { border-right: none; border-bottom: 2px solid var(--rule-2); }
  .card-term { font-size: 28px; }
  .flashcard { height: 340px; }
  .quiz-card, .bash-card { padding: var(--s4); }
  .btn { padding: 12px 18px; font-size: 12px; min-height: 44px; }
  .btn.small { padding: 8px 14px; font-size: 11px; min-height: 36px; }
  .tab { padding: var(--s3) var(--s4); font-size: 12px; }
  .term-output { min-height: 240px; max-height: 360px; font-size: 12px; }
  .bash-editor { min-height: 200px; font-size: 12.5px; }
  .opt { padding: var(--s3) var(--s4); font-size: 13px; min-height: 52px; }
  .port-num, .port-srv { padding: var(--s3); min-height: 52px; }
  .modal-content { padding: var(--s5) var(--s4); }
  .modal-content h2 { font-size: 44px; }
}

@media (max-width: 520px) {
  body { font-size: 13px; }
  .hero h2 { letter-spacing: -1px; }
  .tagline { font-size: 14px; padding-left: var(--s3); border-left-width: 3px; }
  main { padding: var(--s4) var(--s3) 0; }

  .topbar { position: relative; }
  .brand { padding: var(--s2) var(--s3); }
  .brand h1 { font-size: 14px; }
  .logo { font-size: 18px; }
  .mode-grid { grid-template-columns: 1fr; gap: var(--s2); margin: var(--s5) 0; }
  .mode-card { min-height: 150px; padding: var(--s4); }
  .mode-card h3 { font-size: 18px; }
  .mode-card p { font-size: 12.5px; margin-bottom: var(--s3); }
  .mc-icon { font-size: 30px; margin-bottom: var(--s3); }
  .mode-card::before { font-size: 10px; top: var(--s2); right: var(--s3); }
  /* kill hover translate that can clip on touch */
  .mode-card:hover { transform: none; box-shadow: inset 0 0 0 2px var(--acid-dim); }

  .stats { flex-direction: column; gap: 0; align-items: stretch; }
  .stat { border-left: none; border-top: 1px solid var(--rule); justify-content: space-between; padding: var(--s2) var(--s3); font-size: 11px; }
  .stat-rank { font-size: 10px; padding: 2px 6px; }
  .xp-bar-wrap { width: 100%; height: 22px; }
  .reset-btn { width: 100%; border-left: none; border-top: 1px solid var(--rule); padding: 10px; }

  .progress-summary h3 { font-size: 12px; padding: var(--s2) var(--s3); }
  .prog-grid { grid-template-columns: 1fr 1fr; }
  .prog-item { padding: var(--s3); }
  .pi-val { font-size: 22px; }
  .pi-label { font-size: 9.5px; }

  .cards-toolbar { flex-direction: column; gap: var(--s2); align-items: stretch; }
  .flashcard { height: 300px; }
  .card-term { font-size: 22px; }
  .card-explain { font-size: 14px; }
  .card-vibe { font-size: 12px; }
  .card-controls { flex-wrap: wrap; gap: var(--s2); }
  .card-controls .btn { flex: 1 1 auto; }

  .quiz-q { font-size: 15px; }
  .opt { padding: var(--s3); font-size: 13px; min-height: 56px; gap: var(--s2); }
  .opt::before { width: 26px; height: 26px; font-size: 11px; }
  .quiz-feedback { font-size: 13px; padding: var(--s3); }

  .term-head, .bash-head { flex-wrap: wrap; gap: var(--s2); }
  .terminal::before { font-size: 9px; padding: 6px 10px; letter-spacing: 0; }
  .term-output { font-size: 11.5px; min-height: 200px; max-height: 320px; padding: var(--s3); line-height: 1.6; }
  .term-input-line { padding: var(--s2) var(--s3); }
  .prompt, .term-input { font-size: 12px; }
  .term-task { font-size: 13px; padding: var(--s3); }
  .task-text { font-size: 13px; }
  .hint-text { font-size: 12px; padding: var(--s2) var(--s3); }

  .bash-card { padding: var(--s3); }
  .bash-title { font-size: 16px; }
  .bash-task { font-size: 13px; }
  .bash-editor { min-height: 180px; font-size: 12px; padding: var(--s3); }
  .bash-controls { flex-wrap: wrap; gap: var(--s2); }
  .bash-controls .btn { flex: 1 1 auto; }
  .bash-feedback, .bash-explain { font-size: 12.5px; padding: var(--s3); }
  .bash-meta { flex-wrap: wrap; gap: var(--s2); }
  .level-tag { font-size: 10px; }

  .ports-head { flex-wrap: wrap; gap: var(--s2); }
  .ports-head .instr { font-size: 13px; }
  .port-num { font-size: 16px; padding: var(--s3); min-height: 56px; }
  .port-srv { padding: var(--s3); font-size: 12.5px; min-height: 56px; }
  .ports-col h4 { font-size: 11px; }

  .fs-head .instr { font-size: 13px; }
  .fs-breadcrumb { font-size: 12px; padding: var(--s2) var(--s3); }
  .fs-item { padding: var(--s2) var(--s3); min-height: 40px; font-size: 12.5px; }
  .fs-tree { max-height: 280px; }
  .fs-path { font-size: 16px; }
  .fs-summary { font-size: 13px; }
  .fs-vibe { font-size: 12px; }

  .btn { padding: 11px 14px; font-size: 11.5px; min-height: 44px; letter-spacing: 1px; }
  .btn.small { padding: 8px 12px; font-size: 11px; min-height: 36px; }

  .modal-content { padding: var(--s5) var(--s3); }
  .modal-content h2 { font-size: 34px; }
  .big-rank { font-size: 20px; }

  .toast { font-size: 12px; padding: var(--s2) var(--s3); max-width: calc(100vw - var(--s4)); }
}

/* Prevent hover-translate from causing tap glitches on touch devices */
@media (hover: none) {
  .btn:hover, .opt:hover, .mode-card:hover, .fs-item:hover, .port-num:hover, .port-srv:hover { transform: none; box-shadow: none; }
  .mode-card:hover { background: var(--paper-2); color: var(--ink); border-color: var(--acid-dim); }
  .mode-card:hover h3, .mode-card:hover p { color: var(--ink); }
  .mode-card:hover .mc-xp { background: var(--ink); color: var(--acid); border-color: var(--ink); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--paper); border-left: 2px solid var(--ink); }
::-webkit-scrollbar-thumb { background: var(--ink); border: 2px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--acid); }

/* Selection */
::selection { background: var(--acid); color: var(--paper); }
