/* ══════════════════════════════════════════════════════════════════════════
   style.css — visual theme for the Zone01 slide-deck template (Copilot: safe
   to edit freely). Pairs with index.html + script.js.

   WHAT TO TOUCH WHEN RETHEMING FOR A NEW COURSE:
   - Palette: edit ONLY the --tone-1..5 / --tone-text values (hex + matching
     rgb triplet) inside :root, below. Every other rule in this file reads
     colors exclusively through those tokens (and the --syn-* code-token
     colors, and --code-bg) — never hardcode a color anywhere else.
   - Fonts: --font-display / --font-body / --font-mono in :root.
   - Everything else (layout, quiz styling, transitions, etc.) is generic and
     should NOT need touching per-course.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ── palette (hex, source of truth) — INDICATIVE values for this template. ⊃ */
  /* Always dark-mode: keep --tone-1/--tone-2 near-black/near-black-red so text */
  /* stays readable. These are FALLBACK DEFAULTS (burgundy) — the values below */
  /* get overridden by whichever static/theme-*.css is linked AFTER this file */
  /* in index.html (e.g. theme-cypress.css). See static/theme-burgundy.css. */
  --tone-1: #120401ff;
  --tone-2: #23060eff;
  --tone-3: #3d0c14ff;
  --tone-4: #6e1420ff;
  --tone-5: #d97b3fff;

  --tone-1-rgb: 18, 4, 1;
  --tone-2-rgb: 35, 6, 14;
  --tone-3-rgb: 61, 12, 20;
  --tone-4-rgb: 110, 20, 32;
  --tone-5-rgb: 217, 123, 63;

  --tone-text: #f6e9dcff;
  --tone-text-rgb: 246, 233, 220;

  /* dedicated code-block background — its own root token, not reused from
         --tone-1, so code panels can be retuned independently of the page bg */
  --code-bg: #0d1117ff;
  --code-bg-rgb: 13, 17, 23;


  /* semantic roles — every other rule below reads ONLY these variables */
  --bg: var(--tone-1);
  --panel: var(--tone-3);
  --panel-rgb: var(--tone-3-rgb);
  --ink: var(--tone-text);
  --ink-rgb: var(--tone-text-rgb);
  --accent: var(--tone-5);
  --accent-rgb: var(--tone-5-rgb);
  --danger: var(--tone-4);
  --danger-rgb: var(--tone-4-rgb);

  /* dedicated h1 title color — ADDITIVE token, defaults to --ink so decks
     that don't set it look exactly as before. A theme-*.css can override
     just this one variable to give the big slide titles their own color
     without touching --ink (which is used everywhere else as body text). */
  --h1-color: var(--ink);

  /* correct/wrong stay green/red on purpose — outside the 5-tone palette */
  --correct: rgb(0, 224, 67);
  --correct-rgb: 0, 224, 67;
  --wrong: rgb(255, 56, 38);
  --wrong-rgb: 255, 56, 38;

  --font-display: "Iowan Old Style", "Georgia", "Times New Roman", serif;
  --font-body: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", "Consolas", "Menlo", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--ink);
  overflow: hidden;
}

/* ── layout shell ─────────────────────────────────────────────────────── ⊃ */

#progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(var(--ink-rgb), 0.12);
  z-index: 50;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width .35s ease;
}

#deck {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.slide {
  position: absolute;
  inset: 0;
  display: none;
  padding: 64px 9vw 120px 9vw;
  overflow-y: auto;
  overflow-x: hidden;
  /* explicit overflow-x is required: per spec, if overflow-x is left at
     its default "visible" while overflow-y is "auto", the browser
     silently computes overflow-x as "auto" too — enabling unwanted
     horizontal scroll/pan even when nothing visibly overflows. */
}

/* Background image layer — a SINGLE shared element (#slide-bg-layer,
   see index.html/script.js), NOT a per-slide pseudo-element. It lives
   outside #deck entirely (a sibling), so it is structurally impossible
   for it to affect any .slide's own scrolling/scrollbar — there is no
   ancestor/descendant relationship between them at all. script.js swaps
   its image + shows/hides it in goTo() based on the active slide's opts. */
#slide-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: none;
  --slide-bg-overlay-alpha: 0.5;
  --slide-bg-size: auto;
  --slide-bg-repeat: no-repeat;
  --slide-bg-position: top left;
}

#slide-bg-layer.active {
  display: block;
}

#slide-bg-layer::before,
#slide-bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
}

#slide-bg-layer::before {
  background-image: var(--slide-bg-image);
  background-size: var(--slide-bg-size);
  background-repeat: var(--slide-bg-repeat);
  background-position: var(--slide-bg-position);
}

#slide-bg-layer::after {
  background: rgba(var(--tone-1-rgb), var(--slide-bg-overlay-alpha));
}

/* .slide-content wraps ALL of a slide's actual rendered content (created
   in script.js). It's what plays the swipe-entrance animation — .slide
   itself never transforms, it only scrolls. */
.slide-content {
  position: relative;
  z-index: 1;
}

/* Swipe transition. goTo() in script.js adds .dir-prev before .active
       when navigating backward, so the slide slides in from the correct
       side full-width, like a swipe. ~320ms, no bounce. */
.slide.active {
  display: block;
}

.slide.active .slide-content {
  animation: swipeInLeft .32s cubic-bezier(.25, .8, .35, 1);
}

.slide.active.dir-prev .slide-content {
  animation-name: swipeInRight;
}

@keyframes swipeInLeft {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes swipeInRight {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

.eyebrow {
  font-family: var(--font-mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 14px;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.08;
  margin: 0 0 22px 0;
  color: var(--h1-color);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 32px);
  color: var(--accent);
  margin: 34px 0 14px 0;
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.18);
  padding-bottom: 8px;
}

h3 {
  font-family: var(--font-body);
  font-size: 19px;
  color: var(--ink);
  margin: 22px 0 8px 0;
}

p,
li {
  font-size: 17px;
  line-height: 1.62;
  color: rgba(var(--ink-rgb), 0.92);
}

strong {
  color: var(--ink);
}

a {
  color: var(--accent);
}

.lede {
  font-size: 19px;
  color: rgba(var(--ink-rgb), 0.92);
  max-width: 100%;
  line-height: 1.7;
}

code,
.inline-code {
  font-family: var(--font-mono);
  background: rgba(var(--code-bg-rgb), 0.85);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.92em;
  color: var(--ink);
}

/* ── code blocks ──────────────────────────────────────────────────────── ⊃ */
/* .code-wrap wraps a <pre> so the copy button can be positioned over it. */
/* Syntax tokens below are named after ROLE (keyword/string/...), not after */
/* the palette above — they intentionally mirror VS Code's Dark+ theme and */
/* are independent of --tone-*, since a theme swap shouldn't wash out code. */
:root {
  --syn-keyword: #569cd6;
  --syn-type: #4ec9b0;
  --syn-string: #ce9178;
  --syn-comment: #6a9955;
  --syn-number: #b5cea8;
  --syn-func: #dcdcaa;
  --syn-punct: #d4d4d4;
}

.code-wrap {
  position: relative;
  margin: 18px 0;
}

/* ── spoiler / drag-to-reveal ─────────────────────────────────────────── ⊃ */
/* Markup: <div class="spoiler"><div class="spoiler-lock">...</div>
   <pre><code>...</code></pre></div> — see decorateSpoilers() in script.js.
   Deliberately requires a DRAG (not a click) to unlock. */
.spoiler {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.spoiler-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background: repeating-linear-gradient(45deg,
      rgba(var(--panel-rgb), 0.97),
      rgba(var(--panel-rgb), 0.97) 12px,
      rgba(var(--tone-1-rgb), 0.97) 12px,
      rgba(var(--tone-1-rgb), 0.97) 24px);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--ink);
  border: 1px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 8px;
}

.spoiler-lock span {
  pointer-events: none;
}

.spoiler-lock.dragging {
  cursor: grabbing;
  box-shadow: 0 0 0 2px var(--accent) inset;
}

pre {
  background: rgba(var(--code-bg-rgb), 1);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0;
}

.code-wrap>pre {
  margin: 0;
}

code {
  font-variant-ligatures: none;
}

pre code {
  background: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(var(--ink-rgb), 0.95);
  white-space: pre;
  font-variant-ligatures: none;
}

.cm {
  color: rgba(var(--ink-rgb), 0.5);
}

/* comment tint, applied manually via span (non-highlighted blocks) */

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  background: rgba(var(--panel-rgb), 0.85);
  color: rgba(var(--ink-rgb), 0.85);
  border: 1px solid rgba(var(--ink-rgb), 0.25);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  opacity: .75;
  transition: opacity .15s, background .15s;
}

.copy-btn:hover {
  opacity: 1;
  background: var(--accent);
  color: var(--bg);
}

/* syntax highlighting token classes — applied by hand, see comment near decorateCodeBlocks() */
.tok-kw {
  color: var(--syn-keyword);
}

.tok-type {
  color: var(--syn-type);
}

.tok-str {
  color: var(--syn-string);
}

.tok-com {
  color: var(--syn-comment);
}

.tok-num {
  color: var(--syn-number);
}

.tok-func {
  color: var(--syn-func);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

@media (max-width:900px) {

  .grid2,
  .grid3 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: rgba(var(--panel-rgb), 0.45);
  border: 1px solid rgba(var(--ink-rgb), 0.15);
  border-radius: 10px;
  padding: 18px 20px;
}

.card h3 {
  margin-top: 0;
  color: var(--accent);
}

.callout {
  border-left: 4px solid var(--danger);
  background: rgba(var(--danger-rgb), 0.18);
  padding: 14px 18px;
  border-radius: 6px;
  margin: 18px 0;
}

.callout.good {
  border-left-color: var(--correct);
  background: rgba(var(--correct-rgb), 0.14);
}

.callout .tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.title-slide {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  height: 100%;
}

.title-badge {
  height: min(32vh, 512px);
  width: auto;
  max-width: 512px;
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  box-sizing: border-box;
}

.title-badge img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.title-badge .fallback {
  font-family: var(--font-display);
  font-size: min(8vh, 120px);
  color: var(--accent);
  font-weight: 700;
}

.kicker-line {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── quiz ──────────────────────────────────────────────────────────────── ⊃ */

.quiz-box {
  background: rgba(var(--panel-rgb), 0.35);
  border: 1px solid rgba(var(--ink-rgb), 0.18);
  border-radius: 12px;
  padding: 26px 28px;
  max-width: 920px;
}

.quiz-q {
  font-size: 19px;
  margin-bottom: 18px;
  color: var(--ink);
  font-weight: 600;
}

/* Optional code block after a quiz question (opt-in via q.code in
   addQuiz()). Distinct look from the regular pre/code blocks — thicker
   accent border + a slightly accent-tinted background — so it visually
   reads as "part of the question" rather than a generic theory code
   sample. */
.quiz-code-block {
  background: rgba(var(--code-bg-rgb), 0.95);
  border: 2px solid rgba(var(--accent-rgb), 0.55);
  margin-bottom: 22px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-opt {
  text-align: left;
  background: rgba(var(--ink-rgb), 0.06);
  border: 1px solid rgba(var(--ink-rgb), 0.22);
  color: rgba(var(--ink-rgb), 0.92);
  font-family: var(--font-body);
  font-size: 15.5px;
  padding: 13px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.quiz-opt:hover {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: var(--accent);
}

.quiz-opt.correct {
  background: rgba(var(--correct-rgb), 0.28);
  border-color: var(--correct);
}

.quiz-opt.wrong {
  background: rgba(var(--wrong-rgb), 0.32);
  border-color: var(--wrong);
}

.quiz-opt.disabled {
  pointer-events: none;
  opacity: 0.9;
}

.quiz-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  display: none;
}

.quiz-opt.correct .quiz-badge {
  display: inline-block;
  background: var(--correct);
  color: var(--tone-1);
}

.quiz-opt.wrong .quiz-badge {
  display: inline-block;
  background: var(--wrong);
  color: var(--tone-text);
}

.quiz-explain {
  display: none;
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(var(--code-bg-rgb), 0.9);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(var(--ink-rgb), 0.92);
  border-left: 3px solid var(--accent);
}

.quiz-explain.show {
  display: block;
}

.quiz-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Groups the score badge + reset button together on the right, so
   justify-content:space-between above keeps them as one right-aligned
   cluster instead of spreading 3 children across the row. */
.quiz-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Score badge — reuses --accent/--correct/--wrong, no new colors. */
.score-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(var(--ink-rgb), 0.25);
  color: rgba(var(--ink-rgb), 0.7);
  white-space: nowrap;
}

.score-badge.good {
  color: var(--correct);
  border-color: var(--correct);
  background: rgba(var(--correct-rgb), 0.12);
}

.score-badge.mid {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

.score-badge.bad {
  color: var(--wrong);
  border-color: var(--wrong);
  background: rgba(var(--wrong-rgb), 0.12);
}

.reset-quiz-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.65);
  border: 1px solid rgba(var(--ink-rgb), 0.3);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.reset-quiz-btn:hover {
  color: var(--ink);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
}

/* ── fill-in-the-blank ─────────────────────────────────────────────────── ⊃ */

.fb-item {
  background: rgba(var(--panel-rgb), 0.35);
  border: 1px solid rgba(var(--ink-rgb), 0.18);
  border-radius: 12px;
  padding: 22px 24px;
  max-width: 920px;
  margin-bottom: 22px;
}

.fb-item pre {
  margin: 12px 0;
}

.fb-blank {
  font-family: var(--font-mono);
  font-size: 14.5px;
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--ink);
  padding: 1px 6px;
  width: 4ch;
  min-width: 3ch;
  text-align: center;
  transition: width .1s ease;
  font-variant-ligatures: none;
}

.fb-blank.correct {
  border-color: var(--correct);
  background: rgba(var(--correct-rgb), 0.22);
}

.fb-blank.wrong {
  border-color: var(--wrong);
  background: rgba(var(--wrong-rgb), 0.22);
}

.fb-blank:disabled {
  opacity: 0.9;
}

/* Wrong-answer overlay: a diagonal "teacher's red pen" strike across the
   input, plus the correct answer floating above-right as a green overlay
   (not touching the input's own text). --fb-strike-width controls the
   line thickness — change it here to make the strike thicker/thinner. */
.fb-blank-wrap {
  position: relative;
  display: inline-block;
  --fb-strike-width: 2px;
}

.fb-blank-wrap.wrong::after {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg,
      transparent calc(50% - var(--fb-strike-width) / 2),
      var(--wrong) calc(50% - var(--fb-strike-width) / 2),
      var(--wrong) calc(50% + var(--fb-strike-width) / 2),
      transparent calc(50% + var(--fb-strike-width) / 2));
  pointer-events: none;
}

.fb-correction {
  position: absolute;
  top: -0.65em;
  right: -6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--wrong);
  -webkit-text-stroke: 5px var(--code-bg);
  paint-order: stroke fill;
  white-space: nowrap;
  pointer-events: none;
  transform: rotate(-6deg);
  z-index: 1;
}

.fb-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.fb-check-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 8px 16px;
  border-radius: 7px;
  cursor: pointer;
}

.fb-check-btn:hover {
  opacity: .88;
}

.fb-result {
  font-family: var(--font-mono);
  font-size: 13px;
}

.fb-result.ok {
  color: var(--correct);
}

.fb-result.bad {
  color: var(--wrong);
}

/* Reveal-hint: each revealed answer gets its own dashed pill, stacked in a
   column ABOVE the "Reveal hint" button — never says which blank it's for. */
.fb-hints {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.fb-hint-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px dashed rgba(var(--accent-rgb), 0.45);
  border-radius: 6px;
  padding: 5px 10px;
  width: fit-content;
}

.fb-hint-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  background: transparent;
  color: rgba(var(--ink-rgb), 0.65);
  border: 1px dashed rgba(var(--ink-rgb), 0.35);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 8px;
}

.fb-hint-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.fb-hint-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── final score — minimal text placeholder, styled via CSS (see index.html) ─ ⊃ */
#final-score {
  display: block;
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--accent);
}

/* ── glossary — 3 alternative layouts, generator picks per category ─────── ⊃ */

.glossary-group {
  margin-bottom: 34px;
}

.glossary-group h2 {
  margin-top: 0;
}

/* Variant 1: .glossary-table — classic two-column rows, term | definition */
.glossary-table {
  width: 100%;
  border-collapse: collapse;
}

.glossary-table tr {
  border-bottom: 1px solid rgba(var(--ink-rgb), 0.12);
}

.glossary-table tr:last-child {
  border-bottom: none;
}

.glossary-table td {
  padding: 10px 12px;
  font-size: 14.5px;
  vertical-align: top;
}

.glossary-table td.gt-term {
  font-family: var(--font-mono);
  color: var(--accent);
  white-space: nowrap;
  width: 1%;
  padding-right: 24px;
}

.glossary-table td.gt-def {
  color: rgba(var(--ink-rgb), 0.85);
}

/* Variant 2: .glossary-strip — wrapping row of pills (v2: was a horizontally
   scrolling row; pills now wrap onto new lines when the row runs out of
   width, so the container itself never needs an x-scrollbar). Scroll-x is
   pushed down to the individual .gs-name token instead, for the rare case
   where a single unbroken word (no spaces to wrap on) is wider than the
   pill itself. */
.glossary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.glossary-strip .gs-pill {
  flex: 0 0 auto;
  min-width: 160px;
  max-width: 220px;
  background: rgba(var(--panel-rgb), 0.4);
  border: 1px solid rgba(var(--ink-rgb), 0.15);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
}

.gs-pill .gs-name {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 13.5px;
  display: block;
  margin-bottom: 4px;
  /* Isolated scroll-x: only kicks in if THIS token alone (e.g. a long
     identifier with no spaces) is wider than the pill's content box. */
  overflow-x: auto;
  white-space: nowrap;
  padding-bottom: 2px;
}

.gs-pill .gs-def {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(var(--ink-rgb), 0.85);
}

/* Variant 3: .glossary-columns — compact multi-column list, term — definition per line */
/* Variant 3: .glossary-columns — Απλή κατακόρυφη λίστα */
.glossary-columns {
  display: block;
  /* Απλή ροή, χωρίς στήλες */
}

.glossary-columns .gc-line {
  display: block;
  margin-bottom: 16px;
  /* Περισσότερος χώρος ανάμεσα στα ζευγάρια */
  padding-bottom: 12px;
  border-bottom: 1px dotted rgba(var(--ink-rgb), 0.15);
}

.glossary-columns .gc-term {
  display: block;
  /* Αναγκάζει τον όρο να πιάνει όλη τη γραμμή */
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: bold;
  /* Κάνει τον όρο να ξεχωρίζει ελαφρώς */
  margin-bottom: 4px;
  /* Κενό ανάμεσα στον όρο και την επεξήγηση */
}

.glossary-columns .gc-def {
  display: block;
  /* Η επεξήγηση ξεκινάει ακριβώς από κάτω */
  font-size: 14.5px;
  line-height: 1.6;
  color: rgba(var(--ink-rgb), 0.85);
}


/* ── matching pairs ────────────────────────────────────────────────────── ⊃ */

.matching-container+.matching-container {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed rgba(var(--ink-rgb), 0.15);
}

.matching-set-label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.matching-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 900px;
}

/* Keep the two columns SIDE BY SIDE on small screens (never stack them —
   stacking makes it impossible to see which left term lines up with which
   right definition). Shrink gap/padding/font-size instead. */
@media (max-width: 900px) {
  .matching-wrap {
    gap: 14px;
  }

  .match-btn {
    font-size: 13px;
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  .matching-wrap {
    gap: 8px;
  }

  .match-btn {
    font-size: 11px;
    padding: 6px 7px;
    border-radius: 6px;
  }
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-btn {
  text-align: left;
  background: rgba(var(--ink-rgb), 0.06);
  border: 1px solid rgba(var(--ink-rgb), 0.22);
  color: rgba(var(--ink-rgb), 0.92);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.match-btn:hover {
  border-color: var(--accent);
}

.match-btn.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.18);
}

.match-btn.matched {
  border-color: var(--correct);
  background: rgba(var(--correct-rgb), 0.22);
  pointer-events: none;
  opacity: 0.85;
}

.match-btn.flash-wrong {
  animation: matchWrongFlash .45s ease;
}

@keyframes matchWrongFlash {

  0%,
  100% {
    background: rgba(var(--wrong-rgb), 0);
  }

  50% {
    background: rgba(var(--wrong-rgb), 0.35);
    border-color: var(--wrong);
  }
}

/* ── nav ───────────────────────────────────────────────────────────────── ⊃ */

#nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: linear-gradient(0deg, rgba(var(--tone-1-rgb), 0.98) 80%, rgba(var(--tone-1-rgb), 0) 100%);
  z-index: 50;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-btn {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid rgba(var(--ink-rgb), 0.3);
  padding: 10px 18px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  /* .nav-btn is also used on the <a> "Return" link */
}

/* Base state: only the desktop label shows. The 720px query below swaps
   this (bug fix — .mobile-text had no default here, so both labels used
   to render together, e.g. "Reset ProgressReset", on wider screens). */
.mobile-text {
  display: none;
}

.nav-btn:hover {
  background: var(--accent);
  color: var(--bg);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.nav-btn:disabled:hover {
  background: var(--panel);
  color: var(--ink);
}

/* ── navigation dots container ───────────────────────────────────────────── ⊃ */
/* #dots is now a fixed-height CLIPPED VIEWPORT (never wraps to multiple
   rows, no matter how many slides exist). #dots-track is the actual flex
   row of dots and is free to be wider than the viewport — it gets slid
   left/right via transform (see dots-scroll logic in script.js). The two
   .dots-arrow zones sit on top and only appear when there is actually
   more track hidden on that side (see .can-scroll-left/right). */
#dots {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 26px;
  margin-left: 20px;
  margin-right: 20px;
  overflow: hidden;
}

#dots-track {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  /* actual left offset is set inline via JS transform once measured */
  will-change: transform;
}

.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(var(--ink-rgb), 0.25);
  cursor: pointer;
  flex: 0 0 auto;
  position: relative;
}

/* Active dot is ALWAYS a solid --accent (tone-5), regardless of slide
   type — intentionally NOT overridden by .quiz-dot below, so every
   active dot (plain content, quiz, glossary, vscode challenge...)
   matches the same solid accent color. */
.dot.active {
  background: var(--accent);
  width: 22px;
  border-radius: 5px;
}


.dot.quiz-dot {
  background: rgba(var(--danger-rgb), 0.55);
}

/* ── grouped diamonds (quiz/fillblank/matching/glossary/vscode challenge) ── ⊃ */
/* Only real content slides get a full-size dot in the main track (see the
   build loop in initSlideDeck()). Every run of consecutive non-content
   slides that follows a content slide is rendered instead as a small
   .dot-group of diamonds sitting right next to that content dot — this
   is what keeps the browsable strip focused on theory sections even in
   decks with many quiz/glossary/etc. slides interleaved. */
.dot-group {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  position: relative;
}

/* Wraps a run of two-or-more consecutive plain content dots that have no
   quiz/glossary/etc. diamond group between them, so they sit flush
   against each other with zero gap — same idea as .dot-group above, but
   for circles instead of diamonds. Every run-eligible content dot is
   wrapped in one of these even when it ends up alone (a single-item flex
   container looks identical to a bare dot, so this costs nothing
   visually). START (first slide) and END (last slide) are never put in
   a .dot-run — see the eligibility check in initSlideDeck() — so they
   always keep the normal #dots-track gap from their neighbor. */
.dot-run {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
}

.dot.dot-diamond {
  width: 9px;
  height: 9px;
  border-radius: 0;
  transform: rotate(45deg);
}

.dot.dot-diamond.active {
  width: 9px;
  border-radius: 0;
  /* .dot.quiz-dot below has the same specificity as .dot.active above and
     comes later in the file, so on a diamond that is BOTH quiz-dot AND
     active, quiz-dot's danger-colored background was winning the
     source-order tie-break instead of the accent color an active dot is
     supposed to have. Restate it here explicitly (higher specificity:
     three classes vs quiz-dot's two) so an active diamond is always
     accent, exactly like an active plain dot. */
  background: var(--accent);
}

/* "x/y" position badge — a SINGLE shared instance lives on <body>,
   positioned via JS with position:fixed + getBoundingClientRect() (see
   updateGroupBadge() in script.js), same technique as the shared
   tooltip below. NOT nested inside #dots, so #dots's overflow:hidden
   (only 26px tall, required for the windowed dot scroller) never clips
   it. Shown only below the group that currently contains the active
   diamond — toggled via the .visible class, never while browsing plain
   content dots. z-index sits above the dots row but below the shared
   tooltip's 500, so the tooltip always wins if both were ever visible. */
.dot-group-badge {
  position: fixed;
  transform: translateX(-50%);
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.12s ease;
}

.dot-group-badge.visible {
  opacity: 1;
  visibility: visible;
}

/* ── dots hover-scroll arrow zones ───────────────────────────────────────── ⊃ */
.dots-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  display: none;
  /* shown only via .can-scroll-left / .can-scroll-right on #dots */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(var(--tone-1-rgb), 0) 100%);
  user-select: none;
}

.dots-arrow.dots-arrow-left {
  left: 0;
}

.dots-arrow.dots-arrow-right {
  right: 0;
  background: linear-gradient(270deg, var(--bg) 0%, rgba(var(--tone-1-rgb), 0) 100%);
}

#dots.can-scroll-left .dots-arrow-left,
#dots.can-scroll-right .dots-arrow-right {
  display: flex;
}

/* Solid isosceles triangle, same size/color language as .dot (20px scale,
   same rgba(--ink-rgb) fill, same --accent on hover) — built with the
   classic CSS border trick so it needs no image/SVG asset. */
.dots-arrow-triangle {
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.dots-arrow-left .dots-arrow-triangle {
  border-right: 12px solid rgba(var(--ink-rgb), 0.55);
}

.dots-arrow-right .dots-arrow-triangle {
  border-left: 12px solid rgba(var(--ink-rgb), 0.55);
}

.dots-arrow-right:hover .dots-arrow-triangle {
  border-left-color: var(--accent);
}

.dots-arrow-left:hover .dots-arrow-triangle {
  border-right-color: var(--accent);
}


/* ── dot tooltip ──────────────────────────────────────────────────────────── ⊃ */
/* A SINGLE shared instance lives on <body>, positioned via JS with
   position:fixed + getBoundingClientRect() (see showDotTooltip() in
   script.js) — NOT nested inside #dots, so #dots's overflow:hidden
   (required for the windowed dot scroller) never clips it. Visibility is
   toggled via the .visible class from JS, not :hover, since the element
   is shared and moved between different dots. */
.dot-tooltip {
  position: fixed;
  background: var(--panel);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 7px;
  padding: 8px 12px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 500;
}

/* Both tooltip lines intentionally share the same font-size (12px, from
   .dot-tooltip) — only color/letter-spacing differ so the eyebrow reads
   as a label above the title, not as a smaller sub-caption. */
.dot-tooltip .dt-eyebrow {
  color: var(--accent);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Single-line label mode (START/END/QUIZ/FINAL QUIZ/FILLBLANK/
   MATCHINGPAIRS/VSCODECHALLENGE) — reuses .dt-title's slot but styled to
   stand out as a short tag rather than a slide title. */
.dot-tooltip .dt-title.dt-label {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .08em;
}

.dot-tooltip.visible {
  opacity: 1;
  visibility: visible;
}


#slide-counter {
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(var(--ink-rgb), 0.6);
  white-space: nowrap;
}

ul {
  padding-left: 22px;
}

li {
  margin-bottom: 8px;
}

.sources-list a {
  display: block;
  margin: 6px 0;
  font-family: var(--font-mono);
  font-size: 15px;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.4);
  border-radius: 5px;
}

/* ── compact navigation bar for screens under 920px ──────────────────────── ⊃ */
@media (max-width: 920px) {

  /* Dots now show on small screens too — the windowed/scrollable dot
     track (see #dots overflow:hidden + #dots-track transform sliding,
     the hover-scroll arrows, and the shared tooltip) already handles any
     number of slides without wrapping or overflowing, so there is no
     longer a reason to hide them here. */

  /* The right-side "x/59" slide counter is dropped entirely at this
     width to free up horizontal space — its information is replaced by
     the always-visible per-dot position badge under the active dot/
     diamond instead (see .dot-group-badge + updateGroupBadge() in
     script.js, which switches to deck-wide "current/total" mode at this
     same breakpoint). */
  #slide-counter {
    display: none;
  }

  /* Swap long desktop labels with short mobile labels */
  .desktop-text {
    display: none;
  }

  .mobile-text {
    display: inline;
  }

  /* Tighten up navigation container layout and gaps */
  #nav-bar {
    padding: 0 8px;
    gap: 6px;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-group {
    gap: 6px;
  }

  /* Tighten #dots side margins on small screens — the desktop 20px each
     side eats too much space next to the already-compact nav buttons. */
  #dots {
    margin-left: 8px;
    margin-right: 8px;
  }

  /* Reduce button padding and font size for compact fitting */
  .nav-btn {
    padding: 8px 10px;
    font-size: 12px;
    gap: 4px;
  }

  /* Slide content gets a lot of vertical padding on desktop (64px/120px);
     tighten it on small phones so there's more usable reading space. */
  .slide {
    padding: 24px 6vw 100px 6vw;
  }

  /* Safety net: eyebrow + score badge + reset button can get tight on very
     narrow phones — let the right-side cluster wrap under the eyebrow
     instead of overflowing/clipping. */
  .quiz-head-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}