/* =====================================================
   ValsamisPhysics: Shared Stylesheet
   Light page, colored simulation tiles, Type Bar header
   (redesign of 2026-09-26; the previous editorial sheet
   is kept in _backup/2026-09-26-pre-redesign/)
   ===================================================== */

:root {
  /* ink and page */
  --ink: #1d1c22;
  --muted: #6a645b;
  --muted-soft: #8f887d;
  --line: rgba(29, 28, 34, 0.13);
  --hairline: rgba(29, 28, 34, 0.13);
  --page: #f8f5ef;
  --surface: #fffdf9;
  --paper: #f6f1e7;          /* tile face; also the light fill inside the card art */
  --paper-dark: #efe9dd;

  /* branch colors: the four stripes of the type bar, plus a neutral */
  --c-mech: #cf6a28;
  --c-em: #4a5ad3;
  --c-wave: #11888a;
  --c-thermal: #c7392b;
  --c-general: #7a6f60;

  /* the art uses var(--accent) for its one highlighted element */
  --accent: #cf6a28;

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Fraunces', 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --wrap: 1200px;
  --gutter: 32px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

.site-wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter) 64px;
}

/* =====================================================
   HEADER: brand, section links, course switch, type bar
   ===================================================== */
.site-top { background: var(--surface); box-shadow: 0 1px 0 rgba(29, 28, 34, 0.06); }
.site-top-in {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 76px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 14px 0; }
.brand-mark { width: 34px; height: 34px; flex: none; color: var(--ink); }
.wordmark {
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-variation-settings: "wdth" 125;
  font-weight: 900;
}
.wordmark .brand-physics { font-weight: 400; }
.top-nav { display: flex; align-self: stretch; margin-left: auto; gap: 2px; flex-wrap: wrap; }
.top-nav a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  min-height: 76px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.top-nav a:hover { color: var(--ink); }
.top-nav a.current { color: var(--ink); font-weight: 800; box-shadow: inset 0 4px 0 var(--ink); }

.curriculum-toggle { display: flex; flex: none; border-radius: 999px; padding: 3px; background: rgba(29, 28, 34, 0.07); }
.curriculum-toggle button {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  min-height: 40px;
  cursor: pointer;
}
.curriculum-toggle button:hover:not(.active) { color: var(--ink); }
.curriculum-toggle button.active { background: var(--ink); color: #fff; }
/* On a page whose items serve both courses (Simulations), both halves of the switch show as selected and
   the switch does nothing, so neither course looks picked over the other (Tony, 2026-10-17). */
.curriculum-toggle.is-off { gap: 3px; cursor: default; }
.curriculum-toggle.is-off button,
.curriculum-toggle.is-off button.active { background: var(--ink); color: #fff; pointer-events: none; }

.typebar { display: grid; grid-template-columns: repeat(4, 1fr); height: 6px; }
.typebar i:nth-child(1) { background: var(--c-mech); }
.typebar i:nth-child(2) { background: var(--c-em); }
.typebar i:nth-child(3) { background: var(--c-wave); }
.typebar i:nth-child(4) { background: var(--c-thermal); }

/* =====================================================
   HUB HERO: course line, section name, one-line blurb
   ===================================================== */
.hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 44px;
  align-items: end;
  padding: 56px 0 40px;
}
.hub-setline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 18px;
}
.pips { display: flex; gap: 4px; }
.pips i { width: 9px; height: 9px; border-radius: 50%; }
.pips i:nth-child(1) { background: var(--c-mech); }
.pips i:nth-child(2) { background: var(--c-em); }
.pips i:nth-child(3) { background: var(--c-wave); }
.pips i:nth-child(4) { background: var(--c-thermal); }
.hub-title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(40px, 6.2vw, 78px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  font-variation-settings: "wdth" 125;
}
.hub-deck { margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.5; color: #4a453e; max-width: 44ch; }

/* =====================================================
   FILTER BAR: search, branch chips, count
   ===================================================== */
.hub-filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 30px; }
.hub-search-input {
  /* kept short so search, chips, the unit menu and the count share one line
     on a laptop; it still grows into spare room, up to 360 px */
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 360px;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 0 16px;
}
.hub-search-input::placeholder { color: var(--muted); }
.hub-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hub-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
}
.hub-chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); }
.hub-chip:hover { color: var(--ink); }
.hub-chip[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); background: #fff; }
.hub-select-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hub-select-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hub-select {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 0 34px 0 14px;
  width: 220px;
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.hub-count { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* group headings inside a hub (cheatsheets by course and branch) */
.section-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-kicker .num { color: var(--ink); font-weight: 600; }
.section-kicker .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.section-kicker::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hub-group + .hub-group { margin-top: 48px; }

/* =====================================================
   TILES
   ===================================================== */
.games-grid, .guides-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.tile {
  --t: var(--c-general);
  --rx: 0deg; --ry: 0deg; --hx: 50%; --hy: 50%;
  position: relative;
  display: block;
  aspect-ratio: 63 / 88;
  padding: 9px;
  border-radius: 14px;
  background: var(--t);
  color: var(--ink);
  text-decoration: none;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 1px 1px rgba(40, 30, 20, 0.10), 0 14px 26px -12px rgba(40, 30, 20, 0.40);
}
.tile:hover { box-shadow: 0 2px 2px rgba(40, 30, 20, 0.10), 0 28px 44px -16px rgba(40, 30, 20, 0.50); transition: transform 0.06s linear, box-shadow 0.25s ease; }
.tile-face {
  height: 100%;
  border-radius: 8px;
  background: var(--paper);
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
}
.tile-name { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.tile-title { margin: 0; font-weight: 800; font-size: 19px; line-height: 1.05; letter-spacing: -0.01em; font-variation-settings: "wdth" 82; }
.tile-badge { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--t); display: grid; place-items: center; color: #fff; }
.tile-badge svg { width: 16px; height: 16px; }
.tile-art {
  --accent: var(--t);
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  border-radius: 4px;
  overflow: hidden;
  background: color-mix(in oklab, var(--t) 14%, var(--paper));
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--t) 55%, var(--paper));
  color: var(--ink);
  display: grid;
  place-items: center;
}
.tile-art svg { width: 86%; height: auto; max-height: 90%; }
.tile-art .illus-unit { display: grid; place-items: center; text-align: center; }
.tile-art .unit-num {
  font-weight: 800;
  font-size: clamp(56px, 6vw, 76px);
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variation-settings: "wdth" 112;
  color: var(--t);
}
.tile-art .unit-label { display: block; margin-top: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.tile-art .illus-fallback { font-family: var(--serif); font-style: italic; font-size: 72px; line-height: 1; color: color-mix(in oklab, var(--t) 60%, var(--paper)); }
.tile-strip {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5e5850;
  padding: 0 2px 7px;
  border-bottom: 1px solid color-mix(in oklab, var(--t) 35%, var(--paper));
}
.tile-strip span:last-child { text-align: right; white-space: nowrap; }
.tile-text {
  flex: none;
  margin: 0;
  height: calc(4 * 1.4em + 16px);
  display: flex;
  align-items: center;
  overflow: hidden;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  line-height: 1.4;
  color: #3b3731;
  padding: 8px 10px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--t) 7%, var(--paper));
}
.tile-foot {
  flex: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5e5850;
  padding: 0 2px;
}
.tile-foot .saved-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--t); margin-right: 7px; vertical-align: 1px; }
.tile-go { font-family: var(--display); font-size: 16px; font-weight: 700; line-height: 1; color: var(--t); transition: transform 0.2s ease; }
.tile:hover .tile-go { transform: translateX(3px); }
.tile-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(circle at var(--hx) var(--hy), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 58%);
  mix-blend-mode: soft-light;
}
.tile:hover .tile-glare { opacity: 1; }

/* tiles with no blurb (guides) keep the frame but drop the fixed card shape */
.tile.no-text { aspect-ratio: auto; }
.tile.no-text .tile-art { flex: none; aspect-ratio: 5 / 4; }
.tile.no-text .tile-foot { margin-top: auto; }

/* short tiles for items with no drawing (cheatsheets): the unit number sits
   in a small framed box beside the title, and the blurb box takes up any
   extra row height so the footers line up */
.tile.compact { aspect-ratio: auto; }
.tile.compact .tile-name { justify-content: flex-start; gap: 12px; }
.tile.compact .tile-title { flex: 1; }
.tile-unit {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 4px;
  display: grid;
  place-content: center;
  text-align: center;
  background: color-mix(in oklab, var(--t) 14%, var(--paper));
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--t) 55%, var(--paper));
}
.tile-unit b { font-weight: 800; font-size: 27px; line-height: 0.9; letter-spacing: -0.02em; font-variation-settings: "wdth" 112; color: var(--t); }
.tile-unit span { display: block; margin-top: 4px; font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.tile.compact .tile-text { height: auto; flex: 1 1 auto; min-height: calc(3 * 1.4em + 16px); }

.empty-state {
  grid-column: 1 / -1;
  padding: 60px 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--muted);
}
.empty-state strong { font-style: normal; color: var(--ink); }

/* =====================================================
   GUIDES: Tiles or Card Feed
   ===================================================== */
.view-switch { display: inline-flex; margin-top: 20px; padding: 3px; border-radius: 999px; background: rgba(29, 28, 34, 0.07); }
.view-switch button {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
}
.view-switch button:hover { color: var(--ink); }
.view-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.feed-view { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 44px; align-items: start; }
/* The phone is drawn at the size of a real iPhone 17 / 17 Pro screen, 402 by 874
   CSS px, inside a 10 px bezel (422 by 894 in all). guides.html sets --s below 1
   when the window is too short (or too narrow) to show the whole phone, and the
   phone is scaled down as one piece with zoom, so the feed inside is still laid
   out at a true phone width. .feed-slot reserves the scaled size in the page.
   zoom is used rather than transform because a scaled iframe under transform
   leaves a one pixel light seam along the bottom of the screen in Chrome. If a
   browser does not carry zoom into the frame, guides.html adds
   .scale-by-transform and the transform is used instead. */
.feed-slot { --s: 1; width: calc(422px * var(--s)); height: calc(894px * var(--s)); }
.feed-device {
  width: 422px;
  height: 894px;
  padding: 10px;
  border-radius: 48px;
  background: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(40, 30, 20, 0.55);
  zoom: var(--s);
}
.feed-slot.scale-by-transform .feed-device { zoom: 1; transform: scale(var(--s)); transform-origin: 0 0; }
.feed-frame { display: block; width: 402px; height: 874px; border: 0; border-radius: 38px; background: #f8fafc; }
.feed-side { max-width: 36ch; padding-top: 12px; }
.feed-note { margin: 0 0 14px; font-family: var(--serif); font-size: 17px; line-height: 1.5; color: #4a453e; }
.feed-side .btn { margin-top: 6px; }

/* =====================================================
   FOOTER
   ===================================================== */
.colophon {
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

/* =====================================================
   PLAYER PAGE (game-template.html)
   ===================================================== */
.game-titleblock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 44px 0 24px;
}
.game-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); }
.game-kicker .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--t, var(--c-general)); }
.game-title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(32px, 4.6vw, 60px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-variation-settings: "wdth" 112;
}
.game-title .conj { font-weight: inherit; }
.game-deck { margin: 12px 0 0; font-family: var(--serif); font-size: 17px; line-height: 1.5; color: #4a453e; max-width: 60ch; }
.game-controls { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.game-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn.btn-accent { background: var(--ink); color: #fff; }
.btn.btn-accent:hover { background: #3a3842; border-color: #3a3842; }
.btn.btn-ghost { border-color: var(--line); color: var(--muted); }
.btn.btn-ghost:hover { background: #fff; color: var(--ink); border-color: var(--ink); }
.save-status { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted-soft); }
.save-status.saved { color: var(--c-wave); }

.game-stage {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -26px rgba(40, 30, 20, 0.45);
}
.game-canvas { display: block; width: 100%; height: 520px; }
.game-stage.stage-full { display: block; height: auto; min-height: 0; padding: 0; }
.game-frame {
  width: 100%;
  height: 100vh;              /* replaced inline by the height reporter on its first message */
  border: 0;
  display: block;
  background: #fff;
}
.game-frame:fullscreen { width: 100vw !important; height: 100vh !important; background: #000; }
.stage-placeholder { text-align: center; padding: 60px 20px; color: var(--muted); }
.stage-placeholder .glyph { font-family: var(--serif); font-style: italic; font-size: 64px; line-height: 1; color: var(--ink); }
.stage-placeholder .label { margin-top: 14px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.stage-placeholder .note { margin: 6px auto 0; max-width: 360px; font-family: var(--serif); font-style: italic; font-size: 15px; }

/* side rail (kept for any page that still uses it) */
.game-layout { display: grid; grid-template-columns: 1fr 260px; gap: 24px; margin-top: 20px; }
.side-rail { font-size: 13px; line-height: 1.5; }
.side-rail .rail-kicker { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.side-rail h3 { font-weight: 800; font-size: 16px; margin: 0 0 6px; }
.side-rail .rail-block { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.side-rail .rail-block:last-child { border-bottom: none; }
.side-rail .stat-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; padding: 3px 0; }
.side-rail .stat-row .label { color: var(--muted); }
.side-rail .stat-row .value { font-weight: 600; }

/* =====================================================
   RESUME / RESTART MODAL and TOAST
   ===================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(29, 28, 34, 0.45);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%;
  max-width: 440px;
  padding: 30px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
}
.modal .modal-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.modal h2 { margin: 0 0 10px; font-weight: 900; font-size: 30px; line-height: 1; letter-spacing: -0.02em; font-variation-settings: "wdth" 112; }
.modal h2 .conj { font-weight: inherit; }
.modal p { margin: 0 0 20px; font-family: var(--serif); font-size: 15px; line-height: 1.45; color: #4a453e; }
.modal .modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal .saved-summary { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--muted-soft); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.accent { background: var(--c-wave); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1100px) {
  .games-grid, .guides-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-hero { grid-template-columns: 1fr; gap: 18px; padding-top: 44px; }
  .hub-title { font-size: clamp(40px, 10.4vw, 96px); }
}
@media (max-width: 900px) {
  .feed-view { grid-template-columns: 1fr; gap: 24px; }
  .feed-slot { margin: 0 auto; }
  .feed-side { max-width: none; padding-top: 0; }
  .site-top-in { gap: 0; }
  /* nav on its own row: a hairline along its top edge so the current-page
     marker reads as sitting on the nav row, not under the course switch */
  .top-nav { position: relative; order: 3; width: calc(100% + 28px); margin-top: 8px; margin-left: -14px; margin-right: -14px; align-self: auto; }
  .top-nav::before { content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 1px; background: rgba(29, 28, 34, 0.08); pointer-events: none; }
  .top-nav a { min-height: 48px; }
  .site-top-in .curriculum-toggle { margin-left: auto; }
  .game-titleblock { grid-template-columns: 1fr; gap: 18px; }
  .game-controls { align-items: flex-start; }
  .game-buttons { justify-content: flex-start; }
  .game-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; }
  .wordmark { font-size: 14px; letter-spacing: 0.05em; }
  .brand-mark { width: 28px; height: 28px; }
  .top-nav { gap: 0; width: 100%; margin: 8px 0 0; flex-wrap: nowrap; justify-content: space-between; }
  .top-nav::before { left: 0; right: 0; }
  .top-nav a { padding: 0 6px; font-size: 12.5px; min-height: 46px; }
  .top-nav a:first-child { padding-left: 0; }
  .top-nav a:last-child { padding-right: 0; }
  .curriculum-toggle button { padding: 8px 13px; }
  .hub-deck { font-size: 17px; }
  .games-grid, .guides-grid { grid-template-columns: 1fr; }
  .hub-search-input { flex-basis: 100%; max-width: none; }
  .hub-count { margin-left: 0; }
  .hub-select-wrap { width: 100%; }
  .hub-select { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .tile { transform: none !important; transition: none; }
  .tile-glare, .tile-go { transition: none; }
}
