@import url("https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&display=swap");

/* =========================================================
   THE LAST TRAIN HOME — FULL CSS — V1.7 SPLIT BUILD
   CodePen 2.0: paste this entire file into the CSS panel.
   The HTML panel also contains critical fallback CSS on purpose.
   ========================================================= */

:root {
  --bg-0: #02070a;
  --bg-1: #061116;
  --bg-2: #0a1c22;
  --panel: rgba(7, 22, 27, 0.96);
  --panel-soft: rgba(13, 37, 45, 0.94);
  --panel-bright: #12313a;
  --ink: #effdf8;
  --muted: #9db7b3;
  --line: #2b5960;
  --line-soft: rgba(87, 155, 158, 0.3);
  --mint: #76f2d0;
  --mint-soft: #c1fff0;
  --amber: #ffd36e;
  --red: #ff6d7a;
  --blue: #76baff;
  --shadow: rgba(0, 0, 0, 0.58);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Silkscreen", ui-monospace, monospace;
  background:
    radial-gradient(circle at 50% -10%, rgba(52, 134, 132, 0.26), transparent 38%),
    linear-gradient(180deg, #07171c 0%, #020609 100%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

#game-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: visible;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)),
    repeating-linear-gradient(90deg, transparent 0 62px, rgba(118, 242, 208, 0.02) 63px 64px),
    var(--bg-0);
}

#game-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0.08;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(255,255,255,0.12) 4px,
    transparent 5px
  );
  mix-blend-mode: screen;
}

#game-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  box-shadow: inset 0 0 90px rgba(0,0,0,0.62);
}

#app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.screen,
.gameplay {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 34px) 34px;
}

.center-screen {
  display: grid;
  place-items: center;
}

.panel {
  width: min(780px, 100%);
  padding: clamp(22px, 4vw, 38px);
  border: 2px solid var(--line);
  background:
    linear-gradient(180deg, rgba(13, 40, 47, 0.98), rgba(5, 18, 23, 0.98));
  box-shadow:
    0 0 0 5px rgba(3, 13, 17, 0.9),
    0 24px 70px var(--shadow);
}

.title-screen {
  position: relative;
  overflow: hidden;
}

.title-screen::before,
.title-screen::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.title-screen::before {
  inset: 10% -15% auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--mint), transparent);
  box-shadow:
    0 90px 0 rgba(118,242,208,.28),
    0 180px 0 rgba(118,242,208,.18),
    0 270px 0 rgba(118,242,208,.12);
  transform: rotate(-5deg);
}

.title-screen::after {
  right: 9%;
  bottom: 10%;
  width: 180px;
  height: 110px;
  border: 2px solid rgba(118,242,208,.18);
  background:
    linear-gradient(90deg, transparent 48%, rgba(118,242,208,.13) 49% 51%, transparent 52%),
    linear-gradient(rgba(255,211,110,.06), rgba(255,211,110,.01));
}

.title {
  margin: 0 0 14px;
  color: var(--mint);
  font-size: clamp(2.2rem, 7vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 rgba(18, 91, 82, 0.55);
}

.title-kicker,
.eyebrow {
  margin: 0 0 11px;
  color: var(--amber);
  font-size: .76rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.subtitle,
.helper,
.scene-copy,
.result-copy {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.subtitle,
.helper {
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.75;
}

.title-route {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 6px;
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
}

.route-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--mint);
  background: var(--bg-0);
}

.route-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--mint), var(--amber), var(--red));
}

.primary-button,
.secondary-button,
.choice-button,
.icon-button {
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--panel-bright);
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(0,0,0,.35);
  transition: transform 110ms ease, border-color 110ms ease, background 110ms ease;
}

.primary-button,
.secondary-button {
  min-width: 150px;
  padding: 13px 18px;
}

.primary-button {
  border-color: var(--mint);
  background: var(--mint);
  color: #041411;
  font-weight: 700;
}

.secondary-button {
  background: #0d2830;
}

.primary-button:hover,
.secondary-button:hover,
.choice-button:not(:disabled):hover,
.icon-button:hover {
  transform: translate(-2px, -2px);
  border-color: var(--mint);
  box-shadow: 6px 6px 0 rgba(0,0,0,.4);
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.top-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.icon-button {
  padding: 8px 10px;
  color: var(--muted);
  font-size: .72rem;
}

.hud {
  display: grid;
  grid-template-columns: 1.15fr repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.hud-cell {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 37, 45, .98), rgba(4, 16, 20, .98));
}

.hud-label {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: .62rem;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud-value {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(.78rem, 1.8vw, 1rem);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-bar {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  background: #02090c;
  border: 1px solid rgba(81, 132, 136, .22);
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #3bbd98, var(--mint));
}

.meter-fill.danger {
  background: linear-gradient(90deg, var(--amber), var(--red));
}

.scene-art {
  position: relative;
  display: grid;
  min-height: clamp(260px, 43vh, 470px);
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--line);
  background:
    linear-gradient(180deg, rgba(9, 30, 37, .3), rgba(0, 0, 0, .55)),
    repeating-linear-gradient(90deg, #0c252c 0 74px, #071920 75px 78px),
    #071318;
  box-shadow: inset 0 0 45px rgba(0,0,0,.45);
}

.scene-art::before {
  content: "";
  position: absolute;
  inset: 11% 5% auto;
  height: 4px;
  background: rgba(118,242,208,.12);
  box-shadow: 0 16px 0 rgba(255,211,110,.05);
}

.scene-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.art-label {
  position: relative;
  z-index: 2;
  max-width: 80%;
  padding: 18px 22px;
  border: 1px solid var(--line);
  background: rgba(1, 10, 13, .8);
  color: var(--mint);
  font-size: clamp(.75rem, 2vw, 1.1rem);
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
}

.art-label::before {
  content: "NO SIGNAL // ";
  color: var(--red);
}

.scene-content {
  padding: 22px 0 6px;
}

.scene-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.scene-title {
  margin: 0;
  font-size: clamp(1.45rem, 3.8vw, 2.45rem);
  line-height: 1.08;
}

.scene-location {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: .72rem;
  text-align: right;
  text-transform: uppercase;
}

.scene-copy,
.result-copy {
  margin: 15px 0 0;
  color: #d5e6e3;
  font-size: clamp(.94rem, 1.8vw, 1.08rem);
  line-height: 1.8;
}

.vocab {
  color: var(--mint-soft);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(118,242,208,.38);
  text-underline-offset: 4px;
}

.choices {
  display: grid;
  gap: 10px;
  margin-top: 19px;
}

.choice-button {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  width: 100%;
  padding: 14px;
  text-align: left;
}

.choice-button:disabled {
  cursor: not-allowed;
  opacity: .48;
  filter: grayscale(.35);
}

.choice-letter {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  background: var(--mint);
  color: #03110e;
  font-weight: 700;
}

.choice-copy {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95rem;
  line-height: 1.55;
}

.lock-text {
  display: block;
  margin-top: 7px;
  color: var(--amber);
  font-size: .78rem;
}

.discussion-box,
.inventory {
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px dashed var(--line);
  background: rgba(3, 15, 19, .74);
}

.discussion-title,
.inventory-title {
  color: var(--mint);
  font-size: .67rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.discussion-frames,
.inventory-items,
.change-row,
.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.frame-chip,
.item-chip,
.stat-chip,
.status-badge {
  display: inline-block;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: rgba(11, 35, 42, .86);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .75rem;
  line-height: 1.25;
}

.item-chip {
  border-color: rgba(255,211,110,.45);
  color: var(--amber);
}

.status-badge {
  border-color: rgba(118,242,208,.55);
  color: var(--mint-soft);
}

.stat-chip.positive {
  border-color: rgba(118,242,208,.55);
  color: #8affd8;
}

.stat-chip.negative {
  border-color: rgba(255,109,122,.56);
  color: #ff9ca6;
}

.stat-chip.neutral {
  border-color: rgba(118,186,255,.52);
  color: #a8d6ff;
}

.result-panel {
  margin-top: 17px;
  padding: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13,37,45,.8), rgba(4,15,19,.8));
}

.result-label {
  color: var(--amber);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.inventory.empty .inventory-items {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
}

.end-title {
  margin: 4px 0 0;
  color: var(--mint);
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.05;
}

.ending-score {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 19px 0;
}

.ending-score > div {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.score-label {
  display: block;
  color: var(--muted);
  font-size: .62rem;
  text-transform: uppercase;
}

.score-value {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 1.05rem;
}

.small-note {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  line-height: 1.5;
}

@media (max-width: 850px) {
  .hud {
    grid-template-columns: repeat(2, 1fr);
  }

  .hud-cell:first-child {
    grid-column: 1 / -1;
  }

  .scene-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .scene-location {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .screen,
  .gameplay {
    padding: 14px 12px 22px;
  }

  .panel {
    padding: 20px 17px;
  }

  .title {
    font-size: clamp(2rem, 15vw, 3.4rem);
  }

  .scene-art {
    min-height: 225px;
  }

  .choice-button {
    padding: 12px;
  }

  .choice-letter {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .ending-score {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}


/* =========================================================
   INTERACTIVE TUTORIAL MODE
   ========================================================= */

.first-run-tutorial-backdrop {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 8, 12, 0.78);
}

.first-run-tutorial-card {
  width: min(590px, 100%);
  padding: clamp(22px, 4vw, 34px);
  border: 2px solid var(--mint);
  background:
    linear-gradient(180deg, rgba(13, 40, 47, 0.99), rgba(5, 18, 23, 0.99));
  box-shadow:
    0 0 0 5px rgba(3, 13, 17, 0.94),
    0 28px 80px rgba(0, 0, 0, 0.66);
}

.first-run-tutorial-card h2,
.first-run-tutorial-card p {
  margin: 0;
}

.first-run-tutorial-card h2 {
  margin: 10px 0 12px;
  color: var(--mint);
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.25;
}

.first-run-tutorial-card p {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.65;
}

.tutorial-kicker {
  display: inline-block;
  padding: 6px 9px;
  border: 1px solid var(--amber);
  color: var(--amber);
  background: rgba(255, 211, 110, 0.08);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tutorial-dimmer {
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
  background: rgba(0, 8, 12, 0.74);
}

body.tutorial-mode button {
  pointer-events: none;
}

.tutorial-target,
.tutorial-popover button {
  pointer-events: auto !important;
}

.tutorial-target {
  position: relative !important;
  z-index: 310 !important;
  outline: 4px solid var(--amber) !important;
  outline-offset: 5px;
  box-shadow:
    0 0 0 9px rgba(255, 211, 110, 0.18),
    0 0 34px rgba(118, 242, 208, 0.24) !important;
  filter: brightness(1.08);
}

.tutorial-popover {
  position: fixed;
  z-index: 340;
  width: min(410px, calc(100vw - 28px));
  padding: 17px 18px 15px;
  border: 2px solid var(--mint);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 44, 52, 0.995), rgba(5, 20, 25, 0.995));
  box-shadow:
    0 0 0 4px rgba(2, 10, 13, 0.96),
    0 22px 60px rgba(0, 0, 0, 0.62);
}

.tutorial-popover-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.tutorial-popover h3,
.tutorial-popover p {
  margin: 0;
}

.tutorial-popover h3 {
  margin: 8px 0 8px;
  color: var(--mint);
  font-size: 1rem;
  line-height: 1.35;
}

.tutorial-popover p {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
}

.tutorial-progress {
  color: var(--amber);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.tutorial-hint {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px dashed var(--line);
  color: var(--mint-soft);
  background: rgba(118, 242, 208, 0.055);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.45;
}

.tutorial-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}

.tutorial-exit-button {
  padding: 8px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.7rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tutorial-next-button {
  min-width: 118px;
  padding: 10px 13px;
  border: 2px solid var(--mint);
  background: var(--mint);
  color: #041411;
  font-weight: 700;
}

.tutorial-practice-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 8px;
  border: 1px solid var(--blue);
  color: #b9dbff;
  background: rgba(118, 186, 255, 0.07);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 560px) {
  .tutorial-popover {
    padding: 15px;
  }

  .tutorial-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .tutorial-next-button {
    width: 100%;
  }
}



/* =========================================================
   V1.5 — CROSSWORD RESOURCES
   Mirrors the Midnight at School classroom crossword flow:
   student projection, teacher key, vocabulary reference,
   and printable student / teacher versions.
   ========================================================= */

.crossword-resource-screen,
.crossword-display-screen,
.vocabulary-screen {
  min-height: 100vh;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(40, 116, 112, .16), transparent 42%),
    linear-gradient(180deg, #07151b, #03090c 72%);
}

.crossword-resource-panel,
.crossword-display-panel,
.vocabulary-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px);
  border: 2px solid var(--line);
  background: rgba(8, 25, 31, .97);
  box-shadow: 0 18px 60px rgba(0,0,0,.48);
}

.crossword-resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.crossword-resource-card {
  display: grid;
  min-height: 145px;
  padding: 20px;
  border: 2px solid var(--line);
  background: var(--panel2);
  color: var(--ink);
  text-align: left;
  align-content: start;
  gap: 8px;
}

.crossword-resource-card:hover,
.crossword-resource-card:focus-visible {
  border-color: var(--mint);
  outline: none;
  transform: translateY(-2px);
}

.crossword-resource-icon {
  color: var(--mint);
  font-size: 1.5rem;
  font-weight: 900;
}

.crossword-resource-title {
  color: var(--mint);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crossword-resource-copy {
  color: var(--muted);
  line-height: 1.55;
}

.crossword-note {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  color: var(--muted);
  background: rgba(4, 15, 19, .8);
  line-height: 1.65;
}

.crossword-student-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(330px, .95fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
  margin-top: 22px;
}

.crossword-grid-wrap {
  display: grid;
  place-items: center;
  padding: 16px;
  border: 2px solid var(--line);
  background: #031015;
  overflow: auto;
}

.crossword-grid {
  --crossword-columns: 20;
  display: grid;
  grid-template-columns: repeat(var(--crossword-columns), minmax(0, 1fr));
  width: min(680px, 100%);
  aspect-ratio: 20 / 21;
  border: 2px solid #88dcca;
  background: #061116;
}

.crossword-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid #24434a;
  overflow: hidden;
}

.crossword-block {
  background: #061116;
  border-color: #061116;
}

.crossword-open-cell {
  background: #f7fffc;
  border-color: #597a7b;
  color: #071317;
}

.crossword-answer-cell {
  background: #ddfff5;
}

.crossword-cell-number {
  position: absolute;
  top: 1px;
  left: 2px;
  color: #24484c;
  font-family: Arial, sans-serif;
  font-size: clamp(.32rem, .65vw, .52rem);
  font-weight: 800;
  line-height: 1;
}

.crossword-cell-letter {
  color: #07201e;
  font-size: clamp(.48rem, 1.15vw, .86rem);
  font-weight: 900;
  text-transform: uppercase;
}

.crossword-clues-panel {
  padding: 18px;
  border: 2px solid var(--line);
  background: rgba(7, 22, 27, .96);
}

.crossword-instruction {
  margin: 0 0 16px;
  color: var(--amber);
  line-height: 1.55;
}

.crossword-clues-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.crossword-clue-column h3 {
  margin: 0 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  color: var(--mint);
  font-size: .9rem;
  text-transform: uppercase;
}

.crossword-clue-column ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crossword-clue-column li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  color: #eaf9f5;
  font-family: system-ui, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: .92rem;
  line-height: 1.45;
  word-break: keep-all;
}

.crossword-clue-number {
  color: var(--amber);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 900;
}

.crossword-inline-answer {
  display: block;
  margin-top: 2px;
  color: var(--mint);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crossword-answer-table-wrap {
  margin-top: 24px;
  overflow-x: auto;
  border: 2px solid var(--line);
}

.crossword-answer-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  background: #07161b;
  font-family: system-ui, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: .9rem;
  line-height: 1.45;
}

.crossword-answer-table th,
.crossword-answer-table td {
  padding: 11px 12px;
  border: 1px solid #294a50;
  text-align: left;
  vertical-align: top;
}

.crossword-answer-table th {
  color: #031411;
  background: var(--mint);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .76rem;
  text-transform: uppercase;
}

.crossword-answer-table tbody tr:nth-child(even) {
  background: rgba(30, 72, 76, .23);
}

.crossword-answer-table strong {
  color: var(--mint);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-transform: uppercase;
}

.vocabulary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.vocabulary-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  background: #07161b;
}

.vocabulary-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #031411;
  background: var(--mint);
  font-weight: 900;
}

.vocabulary-card h3 {
  margin: 0 0 5px;
  color: var(--mint);
  text-transform: uppercase;
}

.vocabulary-card p {
  margin: 0 0 5px;
  color: var(--muted);
  line-height: 1.5;
}

.vocabulary-card span {
  color: var(--amber);
  font-family: system-ui, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

.printable-resource-screen {
  min-height: 100vh;
  padding: 76px 18px 30px;
  background: #112126;
}

.printable-controls {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.printable-crossword-sheet {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 24px;
  color: #101010;
  background: white;
  font-family: Arial, "Malgun Gothic", sans-serif;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
}

.printable-crossword-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #111;
}

.printable-crossword-header p {
  margin: 0 0 4px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.printable-crossword-header h1 {
  margin: 0;
  font-size: 1.45rem;
}

.printable-student-fields {
  display: grid;
  gap: 6px;
  min-width: 245px;
  font-size: .82rem;
}

.printable-crossword-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.printable-grid-area .crossword-grid {
  width: 100%;
  border: 1.5px solid #444;
  background: white;
}

.printable-grid-area .crossword-cell {
  border: 1px solid #999;
}

/* ZERO-INK PRINT DESIGN: unused crossword cells disappear into the white page. */
.printable-grid-area .crossword-block {
  background: #ffffff;
  border-color: #ffffff;
}

.printable-grid-area .crossword-open-cell,
.printable-grid-area .crossword-answer-cell {
  background: white;
}

.printable-grid-area .crossword-cell-letter {
  color: #000;
}

.printable-grid-area .crossword-cell-number {
  color: #444;
}

.printable-clue-area {
  min-width: 0;
}

.printable-instruction {
  margin: 0 0 10px;
  font-size: .88rem;
  line-height: 1.4;
}

.printable-clues-grid .crossword-clue-column h3 {
  color: #111;
  border-color: #777;
}

.printable-clues-grid .crossword-clue-column li {
  color: #111;
  font-size: .8rem;
  line-height: 1.32;
}

.printable-clues-grid .crossword-clue-number {
  color: #111;
}

.printable-clues-grid .crossword-inline-answer {
  color: #0b5d52;
}

@media (max-width: 900px) {
  .crossword-resource-grid,
  .crossword-student-layout,
  .vocabulary-grid,
  .printable-crossword-layout {
    grid-template-columns: 1fr;
  }

  .crossword-clues-grid {
    grid-template-columns: 1fr;
  }

  .crossword-grid {
    width: min(640px, 96vw);
  }
}

@media (max-width: 600px) {
  .crossword-resource-screen,
  .crossword-display-screen,
  .vocabulary-screen {
    padding: 14px;
  }

  .crossword-resource-grid {
    grid-template-columns: 1fr;
  }

  .crossword-resource-panel,
  .crossword-display-panel,
  .vocabulary-panel {
    padding: 18px;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 8mm;
  }

  html, body {
    width: auto !important;
    min-height: auto !important;
    background: white !important;
  }

  #game-shell,
  #app,
  .printable-resource-screen {
    min-height: 0 !important;
    background: white !important;
  }

  .printable-resource-screen {
    padding: 0 !important;
  }

  .no-print,
  .printable-controls {
    display: none !important;
  }

  .printable-crossword-sheet {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .printable-crossword-header {
    margin-bottom: 3mm;
    padding-bottom: 2mm;
  }

  .printable-crossword-header h1 {
    font-size: 15pt;
  }

  .printable-crossword-layout {
    grid-template-columns: 116mm 1fr !important;
    gap: 5mm !important;
  }

  .printable-grid-area .crossword-grid {
    width: 116mm !important;
    height: auto !important;
  }

  .printable-clues-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 4mm !important;
  }

  .printable-clues-grid .crossword-clue-column li {
    font-size: 7.4pt !important;
    line-height: 1.22 !important;
    gap: 1mm !important;
    grid-template-columns: 7mm 1fr !important;
  }

  .printable-clues-grid .crossword-clue-column ol {
    gap: 1.2mm !important;
  }

  .printable-clues-grid .crossword-clue-column h3 {
    margin-bottom: 2mm !important;
    padding-bottom: 1mm !important;
    font-size: 8pt !important;
  }

  .printable-instruction {
    margin-bottom: 2mm !important;
    font-size: 7.6pt !important;
  }
}


/* Last Bell Studio website integration */
.site-return-link{position:fixed;top:14px;left:14px;z-index:300;display:inline-flex;align-items:center;min-height:38px;padding:8px 11px;border:2px solid var(--mint);color:var(--ink);background:rgba(5,18,23,.94);box-shadow:4px 4px 0 rgba(0,0,0,.45);font-size:.68rem;text-decoration:none}.site-return-link:hover{transform:translate(-1px,-1px);border-color:var(--amber)}.site-return-link:focus-visible{outline:3px solid var(--amber);outline-offset:3px}@media(max-width:720px){.site-return-link{top:8px;left:8px;min-height:34px;padding:7px 8px;font-size:.58rem}}



.last-train-title-screen {
  position: relative;
  width: 100vw;
  max-width: none;
  height: 100vh;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
  background: #010605;
}

.last-train-title-screen::before,
.last-train-title-screen::after {
  content: none;
}

.last-train-title-art {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  image-rendering: pixelated;
  pointer-events: none;
}








.last-train-title-actions {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 65.5%;
  bottom: auto;
  display: grid;
  width: min(420px, 82vw);
  gap: 10px;
  transform: translateX(-50%);
}

.last-train-title-actions .primary-button,
.last-train-title-actions .secondary-button {
  width: 100%;
  min-width: 0;
  padding: 14px 20px;
  border-width: 2px;
  background: rgba(5, 24, 22, 0.88);
  backdrop-filter: blur(3px);
  text-transform: uppercase;
}

.last-train-title-actions .primary-button {
  color: #041411;
  background: rgba(181, 255, 177, 0.94);
  border-color: #c9ffc1;
  box-shadow: 0 0 22px rgba(184, 255, 173, .16), 4px 4px 0 rgba(0,0,0,.55);
}

.last-train-title-actions .secondary-button {
  color: var(--mint-soft);
  border-color: rgba(193, 255, 240, .55);
  box-shadow: 4px 4px 0 rgba(0,0,0,.55);
}

/* The track is intentionally confined to the bright floor/platform strip
   identified during v16.5 QA instead of crossing the dark train itself. */
.title-mouse-track {
  position: absolute;
  z-index: 14;
  left: 28%;
  right: 27%;
  bottom: 10.5%;
  height: 32px;
  pointer-events: none;
  overflow: visible;
}

.title-mouse {
  position: absolute;
  left: 0;
  bottom: 5px;
  width: 21px;
  height: 10px;
  border-radius: 52% 58% 46% 50%;
  background: #07110d;
  box-shadow:
    9px 1px 0 -2px #07110d,
    0 0 0 1px rgba(154, 245, 168, .18);
  opacity: 0;
  transform: translateX(-34px) scaleX(1);
  transform-origin: center;
  will-change: left, transform, opacity;
  animation: last-train-mouse-cross 30s linear infinite;
}

.title-mouse::before {
  content: "";
  position: absolute;
  right: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #07110d;
}

.title-mouse::after {
  content: "";
  position: absolute;
  right: 0;
  top: -5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #0b1711;
  box-shadow: -5px 0 0 #0b1711;
}

.title-mouse-tail {
  position: absolute;
  left: -15px;
  top: 5px;
  width: 18px;
  height: 7px;
  border-top: 2px solid #08140f;
  border-radius: 50% 0 0 0;
  transform: rotate(-9deg);
  transform-origin: right center;
}





@keyframes last-train-mouse-cross {
  0%, 18% { left: 0; opacity: 0; transform: translateX(-34px) scaleX(1); }
  20% { left: 0; opacity: .92; transform: translateX(-34px) scaleX(1); }
  36% { left: 100%; opacity: .92; transform: translateX(34px) scaleX(1); }
  38%, 100% { left: 100%; opacity: 0; transform: translateX(34px) scaleX(1); }
}

.teacher-menu-screen {
  background:
    linear-gradient(rgba(2, 8, 9, .72), rgba(2, 8, 9, .88)),
    url("./assets/title/last-train-home-title.png") center / cover no-repeat;
}

.teacher-menu-panel {
  width: min(780px, 94vw);
}

.teacher-menu-heading {
  margin: 0;
  color: var(--mint);
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 1;
  text-transform: uppercase;
}

.teacher-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.teacher-menu-card {
  display: grid;
  gap: 9px;
  min-height: 132px;
  padding: 18px;
  border: 2px solid var(--line);
  background: rgba(6, 28, 33, .96);
  color: var(--ink);
  text-align: left;
  box-shadow: 4px 4px 0 rgba(0,0,0,.4);
  cursor: pointer;
}

.teacher-menu-card:hover {
  transform: translate(-2px,-2px);
  border-color: var(--mint);
  box-shadow: 6px 6px 0 rgba(0,0,0,.45);
}

.teacher-menu-card-title {
  color: var(--mint-soft);
  font-size: .9rem;
  text-transform: uppercase;
}

.teacher-menu-card-copy {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86rem;
  line-height: 1.55;
}

.teacher-menu-footer {
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .last-train-title-art {
    object-position: center center;
  }
  .last-train-title-actions {
    top: 66%;
    bottom: auto;
    gap: 9px;
  }
  .last-train-title-actions .primary-button,
  .last-train-title-actions .secondary-button {
    padding: 12px 15px;
  }
  .title-mouse-track {
    left: 22%;
    right: 21%;
    bottom: 10%;
  }
  .teacher-menu-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .title-mouse{
    animation: none;
  }
  
  
  .title-mouse { display: none; }
}


/* =========================================================
   V16.8 — LAST TRAIN HOME BGM
   ========================================================= */
.last-train-music-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 520;
  min-height: 38px;
  padding: 8px 12px;
  border: 2px solid var(--mint);
  background: rgba(5, 18, 23, .92);
  color: var(--mint-soft);
  box-shadow: 4px 4px 0 rgba(0,0,0,.45);
  font: 700 11px/1 "Silkscreen", ui-monospace, monospace;
  letter-spacing: .04em;
  cursor: pointer;
}
.last-train-music-toggle:hover {
  transform: translate(-1px,-1px);
  border-color: var(--amber);
}
.last-train-music-toggle:active {
  transform: translate(2px,2px);
  box-shadow: 1px 1px 0 rgba(0,0,0,.45);
}
.teacher-menu-credit {
  cursor: default;
}
.teacher-menu-credit:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: 4px 4px 0 rgba(0,0,0,.4);
}
@media (max-width: 720px) {
  .last-train-music-toggle { top: 8px; right: 8px; min-height: 34px; padding: 7px 9px; font-size: 9px; }
}

.teacher-menu-credit-link { color: var(--mint); text-underline-offset: 3px; }
.teacher-menu-credit-link:hover { color: var(--amber); }


/* =========================================================
   V16.9 — FINAL CLASSROOM POLISH
   ========================================================= */

/* Keep controls + live stats visible while a teacher scrolls a longer scene. */
.sticky-game-header {
  position: sticky;
  top: 0;
  z-index: 90;
  margin: -1px 0 10px;
  padding: 8px 0 2px;
  background: linear-gradient(180deg, rgba(2,7,10,.99), rgba(2,7,10,.94));
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}
.sticky-game-header .top-controls,
.sticky-game-header .hud {
  margin-bottom: 8px;
}

/* Make the title atmosphere unambiguously visible while still subtle. */




/* Game & Media Settings, visually related to Midnight at School. */
.media-settings-screen {
  padding: 72px 22px 34px;
  align-items: flex-start;
}
.media-settings-panel {
  width: min(1120px, 94vw);
}
.media-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}
.media-settings-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11,32,38,.96), rgba(4,14,18,.96));
}
.media-settings-card h2 {
  margin: 0 0 12px;
  color: var(--mint-soft);
  font-size: 1rem;
}
.media-settings-card p {
  color: var(--ink);
  line-height: 1.65;
}
.media-settings-status {
  color: var(--amber) !important;
}
.media-settings-action {
  width: 100%;
  margin-top: 10px;
}
.media-range-label {
  display: block;
  margin: 22px 0 8px;
  color: var(--mint-soft);
}
.media-volume-slider {
  width: 100%;
  accent-color: var(--mint);
}
.danger-action {
  border-color: var(--red);
}

/* Classroom vocabulary helper. */
.vocab[data-korean] {
  position: relative;
  cursor: help;
  outline-offset: 4px;
}
.vocab[data-korean]::after {
  content: attr(data-korean);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 950;
  width: max-content;
  max-width: min(330px, 72vw);
  padding: 9px 12px;
  border: 2px solid var(--mint);
  color: #02100d;
  background: var(--mint-soft);
  box-shadow: 5px 5px 0 rgba(0,0,0,.58);
  font-family: "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity .12s ease, transform .12s ease;
}
.vocab[data-korean]:hover::after,
.vocab[data-korean]:focus-visible::after,
.vocab[data-korean].vocab-open::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 760px) {
  .media-settings-grid { grid-template-columns: 1fr; }
  .sticky-game-header { padding-top: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .vocab[data-korean]::after { transition: none; }
}




/* Low stationary-ish floor haze. Transparency lives in the gradients,
   not on the parent, so animated wisps retain useful contrast. */




/* Independently phased rising wisps. */














/* Clearly visible breathe/rise/fade cycle. The wisp travels roughly
   90–120px vertically rather than only a few pixels. */








@media (prefers-reduced-motion: reduce) {
  

  
}

/* =========================================================
   V16.9.2 — TRUE FROZEN GAMEPLAY HUD
   The gameplay controls + live stats are a fixed independent
   panel. Scene artwork/text scroll underneath, while space is
   reserved so the fixed panel never covers scene content.
   ========================================================= */
.gameplay .sticky-game-header {
  position: fixed !important;
  top: 0;
  left: 50%;
  width: min(1112px, calc(100vw - 32px));
  margin: 0 !important;
  padding: 10px 8px 8px;
  transform: translateX(-50%);
  z-index: 500;
  background:
    linear-gradient(180deg, rgba(2, 7, 10, .995), rgba(4, 15, 19, .985));
  border-bottom: 1px solid rgba(118, 242, 208, .34);
  box-shadow:
    0 7px 0 rgba(0, 0, 0, .28),
    0 14px 28px rgba(0, 0, 0, .38);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

/* Keep the fixed panel compact and one row of stats at desktop sizes. */
.gameplay .sticky-game-header .top-controls {
  min-height: 34px;
  margin: 0 0 7px;
  padding: 0 126px;
  align-items: center;
  justify-content: center;
}

.gameplay .sticky-game-header .hud {
  grid-template-columns: 1.15fr repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.gameplay .sticky-game-header .hud-cell {
  min-height: 58px;
  padding: 8px 10px;
}

.gameplay .sticky-game-header .hud-value {
  font-size: clamp(.70rem, 1.35vw, .92rem);
}

/* Reserve real document space for the fixed HUD. */
.gameplay:has(.sticky-game-header) {
  padding-top: 142px;
}

/* The permanent corner controls must always sit above the frozen panel. */
.site-return-link {
  z-index: 560;
}

.last-train-music-toggle {
  z-index: 570;
}

/* Avoid the global <=850px two-column HUD rule making the frozen bar very tall. */
@media (max-width: 850px) {
  .gameplay .sticky-game-header .hud {
    grid-template-columns: 1.05fr repeat(4, minmax(0, 1fr));
  }

  .gameplay .sticky-game-header .hud-cell:first-child {
    grid-column: auto;
  }

  .gameplay .sticky-game-header .hud-cell {
    padding: 7px 6px;
  }

  .gameplay .sticky-game-header .hud-label {
    font-size: .50rem;
  }

  .gameplay .sticky-game-header .hud-value {
    font-size: clamp(.58rem, 1.8vw, .76rem);
  }
}

@media (max-width: 720px) {
  /* Leave the first row clear for Last Bell + Music on compact windows. */
  .gameplay .sticky-game-header {
    top: 48px;
    width: calc(100vw - 16px);
    padding: 6px 6px 7px;
  }

  .gameplay .sticky-game-header .top-controls {
    min-height: 30px;
    margin-bottom: 5px;
    padding: 0;
    gap: 5px;
  }

  .gameplay .sticky-game-header .icon-button {
    padding: 6px 7px;
    font-size: .55rem;
  }

  .gameplay .sticky-game-header .hud {
    gap: 4px;
  }

  .gameplay .sticky-game-header .hud-cell {
    min-height: 50px;
    padding: 6px 4px;
  }

  .gameplay .sticky-game-header .hud-label {
    font-size: .44rem;
    letter-spacing: .03em;
  }

  .gameplay .sticky-game-header .hud-value {
    margin-top: 3px;
    font-size: clamp(.50rem, 2.1vw, .66rem);
  }

  .gameplay .sticky-game-header .meter-bar {
    height: 4px;
    margin-top: 5px;
  }

  .gameplay:has(.sticky-game-header) {
    padding-top: 174px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gameplay .sticky-game-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}









/* Each pseudo-element is a separate, non-rectangular wisp band. */















/* Smaller wisps slide, compress, and lift independently to create
   a flowing wave texture instead of a synchronized rectangle. */
@keyframes last-train-wisp-flow-a {
  0%   { transform: translate3d(-5%, 14px, 0) scale(1.02,.78); opacity: .28; }
  42%  { transform: translate3d(1%, -5px, 0) scale(1.13,1.02); opacity: .55; }
  100% { transform: translate3d(7%, 3px, 0) scale(.98,.88); opacity: .31; }
}

@keyframes last-train-wisp-flow-b {
  0%   { transform: translate3d(7%, 3px, 0) scale(.98,.86); opacity: .25; }
  48%  { transform: translate3d(0%, -10px, 0) scale(1.12,1.08); opacity: .49; }
  100% { transform: translate3d(-6%, 10px, 0) scale(1.03,.80); opacity: .27; }
}

@keyframes last-train-wisp-flow-c {
  0%   { transform: translate3d(-4%, 9px, 0) scale(1.05,.82); opacity: .26; }
  38%  { transform: translate3d(2%, -8px, 0) scale(1.16,1.05); opacity: .52; }
  72%  { transform: translate3d(5%, 1px, 0) scale(1.03,.91); opacity: .34; }
  100% { transform: translate3d(8%, -4px, 0) scale(1.10,.96); opacity: .29; }
}

@keyframes last-train-wisp-flow-d {
  0%   { transform: translate3d(6%, 12px, 0) scale(1.00,.79); opacity: .22; }
  45%  { transform: translate3d(0%, -6px, 0) scale(1.14,1.06); opacity: .47; }
  100% { transform: translate3d(-8%, 4px, 0) scale(1.04,.86); opacity: .25; }
}

@media (prefers-reduced-motion: reduce) {
  

  
  
  
}










/* Rear bank: broad, dim shapes. */




/* Front bank: slightly sharper, narrower ribbons. */




/* The four banks never move in lock-step: each slides, lifts and changes
   thickness on its own timing, producing a slow rolling/wave-like flow. */
@keyframes last-train-natural-flow-a {
  0%   { transform: translate3d(-7%, 12px, 0) scale(1.00, .78); opacity: .54; }
  38%  { transform: translate3d(-1%, -7px, 0) scale(1.10, 1.03); opacity: .79; }
  68%  { transform: translate3d(4%, 1px, 0) scale(1.04, .90); opacity: .66; }
  100% { transform: translate3d(8%, -5px, 0) scale(1.13, .98); opacity: .58; }
}

@keyframes last-train-natural-flow-b {
  0%   { transform: translate3d(8%, 6px, 0) scale(.98, .84); opacity: .50; }
  43%  { transform: translate3d(2%, -12px, 0) scale(1.13, 1.08); opacity: .73; }
  72%  { transform: translate3d(-3%, -2px, 0) scale(1.06, .93); opacity: .61; }
  100% { transform: translate3d(-8%, 9px, 0) scale(1.02, .81); opacity: .52; }
}

@keyframes last-train-natural-flow-c {
  0%   { transform: translate3d(-6%, 9px, 0) scale(1.03, .82); opacity: .50; }
  35%  { transform: translate3d(0%, -10px, 0) scale(1.15, 1.06); opacity: .76; }
  66%  { transform: translate3d(5%, 2px, 0) scale(1.05, .91); opacity: .63; }
  100% { transform: translate3d(9%, -4px, 0) scale(1.10, .96); opacity: .53; }
}

@keyframes last-train-natural-flow-d {
  0%   { transform: translate3d(7%, 11px, 0) scale(1.00, .80); opacity: .47; }
  44%  { transform: translate3d(1%, -8px, 0) scale(1.12, 1.04); opacity: .70; }
  75%  { transform: translate3d(-4%, 1px, 0) scale(1.06, .91); opacity: .59; }
  100% { transform: translate3d(-9%, 5px, 0) scale(1.03, .86); opacity: .49; }
}

@media (prefers-reduced-motion: reduce) {
  
}








/* Low platform bank. Larger wisps stay close to the illuminated floor. */





/* Higher, thinner ribbons. These break up the silhouette and produce
   the wave-like flow requested without creating a full-width veil. */




@keyframes last-train-explicit-wisp-a {
  0%   { transform: translate3d(-8vw, 1.0vh, 0) scale(1.00, .72); opacity: .44; }
  34%  { transform: translate3d(-1vw, -.8vh, 0) scale(1.11, 1.04); opacity: .68; }
  67%  { transform: translate3d(6vw, .2vh, 0) scale(1.04, .86); opacity: .54; }
  100% { transform: translate3d(13vw, -.5vh, 0) scale(1.14, .96); opacity: .46; }
}
@keyframes last-train-explicit-wisp-b {
  0%   { transform: translate3d(9vw, .7vh, 0) scale(.96, .78); opacity: .39; }
  42%  { transform: translate3d(2vw, -1.3vh, 0) scale(1.15, 1.08); opacity: .65; }
  73%  { transform: translate3d(-3vw, -.2vh, 0) scale(1.06, .91); opacity: .51; }
  100% { transform: translate3d(-9vw, .5vh, 0) scale(1.02, .80); opacity: .42; }
}
@keyframes last-train-explicit-wisp-c {
  0%   { transform: translate3d(-7vw, .8vh, 0) scale(1.02, .75); opacity: .42; }
  46%  { transform: translate3d(1vw, -1.1vh, 0) scale(1.14, 1.06); opacity: .68; }
  72%  { transform: translate3d(5vw, .1vh, 0) scale(1.05, .88); opacity: .53; }
  100% { transform: translate3d(10vw, -.4vh, 0) scale(1.11, .94); opacity: .45; }
}
@keyframes last-train-explicit-wisp-d {
  0%   { transform: translate3d(8vw, .9vh, 0) scale(.98, .78); opacity: .37; }
  48%  { transform: translate3d(0, -1.2vh, 0) scale(1.13, 1.05); opacity: .62; }
  100% { transform: translate3d(-11vw, .4vh, 0) scale(1.03, .84); opacity: .40; }
}
@keyframes last-train-explicit-wisp-e {
  0%   { transform: translate3d(-5vw, .3vh, 0) scale(1.00, .73); opacity: .31; }
  50%  { transform: translate3d(3vw, -1.0vh, 0) scale(1.16, 1.06); opacity: .51; }
  100% { transform: translate3d(11vw, -.2vh, 0) scale(1.04, .83); opacity: .33; }
}
@keyframes last-train-explicit-wisp-f {
  0%   { transform: translate3d(7vw, .4vh, 0) scale(1.02, .76); opacity: .29; }
  43%  { transform: translate3d(0, -1.1vh, 0) scale(1.13, 1.05); opacity: .48; }
  100% { transform: translate3d(-8vw, .2vh, 0) scale(1.01, .85); opacity: .30; }
}
@keyframes last-train-explicit-wisp-g {
  0%   { transform: translate3d(-4vw, .2vh, 0) scale(.98, .75); opacity: .27; }
  47%  { transform: translate3d(3vw, -.9vh, 0) scale(1.14, 1.03); opacity: .45; }
  100% { transform: translate3d(9vw, .3vh, 0) scale(1.02, .82); opacity: .28; }
}

@media (max-width: 700px) {
  
}

@media (prefers-reduced-motion: reduce) {
  
}

/* =========================================================
   V17.1 — projector-readable Korean vocabulary popups
   Larger type and padding make meanings readable from the back of class.
   ========================================================= */
.vocab[data-korean]::after {
  max-width: min(420px, 78vw);
  padding: 12px 16px;
  font-size: clamp(1.08rem, 1.45vw, 1.28rem);
  line-height: 1.5;
}

