/*
 * Design tokens from the Routific Website Figma file (variables on node 7166:92349).
 * Code components render inside Shadow DOM, so tokens are declared on :host as well as :root
 * (:root covers the local preview and Webflow's own page; :host covers the shadow tree).
 */
:host,
:host {
  /* Brand */
  --rt-indigo-100: #374cd2;
  --rt-indigo-200: #667afa;
  --rt-yellow-200: #ffad0a;
  --rt-yellow-border: #b97b01;
  --rt-turquoise: #45c4d7;
  --rt-primary-500: #326bfc;
  --rt-primary-600: #1750e3;
  --rt-hero-blue: #1f36a7;
  --rt-hero-lilac: #eceefb;

  /* Text */
  --rt-text-primary: #282828;
  --rt-text-secondary: #676d7e;
  --rt-text-tertiary: #9da1af;

  /* Route colours */
  --rt-route-violet: #7547bf;
  --rt-route-pink: #ff85a9;
  --rt-route-sky: #269ed1;
  --rt-route-lilac: #a770db;

  /* Type — Proxima Nova is expected to be loaded by the Webflow site (Adobe Fonts);
     Plus Jakarta Sans and Figtree are loaded from Google Fonts by useDocumentFonts(). */
  --rt-font-display: "Plus Jakarta Sans", system-ui, sans-serif;
  --rt-font-heading: "Figtree", system-ui, sans-serif;
  --rt-font-body: "proxima-nova", "Proxima Nova", "Figtree", system-ui, sans-serif;
  --rt-font-ui: "SF Pro Text", -apple-system, "Inter", system-ui, sans-serif;

  /* Radii */
  --rt-radius-md: 8px;
  --rt-radius-lg: 16px;

  /* Vector map (Hero/showcase/MapBase.tsx): Mapbox-light look of the current Routific UI */
  --map-land: #edeff3;
  --map-street: #fcfdfe;
  --map-park: #d3e9d1;
  --map-water: #b3caf3;
  --map-industrial: #f2e4c6;
  --map-highway: #aab3c7;
  --map-highway-edge: #fcfdfe;
}

/* Shared styles for the vector map (Hero/showcase/MapBase.tsx). Colours are in tokens.css. */
.rt-map-labels text {
  font-family: var(--rt-font-heading);
  font-weight: 700;
  fill: #8a90a2;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.6px;
}

/* ---- 404: copy beside Rovin's illustration, which opens a game card (not in Figma: flag for design review) ---- */
.rt-nf {
  box-sizing: border-box;
  padding: 160px 24px 112px;
  background:
    radial-gradient(60% 50% at 85% 20%, rgba(102, 122, 250, 0.14), transparent 70%),
    linear-gradient(180deg, #f3f5ff 0%, #fff 75%);
  font-family: var(--rt-font-body);
  color: var(--rt-text-primary);
  /* Plus Jakarta's "fi" ligature dropped the i in pixel-font headings ("Routfic") */
  font-variant-ligatures: none;
}
.rt-nf *,
.rt-nf *::before,
.rt-nf *::after {
  box-sizing: border-box;
}
.rt-nf-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  /* top-aligned: the copy must not jump when the game card grows between screens */
  align-items: start;
  gap: 56px;
  max-width: 1180px;
  margin: 0 auto;
}

/* copy */
.rt-nf-eyebrow {
  margin: 0 0 14px;
  font-family: var(--rt-font-heading);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rt-indigo-100);
}
.rt-nf-h1 {
  margin: 0;
  font-family: var(--rt-font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.rt-nf-text {
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: #3c4152;
  text-wrap: pretty;
}
.rt-nf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font-family: var(--rt-font-body);
  font-weight: 600;
  font-size: 16px;
  line-height: 22px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.rt-nf-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(31, 54, 167, 0.16);
}
.rt-nf-btn:focus-visible,
.rt-nf-next:focus-visible,
.rt-nf-art:focus-visible {
  outline: 2px solid var(--rt-primary-500);
  outline-offset: 3px;
}
.rt-nf-btn-primary {
  background: var(--rt-yellow-200);
  border-color: var(--rt-yellow-border);
  color: var(--rt-text-primary);
}
.rt-nf-btn-ghost {
  background: #fff;
  border-color: #c9d0f5;
  color: var(--rt-indigo-100);
}
.rt-nf-home {
  margin-top: 28px;
  padding: 14px 28px;
  font-size: 17px;
}

/* card */
.rt-nf-card {
  position: relative;
  padding: 20px;
  border: 1px solid #e3e7fb;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 60px -30px rgba(31, 54, 167, 0.28);
}
.rt-nf-card-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  min-height: 92px;
  padding: 0 116px 14px 4px;
}
/* Rovin alone (the original art without the cabinet) */
.rt-nf-rovin {
  flex: none;
  width: 76px;
}
.rt-nf-rovin svg {
  display: block;
  width: 100%;
  height: auto;
}
.rt-nf-rovin.is-cheer {
  animation: rt-nf-hop 700ms cubic-bezier(0.34, 1.56, 0.64, 1) 2;
}
.rt-nf-rovin.is-oops {
  animation: rt-nf-shake 420ms ease 1;
}
@keyframes rt-nf-hop {
  50% { transform: translateY(-8px); }
}
@keyframes rt-nf-shake {
  25% { transform: rotate(-4deg); }
  75% { transform: rotate(4deg); }
}

/* landing: the original illustration; hovering it (or always, on touch screens) offers a game */
.rt-nf-art {
  position: relative;
  display: block;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: none;
  cursor: default;
}
.rt-nf-art img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1), filter 300ms ease;
}
.rt-nf-play {
  position: absolute;
  left: 50%;
  bottom: 18%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 12px 16px;
  border-radius: 999px;
  background: var(--rt-indigo-100);
  box-shadow: 0 14px 30px -10px rgba(31, 54, 167, 0.55);
  font-family: var(--rt-font-heading);
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px) scale(0.96);
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.rt-nf-play svg {
  width: 18px;
  height: 18px;
}
.rt-nf-art:hover,
.rt-nf-art:focus-visible {
  cursor: pointer;
}
.rt-nf-art:hover img,
.rt-nf-art:focus-visible img {
  transform: translateY(-4px) scale(1.01);
  filter: drop-shadow(0 18px 30px rgba(31, 54, 167, 0.14));
}
.rt-nf-art:hover .rt-nf-play,
.rt-nf-art:focus-visible .rt-nf-play {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
@media (hover: none) {
  .rt-nf-art {
    cursor: pointer;
  }
  .rt-nf-play {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
.rt-nf-card {
  animation: rt-nf-in 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes rt-nf-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}
.rt-nf-card-kicker {
  margin: 0;
  font-family: var(--rt-font-heading);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rt-text-tertiary);
}
.rt-nf-card-title h2 {
  margin: 2px 0 0;
  font-family: var(--rt-font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
}
.rt-nf-card-title .rt-nf-how-line {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--rt-text-secondary);
}
.rt-nf-next {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #dfe3f7;
  border-radius: 999px;
  background: #f6f7fe;
  font-family: var(--rt-font-heading);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--rt-indigo-100);
  cursor: pointer;
}
.rt-nf-next svg {
  width: 15px;
  height: 15px;
}
.rt-nf-next:hover {
  background: #eef0fd;
}
.rt-nf-placeholder {
  width: 100%;
  border-radius: 18px;
  background: #f1f3fb;
}

/* shared game bits */
.rt-nf-game-body {
  display: flex;
  flex-direction: column;
}
.rt-nf-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--rt-font-heading);
}
.rt-nf-svg:focus-visible {
  outline: 2px solid var(--rt-primary-500);
  outline-offset: 3px;
}
.rt-nf-map {
  fill: var(--map-land, #edeff3);
}
.rt-nf-streets {
  fill: none;
  stroke: #fcfdfe;
  stroke-width: 9;
}
.rt-nf-hit {
  fill: transparent;
}
.rt-nf-status {
  min-height: 48px;
  padding: 14px 4px 0;
  font-size: 16px;
  line-height: 1.45;
  color: #3c4152;
}
.rt-nf-good {
  color: #1d9a63;
}
.rt-nf-bad {
  color: #e2445c;
}
.rt-nf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
}
.rt-nf-actions:empty {
  display: none;
}

/* route game */
.rt-nf-house {
  cursor: pointer;
  outline: none;
}
.rt-nf-house.is-done {
  cursor: default;
}
.rt-nf-house:not(.is-done):hover circle:nth-child(2),
.rt-nf-house:not(.is-done):focus-visible circle:nth-child(2) {
  stroke: #7547bf;
  stroke-width: 2.6;
}
.rt-nf-yours {
  fill: none;
  stroke: #7547bf;
  stroke-width: 3.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke;
}
.rt-nf-best {
  fill: none;
  stroke: #1d9a63;
  stroke-width: 3.6;
  stroke-dasharray: 0.012 0.008;
  stroke-linejoin: round;
  opacity: 0.9;
}
.rt-nf-best.is-drawing {
  stroke-dasharray: 1;
  animation: rt-nf-draw 1.6s ease forwards;
}
@keyframes rt-nf-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* mission briefing at the start of each level */
.rt-nf-mission {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 3px solid var(--rt-navy, #131b52);
  border-radius: 6px;
  background: #fff8e6;
  font-family: var(--rt-pixel, monospace);
  font-size: 9px;
  line-height: 1.9;
  text-transform: uppercase;
  color: var(--rt-navy, #131b52);
}
.rt-nf-mission b {
  margin-right: 6px;
  padding: 2px 6px;
  font-weight: 400;
  background: var(--rt-navy, #131b52);
  color: var(--rt-yellow-200);
}
.rt-nf-blink {
  animation: rt-nf-blink-text 1s steps(1) infinite;
}
/* level 4: real road shapes from the Routific Engine */
.rt-nf-yours.is-ghost {
  opacity: 0.35;
  stroke-dasharray: 6 6;
}
.rt-nf-road {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rt-nf-road-yours {
  stroke: #7547bf;
}
.rt-nf-road-best {
  stroke: #1d9a63;
  stroke-dasharray: 2 6;
}
/* the bonus level's map is OpenStreetMap data: its attribution, small in the corner */
.rt-nf-osm {
  font: 500 9px/1 var(--rt-font-body, sans-serif);
  fill: #5b6280;
  opacity: 0.85;
  pointer-events: none;
}

/* Zone Defense: crew chips, familiarity glow, meters */
.rt-nf-crew {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.rt-nf-crew-chip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 7px;
  padding: 6px 10px 6px 8px;
  border: 3px solid var(--c);
  border-radius: 6px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--rt-navy, #131b52);
  font-family: var(--rt-font-heading);
  text-align: left;
  color: var(--rt-navy, #131b52);
  cursor: pointer;
  transition: transform 80ms steps(2);
}
.rt-nf-crew-chip.is-on {
  background: var(--c);
  color: #fff;
  transform: translate(-1px, -1px);
}
.rt-nf-crew-chip.is-sick {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  border-style: dashed;
}
.rt-nf-crew-chip.is-shake {
  animation: rt-nf-shake 400ms steps(6);
}
.rt-nf-crew-dot {
  grid-row: span 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 2px #fff;
}
.rt-nf-crew-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rt-nf-crew-chip small {
  min-width: 0;
  overflow: hidden;
  font-size: 11.5px;
  opacity: 0.85;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rt-nf-mapwrap {
  position: relative;
}
.rt-nf-turfs {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 5px 9px;
  border: 2px solid var(--rt-navy, #131b52);
  border-radius: 5px;
  background: #fff;
  box-shadow: 2px 2px 0 var(--rt-navy, #131b52);
  font-family: var(--rt-font-heading);
  font-weight: 700;
  font-size: 12px;
  color: var(--rt-navy, #131b52);
  cursor: pointer;
}
.rt-nf-turfs.is-on {
  background: var(--rt-yellow-200);
}
.rt-nf-zones.is-lasso {
  cursor: crosshair;
}
.rt-nf-zstop {
  cursor: pointer;
  outline: none;
}
.rt-nf-zstop:focus-visible .rt-nf-drop > circle:first-child {
  stroke: var(--rt-navy, #131b52);
  stroke-width: 3;
}
.rt-nf-heat {
  animation: rt-nf-heat-in 400ms ease both;
}
@keyframes rt-nf-heat-in {
  from { opacity: 0; }
}
.rt-nf-meters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.rt-nf-meters div {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 2px solid #e3e7fb;
  border-radius: 6px;
  background: #f8f9ff;
}
.rt-nf-meters b {
  font-family: var(--rt-pixel, monospace);
  font-size: 12px;
  font-weight: 400;
  color: var(--rt-navy, #131b52);
}
.rt-nf-meters span {
  font-family: var(--rt-font-heading);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--rt-text-secondary);
}
.rt-nf-meters .is-good b {
  color: #1d9a63;
}
.rt-nf-meters .is-bad b {
  color: #e2445c;
}
@media (max-width: 599px) {
  .rt-nf-meters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rt-nf-crew-chip {
    padding: 5px 8px 5px 6px;
  }
  .rt-nf-crew-name {
    font-size: 13px;
  }
  .rt-nf-crew-min {
    display: none;
  }
  .rt-nf-turfs {
    font-size: 11px;
  }
}

/* time windows (route game, level 3) */
.rt-nf-win rect {
  fill: #fff;
  stroke: #326bfc;
  stroke-width: 1.2;
}
.rt-nf-win text {
  font-family: var(--rt-font-ui);
  font-size: 9.5px;
  font-weight: 600;
  fill: #326bfc;
}
.rt-nf-win.is-late rect {
  fill: #fdecef;
  stroke: #e2445c;
}
.rt-nf-win.is-late text {
  fill: #e2445c;
}
.rt-nf-reallife {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f3f5ff;
  font-size: 15px;
  line-height: 1.5;
  color: #3c4152;
}

/* untangle: Routific's map, Routes panel and timeline row; Draw Routes power-up */
.rt-nf-app {
  border: 1px solid #e3e7fb;
  background: #fff;
}
.rt-nf-app.is-drawing {
  cursor: crosshair;
}
.rt-nf-stopnum {
  font-family: var(--rt-font-ui);
  font-size: 10px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.rt-nf-stopnum-sm {
  font-size: 9px;
}
.rt-nf-flow {
  font-family: var(--rt-font-ui);
  font-size: 14px;
  font-weight: 600;
  fill: #fff;
}
.rt-nf-ph {
  font-family: var(--rt-font-ui);
  font-size: 13px;
  font-weight: 700;
  fill: #282828;
}
.rt-nf-prow {
  font-family: var(--rt-font-ui);
  font-size: 11.5px;
  font-weight: 600;
  fill: #282828;
}
.rt-nf-pmeta {
  font-family: var(--rt-font-ui);
  font-size: 10.5px;
  fill: #3d4354;
}
.rt-nf-pmeta-sm {
  font-size: 9px;
}
.rt-nf-pill {
  cursor: grab;
  outline: none;
  touch-action: none;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.rt-nf-pill.is-drag {
  cursor: grabbing;
  transition: none;
  filter: drop-shadow(0 3px 5px rgba(31, 54, 167, 0.35));
}
.rt-nf-pill:focus-visible circle:nth-child(2) {
  stroke-width: 3;
}
.rt-nf-levels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.rt-nf-levels span {
  white-space: nowrap;
}
@media (max-width: 599px) {
  .rt-nf-levels .rt-nf-target {
    flex-basis: 100%;
    margin-left: 0;
    padding: 0 2px;
  }
}
.rt-nf-levels span {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f3fb;
  font-family: var(--rt-font-heading);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--rt-text-tertiary);
}
.rt-nf-levels .is-on {
  background: var(--rt-indigo-100);
  color: #fff;
}
.rt-nf-levels .rt-nf-target {
  margin-left: auto;
  background: none;
  font-weight: 600;
  color: var(--rt-text-secondary);
}
.rt-nf-levels .is-done {
  background: #e3f5ec;
  color: #1d9a63;
}
.rt-nf-btn-power {
  background: #fff3d6;
  border-color: var(--rt-yellow-200);
  color: #6b4500;
}
@media (max-width: 599px) {
  .rt-nf-btn-power {
    font-size: 15px;
    padding-left: 14px;
    padding-right: 14px;
  }
}
.rt-nf-btn-power small {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.75;
}
.rt-nf-btn-draw {
  background: #326bfc;
  border-color: #326bfc;
  color: #fff;
}
.rt-nf-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
}

/* confetti over the card when the last level is solved */
.rt-nf-confetti {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.rt-nf-confetti span {
  position: absolute;
  top: -16px;
  opacity: 0;
  animation-name: rt-nf-confetti;
  animation-timing-function: cubic-bezier(0.25, 0.6, 0.45, 1);
  animation-fill-mode: forwards;
}
@keyframes rt-nf-confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), 640px) rotate(var(--spin)); }
}

/* ---- Arcade skin: pixel font, chunky borders with hard shadows, a score HUD, high scores ---- */
.rt-nf {
  --rt-pixel: "Press Start 2P", ui-monospace, monospace;
  --rt-navy: #131b52;
}
.rt-nf-card {
  border: 3px solid var(--rt-navy);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--rt-navy);
}
.rt-nf-card-kicker {
  font-family: var(--rt-pixel);
  font-size: 8px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: #ff7a45;
}
.rt-nf-card-title h2 {
  margin-top: 6px;
  font-family: var(--rt-pixel);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
}
.rt-nf-hud {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--rt-navy);
  font-family: var(--rt-pixel);
  font-size: 10px;
  color: #c9d0f5;
  overflow: hidden;
}
.rt-nf-hud::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.rt-nf-hud b {
  display: inline-block;
  font-weight: 400;
  color: var(--rt-yellow-200);
}
.rt-nf-hud b.is-bump {
  animation: rt-nf-bump 420ms steps(4) 1;
}
@keyframes rt-nf-bump {
  40% { transform: scale(1.35); color: #fff; }
}
.rt-nf-game {
  position: relative;
}
.rt-nf-pops {
  position: absolute;
  left: 0;
  right: 0;
  top: 34%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.rt-nf-pop {
  font-family: var(--rt-pixel);
  font-size: 15px;
  color: var(--rt-yellow-200);
  text-shadow: 3px 0 0 var(--rt-navy), -3px 0 0 var(--rt-navy), 0 3px 0 var(--rt-navy), 0 -3px 0 var(--rt-navy), 3px 3px 0 var(--rt-navy);
  animation: rt-nf-pop 1.6s steps(12) forwards;
}
@keyframes rt-nf-pop {
  0% { opacity: 0; transform: translateY(10px) scale(0.8); }
  15% { opacity: 1; transform: translateY(0) scale(1.1); }
  25% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-36px); }
}
.rt-nf-levels span {
  font-family: var(--rt-pixel);
  font-size: 8px;
  font-weight: 400;
  padding: 6px 9px;
  border-radius: 4px;
}
.rt-nf-levels .rt-nf-target {
  font-family: var(--rt-pixel);
  font-size: 8px;
  line-height: 1.6;
}
/* buttons inside the card: chunky arcade buttons */
.rt-nf-card .rt-nf-btn,
.rt-nf-arc-btn {
  padding: 12px 16px;
  border: 3px solid var(--rt-navy);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--rt-navy);
  font-family: var(--rt-pixel);
  font-size: 10px;
  line-height: 1.4;
  font-weight: 400;
  text-transform: uppercase;
  transition: transform 80ms steps(2), box-shadow 80ms steps(2);
}
.rt-nf-card .rt-nf-btn:hover,
.rt-nf-arc-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--rt-navy);
}
.rt-nf-card .rt-nf-btn:active,
.rt-nf-arc-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--rt-navy);
}
.rt-nf-card .rt-nf-btn-ghost {
  background: #fff;
  color: var(--rt-navy);
}
.rt-nf-card .rt-nf-btn-power small {
  font-size: 8px;
}
.rt-nf-next {
  border: 2px solid var(--rt-navy);
  border-radius: 6px;
  box-shadow: 3px 3px 0 var(--rt-navy);
  background: #fff;
  font-family: var(--rt-pixel);
  font-size: 9px;
  font-weight: 400;
  color: var(--rt-navy);
  text-transform: uppercase;
}
.rt-nf-play {
  font-family: var(--rt-pixel);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  border: 3px solid var(--rt-navy);
  border-radius: 8px;
  box-shadow: 5px 5px 0 var(--rt-navy);
  background: var(--rt-yellow-200);
  color: var(--rt-navy);
}
/* high scores */
.rt-nf-hs {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  border-radius: 11px;
  background: #131b52;
  animation: rt-nf-in 300ms steps(6) both;
}
.rt-nf-hs-box {
  width: 100%;
  max-width: 360px;
  font-family: var(--rt-pixel);
  color: #fff;
  text-align: center;
}
.rt-nf-hs-h {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--rt-yellow-200);
  animation: rt-nf-blink-text 1s steps(1) infinite;
}
@keyframes rt-nf-blink-text {
  50% { opacity: 0.35; }
}
.rt-nf-hs-score {
  margin: 14px 0 22px;
  font-size: 22px;
  color: #fff;
}
.rt-nf-hs-form {
  display: grid;
  justify-items: center;
  gap: 16px;
}
.rt-nf-hs-form label {
  font-size: 10px;
  color: #c9d0f5;
}
.rt-nf-hs-form input {
  width: 5.2em;
  padding: 6px 0 8px 0.4em;
  border: 0;
  border-bottom: 4px dashed var(--rt-yellow-200);
  background: transparent;
  font-family: var(--rt-pixel);
  font-size: 30px;
  letter-spacing: 0.4em;
  text-align: center;
  text-transform: uppercase;
  color: var(--rt-yellow-200);
  caret-color: #fff;
  outline: none;
}
.rt-nf-hs-form input::placeholder {
  color: rgba(255, 173, 10, 0.35);
}
.rt-nf-hs-list {
  margin: 0 0 22px;
  padding: 0 6px 0 0;
  list-style: none;
  font-size: 12px;
  line-height: 2.4;
  /* the top 20: about six rows show, the rest scroll (inside the list, not the page) */
  max-height: calc(6.5 * 2.4em);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rt-yellow-200) rgba(255, 255, 255, 0.12);
}
.rt-nf-hs-list::-webkit-scrollbar {
  width: 6px;
}
.rt-nf-hs-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.12);
}
.rt-nf-hs-list::-webkit-scrollbar-thumb {
  background: var(--rt-yellow-200);
}
.rt-nf-hs-list:focus-visible {
  outline: 2px solid var(--rt-yellow-200);
  outline-offset: 4px;
}
.rt-nf-hs-list li {
  display: grid;
  grid-template-columns: 3em 4em 1fr;
  text-align: left;
}
.rt-nf-hs-list li span:last-child {
  text-align: right;
}
/* your entry stays bright: it flashes yellow / white, never dims */
.rt-nf-hs-list li.is-mine {
  color: var(--rt-yellow-200);
  animation: rt-nf-blink-mine 0.8s steps(1) infinite;
}
@keyframes rt-nf-blink-mine {
  50% { color: #fff; }
}
.rt-nf-hs-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.rt-nf-arc-btn {
  background: #fff;
  color: var(--rt-navy);
  cursor: pointer;
}
.rt-nf-arc-btn.is-yellow {
  background: var(--rt-yellow-200);
}
.rt-nf-hs .rt-nf-arc-btn {
  border-color: #fff;
  box-shadow: 4px 4px 0 #000;
}

/* ---- Rovin's Route Rush: CRT power-on, title, story, countdown, level banners ---- */
.rt-nf-card.is-boot,
.rt-nf-card.is-title,
.rt-nf-card.is-story {
  padding: 0;
  overflow: hidden;
  background: #0b1038;
}
.rt-nf-boot {
  min-height: 520px;
  background: #0b1038;
  position: relative;
}
.rt-nf-boot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 4px;
  background: #fff;
  box-shadow: 0 0 30px 8px #8fa0ff;
  transform: translate(-50%, -50%) scaleX(0);
  animation: rt-nf-crt 900ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes rt-nf-crt {
  0% { transform: translate(-50%, -50%) scale(0, 1); opacity: 1; }
  33% { transform: translate(-50%, -50%) scale(1, 1); opacity: 1; }
  40% { transform: translate(-50%, -50%) scale(1, 160); opacity: 1; }
  52% { transform: translate(-50%, -50%) scale(1, 160); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1, 160); opacity: 0; }
}

.rt-nf-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 520px;
  padding: 40px 24px 32px;
  overflow: hidden;
  font-family: var(--rt-pixel);
  color: #fff;
  text-align: center;
  animation: rt-nf-screen-in 500ms steps(8) both;
}
@keyframes rt-nf-screen-in {
  from { opacity: 0; filter: brightness(2.5) blur(2px); }
}
/* scanlines + vignette over every screen */
.rt-nf-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}
.rt-nf-screen > * {
  position: relative;
  z-index: 1;
}
.rt-nf-stars {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 32% 72%, #c9d0f5, transparent),
    radial-gradient(1.5px 1.5px at 58% 26%, #fff, transparent),
    radial-gradient(1px 1px at 76% 64%, #c9d0f5, transparent),
    radial-gradient(1.5px 1.5px at 88% 12%, #ffad0a, transparent),
    radial-gradient(1px 1px at 22% 44%, #fff, transparent),
    radial-gradient(1px 1px at 66% 86%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 44% 8%, #45c4d7, transparent);
  background-size: 320px 320px;
  animation: rt-nf-stars 24s linear infinite;
  opacity: 0.8;
}
@keyframes rt-nf-stars {
  to { background-position: 0 320px; }
}
/* synthwave grid floor */
.rt-nf-grid {
  position: absolute !important;
  left: -20%;
  right: -20%;
  bottom: 0;
  height: 42%;
  z-index: 0 !important;
  background:
    linear-gradient(transparent 0, #0b1038 4%, transparent 40%),
    repeating-linear-gradient(90deg, rgba(102, 122, 250, 0.55) 0 2px, transparent 2px 60px),
    repeating-linear-gradient(0deg, rgba(102, 122, 250, 0.55) 0 2px, transparent 2px 34px);
  transform: perspective(240px) rotateX(58deg);
  transform-origin: bottom;
  animation: rt-nf-floor 1.2s linear infinite;
}
@keyframes rt-nf-floor {
  to { background-position: 0 0, 0 0, 0 34px; }
}
.rt-nf-title-kicker {
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #8fa0ff;
}
.rt-nf-logo {
  display: grid;
  gap: 8px;
  margin: 0;
  font-family: var(--rt-pixel);
  font-weight: 400;
  line-height: 1.1;
  animation: rt-nf-logo-in 900ms cubic-bezier(0.34, 1.56, 0.64, 1) both 150ms;
}
.rt-nf-logo span:first-child {
  font-size: 18px;
  color: #45c4d7;
}
.rt-nf-logo span:last-child {
  font-size: clamp(26px, 5vw, 40px);
  color: var(--rt-yellow-200);
  text-shadow: 3px 3px 0 #ff7a45, 6px 6px 0 #374cd2;
}
@keyframes rt-nf-logo-in {
  from { transform: translateY(-40px) scale(0.6); opacity: 0; }
}
.rt-nf-title-rovin {
  width: 92px;
  height: auto;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.35));
  animation: rt-nf-bob 1.6s ease-in-out infinite;
}
@keyframes rt-nf-bob {
  50% { transform: translateY(-8px) rotate(-2deg); }
}
.rt-nf-select-h {
  margin: 0 0 -8px;
  font-size: 9px;
  color: #45c4d7;
  text-transform: uppercase;
}
.rt-nf-hs-note {
  margin: -12px 0 18px;
  font-size: 8px;
  color: #8fa0ff;
}
.rt-nf-hs-other {
  display: block;
  width: 100%;
  margin: 0 0 14px;
}
.rt-nf-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.rt-nf-title-row .rt-nf-title-rovin {
  width: 64px;
}
.rt-nf-title-row .rt-nf-logo {
  text-align: left;
}
/* three arcade tiles: a little screen with pixel art, the game name, its tagline */
.rt-nf-select {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 600px;
}
.rt-nf-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px 8px 12px;
  border: 3px solid #2b3790;
  border-radius: 8px;
  background: #131b52;
  box-shadow: 4px 4px 0 #000;
  font-family: var(--rt-pixel);
  color: #aab4ec;
  text-align: center;
  cursor: pointer;
  transition: transform 80ms steps(2);
}
.rt-nf-tile-screen {
  position: relative;
  display: block;
  border: 2px solid #000;
  border-radius: 4px;
  overflow: hidden;
  filter: saturate(0.55) brightness(0.75);
  transition: filter 120ms steps(3);
}
.rt-nf-pixart {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.rt-nf-tile-1p {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 3px 4px 2px;
  background: #000;
  font-size: 7px;
  color: var(--rt-yellow-200);
  visibility: hidden;
  animation: rt-nf-blink-text 0.6s steps(1) infinite;
}
.rt-nf-tile-name {
  font-size: 10px;
  line-height: 1.5;
  text-transform: uppercase;
}
.rt-nf-tile small {
  font-family: "VT323", var(--rt-pixel);
  font-size: 17px;
  line-height: 1;
  color: #7f8bd6;
}
.rt-nf-tile:hover {
  transform: translate(-1px, -1px);
}
.rt-nf-tile:hover .rt-nf-tile-screen {
  filter: none;
}
.rt-nf-tile.is-on {
  border-color: var(--rt-yellow-200);
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000, 0 0 24px rgba(255, 173, 10, 0.35);
}
.rt-nf-tile.is-on .rt-nf-tile-screen {
  filter: none;
}
.rt-nf-tile.is-on .rt-nf-tile-1p {
  visibility: visible;
}
.rt-nf-tile.is-on small {
  color: #c9d0f5;
}
.rt-nf-tile:focus-visible,
.rt-nf-press-start:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}
@media (max-width: 599px) {
  /* phones: one tile per row, art beside the name */
  .rt-nf-select {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .rt-nf-tile {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 6px;
    align-items: center;
    padding: 6px;
    text-align: left;
  }
  .rt-nf-tile-screen {
    grid-row: span 2;
  }
  .rt-nf-tile-name {
    align-self: end;
  }
  .rt-nf-tile small {
    align-self: start;
  }
  .rt-nf-title-row .rt-nf-title-rovin {
    width: 52px;
  }
}
.rt-nf-press-start {
  margin-top: 4px;
  padding: 12px 18px;
  border: 0;
  background: none;
  font-family: var(--rt-pixel);
  font-size: 14px;
  color: var(--rt-yellow-200);
  text-transform: uppercase;
  cursor: pointer;
  animation: rt-nf-blink-text 1s steps(1) infinite;
}
.rt-nf-press-start:hover {
  animation: none;
  color: #fff;
}
/* story: Rovin's dialogue box, then how to play */
.rt-nf-story-screen {
  gap: 22px;
}
.rt-nf-dialog {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  text-align: left;
}
.rt-nf-dialog-face {
  flex: none;
  width: 64px;
  height: auto;
  padding: 6px;
  border: 3px solid #fff;
  border-radius: 6px;
  background: #e5e9ff;
  animation: rt-nf-bob 1.6s ease-in-out infinite;
}
.rt-nf-dialog-box {
  flex: 1;
  padding: 14px 16px;
  border: 3px solid #fff;
  border-radius: 6px;
  background: #131b52;
  box-shadow: 5px 5px 0 #000;
}
.rt-nf-dialog-name {
  margin: 0 0 8px;
  font-size: 9px;
  color: var(--rt-yellow-200);
}
.rt-nf-dialog-text {
  margin: 0;
  font-size: 10px;
  line-height: 1.9;
}
.rt-nf-caret {
  animation: rt-nf-blink-text 0.5s steps(1) infinite;
}
.rt-nf-how {
  width: 100%;
  max-width: 520px;
  text-align: left;
  opacity: 0;
  transition: opacity 300ms steps(4);
}
.rt-nf-how.is-on {
  opacity: 1;
}
.rt-nf-how-h {
  margin: 0 0 10px;
  font-size: 11px;
  color: #45c4d7;
}
.rt-nf-how ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rt-nf-how li {
  position: relative;
  padding-left: 22px;
  font-size: 9px;
  line-height: 1.8;
  color: #e5e9ff;
}
.rt-nf-how li::before {
  content: "★";
  position: absolute;
  left: 0;
  color: var(--rt-yellow-200);
}
.rt-nf-how.is-on li {
  animation: rt-nf-li 300ms steps(5) both;
}
@keyframes rt-nf-li {
  from { opacity: 0; transform: translateX(-12px); }
}
/* countdown and level banners over the game */
.rt-nf-countdown,
.rt-nf-splash {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(11, 16, 56, 0.55);
  pointer-events: none;
}
.rt-nf-countdown span {
  font-family: var(--rt-pixel);
  font-size: 72px;
  color: #fff;
  text-shadow: 5px 5px 0 #374cd2;
  animation: rt-nf-count 600ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.rt-nf-countdown span.is-go {
  color: var(--rt-yellow-200);
  text-shadow: 5px 5px 0 #ff7a45;
}
@keyframes rt-nf-count {
  from { transform: scale(2.4); opacity: 0; }
  60% { transform: scale(0.95); opacity: 1; }
}
.rt-nf-splash {
  animation: rt-nf-splash 1400ms steps(14) both;
}
.rt-nf-splash div {
  text-align: center;
  font-family: var(--rt-pixel);
}
.rt-nf-splash p {
  margin: 0 0 12px;
  font-size: 10px;
  color: #45c4d7;
  text-transform: uppercase;
}
.rt-nf-splash strong {
  font-size: 34px;
  font-weight: 400;
  color: var(--rt-yellow-200);
  text-shadow: 4px 4px 0 #ff7a45;
  text-transform: uppercase;
}
@keyframes rt-nf-splash {
  0% { opacity: 0; }
  15%, 80% { opacity: 1; }
  100% { opacity: 0; }
}
/* music + sound-effect toggles */
.rt-nf-mute {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 25;
  display: flex;
  gap: 6px;
}
.rt-nf-mute button {
  position: relative;
  min-width: 34px;
  padding: 6px 8px;
  border: 2px solid #8fa0ff;
  border-radius: 4px;
  background: #0b1038;
  font-family: var(--rt-pixel);
  font-size: 9px;
  line-height: 1.3;
  color: #fff;
  cursor: pointer;
}
.rt-nf-mute button.is-off {
  border-color: #3a4590;
  color: #5d68b0;
}
/* a pixel slash through a switched-off toggle */
.rt-nf-mute button.is-off::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 2px;
  background: #ff6b81;
  transform: rotate(-30deg);
}
.rt-nf-card.is-ready .rt-nf-mute,
.rt-nf-card.is-play .rt-nf-mute {
  top: 22px;
  right: 116px;
}
.rt-nf-card.is-ready .rt-nf-card-head,
.rt-nf-card.is-play .rt-nf-card-head {
  padding-right: 206px;
}
.rt-nf-card.is-ready .rt-nf-placeholder {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 3px),
    #131b52;
}
@media (max-width: 599px) {
  .rt-nf-card.is-ready .rt-nf-mute,
  .rt-nf-card.is-play .rt-nf-mute {
    top: 12px;
    right: 12px;
  }
  .rt-nf-card.is-ready .rt-nf-card-head,
  .rt-nf-card.is-play .rt-nf-card-head {
    padding-right: 92px;
  }
}

/* ---- Tablet / phone (layouts not in Figma) ---- */
@media (max-width: 959px) {
  .rt-nf-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}
@media (max-width: 599px) {
  .rt-nf {
    padding: 112px 16px 72px;
  }
  .rt-nf-home {
    width: 100%;
  }
  .rt-nf-card {
    margin: 0 -4px;
    padding: 14px;
    border-radius: 20px;
  }
  .rt-nf-card-head {
    padding: 0 0 12px;
    min-height: 0;
  }
  .rt-nf-rovin {
    width: 60px;
  }
  .rt-nf-next {
    position: static;
    align-self: center;
    margin: 14px auto 0;
    display: flex;
  }
  .rt-nf-card-title h2 {
    font-size: 12px;
  }
  .rt-nf-hud {
    font-size: 8px;
    padding: 10px;
  }
  .rt-nf-screen {
    min-height: 560px;
    padding: 36px 16px 24px;
  }
  .rt-nf-dialog-face {
    width: 52px;
  }
  .rt-nf-countdown span {
    font-size: 54px;
  }
  .rt-nf-card .rt-nf-btn {
    font-size: 9px;
  }
  .rt-nf-actions {
    gap: 12px;
  }
  .rt-nf-actions .rt-nf-btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rt-nf * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---- Lasso (Zone Defense): corners like Routific's lasso tool ---- */
.rt-nf-corner {
  fill: #fff;
  stroke: currentColor;
  stroke-width: 2.5;
  cursor: move;
}
.rt-nf-corner.is-first {
  fill: currentColor;
  stroke: #fff;
  cursor: pointer;
  animation: rt-nf-blink-text 0.8s steps(1) infinite;
}
.rt-nf-picked {
  animation: rt-nf-blink-text 0.8s steps(1) infinite;
}
.rt-nf-lassobar {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 20px);
  padding: 6px 6px 6px 12px;
  border: 3px solid var(--rt-navy);
  border-radius: 6px;
  background: #0b1038;
  box-shadow: 3px 3px 0 #000;
  font-family: "VT323", var(--rt-pixel);
  font-size: 19px;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
  transform: translateX(-50%);
}
.rt-nf-lassobar span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-nf-lassobar button {
  flex: none;
  padding: 7px 10px;
  border: 2px solid #fff;
  border-radius: 4px;
  background: transparent;
  font-family: var(--rt-pixel);
  font-size: 9px;
  color: #fff;
  text-transform: uppercase;
  cursor: pointer;
}
.rt-nf-lassobar button.is-ok {
  border-color: var(--rt-yellow-200);
  background: var(--rt-yellow-200);
  color: var(--rt-navy);
}
.rt-nf-lassobar button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ---- In-game skin: the same navy arcade cabinet as the title screens (not in Figma) ---- */
.rt-nf-card:is(.is-play, .is-ready) {
  --rt-term: "VT323", ui-monospace, monospace;
  background: #0b1038;
  color: #e5e9ff;
  overflow: hidden;
}
.rt-nf-card:is(.is-play, .is-ready)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  border-radius: inherit;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.07) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 70%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-rovin {
  padding: 6px 8px 4px;
  border: 3px solid #fff;
  border-radius: 6px;
  background: #e5e9ff;
  box-shadow: 3px 3px 0 #000;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-card-title h2 {
  color: #fff;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-card-title .rt-nf-how-line {
  font-family: var(--rt-term);
  font-size: 20px;
  line-height: 1.1;
  color: #aab4ec;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-hud {
  border: 2px solid #2b3790;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-next,
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-mute button:not(.is-off) {
  border-color: #fff;
  background: #131b52;
  color: #fff;
  box-shadow: 3px 3px 0 #000;
}
/* the map / app is a screen inside the cabinet */
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-svg {
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow: 4px 4px 0 #000;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-levels span {
  border: 2px solid #2b3790;
  background: #131b52;
  color: #7f8bd6;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-levels .is-on {
  border-color: var(--rt-yellow-200);
  background: var(--rt-yellow-200);
  color: var(--rt-navy);
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-levels .is-done {
  border-color: #3ee08f;
  background: #0f3b2c;
  color: #3ee08f;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-levels .rt-nf-target {
  border: 0;
  background: none;
  color: #aab4ec;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-status {
  font-family: var(--rt-term);
  font-size: 22px;
  line-height: 1.15;
  color: #e5e9ff;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-status strong {
  font-weight: 400;
  color: var(--rt-yellow-200);
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-good,
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-meters .is-good b {
  color: #3ee08f;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-bad,
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-status strong.rt-nf-bad,
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-meters .is-bad b {
  color: #ff6b81;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-mission {
  border-color: var(--rt-yellow-200);
  background: #131b52;
  color: #fff;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-mission b {
  background: var(--rt-yellow-200);
  color: var(--rt-navy);
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-reallife {
  border: 3px solid #fff;
  border-radius: 6px;
  background: #131b52;
  box-shadow: 4px 4px 0 #000;
  font-family: var(--rt-term);
  font-size: 21px;
  line-height: 1.15;
  color: #e5e9ff;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-reallife strong {
  font-weight: 400;
  color: var(--rt-yellow-200);
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-meters div {
  border: 2px solid #2b3790;
  background: #131b52;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-meters b {
  color: #fff;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-meters span {
  font-family: var(--rt-term);
  font-size: 18px;
  font-weight: 400;
  color: #aab4ec;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-crew-chip {
  border-color: var(--c);
  background: #131b52;
  box-shadow: 3px 3px 0 #000;
  color: #fff;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-crew-chip.is-on {
  background: var(--c);
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-crew-name {
  font-family: var(--rt-pixel);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.6;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-crew-chip small {
  font-family: var(--rt-term);
  font-size: 17px;
  line-height: 1;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-crew-dot {
  box-shadow: 0 0 0 2px #0b1038;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-turfs {
  border-color: var(--rt-navy);
  font-family: var(--rt-pixel);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.4;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-btn-ghost {
  border-color: #fff;
  background: #131b52;
  color: #fff;
  box-shadow: 4px 4px 0 #000;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-btn-primary,
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-btn-power {
  box-shadow: 4px 4px 0 #000;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-btn:disabled {
  opacity: 1;
  border-color: #3a4590;
  background: #131b52;
  box-shadow: none;
  color: #5d68b0;
}
@media (max-width: 599px) {
  .rt-nf-card:is(.is-play, .is-ready) .rt-nf-status {
    font-size: 20px;
  }
  .rt-nf-card:is(.is-play, .is-ready) .rt-nf-crew-name {
    font-size: 9px;
  }
  .rt-nf-lassobar {
    font-size: 17px;
  }
}


/* ---- Design pass (playtest feedback): pixel Rovin, speech bubble, page pieces, van, phone layout ---- */
.rt-nf-sprite {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.rt-nf-arrow {
  display: inline-block;
  width: 0.6em;
  height: 0.84em;
  margin-left: 0.35em;
  vertical-align: -0.05em;
}
.rt-nf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Rovin's one-liners: a speech bubble where the how-to line was */
.rt-nf-saybox {
  position: relative;
}
.rt-nf-how-line.is-hidden {
  visibility: hidden;
}
.rt-nf-card-title .rt-nf-bubble {
  position: absolute;
  left: 6px;
  top: -2px;
  z-index: 15;
  max-width: calc(100% - 6px);
  margin: 0;
  padding: 6px 10px 5px;
  border: 2px solid #fff;
  border-radius: 4px;
  background: #fff;
  box-shadow: 3px 3px 0 #000;
  font-family: "VT323", var(--rt-pixel);
  font-size: 20px;
  line-height: 1.05;
  color: var(--rt-navy);
  animation: rt-nf-bubble-in 200ms steps(3) both;
}
.rt-nf-card-title .rt-nf-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  border: 4px solid transparent;
  border-right-color: #fff;
  border-top-color: #fff;
}
@keyframes rt-nf-bubble-in {
  from { opacity: 0; transform: translateX(-6px) scale(0.9); }
}
/* pop-ups sit just under the HUD, above the map, one after another */
.rt-nf-pops {
  top: 4px;
}
/* the level row keeps only its target (the HUD shows the level) */
.rt-nf-levels span:not(.rt-nf-target) {
  display: none;
}
.rt-nf-levels .rt-nf-target {
  margin-left: 0;
  padding-left: 2px;
}
/* countdown: the board waits, dimmed, and its stops drop in */
.rt-nf-card.is-ready .rt-nf-game-body {
  pointer-events: none;
}
.rt-nf-card.is-ready .rt-nf-actions,
.rt-nf-card.is-ready .rt-nf-status {
  visibility: hidden;
}
.rt-nf-drop {
  animation: rt-nf-drop 360ms steps(4) both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
@keyframes rt-nf-drop {
  0% { transform: translateY(-26px); opacity: 0; }
  60% { transform: translateY(3px); opacity: 1; }
  100% { transform: none; }
}
.rt-nf-card.is-play .rt-nf-drop {
  animation: none;
}
/* the van's ✓ per stop */
.rt-nf-tick {
  font-family: var(--rt-pixel);
  font-size: 11px;
  fill: #3ee08f;
  stroke: #0b1038;
  stroke-width: 3px;
  paint-order: stroke;
  text-anchor: middle;
  opacity: 0;
  animation: rt-nf-tick 900ms steps(6) both;
}
@keyframes rt-nf-tick {
  0% { opacity: 0; transform: translateY(6px); }
  20% { opacity: 1; transform: none; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-8px); }
}
/* boot: hide the toggles while the CRT warms up; a white flash, then a dark screen */
.rt-nf-card.is-boot .rt-nf-mute {
  visibility: hidden;
}

/* title */
.rt-nf-title-row .rt-nf-title-rovin {
  width: 60px;
  flex: none;
}
.rt-nf-tile-piece {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
}
.rt-nf-page {
  display: block;
  width: 100%;
  height: auto;
}
.rt-nf-tile-piece .rt-nf-page:not(.is-found) {
  opacity: 0.8;
}
.rt-nf-pieces {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 -8px;
  font-size: 9px;
  color: #aab4ec;
}
.rt-nf-pieces .rt-nf-page {
  width: 18px;
}
.rt-nf-pieces span {
  margin-left: 4px;
}
/* story: the box keeps its final height (no jump while typing), clear of the toggles */
.rt-nf-story-screen {
  justify-content: flex-start;
  padding-top: 64px;
}
.rt-nf-dialog {
  align-items: flex-start;
}
.rt-nf-dialog-face {
  width: 72px;
  padding: 6px 8px 4px;
}
.rt-nf-ghost {
  visibility: hidden;
}
/* power-up and draw buttons in the arcade palette */
.rt-nf-card .rt-nf-btn-power {
  border-color: var(--rt-navy);
  background: #ff7a45;
  color: #fff;
  animation: rt-nf-power 1.2s steps(2) infinite;
}
@keyframes rt-nf-power {
  50% { background: #ff9a6b; }
}
/* high scores: Rovin cheers, the page pieces, a trial link */
.rt-nf-hs {
  overflow-y: auto;
}
.rt-nf-hs-rovin {
  width: 56px;
  margin: 0 auto 10px;
  animation: rt-nf-hop 700ms cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}
.rt-nf-hs-pieces {
  margin: 0 0 16px;
}
.rt-nf-hs-pieces p {
  margin: 0 0 8px;
  font-size: 9px;
  color: #3ee08f;
}
.rt-nf-hs-pieces span {
  display: inline-flex;
  gap: 8px;
}
.rt-nf-hs-pieces .rt-nf-page {
  width: 24px;
}
.rt-nf-hs-h {
  animation: rt-nf-blink-yw 0.9s steps(1) infinite;
}
@keyframes rt-nf-blink-yw {
  50% { color: #fff; }
}
.rt-nf-hs-form input:placeholder-shown {
  animation: rt-nf-blink-text 0.8s steps(1) infinite;
}
.rt-nf-hs-other small {
  display: block;
  margin-bottom: 6px;
  font-size: 7px;
  opacity: 0.8;
}
a.rt-nf-hs-other {
  text-decoration: none;
  margin-bottom: 10px;
}
.rt-nf-hs-trial {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--rt-pixel);
  font-size: 9px;
  color: var(--rt-yellow-200);
  text-decoration: none;
}
.rt-nf-hs-trial:hover {
  color: #fff;
}
@media (max-width: 599px) {
  /* phones: a compact header (Rovin and the title; his bubble when he talks), a 2 × 2 HUD */
  .rt-nf-card:is(.is-play, .is-ready) .rt-nf-card-kicker,
  .rt-nf-card:is(.is-play, .is-ready) .rt-nf-how-line {
    display: none;
  }
  .rt-nf-card:is(.is-play, .is-ready) .rt-nf-card-head {
    align-items: center;
  }
  .rt-nf-rovin {
    width: 48px;
  }
  .rt-nf-card-title .rt-nf-bubble {
    font-size: 18px;
  }
  .rt-nf-hud {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
  }
  .rt-nf-hud span {
    display: flex;
    justify-content: space-between;
  }
  .rt-nf-story-screen {
    padding-top: 56px;
  }
  .rt-nf-dialog {
    flex-direction: column;
    align-items: stretch;
  }
  .rt-nf-dialog-face {
    width: 52px;
  }
}
@media (max-width: 519px) {
  .rt-nf-crew {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
/* the game's host on its title tile; Buzz's propeller spins */
.rt-nf-tile-host {
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 38px;
  padding: 3px;
  border: 2px solid #000;
  border-radius: 4px;
  background: #e5e9ff;
}
.rt-nf-prop {
  transform-box: fill-box;
  transform-origin: center;
  animation: rt-nf-spin 0.24s steps(2) infinite;
}
@keyframes rt-nf-spin {
  50% { transform: scaleX(0.5); }
}
.rt-nf-rovin.is-george {
  width: 88px;
}
@media (max-width: 599px) {
  .rt-nf-rovin.is-george {
    width: 58px;
  }
}
@media (max-width: 599px) {
  /* phones: Rovin talks over his game's title, clear of the HUD and the toggles */
  .rt-nf-card:is(.is-play, .is-ready) .rt-nf-card-head {
    position: relative;
  }
  .rt-nf-saybox {
    position: static;
  }
  .rt-nf-card-title .rt-nf-bubble {
    left: 62px;
    right: 92px;
    top: 0;
    max-width: none;
  }
  .rt-nf-card-title .rt-nf-bubble::before {
    top: 12px;
  }
}

/* ---- Beta feedback: an obvious way into the game, a longer boot, Zone Defense's toolbar ---- */
.rt-nf-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.rt-nf-playbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rt-nf-playbtn svg {
  width: 18px;
  height: 18px;
}
/* the illustration always says it's playable: a pixel "Play" button that bobs, a pulsing ring */
.rt-nf-art {
  cursor: pointer;
}
.rt-nf-art .rt-nf-play {
  /* on the floor, under Rovin and the cabinet, clear of the open drawer. Centred with margins, not a
     -50% translate: Safari keeps a percentage transform from before the pixel font loads (the
     button is narrower then), which left it off-centre until tapped */
  bottom: -1%;
  left: 0;
  right: 0;
  width: max-content;
  margin: 0 auto;
  opacity: 1;
  transform: none;
  border: 3px solid var(--rt-navy, #131b52);
  border-radius: 8px;
  animation: rt-nf-play-bob 1.6s ease-in-out infinite;
}
.rt-nf-art .rt-nf-play::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 8px;
  border: 3px solid var(--rt-yellow-200);
  animation: rt-nf-play-ring 1.6s ease-out infinite;
  pointer-events: none;
}
@keyframes rt-nf-play-bob {
  50% { transform: translateY(-6px); }
}
@keyframes rt-nf-play-ring {
  0% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25, 1.6); }
}
.rt-nf-art:hover .rt-nf-play,
.rt-nf-art:focus-visible .rt-nf-play {
  animation: none;
  transform: translateY(-4px) scale(1.06);
}
/* boot: CRT flash, then the arcade's self-test, then the title */
.rt-nf-boot {
  min-height: 520px;
  cursor: pointer;
}
.rt-nf-boot-text {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  padding: 0 12%;
  font-family: var(--rt-pixel);
  font-size: 10px;
  line-height: 1.6;
  color: #c9d0f5;
}
.rt-nf-boot-text p {
  margin: 0;
  opacity: 0;
  animation: rt-nf-boot-line 2600ms steps(1) both;
}
.rt-nf-boot-text p:first-child {
  font-size: 15px;
  color: #fff;
  text-shadow: 2px 0 0 #ff2a6d, -2px 0 0 #05d9e8;
  animation-delay: 0ms;
}
.rt-nf-boot-text p:nth-child(2) {
  margin-bottom: 14px;
  font-size: 8px;
  color: #7f8bd6;
}
@keyframes rt-nf-boot-line {
  0%, 38% { opacity: 0; }
  39%, 100% { opacity: 1; }
}
.rt-nf-boot-l1 {
  animation-name: rt-nf-boot-l1 !important;
}
.rt-nf-boot-l2 {
  animation-name: rt-nf-boot-l2 !important;
}
.rt-nf-boot-l3 {
  animation-name: rt-nf-boot-l3 !important;
}
@keyframes rt-nf-boot-l1 {
  0%, 52% { opacity: 0; }
  53%, 100% { opacity: 1; }
}
@keyframes rt-nf-boot-l2 {
  0%, 64% { opacity: 0; }
  65%, 100% { opacity: 1; }
}
@keyframes rt-nf-boot-l3 {
  0%, 76% { opacity: 0; }
  77%, 100% { opacity: 1; }
}
.rt-nf-boot-bar {
  width: 100%;
  max-width: 320px;
  height: 12px;
  margin-top: 8px;
  padding: 2px;
  border: 2px solid #c9d0f5;
  opacity: 0;
  animation: rt-nf-boot-line 2600ms steps(1) both;
}
.rt-nf-boot-bar span {
  display: block;
  height: 100%;
  background: var(--rt-yellow-200);
  transform-origin: left;
  animation: rt-nf-boot-fill 2600ms steps(12) both;
}
@keyframes rt-nf-boot-fill {
  0%, 40% { transform: scaleX(0); }
  92%, 100% { transform: scaleX(1); }
}
/* Zone Defense: the lasso's toolbar under the map */
.rt-nf-zbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin-top: 10px;
  padding: 6px 8px 6px 12px;
  border: 2px solid #2b3790;
  border-radius: 6px;
  background: #131b52;
  font-family: "VT323", var(--rt-pixel);
  font-size: 19px;
  line-height: 1.05;
  color: #fff;
}
.rt-nf-zbar > span {
  flex: 1 1 auto;
}
.rt-nf-zbar-hint {
  color: #aab4ec;
}
.rt-nf-zbar button {
  flex: none;
  padding: 7px 10px;
  border: 2px solid #fff;
  border-radius: 4px;
  background: transparent;
  font-family: var(--rt-pixel);
  font-size: 9px;
  color: #fff;
  text-transform: uppercase;
  cursor: pointer;
}
.rt-nf-zbar button.is-ok {
  border-color: var(--rt-yellow-200);
  background: var(--rt-yellow-200);
  color: var(--rt-navy);
}
.rt-nf-zbar button:disabled {
  opacity: 0.4;
  cursor: default;
}
.rt-nf-zbar .rt-nf-zbar-driver {
  border-color: var(--c);
  background: var(--c);
  box-shadow: 2px 2px 0 #000;
}
.rt-nf-zbar .rt-nf-zbar-x {
  margin-left: auto;
}
.rt-nf-zstop {
  cursor: grab;
}
.rt-nf-zones.is-dragging,
.rt-nf-zones.is-dragging .rt-nf-zstop {
  cursor: grabbing;
}
.rt-nf-zstop.is-lifted {
  opacity: 0.35;
}
.rt-nf-ztag-xl {
  font-family: var(--rt-pixel);
  font-size: 7.5px;
  fill: #ffad0a;
}
/* a driver's tags: the same badges as on the stops, on the chip's top-right corner */
.rt-nf-crew-chip {
  position: relative;
}
.rt-nf-crew-tags {
  position: absolute;
  top: -10px;
  right: -8px;
  z-index: 1;
  display: flex;
  gap: 2px;
}
.rt-nf-crew-tags svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(2px 2px 0 #000);
}
.rt-nf-crew-tag {
  margin-left: 6px;
  padding: 0 4px;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 0.9em;
}
.rt-nf-crew-tag.is-cold {
  color: #7fd6ff;
}
.rt-nf-crew-tag.is-xl {
  color: #ffad0a;
}

/* locked tiles: games unlock in order */
.rt-nf-tile.is-locked {
  cursor: not-allowed;
  color: #5d68b0;
}
.rt-nf-tile.is-locked .rt-nf-tile-screen > :not(.rt-nf-tile-lock) {
  filter: grayscale(1) brightness(0.45);
}
.rt-nf-tile.is-locked:hover {
  transform: none;
}
.rt-nf-tile-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.rt-nf-tile-lock .rt-nf-lock {
  width: 30px;
  height: auto;
  filter: drop-shadow(2px 2px 0 #000);
}
/* You vs Routific: two cards, click one to show that plan on the map */
.rt-nf-vs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.rt-nf-vs-side {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 3px solid #2b3790;
  border-radius: 6px;
  background: #131b52;
  box-shadow: 3px 3px 0 #000;
  font-family: var(--rt-pixel);
  color: #aab4ec;
  text-align: center;
  cursor: pointer;
  transition: transform 80ms steps(2);
}
.rt-nf-vs-side small {
  font-size: 8px;
  text-transform: uppercase;
}
.rt-nf-vs-side b {
  font-weight: 400;
  font-size: 13px;
  color: #fff;
}
.rt-nf-vs-side.is-you.is-on {
  border-color: #9a6bff;
  background: #2c1f6b;
}
.rt-nf-vs-side.is-routific.is-on {
  border-color: #3ee08f;
  background: #0f3b2c;
}
.rt-nf-vs-side.is-on {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #000;
}
.rt-nf-vs-side.is-on small {
  color: #fff;
}
/* the side you're not looking at invites a click */
.rt-nf-vs-side:not(.is-on) {
  animation: rt-nf-vs-hint 1.4s steps(2) infinite;
}
@keyframes rt-nf-vs-hint {
  50% { border-color: #5d68b0; }
}
.rt-nf-vs-mid {
  font-family: var(--rt-pixel);
  font-size: 14px;
  color: var(--rt-yellow-200);
  text-shadow: 2px 2px 0 #ff2a6d;
}
/* Routific's route, when it's the one on the map: solid and clear */
.rt-nf-best {
  stroke: #1d9a63;
  stroke-width: 4;
  stroke-dasharray: none;
  opacity: 1;
}
@media (max-width: 599px) {
  .rt-nf-vs-side b {
    font-size: 11px;
  }
}
/* ---- End credits: the cast and the Routicians as pixel portraits, rolling up ---- */
.rt-nf-credits {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  border-radius: 11px;
  background: #0b1038;
  font-family: var(--rt-pixel);
  color: #fff;
  text-align: center;
  animation: rt-nf-in 400ms steps(6) both;
}
.rt-nf-cr-roll {
  position: relative;
  z-index: 1;
  padding: 0 24px;
  transform: translateY(var(--from, 100%));
}
.rt-nf-cr-roll.is-rolling {
  animation: rt-nf-cr-roll var(--secs, 60s) linear forwards;
}
.rt-nf-cr-roll.is-ended {
  animation: none;
  transform: translateY(var(--to, 0));
}
@keyframes rt-nf-cr-roll {
  from { transform: translateY(var(--from)); }
  to { transform: translateY(var(--to)); }
}
.rt-nf-cr-title {
  margin: 0 0 40px;
  font-size: 18px;
  line-height: 1.5;
  color: var(--rt-yellow-200);
  text-shadow: 3px 3px 0 #ff2a6d;
}
.rt-nf-cr-h {
  margin: 0 0 22px;
  font-size: 10px;
  color: #45c4d7;
  text-transform: uppercase;
}
.rt-nf-cr-cast {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 56px;
}
.rt-nf-cr-cast > div {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 110px;
}
.rt-nf-cr-cast .rt-nf-sprite {
  width: 64px;
  height: 64px;
}
.rt-nf-cr-cast b,
.rt-nf-cr-person b {
  font-weight: 400;
  font-size: 10px;
  line-height: 1.4;
}
.rt-nf-cr-cast small,
.rt-nf-cr-person small {
  font-family: "VT323", var(--rt-pixel);
  font-size: 17px;
  line-height: 1;
  color: #aab4ec;
}
.rt-nf-cr-team {
  margin-bottom: 48px;
}
.rt-nf-cr-team-h {
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--rt-yellow-200);
}
.rt-nf-cr-people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 26px 16px;
}
.rt-nf-cr-person {
  display: grid;
  justify-items: center;
  gap: 8px;
}
.rt-nf-cr-face {
  width: 72px;
  height: 72px;
  border: 3px solid #fff;
  border-radius: 4px;
  background: #c9d0f5;
  box-shadow: 4px 4px 0 #000;
  image-rendering: pixelated;
}
.rt-nf-cr-end {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 40px 0 0;
}
.rt-nf-cr-end .rt-nf-sprite {
  width: 72px;
  animation: rt-nf-hop 700ms cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}
.rt-nf-cr-end .rt-nf-cr-title {
  margin: 0;
}
.rt-nf-cr-sub {
  margin: 0;
  font-family: "VT323", var(--rt-pixel);
  font-size: 21px;
  color: #c9d0f5;
}
.rt-nf-cr-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  visibility: hidden;
  opacity: 0;
  transition: opacity 300ms steps(4);
}
.rt-nf-cr-actions.is-on {
  visibility: visible;
  opacity: 1;
}
.rt-nf-cr-actions a {
  text-decoration: none;
}
.rt-nf-cr-skip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 6px 10px;
  border: 2px solid #8fa0ff;
  border-radius: 4px;
  background: #0b1038;
  font-family: var(--rt-pixel);
  font-size: 9px;
  color: #c9d0f5;
  cursor: pointer;
}
.rt-nf-title-credits {
  margin-left: 10px;
  padding: 3px 6px;
  border: 2px solid #8fa0ff;
  border-radius: 4px;
  background: none;
  font-family: var(--rt-pixel);
  font-size: 8px;
  color: #c9d0f5;
  cursor: pointer;
}
@media (max-width: 599px) {
  .rt-nf-cr-cast {
    gap: 8px;
  }
  .rt-nf-cr-cast > div {
    width: 96px;
  }
  .rt-nf-cr-people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rt-nf-cr-face {
    width: 60px;
    height: 60px;
  }
}

/* ---- The page goes dark when a game opens (Navbar + Footer follow via setPageTheme) ---- */
/* a navy layer fades in over the light background (gradients can't be transitioned themselves) */
.rt-nf {
  position: relative;
  isolation: isolate;
}
.rt-nf::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(60% 50% at 80% 20%, rgba(102, 122, 250, 0.18), transparent 70%), #0b1040;
  opacity: 0;
  transition: opacity 1200ms ease;
  pointer-events: none;
}
.rt-nf.is-playing::before {
  opacity: 1;
}
.rt-nf-h1,
.rt-nf-text,
.rt-nf-eyebrow {
  transition: color 1200ms ease;
}
.rt-nf.is-playing .rt-nf-h1 {
  color: #fff;
}
.rt-nf.is-playing .rt-nf-text {
  color: #c9d0f5;
}
.rt-nf.is-playing .rt-nf-eyebrow {
  color: #8fa0ff;
}
.rt-nf.is-playing .rt-nf-card {
  border-color: #2b3790;
  box-shadow: 8px 8px 0 #000, 0 0 60px rgba(102, 122, 250, 0.25);
}
/* high scores: share with friends */
.rt-nf-share {
  margin-top: 20px;
}
.rt-nf-share p {
  margin: 0 0 10px;
  font-size: 8px;
  color: #8fa0ff;
  text-transform: uppercase;
}
.rt-nf-share > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.rt-nf-share-btn {
  padding: 7px 10px;
  border: 2px solid #8fa0ff;
  border-radius: 4px;
  background: transparent;
  font-family: var(--rt-pixel);
  font-size: 8px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.rt-nf-share-btn:hover {
  border-color: var(--rt-yellow-200);
  color: var(--rt-yellow-200);
}

/* the last level is won: a bar under the card's head, the result stays visible */
.rt-nf-cleared {
  position: sticky;
  bottom: 12px;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 10px 12px 10px 16px;
  border: 3px solid var(--rt-yellow-200);
  border-radius: 8px;
  background: #131b52;
  box-shadow: 5px 5px 0 #000;
  font-family: var(--rt-pixel);
  animation: rt-nf-in 400ms steps(6) both;
}
.rt-nf-cleared span {
  font-size: 12px;
  color: var(--rt-yellow-200);
  animation: rt-nf-blink-yw 0.9s steps(1) infinite;
}

/* a shared score's challenge, under the copy */
.rt-nf-challenge {
  display: inline-block;
  margin: 18px 0 0;
  padding: 12px 16px;
  border: 3px solid var(--rt-navy, #131b52);
  border-radius: 8px;
  background: #fff3d6;
  box-shadow: 4px 4px 0 var(--rt-navy, #131b52);
  font-family: var(--rt-font-heading);
  font-weight: 600;
  font-size: 17px;
  color: var(--rt-navy, #131b52);
}
.rt-nf.is-playing .rt-nf-challenge {
  border-color: var(--rt-yellow-200);
  background: #131b52;
  color: #fff;
}
.rt-nf-hs-vs {
  margin: -10px 0 18px;
  font-size: 9px;
  line-height: 1.7;
  color: #c9d0f5;
}
.rt-nf-hs-vs.is-win {
  color: #3ee08f;
}
.rt-nf-share-note {
  min-height: 1.4em;
  margin: 8px 0 0 !important;
  color: #3ee08f !important;
  text-transform: none !important;
}

/* title screen: every game's high scores */
.rt-nf-boards {
  z-index: 26;
}
.rt-nf-boards-box {
  width: 100%;
  max-width: 620px;
  font-family: var(--rt-pixel);
  color: #fff;
  text-align: center;
}
.rt-nf-boards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.rt-nf-boards-grid section {
  padding: 12px 10px;
  border: 3px solid #2b3790;
  border-radius: 6px;
  background: #131b52;
}
.rt-nf-boards-grid section.is-locked {
  opacity: 0.55;
}
.rt-nf-boards-title {
  margin: 0 0 12px;
  font-size: 9px;
  color: var(--rt-yellow-200);
  text-transform: uppercase;
}
.rt-nf-boards-note {
  margin: 18px 0;
  font-family: "VT323", var(--rt-pixel);
  font-size: 18px;
  color: #aab4ec;
}
.rt-nf-boards .rt-nf-hs-list {
  margin: 0;
  font-size: 9px;
  max-height: calc(10.5 * 2.4em); /* side by side there's room for ten rows */
}
.rt-nf-boards .rt-nf-hs-list li {
  gap: 6px;
}
@media (max-width: 599px) {
  .rt-nf-boards-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  /* three tables stacked: four and a half rows each (the half row says "scroll"), so Back still fits */
  .rt-nf-boards .rt-nf-hs-list {
    max-height: calc(4.5 * 2.4em);
  }
}

/* real roads: the engine's steps, one after another */
.rt-nf-steps {
  display: grid;
  gap: 4px;
}
.rt-nf-steps span {
  color: #5d68b0;
}
.rt-nf-steps .is-done {
  color: #3ee08f;
}
.rt-nf-steps .is-on {
  color: #fff;
  animation: rt-nf-blink-text 0.8s steps(1) infinite;
}
/* your real road route draws itself while it's being plotted */
.rt-nf-road.is-plotting {
  stroke-dasharray: 1;
  animation: rt-nf-draw 1s ease forwards;
}

/* a driver's shift time on its own line, never cut off */
.rt-nf-crew-dot {
  grid-row: span 3;
}
.rt-nf-crew-chip small.rt-nf-crew-min {
  display: block;
  grid-column: 2;
}
@media (max-width: 599px) {
  .rt-nf-crew-chip small.rt-nf-crew-min {
    display: block;
  }
}

/* lives in the HUD */
.rt-nf-hud .rt-nf-lives {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: -4px 0;
}
.rt-nf-heart {
  display: block;
  width: 20px;
  height: 20px;
}
@media (max-width: 599px) {
  /* phones: the hearts get their own centred row under the 2 x 2 score grid */
  .rt-nf-hud .rt-nf-lives {
    grid-column: 1 / -1;
    justify-content: center;
    margin: 4px 0 0;
  }
  .rt-nf-heart {
    width: 22px;
    height: 22px;
  }
}
.rt-nf-cleared.is-over {
  border-color: #ff6b81;
}
.rt-nf-cleared.is-over span {
  color: #ff6b81;
}

/* Spaghetti Snarl's countdown */
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-levels .rt-nf-timer {
  margin-left: auto;
  font-size: 12px;
  color: #fff;
}
.rt-nf-card:is(.is-play, .is-ready) .rt-nf-levels .rt-nf-timer.is-low {
  color: #ff6b81;
  animation: rt-nf-blink-text 0.5s steps(1) infinite;
}

@media (max-width: 599px) {
  /* phones: Rovin's lines fit in two rows above the HUD */
  .rt-nf-card-title .rt-nf-bubble {
    padding: 4px 8px;
    font-size: 15px;
    line-height: 1;
  }
}

.rt-nf-hs-note.is-warn {
  margin-top: -8px;
  color: #ffad0a;
  line-height: 1.6;
}

