/* Nocna Bocznica — a steam depot at night. Tokens first, then surfaces. */

@font-face {
  font-family: 'Bevan';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../../assets/fonts/bevan-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bevan';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../../assets/fonts/bevan-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo Narrow';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo Narrow';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../../assets/fonts/archivo-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* One depot lamp, wet ballast, cast iron. Everything else is tinted from that. */
  --soot-900: #0a0c0e;
  --soot-800: #12171a;
  --soot-700: #171d21;
  --soot-600: #1f262b;
  --brass-300: #e8b868;
  --brass-deep: #8a6420;
  --steam: #ede7da;
  --steam-dim: #b6c0c6;
  --signal: #c8453a;
  --signal-deep: #7e241c;
  --enamel: #e4dac6;
  --ink: #191512;
  --radius-lg: 26px;
  --radius: 18px;
  --radius-sm: 12px;
  /* One spacing scale. Every inset is read from here, so a panel, a card and a
     row do not invent their own padding: the gutter is the screen's, the panel
     is a sheet's or a plate's, the card is an iron well's, and a list row is
     one line of text with room to be tapped. */
  --gutter: 16px;
  --gutter-tight: 12px;
  --pad-panel: 18px;
  --pad-card: 14px;
  --pad-row: 12px;
  --row-inset: 2px;
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1);
  /* 1 when motion is reduced — by the OS setting or the in-app switch. Every
     spatial offset below is multiplied by (1 - --rm), so reduced motion still
     fades, tints and counts: it just stops travelling. */
  --rm: 0;
  --rise: calc(10px * (1 - var(--rm)));
  --lift: calc(16px * (1 - var(--rm)));
  --nudge: calc(14px * (1 - var(--rm)));
  --display: 'Bevan', 'Rockwell', Georgia, serif;
  --ui: 'Archivo Narrow', 'Arial Narrow', system-ui, -apple-system, sans-serif;
  --stroke-steel: rgba(182, 192, 198, 0.12);
  --stroke-steel-strong: rgba(190, 200, 206, 0.2);
  --stroke-light: rgba(237, 231, 218, 0.1);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--soot-900);
  color: var(--steam);
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

h1,
h2,
p {
  margin: 0;
}

/* ------------------------------------------------------------- atmosphere */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(64% 48% at 14% 4%, rgba(255, 186, 104, 0.3) 0%, rgba(255, 176, 90, 0.07) 42%, transparent 74%),
    radial-gradient(120% 80% at 50% -18%, #1b2429 0%, #10161a 46%, #080a0c 100%),
    linear-gradient(180deg, #0d1114, #080a0b);
  overflow: hidden;
}
.bokeh {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.55;
  will-change: transform;
}
.bokeh-a {
  width: 320px;
  height: 260px;
  top: 1%;
  left: -14%;
  background: radial-gradient(circle, rgba(255, 190, 110, 0.72), transparent 66%);
}
.bokeh-b {
  width: 540px;
  height: 190px;
  top: 50%;
  left: -22%;
  background: radial-gradient(ellipse, rgba(198, 216, 222, 0.26), transparent 70%);
  filter: blur(30px);
}
.bokeh-c {
  width: 140px;
  height: 140px;
  top: 18%;
  right: -8%;
  background: radial-gradient(circle, rgba(200, 69, 58, 0.62), transparent 66%);
}
.atmosphere::after {
  content: '';
  position: absolute;
  inset: -20% -30% 30% -40%;
  background: linear-gradient(118deg, rgba(255, 196, 128, 0.13) 0%, rgba(255, 186, 110, 0.05) 26%, transparent 52%);
  pointer-events: none;
}
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.09;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ------------------------------------------------------------------ shell */
#app {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) calc(10px + env(safe-area-inset-bottom));
}
body[data-screen='game'] #app {
  --gutter: var(--gutter-tight);
}
#app::before {
  content: '';
  position: absolute;
  inset: 0;
  border-left: 1px solid rgba(237, 231, 218, 0.04);
  border-right: 1px solid rgba(237, 231, 218, 0.04);
  pointer-events: none;
}

.screen {
  position: absolute;
  inset: 0;
  padding: inherit;
  display: none;
  flex-direction: column;
}
.screen.is-active {
  display: flex;
  animation: screenIn calc(0.36s - 0.16s * var(--rm)) var(--ease);
}
@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(var(--rise));
  }
}
@keyframes screenFade {
  from {
    opacity: 0;
  }
}

/* ------------------------------------------------------------------- menu */
.menu-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding-top: 6px;
}
.brand-mark {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(29px, 8.8vw, 40px);
  letter-spacing: 0.005em;
  line-height: 0.96;
  text-transform: uppercase;
  color: var(--brass-300);
  text-shadow:
    0 1px 0 rgba(8, 10, 12, 0.9),
    0 12px 28px rgba(0, 0, 0, 0.75);
}
.brand-sub {
  margin-top: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(214, 222, 226, 0.86);
}

.gift {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px 0 10px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(46, 54, 59, 0.95), rgba(19, 24, 27, 0.95));
  border: 1px solid var(--stroke-steel-strong);
  color: rgba(226, 233, 236, 0.86);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.8);
  animation: giftIn 0.9s var(--ease) both;
}
.gift-icon {
  width: 16px;
  height: 16px;
}
/* The delivery makes an entrance and then holds still. A control that bobs
   forever is animation debt, not an invitation. */
@keyframes giftIn {
  0% {
    opacity: 0;
    transform: translateY(calc(-6px * (1 - var(--rm))));
    box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.8), 0 0 0 rgba(232, 184, 104, 0);
  }
  55% {
    opacity: 1;
    box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.8), 0 0 16px rgba(232, 184, 104, 0.4);
  }
  100% {
    opacity: 1;
    box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.8), 0 0 0 rgba(232, 184, 104, 0);
  }
}

.hero {
  position: relative;
  /* Grows into spare height, never shrinks below its content: a menu that
     overlaps its own card on a short phone is worse than a menu that scrolls. */
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 12px 0 6px;
}
/* The yard window: the one picture the menu shows of its own world. It is a
   cast-iron bezel around a night, and the rolling stock stands in it. It is a
   band, so it never takes more than a fifth of the screen: on a tall phone the
   menu has a rank, two modes and three assignments to show as well. */
.cine-band {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(220px, 19dvh);
  min-height: 104px;
  margin: 2px 0 10px;
  overflow: hidden;
  border-radius: 10px;
  background: #080a0b;
  box-shadow:
    inset 0 0 0 1px var(--stroke-steel-strong),
    inset 0 1px 0 rgba(237, 231, 218, 0.06),
    0 20px 36px -24px rgba(0, 0, 0, 0.95);
}
#cinema {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.hero-card {
  position: relative;
  padding: 14px var(--pad-panel) 12px;
  border-radius: 12px;
  background: linear-gradient(178deg, #efe6d2 0%, #ded3ba 62%, #cdc0a4 100%);
  border: 1px solid rgba(120, 100, 60, 0.55);
  box-shadow:
    0 26px 48px -26px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -3px 8px rgba(90, 78, 52, 0.3);
  color: var(--ink);
}
.hero-card::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 8px;
  border: 1px solid rgba(60, 48, 28, 0.3);
  pointer-events: none;
}
.hero-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: #463718;
}
.hero-level {
  margin-top: 3px;
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(25, 21, 18, 0.82);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.hero-level strong {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 0.9;
}
.hero-stats {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #3b3222;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.stat b {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-dim {
  color: rgba(59, 50, 34, 0.92);
}
.star-ico {
  width: 14px;
  height: 14px;
}
.streak {
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--signal-deep);
}

/* The rank is a fact the station states, so it sits inside the enamel card:
   a hairline rule, the rank as signage, and the distance to the next one as a
   thin brass track. It is a button because the ladder is worth opening. */
.hero-rank {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding-top: 9px;
  text-align: left;
  border-top: 1px solid rgba(60, 48, 28, 0.28);
}
.hero-rank-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1px 8px;
}
.hero-rank-name {
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #463718;
}
.hero-rank-next {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(60, 48, 28, 0.8);
}
.rank-track {
  display: block;
  margin-top: 6px;
  height: 4px;
  border-radius: 2px;
  background: rgba(60, 48, 28, 0.22);
  overflow: hidden;
}
.rank-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #8a6420, #c8993c 68%, #e8b868);
  transition: width 0.4s var(--ease);
}

/* Two ways to play that are not the main run. Iron wells, not cards: a brass
   name, the day's facts in steam, and one warm edge when the daily is open. */
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mode-card {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3px;
  padding: 12px var(--pad-card) 10px;
  border-radius: 12px;
  text-align: left;
  background: linear-gradient(180deg, rgba(31, 38, 43, 0.92), rgba(14, 18, 20, 0.92));
  border: 1px solid var(--stroke-steel-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    transform 0.16s var(--ease),
    filter 0.16s ease;
}
.mode-card:active {
  transform: scale(0.975);
}
.mode-card.is-ready {
  border-color: rgba(232, 184, 104, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 12px 22px -18px rgba(232, 184, 104, 0.85);
}
.mode-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--brass-300);
}
.mode-card.is-done .mode-name {
  color: rgba(232, 184, 104, 0.55);
}
.mode-day {
  font-size: 11px;
  letter-spacing: 0.02em;
  color: rgba(206, 214, 219, 0.7);
}
/* Two facts share this line — the day's stars and the run of days — so they are
   pushed apart: read side by side they were one number, and three stars in a row
   looked like a streak of three. */
.mode-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 13px;
}
.mode-note {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(237, 231, 218, 0.74);
}
.mode-card.is-ready .mode-note {
  color: var(--steam);
}
.mode-stars {
  display: inline-flex;
  gap: 3px;
}
.mode-stars i {
  width: 11px;
  height: 11px;
  background: rgba(237, 231, 218, 0.16);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.mode-stars i.on {
  background: linear-gradient(180deg, #f6ead0, #e8b868 55%, #a87e2a);
}

.menu-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 8px;
}
.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
/* Three short labels, one thumb: the row must not become a menu of its own. */
.row .btn {
  padding: 0 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.menu-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 2px;
  font-size: 12px;
  color: rgba(182, 192, 198, 0.66);
}
.coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.coin-ico {
  width: 15px;
  height: 15px;
}
.coin b {
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
}
.coin-label {
  color: rgba(200, 208, 213, 0.72);
}

/* A short phone is still a phone: the menu scrolls rather than overlaps, and
   the decorative stock steps aside so the rank and the two modes stay whole. */
#screen-menu {
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* The picture is not decoration that may vanish: on a short screen it gets
   shorter, never gone, because it is the only place the world is shown. */
@media (max-height: 760px) {
  .cine-band {
    aspect-ratio: auto;
    height: 132px;
    max-height: none;
    min-height: 0;
  }
  .hero {
    padding: 6px 0 8px;
  }
}
@media (max-height: 640px) {
  .cine-band {
    height: 104px;
  }
  .hero-card {
    padding: 12px 15px 11px;
  }
  .hero-level strong {
    font-size: 38px;
  }
  .mode-card {
    min-height: 74px;
    padding: 9px 10px 8px;
  }
  .modes {
    gap: 8px;
  }
}

@media (max-width: 340px) {
  /* At 320 px the wordmark alone needs 184 px, and a word cannot wrap inside
     itself: the delivery keeps its crate and gives up its label rather than
     letting the two collide. The count stays in the button's name. */
  .gift {
    width: 44px;
    gap: 0;
    padding: 0;
    justify-content: center;
  }
  #gift-label {
    display: none;
  }
}

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    transform 0.16s var(--ease),
    filter 0.16s ease,
    background 0.16s ease;
  overflow: hidden;
}
.btn:active {
  transform: scale(0.975);
}
.btn:disabled {
  opacity: 0.45;
}
.btn-primary {
  background: linear-gradient(180deg, #d4503f 0%, #b83a2c 48%, #7e241c 100%);
  color: #fff6ec;
  border: 1px solid rgba(255, 232, 206, 0.22);
  box-shadow:
    0 16px 28px -14px rgba(168, 50, 40, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -3px 8px rgba(60, 16, 10, 0.5);
  text-shadow: 0 1px 2px rgba(60, 16, 10, 0.5);
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 1px 1px 55% 1px;
  border-radius: 9px 9px 40% 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.btn-xl {
  min-height: 62px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.btn-ghost {
  background: linear-gradient(180deg, rgba(31, 38, 43, 0.9), rgba(14, 18, 20, 0.9));
  border: 1px solid var(--stroke-steel-strong);
  color: var(--brass-300);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn-quiet {
  min-height: 40px;
  font-size: 13px;
  color: rgba(237, 231, 218, 0.6);
}
.btn-danger {
  background: rgba(160, 45, 36, 0.16);
  border: 1px solid rgba(200, 69, 58, 0.4);
  color: #efcabc;
  min-height: 46px;
}
.btn-danger.is-armed {
  background: rgba(160, 45, 36, 0.4);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: rgba(237, 231, 218, 0.7);
  background: rgba(237, 231, 218, 0.04);
  border: 1px solid rgba(237, 231, 218, 0.07);
  transition: transform 0.16s var(--ease);
}
.icon-btn:active {
  transform: scale(0.92);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* -------------------------------------------------------------------- map */
.map-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 10px;
}
.map-title {
  flex: 1;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.map-stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  font-size: 14px;
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
}
.map-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
  scrollbar-width: none;
}
.map-list::-webkit-scrollbar {
  display: none;
}
.chapter {
  margin-bottom: 20px;
}
.chapter-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(228, 234, 238, 0.9);
  padding: 6px var(--row-inset) 10px;
}
.chapter-range {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(212, 220, 225, 0.78);
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.level-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  display: grid;
  place-items: center;
  gap: 2px;
  background: linear-gradient(180deg, #e7ddc8, #d3c6a8);
  border: 1px solid rgba(60, 48, 28, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 8px 14px -12px rgba(0, 0, 0, 0.95);
  transition:
    transform 0.16s var(--ease),
    border-color 0.2s ease;
  padding: 6px 4px;
}
.level-tile:active {
  transform: scale(0.95);
}
.tile-num {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1;
}
.tile-stars {
  display: flex;
  gap: 2px;
  height: 7px;
}
.tile-stars i {
  width: 7px;
  height: 7px;
  background: rgba(80, 64, 38, 0.25);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.tile-stars i.on {
  background: linear-gradient(180deg, #b98a2c, #7c5a14);
}
.level-tile.is-current {
  border-color: var(--brass-300);
  background: linear-gradient(180deg, #f6eeda, #e2d6b8);
  box-shadow:
    0 0 0 1px rgba(232, 184, 104, 0.55),
    0 14px 26px -16px rgba(232, 184, 104, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.level-tile.is-current .tile-num {
  color: var(--ink);
}
.level-tile.is-locked {
  background: rgba(11, 14, 16, 0.6);
  border: 1px dashed rgba(182, 192, 198, 0.22);
  box-shadow: none;
}
/* A sealed tile is dimmer than an open one, not illegible: the number is how
   you read the line ahead, so it stays above the map's own ground. */
.level-tile.is-locked .tile-num {
  font-size: 15px;
  color: rgba(182, 192, 198, 0.58);
}
.level-tile.is-locked .tile-stars i {
  background: rgba(182, 192, 198, 0.12);
}

/* ------------------------------------------------------------------- rank */
/* A station departure board: rank numerals in brass, names as signage, and
   enamel plates only for the three places that earn one. */
.rank-me {
  max-width: 40%;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(38, 46, 51, 0.9), rgba(18, 23, 26, 0.9));
  border: 1px solid var(--stroke-steel-strong);
  color: var(--brass-300);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.16s var(--ease);
}
.rank-me:active {
  transform: scale(0.95);
}
.rank-sub {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(182, 192, 198, 0.62);
}
/* Four boards behind one screen — the whole career and its three windows —
   picked on a strip of signage. One word each, so the four fit a 320 px phone;
   the board in front is the one underlined in brass. */
.rank-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  flex: 0 0 auto;
  margin: 0 0 10px;
  border: 1px solid var(--stroke-steel);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(33, 41, 46, 0.92), rgba(17, 22, 25, 0.92));
  overflow: hidden;
}
.rank-tab {
  min-height: 44px;
  padding: 12px 2px 10px;
  border-bottom: 2px solid transparent;
  color: rgba(182, 192, 198, 0.72);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    transform 0.16s var(--ease),
    color 0.16s var(--ease);
}
.rank-tab:active {
  transform: scale(0.95);
}
.rank-tab.is-on {
  color: var(--brass-300);
  border-bottom-color: var(--brass-300);
}
/* What the podium of the window in front pays. The career board has none, and
   an empty line leaves no gap. */
.rank-prize {
  margin: -6px 0 10px;
  font-size: 11px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232, 184, 104, 0.72);
}
.rank-prize:empty {
  display: none;
}
.rank-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0 0 8px;
  list-style: none;
  scrollbar-width: none;
}
.rank-list::-webkit-scrollbar {
  display: none;
}
/* A swipe brings the next board in from the side the finger sent it, on the
   same slide the Kolejopedia's paper takes. */
.rank-list.is-slide-next {
  --slide: 1;
}
.rank-list.is-slide-prev {
  --slide: -1;
}
.rank-list.is-slide-next,
.rank-list.is-slide-prev {
  animation: knowSlide 0.24s var(--ease);
}
.rank-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  padding: 6px 12px 6px 6px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(33, 41, 46, 0.92), rgba(17, 22, 25, 0.92));
  border: 1px solid var(--stroke-steel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.rank-num {
  display: grid;
  place-items: center;
  height: 30px;
  font-family: var(--display);
  font-size: 15px;
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
}
.rank-row.is-top .rank-num {
  width: 30px;
  border-radius: 7px;
  background: linear-gradient(180deg, #efe6d2, #d3c6a8);
  border: 1px solid rgba(60, 48, 28, 0.45);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.rank-who {
  min-width: 0;
}
.rank-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--steam);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The player finds their own row without reading all thirty. */
.rank-row.is-me .rank-name::after {
  content: 'ty';
  margin-left: 6px;
  padding: 1px 5px 2px;
  border-radius: 4px;
  background: var(--brass-300);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.14em;
  vertical-align: 1px;
}
.rank-level {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(182, 192, 198, 0.62);
}
.rank-km {
  font-family: var(--display);
  font-size: 16px;
  color: var(--steam);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.rank-km i {
  margin-left: 4px;
  font-family: var(--ui);
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(182, 192, 198, 0.62);
}
/* The sum of everything this player has proven: context, so it sits quieter and
   a hairline keeps the two numbers from reading as one. Display numerals keep the
   sheet's own floor — a number is never set smaller than 15 px. */
.rank-total {
  display: grid;
  justify-items: end;
  padding-left: 10px;
  border-left: 1px solid var(--stroke-steel);
  font-family: var(--display);
  font-size: 15px;
  line-height: 1.2;
  color: rgba(232, 184, 104, 0.82);
  font-variant-numeric: tabular-nums;
}
.rank-total i {
  font-family: var(--ui);
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(182, 192, 198, 0.55);
}
.rank-row.is-me {
  border-color: rgba(232, 184, 104, 0.5);
  background: linear-gradient(180deg, rgba(232, 184, 104, 0.12), rgba(17, 22, 25, 0.9));
  box-shadow:
    0 0 0 1px rgba(232, 184, 104, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.rank-note {
  padding: 26px 10px;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(182, 192, 198, 0.62);
  text-wrap: balance;
}
/* An empty board is one sentence in a tall room: let it sit in the middle. */
.rank-list:has(> .rank-note:only-child) {
  display: grid;
  place-items: center;
}
.rank-status {
  min-height: 18px;
  padding: 6px var(--row-inset) 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(182, 192, 198, 0.7);
}

/* ------------------------------------------------------------------- game */
.screen-game {
  gap: 10px;
  justify-content: flex-start;
}
/* The yard lands in its own sequence, so the screen itself only fades. */
.screen-game.is-active {
  animation: screenFade calc(0.22s - 0.08s * var(--rm)) ease;
}
/* The HUD sits on the top gutter and the rail on the bottom one; the board is
   what takes the free height, centred between them. Neither group may claim an
   auto margin, or the top of the screen fills with nothing. */
.game-top,
.game-bottom {
  display: flex;
  flex-direction: column;
}
.game-top {
  gap: 8px;
}
.game-bottom {
  gap: 6px;
}
.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}
.hud-mid {
  flex: 1;
  min-width: 0;
}
.hud-level {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass-300);
  text-shadow: 0 1px 3px rgba(8, 6, 3, 0.9);
}
.hud-era {
  display: flex;
  flex-wrap: wrap;
  gap: 1px 8px;
  margin-top: 1px;
  color: rgba(232, 184, 104, 0.7);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.hud-name {
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(237, 231, 218, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-moves-wrap {
  display: grid;
  justify-items: center;
  min-width: 64px;
  padding: 5px 10px 4px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(31, 38, 43, 0.92), rgba(12, 16, 18, 0.95));
  border: 1px solid var(--stroke-steel-strong);
  box-shadow:
    inset 0 1px 0 rgba(220, 232, 238, 0.1),
    inset 0 -8px 12px -10px rgba(0, 0, 0, 0.9);
}
.hud-moves {
  font-family: var(--display);
  font-size: 27px;
  font-weight: 400;
  line-height: 0.95;
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
}
.hud-moves.is-low {
  color: #e0655a;
  animation: lowPulse 1.8s ease-in-out infinite;
}
.hud-moves.bump {
  animation: bump 0.28s var(--ease);
}
.hud-moves-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(237, 231, 218, 0.68);
}
@keyframes bump {
  40% {
    transform: scale(calc(1 + 0.18 * (1 - var(--rm))));
  }
}
@keyframes lowPulse {
  50% {
    opacity: calc(1 - 0.45 * (1 - var(--rm)));
  }
}

.goals-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.goals {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.goal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px 0 4px;
  border-radius: 9px;
  background: rgba(4, 6, 8, 0.42);
  box-shadow:
    inset 0 2px 5px -2px rgba(0, 0, 0, 0.9),
    inset 0 -1px 0 rgba(220, 232, 238, 0.06);
  transition:
    background 0.24s ease,
    box-shadow 0.24s ease;
}
.goal-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.goal-count {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(237, 231, 218, 0.82);
  letter-spacing: 0.01em;
}
.goal.is-done {
  background: rgba(140, 170, 110, 0.14);
  box-shadow:
    inset 0 2px 5px -2px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(140, 170, 110, 0.28);
}
.goal.is-done .goal-count {
  color: #c6d8b0;
}
/* A goal that has just closed ticks once, so the completion is not only a
   colour you might not have been looking at. */
.goal.is-struck {
  animation: goalTick 0.44s var(--ease);
}
@keyframes goalTick {
  0% {
    transform: scale(calc(1 + 0.1 * (1 - var(--rm))));
    box-shadow:
      inset 0 2px 5px -2px rgba(0, 0, 0, 0.9),
      inset 0 0 0 1px rgba(198, 216, 176, 0.85);
  }
  100% {
    transform: scale(1);
  }
}
.score-unit {
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(184, 194, 200, 0.7);
}
.score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 2px 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}


.sugar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sugar-track {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(214, 228, 236, 0.07), rgba(214, 228, 236, 0) 48%),
    #161B1F;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(190, 200, 206, 0.14),
    inset 0 -1px 0 rgba(214, 228, 236, 0.08);
  overflow: hidden;
}
.sugar-track::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(10, 12, 14, 0.55) 0 1px, transparent 1px 9px);
  pointer-events: none;
}
.sugar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, #c8453a 0%, #f0a24a 55%, #ffe9a8 100%);
  transition: width 0.4s var(--ease);
  box-shadow: 0 0 12px rgba(255, 176, 90, 0.6);
}
/* The needle blows over once when the rush opens. */
.sugar-track::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(255, 226, 172, 0), rgba(255, 238, 206, 0.9));
  opacity: 0;
  pointer-events: none;
}
.sugar-track.is-lit::before {
  animation: gaugeFlare calc(0.95s + 0.15s * var(--rm)) var(--ease);
}
@keyframes gaugeFlare {
  0% {
    opacity: 0;
  }
  16% {
    opacity: calc(1 - var(--rm) * 0.55);
  }
  100% {
    opacity: 0;
  }
}
.sugar-label {
  min-width: 96px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(237, 231, 218, 0.68);
  white-space: nowrap;
}
.sugar-track.is-active {
  background: rgba(232, 184, 104, 0.24);
  box-shadow: 0 0 16px rgba(232, 184, 104, 0.5);
}
/* The rush warms the iron and nothing else. This used to restate the whole
   layout box with `margin-block: 6px` and a 14px radius, so the HUD jumped 54px
   and the board's corners snapped whenever Pełna para opened or closed. */
body.is-sugar .board-wrap {
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 214, 150, 0.07), transparent 55%),
    linear-gradient(180deg, rgba(31, 38, 43, 0.95), rgba(11, 14, 16, 0.98));
  border-color: rgba(206, 190, 160, 0.18);
  box-shadow:
    0 26px 55px -26px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -26px 44px -32px rgba(0, 0, 0, 0.95);
}
.board-wrap::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 10px;
  pointer-events: none;
  background:
    radial-gradient(circle 2.5px at 9px 9px, rgba(232, 184, 104, 0.6) 0 40%, transparent 100%),
    radial-gradient(circle 2.5px at calc(100% - 9px) 9px, rgba(232, 184, 104, 0.6) 0 40%, transparent 100%),
    radial-gradient(circle 2.5px at 9px calc(100% - 9px), rgba(232, 184, 104, 0.6) 0 40%, transparent 100%),
    radial-gradient(circle 2.5px at calc(100% - 9px) calc(100% - 9px), rgba(232, 184, 104, 0.6) 0 40%, transparent 100%);
}

.board-wrap {
  position: relative;
  flex: 0 1 auto;
  min-height: 210px;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  align-self: center;
  margin-block: auto;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 90% at 10% 0%, rgba(237, 231, 218, 0.09), transparent 55%),
    linear-gradient(180deg, rgba(31, 38, 43, 0.88), rgba(16, 19, 22, 0.94));
  border: 1px solid rgba(190, 200, 206, 0.1);
  box-shadow:
    0 26px 55px -26px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -20px 40px -30px rgba(0, 0, 0, 0.55);
  padding: 8px;
  overflow: hidden;
  transition: box-shadow 0.4s ease;
}
.board-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 32%);
}
#board {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  display: block;
  border-radius: 18px;
  touch-action: none;
  cursor: grab;
}
#board.is-pressed {
  cursor: grabbing;
}

/* A phone spends its width on the yard: the plate runs edge to edge and the
   canvas fills it, so the eight tiles a row are as large as the screen allows.
   The HUD and the booster rail keep the gutter themselves, since the screen
   gives it up. 560 px is where the app column stops growing. */
@media (max-width: 560px) {
  .screen-game {
    padding-inline: 0;
  }
  .game-top,
  .game-bottom {
    padding-inline: var(--gutter);
  }
  .board-wrap {
    padding: 0;
    border-radius: 0;
  }
  #board {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* Cast iron does not glow for its own sake: this only fires while the gauge is
   full, and it marks the moment the rush opens rather than the state after it. */
.board-lamp {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255, 218, 158, 0.6),
    inset 0 0 26px rgba(255, 196, 110, 0.5),
    inset 0 0 70px -12px rgba(255, 172, 82, 0.6);
}
.board-lamp.is-lit {
  animation: lampFlare calc(1.15s + 0.25s * var(--rm)) var(--ease);
}
@keyframes lampFlare {
  0% {
    opacity: 0;
  }
  16% {
    opacity: calc(1 - var(--rm) * 0.45);
  }
  46% {
    opacity: calc(1 - var(--rm) * 0.6);
  }
  100% {
    opacity: 0;
  }
}

.objective {
  font-size: 12px;
  letter-spacing: 0.02em;
  color: rgba(237, 231, 218, 0.66);
  text-align: center;
  padding: 2px 8px 0;
}
.objective b {
  color: var(--brass-300);
  font-weight: 600;
}
.fatal {
  position: fixed;
  inset: auto 12px 12px 12px;
  z-index: 99;
  padding: 12px 14px;
  border-radius: 14px;
  background: #3a1a12;
  border: 1px solid #c8453a;
  color: #f3d9d0;
  font: 12px/1.4 ui-monospace, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 40vh;
  overflow-y: auto;
}

.hint {
  font-size: 12.5px;
  line-height: 1.35;
  text-align: center;
  color: rgba(237, 231, 218, 0.68);
  padding: 0 8px;
}

.boosters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-bottom: 2px;
}
.booster {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(237, 231, 218, 0.07), rgba(237, 231, 218, 0.02));
  border: 1px solid rgba(237, 231, 218, 0.08);
  transition:
    transform 0.16s var(--ease),
    border-color 0.2s ease;
}
.booster:active {
  transform: scale(0.95);
}
.booster svg {
  width: 20px;
  height: 20px;
  color: var(--brass-300);
}
.booster-name {
  font-size: 11px;
  font-weight: 500;
  color: rgba(237, 231, 218, 0.72);
}
.booster-count.is-price {
  color: var(--brass-300);
}
.booster-count {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
}
.booster.is-empty .booster-count {
  color: rgba(232, 184, 104, 0.55);
}
.booster.is-armed {
  border-color: rgba(200, 69, 58, 0.7);
  background: rgba(200, 69, 58, 0.16);
  box-shadow: 0 0 0 1px rgba(200, 69, 58, 0.4), 0 10px 22px -12px rgba(200, 69, 58, 0.9);
}

/* ------------------------------------------------------------ combo + toast */
.combo {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) scale(calc(0.9 + 0.1 * var(--rm)));
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}
.combo strong {
  font-family: var(--display);
  font-size: clamp(24px, 7.4vw, 34px);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #ffe2ae;
  text-shadow:
    0 2px 0 rgba(60, 36, 0, 0.45),
    0 10px 26px rgba(0, 0, 0, 0.7);
}
.combo span {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(237, 231, 218, 0.66);
}
.combo.is-on {
  animation: comboIn 1.05s var(--ease) forwards;
}
@keyframes comboIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(calc(0.72 + 0.28 * var(--rm)));
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(calc(1.04 - 0.04 * var(--rm)));
  }
  32% {
    transform: translate(-50%, -50%) scale(1);
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 12% * (1 - var(--rm)))) scale(1);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translate(-50%, var(--nudge));
  z-index: 40;
  max-width: min(88vw, 400px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(10, 13, 15, 0.94);
  border: 1px solid var(--stroke-steel);
  color: var(--steam);
  font-size: 12.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.24s ease,
    transform 0.24s var(--ease);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------- overlay */
.overlay {
  position: fixed;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: var(--pad-panel);
  background: rgba(8, 10, 12, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.overlay.is-on {
  opacity: 1;
}
/* A surface on its way out stays in the DOM for a fifth of a second: it must not
   eat the tap the player aims at the board underneath. Same for the sheets. */
.overlay,
.sheet {
  pointer-events: none;
}
.overlay.is-on,
.sheet.is-on {
  pointer-events: auto;
}
.overlay-card {
  width: min(100%, 400px);
  padding: var(--pad-panel);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(200, 69, 58, 0.16), transparent 60%),
    linear-gradient(180deg, #171d21, #141a1d);
  border: 1px solid var(--stroke-steel-strong);
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
  transform: translateY(var(--lift)) scale(calc(0.97 + 0.03 * var(--rm)));
  transition: transform 0.3s var(--ease);
}
.overlay.is-on .overlay-card {
  transform: none;
}
.overlay-card h2 {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.muted {
  margin-top: 4px;
  font-size: 12.5px;
  color: rgba(182, 192, 198, 0.66);
  min-height: 1.2em;
}
.end-next {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--brass-300);
}
.end-bonus {
  margin-top: 9px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.35;
  color: var(--brass-300);
  text-wrap: balance;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}
.stars i {
  width: 38px;
  height: 38px;
  background: rgba(237, 231, 218, 0.1);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.stars i.on {
  background: linear-gradient(180deg, #f6ead0, #e8b868 45%, #a87e2a);
  filter: drop-shadow(0 6px 14px rgba(232, 184, 104, 0.5));
  animation: starPop 0.5s var(--ease) both;
}
@keyframes starPop {
  0% {
    transform: scale(calc(0.4 + 0.6 * var(--rm))) rotate(calc(-18deg * (1 - var(--rm))));
  }
  60% {
    transform: scale(calc(1.16 - 0.16 * var(--rm))) rotate(calc(4deg * (1 - var(--rm))));
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
.end-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0 18px;
}
/* The cell is a column: a label that wraps ("Manewry zapasowe") would otherwise
   push its number below the number beside it. */
.end-stats div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(237, 231, 218, 0.04);
  border: 1px solid rgba(237, 231, 218, 0.06);
}
.end-stats dt {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(210, 218, 223, 0.74);
}
.end-stats dd {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  color: var(--steam);
  font-variant-numeric: tabular-nums;
}
.end-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* The pause card has no stat grid between its line and its buttons, so it needs
   the room the grid would have given it. */
.pause-card .end-actions {
  margin-top: 16px;
}

/* ------------------------------------------------------------------ sheet */
.sheet {
  position: fixed;
  inset: 0;
  /* inset:0 + height keeps the sheet inside the visible area, not behind the URL bar */
  height: 100vh;
  height: 100dvh;
  z-index: 24;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(6, 8, 10, 0.6);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.sheet.is-on {
  opacity: 1;
}
.sheet-panel {
  width: min(100%, 480px);
  max-height: 92%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--pad-panel) calc(var(--pad-panel) + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #171d21, #13181b);
  border: 1px solid var(--stroke-steel-strong);
  border-bottom: 0;
  transform: translateY(calc(100% * (1 - var(--rm))));
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.sheet.is-on .sheet-panel {
  transform: none;
}
.sheet-head {
  /* pinned so Zamknij stays reachable while the long legend scrolls under it */
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: var(--pad-panel) 0 10px;
  background: #171d21;
}
/* soft edge so content scrolling under the pinned header does not look chopped */
.sheet-head::after {
  content: '';
  position: absolute;
  inset: 100% 0 auto;
  height: 12px;
  background: linear-gradient(#171d21, rgba(23, 29, 33, 0));
  pointer-events: none;
}
.sheet-head h2 {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
}
.setting {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pad-row) var(--row-inset);
  border-bottom: 1px solid rgba(237, 231, 218, 0.06);
  font-size: 14px;
  color: rgba(237, 231, 218, 0.86);
}
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(237, 231, 218, 0.12);
  transition: background 0.2s ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e6e7e3;
  transition: transform 0.2s var(--ease);
}
/* A switch is a lamp, so it lights in brass. Signal red stays where the world
   puts it: the one action that matters, and the one that costs. */
.setting.is-on .switch {
  background: linear-gradient(180deg, #e8b868, #8a6420);
  box-shadow: inset 0 1px 0 rgba(255, 246, 228, 0.5), inset 0 -2px 4px rgba(60, 40, 10, 0.5);
}
.setting.is-on .switch::after {
  transform: translateX(18px);
}
.legend-intro {
  margin: 2px 0 10px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(237, 231, 218, 0.72);
}
.legend-title {
  margin: 14px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(228, 234, 238, 0.9);
}
.legend-row {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 2px 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(190, 200, 206, 0.08);
}
.legend-row img {
  grid-row: span 2;
}
.legend-row b {
  font-family: var(--ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.legend-row span {
  grid-column: 2;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(206, 214, 219, 0.62);
}
.sheet-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 14px 0 4px;
}
.sheet-stats div {
  padding: 8px 4px;
  border-radius: 12px;
  background: rgba(237, 231, 218, 0.04);
  border: 1px solid rgba(237, 231, 218, 0.06);
  text-align: center;
}
.sheet-stats dt {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(206, 214, 219, 0.7);
}
.sheet-stats dd {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: var(--steam);
  font-variant-numeric: tabular-nums;
}
/* A quiet line under a sheet's own action, so the button is not a naked promise. */
.legend-hint {
  margin: 8px 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(206, 214, 219, 0.66);
}

/* ------------------------------------------------------------- jazda próbna */
/* The tutorial is a sheet that behaves like a placard in front of the yard: a
   five-by-four stage drawn from the board's own atlas, one sentence of
   instruction, and the two buttons that walk through it. */
.tut-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.tut-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 0 8px;
  background: #171d21;
}
.tut-head-text {
  min-width: 0;
}
.tut-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(232, 184, 104, 0.82);
  font-variant-numeric: tabular-nums;
}
.tut-title {
  margin: 3px 0 0;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--steam);
}
.sheet-panel.tut-panel .tut-stage {
  margin: 2px auto 0;
}
.tut-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 0 0 auto;
}
.tut-yard {
  position: relative;
  width: min(100%, calc(34vh * 5 / 4));
  width: min(100%, calc(34dvh * 5 / 4));
  aspect-ratio: 5 / 4;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(80% 62% at 50% -12%, rgba(255, 196, 122, 0.14), transparent 70%),
    #0b0e10;
  border: 1px solid var(--stroke-steel-strong);
  box-shadow:
    inset 0 1px 0 rgba(220, 232, 238, 0.08),
    inset 0 -18px 24px -22px rgba(0, 0, 0, 0.95),
    0 12px 24px -20px rgba(0, 0, 0, 0.9);
}
.tut-bed,
.tut-gear,
.tut-pieces,
.tut-over {
  position: absolute;
  inset: 0;
}
.tut-bed-cell,
.tut-obj {
  position: absolute;
  width: 20%;
  height: 25%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.tut-bed-cell {
  opacity: 0.9;
}
.tut-obj {
  transition:
    left calc(0.3s * (1 - var(--rm))) var(--ease),
    top calc(0.3s * (1 - var(--rm))) var(--ease),
    opacity calc(0.28s * (1 - var(--rm))) ease,
    transform calc(0.28s * (1 - var(--rm))) var(--ease),
    filter 0.24s ease;
}
.tut-obj.is-pre {
  opacity: 0;
  transform: translateY(-45%);
}
.tut-obj.is-match {
  filter: drop-shadow(0 0 6px rgba(232, 184, 104, 0.9)) brightness(1.22);
}
.tut-obj.is-gone {
  opacity: 0;
  transform: translateY(-8%) scale(0.8);
  filter: grayscale(1) brightness(0.5);
}
.tut-obj.is-flood {
  filter: drop-shadow(0 0 18px rgba(126, 214, 132, 0.85)) brightness(1.15);
}
.tut-seal {
  z-index: 2;
}
.tut-ring {
  position: absolute;
  width: 20%;
  height: 25%;
  pointer-events: none;
}
.tut-ring::after {
  content: '';
  position: absolute;
  inset: 11%;
  border-radius: 50%;
  border: 2px solid var(--brass-300);
  box-shadow: 0 0 10px rgba(232, 184, 104, 0.4);
  opacity: 0;
  transform: scale(calc(1 - 0.3 * (1 - var(--rm))));
  transition:
    opacity 0.2s ease,
    transform calc(0.26s * (1 - var(--rm))) var(--ease);
}
.tut-ring.is-on::after {
  opacity: 0.95;
  transform: none;
}
/* The thumb. It is the only warm ring on the stage, because it is the only
   thing there that is not part of the yard. */
.tut-hand {
  position: absolute;
  width: 20%;
  height: 25%;
  opacity: 0;
  pointer-events: none;
  transition:
    left calc(0.48s * (1 - var(--rm))) var(--ease),
    top calc(0.48s * (1 - var(--rm))) var(--ease),
    opacity 0.2s ease;
}
.tut-hand.is-on {
  opacity: 1;
}
.tut-hand i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 27%;
  min-width: 12px;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 232, 198, 0.95);
  background: radial-gradient(circle, rgba(255, 238, 206, 0.92) 0 26%, rgba(255, 222, 166, 0.3) 30% 100%);
  box-shadow:
    0 0 12px rgba(255, 206, 130, 0.62),
    inset 0 0 6px rgba(255, 226, 178, 0.5);
}
.tut-hand i::after {
  content: '';
  position: absolute;
  inset: -34%;
  border-radius: 50%;
  border: 1px solid rgba(255, 220, 160, 0.6);
  animation: handPulse 1.7s ease-out infinite;
}
@keyframes handPulse {
  0% {
    transform: scale(0.72);
    opacity: 0.8;
  }
  70%,
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
html.rm .tut-hand i::after {
  animation: none;
  opacity: 0.45;
}
/* The caption for what the stage just did. It sits under the yard, never on it:
   a pill over the last track hid the very wagon it was naming. */
.tut-note {
  align-self: flex-start;
  min-height: 21px;
  margin: 10px 0 0;
  padding: 4px 10px 3px;
  border-radius: 999px;
  background: rgba(8, 10, 12, 0.72);
  border: 1px solid rgba(232, 184, 104, 0.3);
  color: #f4e6c8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(calc(4px * (1 - var(--rm))));
  transition:
    opacity 0.24s ease,
    transform calc(0.24s * (1 - var(--rm))) var(--ease);
}
.tut-note.is-on {
  opacity: 1;
  transform: none;
}
.tut-note:empty {
  padding: 0;
  border-color: transparent;
  background: none;
}
.tut-ramp {
  position: absolute;
  left: 2%;
  right: 2%;
  bottom: 1.6%;
  height: 5.5%;
  border-radius: 3px;
  background: repeating-linear-gradient(
    135deg,
    rgba(232, 184, 104, 0.34) 0 4px,
    rgba(232, 184, 104, 0.05) 4px 9px
  );
  border: 1px solid rgba(232, 184, 104, 0.26);
  pointer-events: none;
  transition: filter 0.3s ease;
}
.tut-ramp.is-hit {
  filter: brightness(1.9);
}
/* The HUD screen is the real HUD, cloned: the same plate, the same gauge, and a
   ghost of the yard behind so the numbers are read as part of a board. */
.tut-hud {
  display: none;
}
.tut-stage[data-mode='hud'] {
  position: relative;
  min-height: min(34vh, 300px);
  min-height: min(34dvh, 300px);
}
.tut-stage[data-mode='hud'] .tut-yard {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  opacity: 0.22;
  pointer-events: none;
}
.tut-stage[data-mode='hud'] .tut-hud {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: min(34vh, 300px);
  min-height: min(34dvh, 300px);
  padding: 8px 2px;
}
.tut-hud .goals-row {
  gap: 8px;
}
.tut-hud .hud-moves-wrap {
  min-width: 56px;
}
.tut-hud .score-chip {
  font-size: 15px;
}
/* The booster rail is cloned too, so the icons, the names and the prices are
   the ones the player will find at thumb height. */
.tut-boosters {
  display: none;
}
.tut-stage[data-mode='boosters'] .tut-boosters {
  display: block;
  margin-top: 10px;
}
.tut-stage[data-mode='boosters'] .tut-yard {
  width: min(100%, calc(26vh * 5 / 4));
  width: min(100%, calc(26dvh * 5 / 4));
}
.tut-boosters .booster {
  pointer-events: none;
}
.tut-boosters .booster.is-fired {
  animation: boosterFire 0.68s var(--ease);
}
.tut-boosters .booster.is-armed {
  border-color: rgba(232, 184, 104, 0.55);
}
@keyframes boosterFire {
  0% {
    transform: scale(calc(1 + 0.08 * (1 - var(--rm))));
    border-color: rgba(232, 184, 104, 0.8);
  }
  100% {
    transform: scale(1);
  }
}
.tut-copy {
  display: grid;
  gap: 7px;
  margin: 4px 0 0;
}
.tut-body {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(237, 231, 218, 0.9);
}
.tut-tip {
  padding-left: 10px;
  border-left: 1px solid rgba(232, 184, 104, 0.36);
  font-size: 12.5px;
  line-height: 1.4;
  color: rgba(206, 214, 219, 0.62);
}
.tut-tip:empty {
  display: none;
}
.tut-foot {
  display: grid;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
}
.tut-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tut-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(237, 231, 218, 0.18);
  transition:
    background 0.2s ease,
    transform calc(0.2s * (1 - var(--rm))) var(--ease);
}
.tut-dot.is-past {
  background: rgba(232, 184, 104, 0.5);
}
.tut-dot.is-on {
  background: var(--brass-300);
  transform: scale(1.4);
}
.tut-nav {
  display: grid;
  grid-template-columns: 1fr 1.45fr;
  gap: 8px;
}
.tut-nav .btn {
  margin-top: 0;
  min-height: 48px;
}
.tut-panel #tut-skip {
  min-height: 32px;
  margin-top: 0;
  font-size: 12px;
}
.tut-invite .btn:first-of-type {
  margin-top: 6px;
}

/* A small phone gets a tighter placard rather than a scroll: the yard shrinks,
   the type steps down, and the two buttons keep their 44 px. */
@media (max-height: 700px) {
  .tut-head {
    padding-top: 12px;
  }
  .tut-title {
    font-size: 17px;
  }
  .tut-yard {
    width: min(100%, calc(30vh * 5 / 4));
    width: min(100%, calc(30dvh * 5 / 4));
  }
  .tut-copy {
    gap: 5px;
  }
  .tut-body {
    font-size: 13px;
  }
  .tut-tip {
    font-size: 12px;
  }
  .tut-foot {
    padding-top: 8px;
  }
  .tut-nav .btn {
    min-height: 44px;
  }
  .tut-stage[data-mode='hud'],
  .tut-stage[data-mode='hud'] .tut-hud {
    min-height: min(26vh, 220px);
    min-height: min(26dvh, 220px);
  }
  .tut-stage[data-mode='boosters'] .tut-yard {
    width: min(100%, calc(22vh * 5 / 4));
    width: min(100%, calc(22dvh * 5 / 4));
  }
}

/* A career is a list of stations, so the ladder is drawn as one: brass numerals
   for what is earned, steam for what is not yet. */
.rank-now {
  margin: 2px 0 8px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(237, 231, 218, 0.82);
}
.rank-track-wide {
  height: 5px;
  margin: 0 0 12px;
  background: rgba(237, 231, 218, 0.12);
}
.rank-ladder {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rank-tier {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: var(--pad-row) var(--row-inset);
  border-bottom: 1px solid rgba(190, 200, 206, 0.1);
  opacity: 0.58;
}
.rank-tier.is-passed {
  opacity: 0.92;
}
.rank-tier.is-current {
  opacity: 1;
  background: linear-gradient(90deg, rgba(232, 184, 104, 0.1), transparent 72%);
}
.rank-tier-level {
  font-family: var(--display);
  font-size: 17px;
  text-align: center;
  color: rgba(237, 231, 218, 0.7);
  font-variant-numeric: tabular-nums;
}
.rank-tier.is-passed .rank-tier-level,
.rank-tier.is-current .rank-tier-level {
  color: var(--brass-300);
}
.rank-tier-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.rank-tier-main b {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--steam);
}
.rank-tier-main span {
  font-size: 11.5px;
  line-height: 1.3;
  color: rgba(206, 214, 219, 0.6);
}
.rank-tier-reward {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}
.rank-tier-reward b {
  font-size: 12px;
  font-weight: 700;
  color: rgba(232, 184, 104, 0.9);
  font-variant-numeric: tabular-nums;
}
.rank-tier-reward i {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(206, 214, 219, 0.55);
}

.update-line {
  margin: 14px 0 2px;
  font-size: 12px;
  letter-spacing: 0.03em;
  text-align: center;
  color: rgba(206, 214, 219, 0.7);
  font-variant-numeric: tabular-nums;
}
.endless-teaser {
  padding: var(--pad-card);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(232, 184, 104, 0.08), rgba(200, 69, 58, 0.06));
  border: 1px dashed rgba(182, 192, 198, 0.24);
}
.endless-teaser .chapter-title {
  padding: 0 0 6px;
}
.endless-teaser p {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(237, 231, 218, 0.55);
}
/* A sheet's actions are rows, not chips: one column, the full panel width, so
   the label padding is the same on every one of them. */
.sheet-panel .btn {
  display: flex;
  width: 100%;
  margin-top: 12px;
}
.fine {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(206, 214, 219, 0.64);
  text-align: center;
  text-wrap: balance;
}
/* A line under a switch that needs explaining: the small print's voice, set
   to the left like the switch above it. */
.setting-note {
  margin: 0;
  padding: 8px var(--row-inset) 12px;
  border-bottom: 1px solid rgba(237, 231, 218, 0.06);
  text-align: left;
}

/* A nickname is typed once and then lives in the save: an iron well, brass on
   focus, nothing that looks like a form from another product. */
.name-field {
  display: block;
  margin: 4px 0 2px;
}
.name-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(228, 234, 238, 0.8);
}
.name-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #0e1214, #151b1e);
  border: 1px solid var(--stroke-steel-strong);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  color: var(--steam);
  font: 600 16px/1 var(--ui);
  letter-spacing: 0.04em;
  user-select: text;
  -webkit-user-select: text;
}
.name-field input::placeholder {
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(182, 192, 198, 0.34);
  text-transform: none;
}
.name-field input:focus {
  outline: none;
  border-color: rgba(232, 184, 104, 0.6);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.6),
    0 0 0 3px rgba(232, 184, 104, 0.14);
}
.name-error {
  margin-top: 6px;
  font-size: 12px;
  color: #efcabc;
}

:focus-visible {
  outline: 2px solid var(--brass-300);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ---------------------------------------------------------------- utility */
[hidden] {
  display: none !important;
}

@media (min-width: 620px) {
  body {
    font-size: 16px;
  }
  #app {
    --gutter: 22px;
  }
}

/* Reduced motion, from either the OS or the in-app Animacje switch. Every
   spatial offset in this file is already multiplied by (1 - --rm); what is left
   here is the decision to stop the ambient loops and to slow the one-shot
   flushes that would otherwise be a strobe. Feedback stays: colours, fades and
   the draining gauge all survive, so the board still answers a move. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --rm: 1;
  }
}
html.rm {
  --rm: 1;
}
html.rm .hud-moves.is-low {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .hud-moves.is-low {
    animation: none;
  }
}
.overlay-card:focus,
.sheet-panel:focus {
  outline: none;
}

/* --------------------------------------------------------------- kolejopedia */
/* A reading surface on iron: enamel facts, brass years, steel rows. The board
   still owns the colour; here the page is a station archive after dark. */
.screen-knowledge {
  gap: 0;
  min-height: 0;
}
.know-head {
  padding: 4px 0 10px;
  flex: 0 0 auto;
}
.know-exam {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(232, 184, 104, 0.34);
  background: linear-gradient(180deg, rgba(232, 184, 104, 0.14), rgba(138, 100, 32, 0.08));
  color: var(--brass-300);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: transform 0.16s var(--ease);
}
.know-exam:active {
  transform: scale(0.96);
}
/* Seven sections will not fit at 320 px: the strip scrolls and its right edge
   fades, because a tab that is merely cut looks broken and a faded one looks
   like there is more of it. */
.know-tabs {
  display: flex;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 90%, transparent 100%);
  gap: 4px;
  flex: 0 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 0 8px;
  margin: 0 calc(-1 * var(--gutter));
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  border-bottom: 1px solid rgba(237, 231, 218, 0.07);
}
.know-tabs::-webkit-scrollbar {
  display: none;
}
/* The tab is one line of signage, so its 44 px reach is its own height: the
   rule underneath stays close to the word it marks. */
.know-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 44px;
  padding: 14px 2px 12px;
  margin-right: 14px;
  border-bottom: 2px solid transparent;
  color: rgba(182, 192, 198, 0.72);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.know-tab.is-on {
  color: var(--brass-300);
  border-bottom-color: var(--brass-300);
}
.know-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 0 calc(28px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
/* A swiped section arrives from the side the finger sent it: the page moves,
   it does not cut. Direction rides in --slide; the distance still folds into
   the reduced-motion switch. */
.know-body.is-slide-next {
  --slide: 1;
}
.know-body.is-slide-prev {
  --slide: -1;
}
.know-body.is-slide-next,
.know-body.is-slide-prev {
  animation: knowSlide 0.24s var(--ease);
}
@keyframes knowSlide {
  from {
    opacity: 0;
    transform: translateX(calc(var(--slide) * 20px * (1 - var(--rm))));
  }
}
.know-note {
  margin: 0 0 14px;
  color: rgba(182, 192, 198, 0.82);
  font-size: 13px;
  line-height: 1.45;
}
.know-progress {
  margin: 0 0 12px;
  padding: 7px 0 8px;
  border-top: 1px solid rgba(232, 184, 104, 0.16);
  border-bottom: 1px solid rgba(232, 184, 104, 0.16);
  color: rgba(232, 184, 104, 0.82);
  font-size: 11px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.know-heading {
  margin: 22px 0 8px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(237, 231, 218, 0.9);
}
.know-letter {
  margin: 20px 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(237, 231, 218, 0.08);
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--brass-300);
}
.know-row {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: var(--pad-row) var(--row-inset);
  border-bottom: 1px solid rgba(237, 231, 218, 0.06);
  text-align: left;
}
.know-row:active {
  background: rgba(232, 184, 104, 0.05);
}
.know-row-main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.know-row-main b {
  color: var(--steam);
  font-size: 14.5px;
  font-weight: 600;
}
.know-row-main span {
  color: rgba(182, 192, 198, 0.66);
  font-size: 11.5px;
  letter-spacing: 0.03em;
}
.know-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(232, 184, 104, 0.3);
  transform: translateY(-2px);
}
.know-row.is-read .know-dot {
  background: #9ec98a;
  border-color: #9ec98a;
  box-shadow: 0 0 8px rgba(158, 201, 138, 0.45);
}
.know-term {
  display: block;
  width: 100%;
  padding: var(--pad-row) var(--row-inset);
  border-bottom: 1px solid rgba(237, 231, 218, 0.055);
  text-align: left;
}
.know-term b {
  display: block;
  margin-bottom: 3px;
  color: var(--brass-300);
  font-size: 13.5px;
  letter-spacing: 0.02em;
}
.know-term span {
  display: block;
  color: rgba(237, 231, 218, 0.72);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ------------------------------------------------------------------- era card */
.era-card {
  margin: 0 0 12px;
  padding: var(--pad-card);
  border: 1px solid rgba(237, 231, 218, 0.09);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(31, 38, 43, 0.72), rgba(14, 18, 20, 0.62));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.era-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}
.era-years {
  color: var(--brass-300);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.era-name {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--steam);
}
.era-lead {
  margin: 0 0 10px;
  color: rgba(237, 231, 218, 0.85);
  font-size: 13px;
  line-height: 1.45;
}
.era-milestones {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.era-milestones li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(182, 192, 198, 0.85);
}
.era-milestones b {
  color: rgba(232, 184, 104, 0.92);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.era-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(237, 231, 218, 0.08);
}
.era-count {
  color: rgba(182, 192, 198, 0.6);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.era-open {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(232, 184, 104, 0.34);
  color: var(--brass-300);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.era-open:active {
  background: rgba(232, 184, 104, 0.1);
}

/* ------------------------------------------------------------------- entries */
.know-panel {
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}
.entry-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.entry-kind {
  color: var(--brass-300);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.entry-lead {
  margin: 2px 0 12px;
  color: var(--steam);
  font-size: 15.5px;
  line-height: 1.42;
}
.entry-text {
  margin: 0 0 11px;
  color: rgba(237, 231, 218, 0.8);
  font-size: 14px;
  line-height: 1.55;
}
.entry-facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
  padding: var(--pad-card);
  list-style: none;
  border: 1px solid rgba(232, 184, 104, 0.22);
  border-radius: 10px;
  background: rgba(232, 184, 104, 0.055);
}
.entry-facts li {
  position: relative;
  padding-left: 12px;
  color: rgba(237, 231, 218, 0.88);
  font-size: 12.5px;
  line-height: 1.4;
}
.entry-facts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brass-300);
}
.entry-trivia {
  margin: 14px 0;
  padding: 10px var(--pad-card);
  border-left: 2px solid rgba(200, 69, 58, 0.6);
  background: rgba(200, 69, 58, 0.055);
  border-radius: 0 8px 8px 0;
}
.entry-trivia b {
  display: block;
  margin-bottom: 4px;
  color: rgba(235, 160, 146, 0.95);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.entry-trivia span {
  color: rgba(237, 231, 218, 0.84);
  font-size: 13px;
  line-height: 1.45;
}
.entry-related {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 4px;
}
.entry-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid rgba(237, 231, 218, 0.14);
  color: rgba(237, 231, 218, 0.82);
  font-size: 11.5px;
  letter-spacing: 0.03em;
}
.entry-chip:active {
  background: rgba(237, 231, 218, 0.06);
}

/* --------------------------------------------------------------------- quiz */
.entry-quiz {
  margin-top: 18px;
  padding-top: 13px;
  border-top: 1px solid rgba(237, 231, 218, 0.09);
}
.quiz-label {
  margin: 0 0 10px;
  color: rgba(232, 184, 104, 0.86);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.quiz-question,
.exam-question {
  margin: 0 0 11px;
  color: var(--steam);
  font-size: 14.5px;
  line-height: 1.4;
}
.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}

.quiz-answer {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 12px;
  border-radius: 9px;
  border: 1px solid rgba(237, 231, 218, 0.11);
  background: rgba(237, 231, 218, 0.025);
  color: rgba(237, 231, 218, 0.88);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}
.quiz-answer:active {
  transform: scale(0.99);
}
.quiz-answer i {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(232, 184, 104, 0.28);
  color: var(--brass-300);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.quiz-answer.is-right {
  border-color: rgba(158, 201, 138, 0.6);
  background: rgba(158, 201, 138, 0.1);
}
.quiz-answer.is-wrong {
  border-color: rgba(200, 69, 58, 0.6);
  background: rgba(200, 69, 58, 0.1);
}
.quiz-answer:disabled {
  opacity: 1;
}
.quiz-result {
  margin: 0 0 10px;
  padding: 8px var(--pad-card);
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
}
.quiz-result.is-good {
  border: 1px solid rgba(158, 201, 138, 0.32);
  background: rgba(158, 201, 138, 0.08);
  color: rgba(206, 233, 195, 0.95);
}
.quiz-result.is-bad {
  border: 1px solid rgba(200, 69, 58, 0.32);
  background: rgba(200, 69, 58, 0.08);
  color: rgba(240, 198, 185, 0.95);
}
.quiz-paid {
  margin: 0 0 10px;
  color: var(--brass-300);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------- exam */
.exam-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: var(--pad-row) var(--row-inset);
  border-bottom: 1px solid rgba(237, 231, 218, 0.07);
  color: rgba(237, 231, 218, 0.86);
  font-size: 13px;
  text-align: left;
}
.exam-choice b {
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
}
.exam-step {
  margin: 0 0 8px;
  color: rgba(182, 192, 198, 0.66);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.exam-score {
  margin: 4px 0 6px;
  font-family: var(--display);
  font-size: 34px;
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ diagram */
.diagram {
  margin: 0 0 6px;
  padding: var(--pad-card);
  border: 1px solid rgba(237, 231, 218, 0.1);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(31, 38, 43, 0.8), rgba(12, 16, 18, 0.86));
}
.diagram-title {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--steam);
}
.diagram-note {
  margin: 0 0 10px;
  color: rgba(182, 192, 198, 0.7);
  font-size: 11.5px;
  line-height: 1.4;
}
.diagram-stage {
  position: relative;
  /* the stage and the SVG share one box, so percentages on the pins land exactly
     on the drawing; the frame is a shadow, never a border that shifts the box */
  aspect-ratio: 100 / 60;
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(232, 184, 104, 0.1), rgba(10, 12, 14, 0) 60%),
    #0d1113;
  box-shadow: inset 0 0 0 1px rgba(237, 231, 218, 0.09);
}
.diagram-svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.diag-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 184, 104, 0.9);
  background: rgba(10, 12, 14, 0.72);
  box-shadow: 0 0 0 2px rgba(6, 8, 10, 0.55);
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.16s var(--ease);
}
.diag-dot::after {
  content: '';
  position: absolute;
  inset: 3.6px;
  border-radius: 50%;
  background: rgba(232, 184, 104, 0.7);
}
.diag-dot.is-on,
.diag-dot:active {
  background: rgba(232, 184, 104, 0.9);
  box-shadow: 0 0 12px rgba(232, 184, 104, 0.5);
  transform: scale(1.06);
}
.diag-dot.is-on::after {
  background: #1a1410;
}
.diagram-readout {
  min-height: 64px;
  padding: 11px 2px 0;
}
.diagram-readout h3 {
  margin: 0 0 5px;
  color: var(--brass-300);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.diagram-readout p {
  margin: 0 0 8px;
  color: rgba(237, 231, 218, 0.8);
  font-size: 12.5px;
  line-height: 1.45;
}
.diagram-readout p.diagram-hint {
  color: rgba(182, 192, 198, 0.6);
  font-size: 12px;
}
.diagram-readout .entry-facts {
  margin: 8px 0 0;
  padding: 9px 10px;
}
.era-sub {
  margin: 18px 0 8px;
  color: rgba(232, 184, 104, 0.9);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.era-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0 0 0 10px;
  list-style: none;
  border-left: 1px solid rgba(232, 184, 104, 0.22);
}
.era-timeline li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(237, 231, 218, 0.8);
}
.era-timeline b {
  color: var(--brass-300);
  font-variant-numeric: tabular-nums;
}
.era-start {
  width: 100%;
}
.era-start-bar {
  position: sticky;
  bottom: 0;
  margin: 18px -2px -4px;
  padding: 20px 2px 2px;
  background: linear-gradient(rgba(19, 24, 27, 0), #13181b 16%);
}

@media (max-width: 360px) {
  .era-milestones li,
  .era-timeline li {
    grid-template-columns: 40px 1fr;
  }
  .know-tab {
    margin-right: 11px;
    font-size: 11px;
  }
}

/* The map is also the table of contents: every era head opens its chronicle. */
.chapter-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 2px var(--row-inset) 10px;
  text-align: left;
}
.chapter-head .chapter-title {
  width: 100%;
  padding: 4px 0 0;
}
.chapter-head.is-static {
  pointer-events: none;
}
.chapter-years {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(232, 184, 104, 0.66);
  font-variant-numeric: tabular-nums;
}
.chapter.is-future .chapter-title {
  color: rgba(228, 234, 238, 0.5);
}
.chapter.is-future .chapter-years {
  color: rgba(232, 184, 104, 0.52);
}
.endless-teaser p {
  margin: 10px 2px 0;
  color: rgba(182, 192, 198, 0.66);
  font-size: 11.5px;
  line-height: 1.45;
}
.end-discovery {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px var(--pad-card);
  border-radius: 9px;
  border: 1px solid rgba(232, 184, 104, 0.34);
  background: rgba(232, 184, 104, 0.07);
  color: var(--brass-300);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.end-discovery:active {
  transform: scale(0.99);
}

@media (max-width: 360px) {
  .know-head .map-title {
    font-size: 18px;
  }
  .know-exam {
    padding: 0 9px;
    font-size: 11px;
    letter-spacing: 0.1em;
  }
}

/* ------------------------------------------------------------- quests */
/* The night's three assignments: a strip of iron troughs in the menu, and the
   same three bars at reading size in a sheet. No enamel here — this is a
   working list, not a record. */
.quest-card {
  grid-column: 1 / -1;
  min-height: 58px;
  gap: 7px;
  padding: 9px 12px 10px;
}
.quest-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.quest-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}
.quest-bars i {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: rgba(4, 6, 8, 0.7);
  box-shadow: inset 0 1px 2px -1px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
.quest-bars b {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(232, 184, 104, 0.65), #e8b868);
  transition: width 0.3s var(--ease);
}
.quest-card.is-done .quest-bars b {
  background: linear-gradient(90deg, rgba(198, 216, 176, 0.6), #c6d8b0);
}

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.quest {
  padding: 10px 12px 11px;
  border-radius: 10px;
  background: rgba(4, 6, 8, 0.4);
  box-shadow:
    inset 0 2px 5px -2px rgba(0, 0, 0, 0.9),
    inset 0 -1px 0 rgba(220, 232, 238, 0.05);
}
.quest-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(237, 231, 218, 0.86);
}
.quest-value {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: rgba(232, 184, 104, 0.85);
  white-space: nowrap;
}
.quest.is-done {
  background: rgba(140, 170, 110, 0.12);
  box-shadow:
    inset 0 2px 5px -2px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(140, 170, 110, 0.26);
}
.quest.is-done .quest-label {
  color: #c6d8b0;
}
.quest.is-done .quest-value {
  color: #c6d8b0;
}
.quest-track {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: rgba(4, 6, 8, 0.72);
  box-shadow: inset 0 1px 2px -1px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
.quest-track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(232, 184, 104, 0.7), #e8b868);
  transition: width 0.3s var(--ease);
}
.quest.is-done .quest-track i {
  background: linear-gradient(90deg, rgba(198, 216, 176, 0.6), #c6d8b0);
}

.chest {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--stroke-steel);
}
.chest-title {
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass-300);
}
.chest-title.is-taken {
  color: rgba(182, 192, 198, 0.6);
  letter-spacing: 0.08em;
  text-transform: none;
  font-weight: 600;
}
.chest-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.chest-row .btn {
  padding: 10px 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.25;
}

/* A stamp on the level line and on the map: the risk is stated before the shift,
   so a loss there reads as the board's, not the player's. */
.hud-tag {
  margin-left: 7px;
  padding: 2px 5px 1px;
  border-radius: 3px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f2c9a4;
  background: rgba(200, 69, 58, 0.2);
  box-shadow: inset 0 0 0 1px rgba(200, 69, 58, 0.4);
  vertical-align: 1px;
}
.tile-tag {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: #f6e7c4;
  background: #8e2f26;
  box-shadow: 0 0 0 1px rgba(20, 8, 6, 0.45);
}
.level-tile.is-super .tile-tag {
  background: #c8453a;
}
.level-tile.is-hard,
.level-tile.is-super {
  border-color: rgba(200, 69, 58, 0.34);
}
.level-tile.is-locked .tile-tag {
  opacity: 0.4;
}

/* ---------------------------------------------------------- Kolejopedia media
   Two kinds of plate hang in the reading room: a photograph at the head of a
   section, and a moving drawing inside an entry. Both are framed like the rest
   of the station — an iron edge, a hairline of enamel, no gloss of their own. */

.know-film {
  margin: 0 0 18px;
}
.film-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 3px;
  background: var(--soot-900);
  box-shadow:
    inset 0 0 0 1px rgba(237, 231, 218, 0.12),
    0 20px 40px -30px #000;
}
.film-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--soot-900);
}
/* The instrument: a transparent sheet over the photograph. A finger that
   starts here is working the plate, not swiping the section, so the browser
   may keep the vertical scroll but not the horizontal page turn. */
.film-plate {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  touch-action: pan-y;
  cursor: grab;
}
.film-plate:active {
  cursor: grabbing;
}
.film-plate:focus-visible {
  outline: 2px solid var(--brass-300);
  outline-offset: -3px;
}
/* The plate is lit by the room, not by itself: a vignette and a bottom fall. */
.film-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 12, 14, 0) 58%, rgba(10, 12, 14, 0.5) 100%);
  box-shadow: inset 0 0 34px rgba(10, 12, 14, 0.5);
}
/* One line under the picture says what the picture can be made to do. It is
   signage, not a paragraph: the brass dot is the only "this is live" mark. */
.film-hint {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 7px;
  margin: 6px 0 0;
  color: rgba(182, 192, 198, 0.8);
  font-size: 11.5px;
  line-height: 1.35;
}
.film-hint-dot {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass-300);
  box-shadow: 0 0 0 3px rgba(232, 184, 104, 0.12);
  transform: translateY(-1px);
}
/* The key line is a caption for a keyboard, not a button: it sits apart, in
   brass, with no plate to press. */
.film-hint kbd {
  margin-left: auto;
  border: 0;
  background: none;
  color: rgba(232, 184, 104, 0.72);
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
/* What the instrument currently reads, for a screen reader. The plate itself
   is a canvas, so this is the one honest textual account of its state. */
.plate-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.film-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 1px 0;
}
/* A caption names a plate, it does not announce a chapter: it is signage, so it
   is set in the UI face, not in the display face at a size the display may never
   take. */
.film-meta b {
  font-family: var(--ui);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-300);
}
.film-meta span {
  color: rgba(182, 192, 198, 0.72);
  font-size: 11.5px;
  line-height: 1.4;
}
.film-credit {
  margin-top: 2px;
  font-style: normal;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.05em;
  /* The one line a photograph requires must be readable: 4.6:1 on the soot. */
  color: rgba(182, 192, 198, 0.66);
}

.entry-figure {
  margin: 2px 0 16px;
}
.figure-frame {
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: var(--soot-900);
  box-shadow: inset 0 0 0 1px rgba(237, 231, 218, 0.1);
}
.figure-frame canvas {
  display: block;
  width: 100%;
}
/* An entry figure that carries an instrument: a finger starting here works the
   mechanism, so the canvas takes horizontal drags and leaves vertical scroll. */
.figure-frame canvas.is-live {
  touch-action: pan-y;
  cursor: grab;
}
.figure-frame canvas.is-live:active {
  cursor: grabbing;
}
.figure-frame canvas.is-live:focus-visible {
  outline: 2px solid var(--brass-300);
  outline-offset: -3px;
}
.figure-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 1px 0;
}
.figure-meta b {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-300);
}
.figure-meta span {
  color: rgba(182, 192, 198, 0.68);
  font-size: 11.5px;
  line-height: 1.4;
}
