/* ui.css — menus, screens, HUD, toasts, touch controls. */

/* ---------------- generic screens ---------------- */

.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: max(2vh, 12px) max(3vw, 12px);
  animation: screen-in 0.35s ease;
}

.menu-gradient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(6, 11, 22, 0.55) 0%, rgba(6, 11, 22, 0.15) 35%,
      rgba(6, 11, 22, 0.15) 65%, rgba(6, 11, 22, 0.75) 100%);
}

.overlay-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 9, 18, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: screen-in 0.25s ease;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(1080px, 100%);
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.screen-header h2 {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 16px rgba(55, 182, 255, 0.5);
}

/* ================================================================= */
/* Main menu — one big rectangle                                      */
/* ================================================================= */

/*
 * The whole menu is a single framed panel over the live mountain. It is
 * deliberately translucent: `backdrop-filter` frosts what is behind it
 * rather than hiding it, so the game never stops being the backdrop to
 * its own menu. Everything below styles the inside of that frame.
 */

.menu-rect-screen {
  justify-content: center;
  overflow: hidden;               /* the rectangle fits; it never scrolls */
}

.menu-rect {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: min(1180px, 96vw);
  max-height: calc(100vh - 4vh);
  padding: 1rem 1.25rem 0.85rem;
  border-radius: 22px;
  overflow: hidden;

  /* Transparent by design — two stops of dark glass, not a solid fill. */
  background:
    linear-gradient(150deg, rgba(20, 34, 58, 0.58) 0%, rgba(8, 14, 26, 0.66) 100%);
  border: 1px solid rgba(127, 212, 255, 0.28);
  backdrop-filter: blur(16px) saturate(1.18);
  -webkit-backdrop-filter: blur(16px) saturate(1.18);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(55, 182, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: rect-in 0.55s cubic-bezier(.2,.9,.3,1.15) backwards;
}

@keyframes rect-in {
  from { opacity: 0; transform: translateY(26px) scale(0.965); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* A slow band of light travelling the frame, and a drifting inner glow.
   Both are decorative and must never eat a click. */
.rect-sheen, .rect-aura { position: absolute; pointer-events: none; }

.rect-sheen {
  inset: 0;
  background: linear-gradient(115deg, transparent 38%,
    rgba(255, 255, 255, 0.07) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: rect-sheen 9s ease-in-out 1.2s infinite;
}
@keyframes rect-sheen {
  0%       { transform: translateX(-120%); }
  38%, 100% { transform: translateX(120%); }
}

.rect-aura {
  inset: -30%;
  z-index: -1;
  background:
    radial-gradient(closest-side, rgba(55, 182, 255, 0.16), transparent 72%);
  animation: rect-aura 14s ease-in-out infinite;
}
@keyframes rect-aura {
  0%, 100% { transform: translate(-8%, -6%) scale(1); }
  50%      { transform: translate(8%, 6%) scale(1.18); }
}

/* ---------------- frame header ---------------- */

.rect-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex: none;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(127, 212, 255, 0.16);
  animation: menu-item-in 0.5s ease 0.06s backwards;
}

.rect-brand { min-width: 0; }
.rect-brand .game-title { font-size: clamp(1.3rem, 3.2vw, 2.3rem); }

.game-subtitle {
  color: var(--c-text-dim);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.72rem;
  margin-top: 0.25rem;
}

/* ---------------- three columns ---------------- */

.rect-body {
  display: grid;
  grid-template-columns: 1fr 1.06fr 1.12fr;
  gap: 0.8rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

.rect-col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  min-height: 0;
  /* A column that runs out of room scrolls inside its own pane. Without
     this a tall column overflows visibly and paints over its neighbour —
     `min-height: 0` alone only lets the box shrink, it does not contain
     what is inside it. The scrollbar itself is never drawn: the menu
     must read as cards, not as scrolling lists. */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: 0.7rem;
  border-radius: 14px;
  /* Each column is its own lighter pane of the same glass. */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(127, 212, 255, 0.13);
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
  animation: menu-item-in 0.5s ease backwards;
}
.rect-col::-webkit-scrollbar { display: none; }
.rect-col:hover {
  border-color: rgba(127, 212, 255, 0.3);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 40px rgba(55, 182, 255, 0.06);
}
.rect-body > .rect-col:nth-child(1) { animation-delay: 0.12s; }
.rect-body > .rect-col:nth-child(2) { animation-delay: 0.19s; }
.rect-body > .rect-col:nth-child(3) { animation-delay: 0.26s; }

.rect-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: none;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--c-accent-2);
  text-shadow: 0 0 12px rgba(55, 182, 255, 0.45);
}

/* ---------------- column 1 · rider ---------------- */

.player-card {
  padding: 0.75rem 0.85rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: none;
}

/* ---------------- nav links ---------------- */

.rect-links { display: flex; flex-direction: column; gap: 0.45rem; margin-top: auto; }
.rect-links.two { flex-direction: row; }
.rect-links.two .rect-link { flex: 1; }

.rect-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  padding: 0.6rem 0.85rem;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(.2,.9,.3,1.3),
    box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.rect-link.wide { justify-content: flex-start; }
.rect-link > span { font-size: 0.8rem; }

/* An accent rail that slides in from the leading edge on hover. */
.rect-link::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--c-accent);
  transform: scaleY(0);
  transform-origin: 50% 50%;
  transition: transform 0.22s cubic-bezier(.2,.9,.3,1.3);
}
.rect-link:hover:not(:disabled) {
  transform: translateX(4px);
  border-color: rgba(127, 212, 255, 0.5);
  background: linear-gradient(100deg, rgba(55, 182, 255, 0.16), rgba(16, 27, 47, 0.5));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 22px rgba(55, 182, 255, 0.28);
}
.rect-link:hover:not(:disabled)::after { transform: scaleY(1); }
.rect-link:active:not(:disabled) { transform: translateX(1px) scale(0.985); }

/* The leading emoji is the hover's punchline. */
.rect-link > :first-child {
  font-size: 1rem;
  transition: transform 0.24s cubic-bezier(.2,.9,.3,1.5);
}
.rect-link:hover:not(:disabled) > :first-child { transform: scale(1.2) rotate(-8deg); }

/* ---------------- column 2 · the hero button ---------------- */

/* PLAY breathes so the eye lands on it before anything else, and it takes
   whatever slack the column has rather than leaving a hole above the
   secondary buttons — the hero button being the biggest thing on the menu
   is the correct answer to spare space. */
.rect-col-play .btn-big {
  flex: 1 1 auto;
  min-height: 58px;
  max-height: 150px;
  background: linear-gradient(180deg, #2f9dff, #1668b8);
  border-color: rgba(200, 236, 255, 0.55);
  font-size: 1.35rem;
  padding: 0.85rem 1.4rem;
  animation: menu-item-in 0.5s ease 0.24s backwards,
    ride-glow 2.6s ease-in-out 0.9s infinite;
}
.rect-col-play .btn-big:hover:not(:disabled) { transform: translateY(-3px) scale(1.02); }

/* ---------------- frame footer ---------------- */

.rect-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: none;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(127, 212, 255, 0.14);
  animation: menu-item-in 0.5s ease 0.34s backwards;
}

.version { color: var(--c-text-dim); font-size: 0.72rem; }
.rect-foot-hint { font-size: 0.7rem; color: var(--c-gold); }

.player-card-row { display: flex; align-items: center; gap: 0.9rem; }

/* ---------------- rider identity ---------------- */

/*
 * The rider card shows the level badge and progression only — identity is
 * local to this device, so there is no avatar or external profile here.
 */

.setting-hint { font-size: 0.72rem; color: var(--c-text-dim); align-self: center; }

/* Profile → weekly board empty state. */
.friends-empty {
  padding: 1.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  color: var(--c-text-dim);
  font-size: 0.88rem;
}

.friends-empty-icon { font-size: 2rem; }

.player-level-badge {
  width: 46px; height: 46px;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #2f9dff, #124b86);
  box-shadow: 0 0 18px rgba(55, 182, 255, 0.6);
}

.player-card-info { flex: 1; }
.player-card-name { font-size: 0.8rem; color: var(--c-text-dim); letter-spacing: 0.1em; text-transform: uppercase; }

.xp-bar {
  height: 7px;
  margin: 0.35rem 0;
  border-radius: 4px;
  background: rgba(127, 212, 255, 0.14);
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-accent), #9be8ff);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.xp-label { font-size: 0.72rem; color: var(--c-text-dim); }

/* ---------------- garage ---------------- */

.garage-layout {
  width: min(1080px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.garage-layout h3 {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-bottom: 0.6rem;
}

.rider-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.rp-helmet { width: 22px; height: 14px; border-radius: 50% 50% 4px 4px; }
.rp-suit { width: 26px; height: 34px; border-radius: 7px; }

.board-preview {
  width: 64px; height: 12px;
  border-radius: 7px;
}

/* ---------------- profile ---------------- */

.tabs { display: flex; gap: 0.4rem; margin-left: auto; }

.tab {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--c-text-dim);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.tab.selected {
  color: var(--c-text);
  border-color: rgba(127, 212, 255, 0.4);
  background: rgba(31, 68, 116, 0.55);
}

.profile-body { width: min(1080px, 100%); }

.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.7rem;
}

.ach-card { padding: 0.8rem 0.9rem; opacity: 0.75; }
.ach-card.done { opacity: 1; border-color: rgba(255, 209, 102, 0.5); }
.ach-head { display: flex; gap: 0.4rem; align-items: baseline; font-size: 0.9rem; }
.ach-xp { margin-left: auto; font-size: 0.72rem; color: var(--c-gold); }
.ach-desc { font-size: 0.78rem; color: var(--c-text-dim); margin: 0.3rem 0 0.5rem; }
.ach-bar { height: 5px; border-radius: 3px; background: rgba(127, 212, 255, 0.13); overflow: hidden; }
.ach-bar-fill { height: 100%; background: var(--c-gold); border-radius: 3px; }

.stats-table { padding: 0.4rem 1rem; }
.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(127, 212, 255, 0.08);
  font-size: 0.9rem;
}
.stats-row:last-child { border-bottom: none; }
.stats-row span { color: var(--c-text-dim); }
.stats-head b { color: var(--c-accent-2); }

/* ---------------- settings & help ---------------- */

.settings-body, .help-body {
  width: min(560px, 100%);
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
}

.setting-row select, .setting-row input[type="range"] {
  accent-color: var(--c-accent);
  background: #16263f;
  color: var(--c-text);
  border: 1px solid var(--c-panel-border);
  border-radius: 6px;
  padding: 0.3rem;
}

.setting-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--c-accent); }

.setting-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.4rem; }

.help-grid { display: flex; flex-direction: column; gap: 0.55rem; font-size: 0.9rem; }
.help-grid b { color: var(--c-accent-2); }
.help-tip { color: var(--c-text-dim); font-size: 0.85rem; line-height: 1.5; }

/* ---------------- pause & results ---------------- */

.pause-panel, .results-panel {
  padding: 1.6rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-width: min(360px, 88vw);
  max-height: 88vh;
  overflow-y: auto;
  text-align: center;
}

.pause-panel h2, .results-panel h2 {
  font-family: var(--font-display);
  font-style: italic;
  letter-spacing: 0.06em;
}

.results-medal .medal-big { font-size: 3rem; animation: medal-pop 0.7s ease; display: inline-block; }

.results-rows { display: flex; flex-direction: column; gap: 0.35rem; }
.results-row {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(127, 212, 255, 0.08);
}
.results-row span { color: var(--c-text-dim); }
.results-row b { color: var(--c-text); }

.results-buttons { display: flex; gap: 0.7rem; justify-content: center; margin-top: 0.4rem; }

/* ---------------- session loading ---------------- */

#session-loading { z-index: 60; }

.session-loading-inner { text-align: center; max-width: 460px; padding: 1rem; }
.session-loading-inner h2 { font-family: var(--font-display); font-style: italic; }
.session-loading-inner p { color: var(--c-text-dim); margin-top: 0.5rem; }
.sl-tip { font-size: 0.85rem; }

.spinner {
  width: 38px; height: 38px;
  margin: 1.2rem auto;
  border: 3px solid rgba(127, 212, 255, 0.2);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

/* ---------------- HUD ---------------- */

#hud {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  font-family: var(--font-display);
}

#hud > * { position: absolute; }

.hud-topleft { top: max(2vh, 10px); left: max(2vw, 10px); }

.hud-mode { font-size: 0.8rem; color: var(--c-text-dim); letter-spacing: 0.1em; }

.hud-timer {
  font-size: 2rem;
  font-style: italic;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}

.hud-timer.urgent { color: var(--c-danger); animation: pulse 0.8s ease infinite; }

.hud-objective { font-size: 0.95rem; color: var(--c-gold); text-shadow: 0 1px 8px rgba(0,0,0,0.8); }

.hud-topcenter {
  top: max(2vh, 10px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.hud-score {
  font-size: 1.7rem;
  font-style: italic;
  text-shadow: 0 0 18px rgba(55, 182, 255, 0.8);
}

.hud-combo {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  align-items: baseline;
}

#hud-combo-mult { color: var(--c-gold); font-size: 1.3rem; }
#hud-combo-score { font-size: 1rem; }

.hud-topright { top: max(2vh, 10px); right: max(2vw, 10px); text-align: right; }

#minimap {
  border-radius: 50%;
  border: 2px solid rgba(127, 212, 255, 0.3);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.hud-weather {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--c-text-dim);
  letter-spacing: 0.08em;
}

.hud-fps { font-size: 0.75rem; color: #7dffb2; margin-top: 0.2rem; }

.hud-bottomleft { bottom: max(3vh, 14px); left: max(2vw, 10px); }

.hud-speed {
  font-size: 3rem;
  font-style: italic;
  line-height: 1;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
}

.hud-speed small { font-size: 1rem; color: var(--c-text-dim); }

.hud-alt { font-size: 0.8rem; color: var(--c-text-dim); margin-top: 0.3rem; font-family: var(--font-body); }

.hud-bottomright { bottom: max(3vh, 14px); right: max(2vw, 10px); text-align: right; }

.boost-label { font-size: 0.68rem; letter-spacing: 0.25em; color: var(--c-text-dim); margin-bottom: 0.25rem; }

.boost-bar {
  width: clamp(120px, 18vw, 220px);
  height: 12px;
  border-radius: 7px;
  background: rgba(127, 212, 255, 0.12);
  border: 1px solid rgba(127, 212, 255, 0.25);
  overflow: hidden;
}

.boost-bar-fill {
  height: 100%;
  width: 30%;
  border-radius: 7px;
  background: linear-gradient(90deg, #ff9d3c, #ffd166);
  transition: width 0.15s linear;
}

.boost-bar-fill.active {
  background: linear-gradient(90deg, #37b6ff, #9be8ff);
  box-shadow: 0 0 14px rgba(55, 182, 255, 0.9);
}

.hud-camname {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--c-text-dim);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.hud-powerups {
  bottom: 156px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.powerup-chip {
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  border-radius: 999px;
  background: var(--c-panel);
  border: 1px solid rgba(255, 209, 102, 0.55);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.35);
  white-space: nowrap;
}

.powerup-chip.expiring { animation: pulse 0.5s ease infinite; }

.trick-toast.powerup { color: #ffb35c; }

/* ---------------- power bar (keys 1-5) ---------------- */

.hud-powerbar {
  position: absolute;
  top: 132px;
  left: 2vw;
  z-index: 22;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: auto;
}

/*
 * One special power = one circular button: coloured ring + icon, a boxed
 * key badge, and the power's name underneath. A conic sweep over the ring
 * drains as the cooldown recovers.
 */
.power-chip {
  position: relative;
  display: grid;
  grid-template-columns: 46px auto;
  grid-template-areas: "ring key" "ring name";
  align-items: center;
  gap: 0 0.45rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--c-text);
  cursor: pointer;
  text-align: left;
  opacity: 0.55;
  transition: opacity 0.18s ease, transform 0.12s ease;
}

.power-chip.ready { opacity: 1; }
.power-chip:active { transform: scale(0.94); }

.pc-ring {
  grid-area: ring;
  position: relative;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 38%,
    rgba(255, 255, 255, 0.14), rgba(8, 14, 26, 0.9) 70%);
  border: 2px solid var(--pc-color, #37b6ff);
  box-shadow: 0 0 10px color-mix(in srgb, var(--pc-color, #37b6ff) 45%, transparent),
    inset 0 0 10px rgba(0, 0, 0, 0.55);
}

.power-chip.ready .pc-ring {
  box-shadow: 0 0 16px color-mix(in srgb, var(--pc-color, #37b6ff) 75%, transparent),
    inset 0 0 10px rgba(0, 0, 0, 0.45);
}

.power-chip.active .pc-ring {
  animation: pc-active 1.1s ease-in-out infinite;
}

@keyframes pc-active {
  0%, 100% { box-shadow: 0 0 14px color-mix(in srgb, var(--pc-color, #37b6ff) 70%, transparent); }
  50% { box-shadow: 0 0 26px color-mix(in srgb, var(--pc-color, #37b6ff) 100%, transparent); }
}

.pc-icon { font-size: 1.25rem; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }

/* Radial cooldown: the shaded wedge shrinks to nothing as the power recharges. */
.pc-sweep {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(rgba(6, 11, 22, 0.82) var(--pc-frac, 0deg),
    transparent var(--pc-frac, 0deg));
}

.pc-cd {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

/* Key badge — a real box, so the binding is unmistakable. */
.pc-key {
  grid-area: key;
  justify-self: start;
  min-width: 22px;
  padding: 1px 5px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-align: center;
  color: var(--c-text);
  background: rgba(12, 20, 36, 0.92);
  border: 1px solid rgba(127, 212, 255, 0.5);
  border-radius: 5px;
  box-shadow: 0 2px 0 rgba(4, 8, 16, 0.85);
}

.pc-name {
  grid-area: name;
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: #d7e6fa;
  white-space: nowrap;
  /* The HUD sits over bright snow as often as over dark sky, so the
     label carries its own contrast rather than relying on the scene. */
  text-shadow: 0 1px 2px rgba(4, 8, 16, 0.95), 0 0 6px rgba(4, 8, 16, 0.75);
}

.power-chip.ready .pc-name { color: #ffffff; }

/* ---------------- bottom control hint ---------------- */

.hud-hint {
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--c-text-dim);
  opacity: 0.75;
  white-space: nowrap;
}

#hud.zen .hud-hint, #hud.zen .hud-powerbar { display: none; }

/* Time Warp: subtle cinematic grade while slow motion is active. */
#app.slowmo #game-canvas { filter: saturate(1.35) contrast(1.06) brightness(1.03); }

.hud-center {
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.hud-countdown {
  font-size: 6rem;
  font-style: italic;
  text-shadow: 0 0 40px rgba(55, 182, 255, 0.9);
}

.hud-tricks {
  position: absolute;
  top: 58%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.trick-toast {
  font-size: 1.25rem;
  font-style: italic;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  animation: trick-in 0.25s ease;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.trick-toast.fade { opacity: 0; transform: translateY(-18px); }
.trick-toast b { color: var(--c-gold); }
.trick-toast i { color: var(--c-accent-2); font-style: normal; }
.trick-toast.perfect { color: #7dffb2; }
.trick-toast.crash { color: var(--c-danger); }
.trick-toast.combo { color: var(--c-gold); }
.trick-toast.checkpoint { color: var(--c-accent-2); }
.trick-toast.ring { color: #ff9dff; }

/* Zen mode hides scoring chrome. */
#hud.zen .hud-topcenter,
#hud.zen .hud-bottomright,
#hud.zen .hud-tricks { display: none; }

.vignette {
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(255, 40, 60, 0.55) 100%);
}

.vignette.flash { animation: vignette-flash 0.7s ease; }

.speedlines {
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(ellipse at center, transparent 58%, rgba(180, 225, 255, 0.16) 100%);
}

.speedlines.active { opacity: 1; }

/* ---------------- Nitro Burst: screen-wide wind trails ---------------- */

/*
 * The camera punches IN on the rider during a Nitro Burst, so the speed
 * has to be told on the screen instead of by the lens. A dense field of
 * streaks tears outward from the centre for exactly as long as the burst
 * runs. Everything animates transform + opacity only, so it composites on
 * the GPU and never touches layout.
 */
#windtrails {
  position: absolute;
  inset: 0;
  /* Under the HUD (20) so the score, timer and warnings stay readable
     straight through a burst, but over the canvas. */
  z-index: 18;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.18s ease-out;
}

#windtrails.active { opacity: 1; }

/* The tunnel: a dark, fast-reading vignette with the nitro's own heat in
   it, so the middle of the frame stays clear and the edges rip past. */
.wt-core {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse at center, transparent 20%, rgba(8, 18, 38, 0.62) 80%),
    radial-gradient(ellipse at center, transparent 30%, rgba(255, 122, 46, 0.3) 100%);
}

.wt-edge {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 46%, rgba(170, 226, 255, 0.42) 100%);
  mix-blend-mode: screen;
}

#windtrails.active .wt-core { animation: wt-pulse 0.5s ease-in-out infinite alternate; }

.wt {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--w, 4px);
  height: var(--len, 18vmax);
  margin: 0 0 0 calc(var(--w, 4px) / -2);
  border-radius: 999px;
  transform-origin: 50% 0;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(200, 240, 255, 0.9) 30%,
    rgba(255, 178, 104, 0.55) 68%,
    transparent 100%);
  box-shadow: 0 0 8px rgba(190, 232, 255, 0.55);
  opacity: 0;
}

#windtrails.active .wt {
  will-change: transform, opacity;
  animation: wt-fly var(--dur, 0.4s) linear var(--d, 0s) infinite;
}

@keyframes wt-fly {
  0% {
    transform: rotate(var(--a)) translateY(var(--r0)) scaleY(0.3);
    opacity: 0;
  }
  15% { opacity: var(--o, 0.6); }
  100% {
    transform: rotate(var(--a)) translateY(92vmax) scaleY(1.7);
    opacity: 0;
  }
}

@keyframes wt-pulse {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

/* ---------------- Super Jump: launch trails ---------------- */

/*
 * A different language from Nitro on purpose: the trails run straight UP
 * the screen behind an expanding shockwave, so the effect reads as lift
 * rather than as speed. One shot, ~1 s, fired by the power itself.
 */
#jumptrails {
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}

#jumptrails.fire { opacity: 1; }

.jt {
  position: absolute;
  bottom: -22vh;
  width: 10px;
  height: var(--h, 22vh);
  margin-left: -5px;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(0deg,
    transparent 0%,
    rgba(110, 240, 90, 0.75) 26%,
    rgba(226, 255, 214, 1) 100%);
  box-shadow: 0 0 12px rgba(130, 245, 110, 0.6);
}

#jumptrails.fire .jt {
  will-change: transform, opacity;
  animation: jt-lift 1s cubic-bezier(0.25, 0.55, 0.4, 1) var(--d, 0s) 1;
}

/* The trails hold their brightness across most of the climb and only fade
   at the very top, so the lift is legible rather than a single flash. */
@keyframes jt-lift {
  0% { transform: translateY(0) scaleY(0.5); opacity: 0; }
  14% { opacity: var(--o, 0.7); }
  68% { opacity: var(--o, 0.7); }
  100% { transform: translateY(-125vh) scaleY(1.5); opacity: 0; }
}

.jt-ring {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 12vmax;
  height: 12vmax;
  margin: -6vmax 0 0 -6vmax;
  border: 5px solid rgba(160, 250, 130, 0.95);
  box-shadow: 0 0 26px rgba(130, 245, 110, 0.7),
              inset 0 0 26px rgba(130, 245, 110, 0.45);
  border-radius: 50%;
  opacity: 0;
}

#jumptrails.fire .jt-ring { animation: jt-ring 0.85s ease-out 1; }

@keyframes jt-ring {
  0% { transform: scale(0.15); opacity: 0.95; border-width: 6px; }
  100% { transform: scale(3.4); opacity: 0; border-width: 1px; }
}

.jt-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(120, 236, 96, 0.5) 0%, transparent 66%);
}

#jumptrails.fire .jt-glow { animation: jt-glow 1s ease-out 1; }

@keyframes jt-glow {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

.lightning {
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: rgba(235, 242, 255, 0.85);
}

.lightning.flash { animation: lightning-flash 0.45s ease-out; }

/* ---------------- toasts ---------------- */

#toasts {
  position: absolute;
  bottom: 12vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  pointer-events: none;
}

.toast {
  padding: 0.55rem 1.1rem;
  background: var(--c-panel);
  border: 1px solid var(--c-panel-border);
  border-radius: 10px;
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.accent { border-color: rgba(55, 182, 255, 0.6); }
.toast.danger { border-color: rgba(255, 90, 110, 0.6); }

/* ---------------- photo mode ---------------- */

#photo-ui {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.photo-hint {
  position: absolute;
  top: 3vh;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: var(--c-text-dim);
  background: var(--c-panel);
  padding: 0.5rem 1rem;
  border-radius: 10px;
}

.photo-buttons {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.7rem;
  pointer-events: auto;
}

/* ---------------- touch controls ---------------- */

#touch-controls {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

.touch-stick {
  position: absolute;
  left: 4vw;
  bottom: 14vh;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(127, 212, 255, 0.08);
  border: 2px solid rgba(127, 212, 255, 0.25);
  pointer-events: auto;
  touch-action: none;
}

.touch-stick-knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: rgba(127, 212, 255, 0.35);
  border: 2px solid rgba(200, 240, 255, 0.6);
}

.touch-buttons {
  position: absolute;
  right: 4vw;
  bottom: 12vh;
  display: flex;
  align-items: flex-end;
  gap: 0.8rem;
  pointer-events: auto;
}

.touch-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(127, 212, 255, 0.4);
  background: rgba(18, 30, 52, 0.65);
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  touch-action: none;
}

.touch-btn:active { background: rgba(55, 182, 255, 0.5); }
.touch-btn-big { width: 84px; height: 84px; font-size: 0.78rem; }
.touch-btn-small { width: 44px; height: 44px; font-size: 1rem; }

.touch-top {
  position: absolute;
  top: max(2vh, 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.6rem;
  pointer-events: auto;
}

/* ---------------- lives / game over / route warning ---------------- */

.hud-lives {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hud-lives .life-gone { opacity: 0.45; filter: grayscale(1); }

.hud-goal {
  margin-top: 0.3rem;
  max-width: 340px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--c-text-dim);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

.route-warning {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1.3rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: #ffd166;
  background: rgba(60, 34, 4, 0.72);
  border: 1px solid rgba(255, 209, 102, 0.65);
  border-radius: 10px;
  text-shadow: 0 0 14px rgba(255, 180, 46, 0.8);
  pointer-events: none;
}

.route-warning.pulse { animation: route-pulse 0.9s ease-in-out 2; }

@keyframes route-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
  50% { transform: translateX(-50%) scale(1.07); opacity: 0.75; }
}

.gameover-banner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: radial-gradient(ellipse at center, rgba(60, 5, 14, 0.55), rgba(8, 2, 6, 0.82));
  pointer-events: none;
  z-index: 30;
}

.gameover-banner .go-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(3rem, 11vw, 6.5rem);
  letter-spacing: 0.1em;
  color: #ff4757;
  text-shadow: 0 0 34px rgba(255, 71, 87, 0.85), 0 6px 20px rgba(0, 0, 0, 0.8);
}

.gameover-banner .go-cause {
  font-size: 1.05rem;
  color: #ffc9cf;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.gameover-banner.slam .go-title { animation: go-slam 0.7s cubic-bezier(0.2, 1.6, 0.35, 1) both; }
.gameover-banner.slam .go-cause { animation: fade-in-up 0.9s ease 0.35s both; }

@keyframes go-slam {
  0% { transform: scale(3.2); opacity: 0; }
  60% { transform: scale(0.94); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

#results-title.gameover { color: #ff4757; text-shadow: 0 0 22px rgba(255, 71, 87, 0.6); }

.feat-tag.ko { background: rgba(255, 71, 87, 0.22); color: #ff8592; border-color: rgba(255, 71, 87, 0.5); }
.feat-tag.safe { background: rgba(64, 226, 160, 0.16); color: #6fe8b8; border-color: rgba(64, 226, 160, 0.45); }

/* ---------------- crystal wallet ---------------- */

.wallet-chip {
  flex: none;
  align-self: center;
  padding: 0.28rem 0.7rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--c-accent-2);
  background: rgba(127, 212, 255, 0.1);
  border: 1px solid rgba(127, 212, 255, 0.32);
  border-radius: 999px;
  white-space: nowrap;
}

.results-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  max-height: 96vh;
}

/* Subtitle under the one-click PLAY button — tells the player where it goes. */
.menu-play-note {
  margin: -0.15rem 0 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--c-text-dim);
  text-align: center;
}

/* ---------------- first-run tour ---------------- */

/*
 * Four pages, shown once, over the menu. It is a modal on purpose: this is
 * the only moment in the game where holding the player still is worth more
 * than letting them press PLAY, and it is over in four clicks.
 */
#onboarding {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(2vh, 12px) max(3vw, 12px);
}

.ob-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.72);
  backdrop-filter: blur(10px) saturate(0.9);
  -webkit-backdrop-filter: blur(10px) saturate(0.9);
  animation: screen-in 0.3s ease;
}

/*
 * Sized so every page fits WITHOUT a scrollbar: the card is wide enough
 * that the bullet lists split into two columns on desktop, which more
 * than halves the tallest page, and it may use nearly the full viewport
 * height before anything would overflow.
 */
.ob-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: min(920px, 96vw);
  max-height: calc(100vh - 20px);
  padding: 1.2rem 1.4rem 1rem;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(22, 38, 64, 0.94), rgba(9, 15, 28, 0.96));
  border: 1px solid rgba(127, 212, 255, 0.34);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.7),
    0 0 70px rgba(55, 182, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: ob-in 0.45s cubic-bezier(.2,.9,.3,1.15) backwards;
}

@keyframes ob-in {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ob-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 38%,
    rgba(255, 255, 255, 0.07) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: rect-sheen 8s ease-in-out 1s infinite;
}

.ob-skip {
  position: absolute;
  top: 0.7rem; right: 0.8rem;
  z-index: 2;
  font-size: 0.66rem;
  padding: 0.28rem 0.6rem;
  opacity: 0.75;
}
.ob-skip:hover { opacity: 1; }

/* ---- the page ---- */

/*
 * No scrollbars: the card is sized so every page fits. `overflow-y: auto`
 * stays only as an invisible safety net for extreme viewports — if it
 * ever engages, the content still pans but no scrollbar is drawn.
 */
.ob-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ob-body::-webkit-scrollbar { display: none; }
.ob-body.turn { animation: ob-turn 0.35s cubic-bezier(.2,.9,.3,1.1); }
@keyframes ob-turn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.ob-head { display: flex; flex-direction: column; gap: 0.15rem; }

.ob-icon {
  font-size: 2rem;
  line-height: 1;
  animation: ob-bob 3.2s ease-in-out infinite;
}
@keyframes ob-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-5px) rotate(-4deg); }
}

.ob-kicker {
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  color: var(--c-accent-2);
}

.ob-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.6rem);
  letter-spacing: 0.04em;
  text-shadow: 0 2px 18px rgba(55, 182, 255, 0.5);
}

.ob-lead {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--c-text);
  max-width: 62ch;
}

/* ---- bullet list ---- */

.ob-points, .ob-caps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.1rem 0 0;
  padding: 0;
}

/* On desktop widths the lists run in two columns: the tallest page drops
   to roughly half its height, which is what guarantees the card fits the
   viewport with no scrollbar. */
@media (min-width: 720px) {
  .ob-points, .ob-caps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.7rem;
    align-items: stretch;
  }
  .ob-lead { max-width: none; }
}

.ob-point {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  align-items: start;
  gap: 0.55rem;
  padding: 0.42rem 0.6rem;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid rgba(127, 212, 255, 0.4);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  animation: menu-item-in 0.4s ease backwards;
  animation-delay: calc(0.1s + var(--ob-i, 0) * 70ms);
}
.ob-point:hover {
  background: rgba(55, 182, 255, 0.13);
  border-left-color: var(--c-accent);
  transform: translateX(3px);
}

.ob-pi { font-size: 1.05rem; line-height: 1.3; text-align: center; }
.ob-pt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ob-pt b { font-size: 0.8rem; }
.ob-pt small { font-size: 0.72rem; color: var(--c-text-dim); }

/* ---- key caps ---- */

.ob-caps { gap: 0.35rem; }

.ob-caprow {
  display: grid;
  grid-template-columns: 6.6rem 1fr;
  align-items: center;
  gap: 0.7rem;
  padding: 0.24rem 0.4rem;
  border-radius: 10px;
  transition: background 0.2s ease;
  animation: menu-item-in 0.4s ease backwards;
  animation-delay: calc(0.1s + var(--ob-i, 0) * 60ms);
}
.ob-caprow:hover { background: rgba(55, 182, 255, 0.1); }

.ob-cap {
  font-family: var(--font-display);
  font-size: 0.8rem;
  padding: 0.32rem 0.5rem;
  text-align: center;
  border-radius: 8px;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(52, 84, 138, 0.95), rgba(28, 48, 82, 0.95));
  border: 1px solid rgba(127, 212, 255, 0.45);
  box-shadow: 0 3px 0 rgba(6, 12, 24, 0.8);
  transition: transform 0.18s cubic-bezier(.2,.9,.3,1.4);
}
.ob-caprow:hover .ob-cap { transform: translateY(-2px); }

.ob-capt { font-size: 0.78rem; color: var(--c-text); }

/* ---- footer ---- */

.ob-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex: none;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(127, 212, 255, 0.16);
}

.ob-dots { display: flex; gap: 0.45rem; }

.ob-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.25s ease, transform 0.25s cubic-bezier(.2,.9,.3,1.5),
    box-shadow 0.25s ease;
}
.ob-dot:hover { background: rgba(255, 255, 255, 0.4); }
.ob-dot.seen { background: rgba(127, 212, 255, 0.55); }
.ob-dot.on {
  background: var(--c-accent);
  transform: scale(1.45);
  box-shadow: 0 0 12px var(--c-accent);
}

/* The last page's button is the one that starts the game — make it read
   like it, not like another "Next". */
.ob-finish {
  animation: ride-glow 2.2s ease-in-out infinite;
  padding-left: 1rem; padding-right: 1rem;
}

@media (max-width: 640px), (max-height: 560px) {
  .ob-card { padding: 0.85rem 0.9rem 0.7rem; gap: 0.5rem; border-radius: 16px; }
  .ob-icon { font-size: 1.5rem; }
  .ob-lead { font-size: 0.76rem; }
  .ob-pt b { font-size: 0.75rem; }
  .ob-pt small { font-size: 12px; }
  .ob-capt { font-size: 0.72rem; }
  .ob-caprow { grid-template-columns: 5.4rem 1fr; gap: 0.5rem; }
  .ob-cap { font-size: 0.7rem; padding: 0.24rem 0.35rem; }
  .ob-point { padding: 0.32rem 0.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ob-card, .ob-sheen, .ob-icon, .ob-point, .ob-caprow, .ob-body.turn,
  .ob-finish { animation: none; }
}

/* Out-of-bounds countdown: escalates to red in the last two seconds. */
.route-warning.critical {
  color: #fff;
  background: rgba(190, 24, 42, 0.9);
  border-color: rgba(255, 140, 150, 0.9);
}
.route-warning b { font-size: 1.15em; }

/* ---------------- combat HUD ---------------- */

/* Ordnance rail, mirrored to the top-right so the two arsenals never
   read as one list. Same circular language as the ride powers. */
.hud-combatbar {
  position: absolute;
  top: 196px;
  right: 2vw;
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
  pointer-events: auto;
}

.combat-chip {
  grid-template-columns: auto 46px;
  grid-template-areas: "key ring" "name ring";
  gap: 0 0.45rem;
  text-align: right;
}

.combat-chip .pc-key { justify-self: end; }
.combat-chip .pc-name { justify-self: end; }

.hud-kills {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: #ffd7dd;
  text-shadow: 0 1px 3px rgba(4, 8, 16, 0.95);
  margin-top: 0.15rem;
}
.hud-kills b { color: #fff; font-size: 1.1em; }

/* Boss health bar, centred under the top HUD. */
.boss-bar {
  position: absolute;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 23;
  width: min(460px, 60vw);
  text-align: center;
  pointer-events: none;
}

.boss-name {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  color: #ffd166;
  text-shadow: 0 1px 4px rgba(4, 8, 16, 0.95);
  margin-bottom: 0.25rem;
}

.boss-hp {
  height: 11px;
  border-radius: 6px;
  background: rgba(8, 14, 26, 0.85);
  border: 1px solid rgba(255, 209, 102, 0.6);
  overflow: hidden;
}

.boss-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff2e63, #ffb02e);
  transition: width 0.18s ease;
}

.touch-btn-fire {
  background: linear-gradient(180deg, rgba(190, 40, 60, 0.92), rgba(120, 20, 36, 0.92));
  border-color: rgba(255, 140, 150, 0.7);
}

/* Short viewports: the 7-chip ordnance rail cannot fit one per row, so it
   becomes a compact 2-column grid of circles with the labels dropped. */
@media (max-height: 660px) {
  .hud-combatbar {
    top: 150px;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.3rem;
    justify-items: end;
  }
  .combat-chip { grid-template-columns: auto 40px; }
  .combat-chip .pc-ring { width: 40px; height: 40px; }
  .combat-chip .pc-name { display: none; }
}

@media (max-width: 960px), (max-height: 540px) {
  .hud-kills { font-size: 11px; }
  .boss-bar { top: 70px; width: min(360px, 70vw); }
}

/* ================================================================== */
/* Ride screen — paged tile grids + square description card           */
/* ================================================================== */

/*
 * Layout rules that drive everything here:
 *   - NO scrollbars anywhere. Grids are paged (2 x 5 = 10 tiles), so any
 *     number of modes/locations fits without ever scrolling.
 *   - Every panel is the same height and every tile is the same size, so
 *     the three columns stay symmetric whatever the content length.
 *   - The description card is a true square (aspect-ratio: 1).
 */

.ride-screen {
  overflow: hidden;
  justify-content: flex-start;
  height: 100%;
}

/* Slow drifting aurora wash behind the whole screen. */
.ride-aurora {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(45% 35% at 20% 25%, rgba(55, 182, 255, 0.22), transparent 70%),
    radial-gradient(40% 30% at 80% 20%, rgba(176, 107, 255, 0.20), transparent 70%),
    radial-gradient(50% 40% at 55% 85%, rgba(255, 179, 92, 0.14), transparent 70%);
  filter: blur(30px);
  animation: aurora-drift 18s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); opacity: 0.85; }
  50%  { transform: translate3d(2%, 1.5%, 0) scale(1.06); opacity: 1; }
  100% { transform: translate3d(-1%, 2%, 0) scale(1.02); opacity: 0.9; }
}

.ride-header { margin-bottom: 0.9rem; animation: menu-item-in 0.45s ease backwards; }

.ride-header h2 {
  background: linear-gradient(180deg, #ffffff 20%, #7fd4ff 75%, #2f9dff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 14px rgba(55, 182, 255, 0.55));
}

/* Three equal columns; the panels themselves stretch to a shared height. */
.ride-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1.05fr;
  /* minmax(0, 1fr) lets the row shrink below its content height — without
     it the grid sizes to content and the screen overflows. */
  grid-template-rows: minmax(0, 1fr);
  gap: 0.9rem;
  width: min(1180px, 100%);
  align-items: stretch;
  /* Fill the space the header leaves and no more: the three columns share
     one height and the grids size themselves to fit inside it. */
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Frosted panel shared by all three columns. */
.panel-soft {
  background: linear-gradient(180deg, rgba(16, 27, 47, 0.86), rgba(10, 18, 32, 0.9));
  border: 1px solid rgba(127, 212, 255, 0.18);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(55, 182, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.ride-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem;
  min-width: 0;
  min-height: 0;          /* grid items must be allowed to shrink */
  animation: menu-item-in 0.5s ease backwards;
}
.ride-layout > .ride-col:nth-child(1) { animation-delay: 0.06s; }
.ride-layout > .ride-col:nth-child(2) { animation-delay: 0.12s; }
.ride-layout > .ride-col:nth-child(3) { animation-delay: 0.18s; }

.ride-col-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

.ride-col h3 {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-accent-2);
  text-shadow: 0 0 12px rgba(55, 182, 255, 0.5);
}

/* ---------------- pager ---------------- */

.pager { display: flex; align-items: center; gap: 0.4rem; }

.pager-btn {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(127, 212, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.pager-btn:hover:not(:disabled) {
  background: rgba(55, 182, 255, 0.28);
  box-shadow: 0 0 12px rgba(55, 182, 255, 0.7);
  transform: scale(1.12);
}
.pager-btn:disabled { opacity: 0.28; cursor: default; }

.pager-dots { display: flex; gap: 4px; }
.pager-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(127, 212, 255, 0.28);
  transition: all 0.2s ease;
}
.pager-dot.on {
  background: var(--c-accent);
  box-shadow: 0 0 8px var(--c-accent);
  transform: scale(1.25);
}

/* ---------------- option bars (1 x 10, never scrolled) ---------------- */

.tile-grid {
  display: grid;
  grid-template-columns: 1fr;      /* one full-width bar per option */
  grid-auto-rows: 1fr;
  gap: 0.3rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;          /* symmetry guard — never a scrollbar */
}

.ride-tile {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.2rem 0.55rem 0.2rem 0.7rem;
  min-height: 0;
  text-align: left;
  color: var(--c-text);
  background: linear-gradient(100deg, rgba(28, 44, 74, 0.82), rgba(16, 27, 47, 0.86));
  border: 1px solid rgba(127, 212, 255, 0.16);
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(.2,.9,.3,1.3),
    border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  animation: tile-in 0.36s ease backwards;
  animation-delay: calc(var(--tile-i, 0) * 26ms);
}

/* Accent rail down the leading edge of every bar. */
.ride-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--tile-accent, var(--c-accent));
  opacity: 0.4;
  transition: opacity 0.18s ease, width 0.18s ease, box-shadow 0.18s ease;
}

@keyframes tile-in {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Sheen that sweeps across a tile on hover. */
.tile-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%,
    rgba(255, 255, 255, 0.16) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform 0.55s ease;
}

.ride-tile:hover:not(.locked):not(.ghost) {
  transform: translateX(5px);
  border-color: var(--tile-accent, var(--c-accent));
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--tile-accent, #37b6ff) 16%, rgba(28, 44, 74, 0.85)),
    rgba(16, 27, 47, 0.86));
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.5),
    0 0 20px color-mix(in srgb, var(--tile-accent, #37b6ff) 60%, transparent);
}
.ride-tile:hover:not(.locked):not(.ghost)::before { opacity: 1; width: 4px; }
.ride-tile:hover:not(.locked):not(.ghost) .tile-glow { transform: translateX(130%); }
.ride-tile:hover:not(.locked):not(.ghost) .tile-icon { transform: scale(1.18) rotate(-6deg); }
.ride-tile:active:not(.locked):not(.ghost) { transform: translateX(2px); }

.ride-tile.selected {
  border-color: var(--tile-accent, var(--c-accent));
  background: linear-gradient(100deg,
    color-mix(in srgb, var(--tile-accent, #37b6ff) 32%, rgba(28, 44, 74, 0.9)),
    rgba(16, 27, 47, 0.92));
  animation: tile-in 0.36s ease backwards,
    tile-pulse 2.4s ease-in-out 0.4s infinite;
}
.ride-tile.selected::before {
  opacity: 1;
  width: 5px;
  box-shadow: 0 0 12px var(--tile-accent, var(--c-accent));
}

@keyframes tile-pulse {
  0%, 100% { box-shadow: 0 0 16px color-mix(in srgb, var(--tile-accent, #37b6ff) 50%, transparent); }
  50%      { box-shadow: 0 0 30px color-mix(in srgb, var(--tile-accent, #37b6ff) 95%, transparent); }
}

/* Locked, but still readable and still clickable — selecting one opens
   its unlock brief, so it has to invite the click rather than refuse it. */
.ride-tile.locked { opacity: 0.55; cursor: help; }
.ride-tile.locked:hover {
  opacity: 0.92;
  transform: translateX(3px);
  border-color: rgba(255, 209, 102, 0.55);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45), 0 0 16px rgba(255, 209, 102, 0.28);
}
.ride-tile.locked:hover .tile-lock { color: var(--c-gold); transform: scale(1.08); }
.ride-tile.locked.selected {
  opacity: 1;
  border-color: rgba(255, 209, 102, 0.75);
  background: linear-gradient(100deg, rgba(74, 58, 26, 0.85), rgba(20, 22, 34, 0.92));
  animation: tile-in 0.36s ease backwards;
}
.ride-tile.locked.selected::before {
  background: var(--c-gold);
  opacity: 1; width: 5px;
  box-shadow: 0 0 12px var(--c-gold);
}
.tile-lock { transition: transform 0.18s ease, color 0.18s ease; }
.ride-tile.ghost { visibility: hidden; pointer-events: none; }

/* ---------------- unlock ladder strip ---------------- */

.map-ladder {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  margin-top: auto;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(255, 209, 102, 0.1), rgba(16, 27, 47, 0.5));
  border: 1px solid rgba(255, 209, 102, 0.22);
  animation: menu-item-in 0.5s ease 0.3s backwards;
}

.ml-count {
  flex: none;
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--c-gold);
  padding: 0.1rem 0.4rem;
  border-radius: 7px;
  background: rgba(255, 209, 102, 0.14);
}
.ml-count.open { color: #7dffb2; background: rgba(125, 255, 178, 0.14); }

.ml-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ml-text b {
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ml-text small {
  font-size: 0.6rem;
  color: var(--c-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ml-done { font-size: 0.68rem; color: #7dffb2; }

/* ---------------- unlock brief ---------------- */

/* A locked pick takes the description card over completely. It stops being
   a square while it does — instructions need lines, not a fixed ratio. */
.desc-square.unlock {
  aspect-ratio: auto;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}
.desc-square.unlock .desc-inner { overflow: hidden; }
.desc-square.unlock .desc-glow {
  background: radial-gradient(closest-side, rgba(255, 209, 102, 0.2), transparent 70%);
}

.ul-tag {
  display: inline-block;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 209, 102, 0.18);
  border: 1px solid rgba(255, 209, 102, 0.4);
  color: var(--c-gold);
  vertical-align: middle;
  margin-right: 0.35rem;
  animation: ul-tag-pulse 2.2s ease-in-out infinite;
}
@keyframes ul-tag-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); }
  50%      { box-shadow: 0 0 14px rgba(255, 209, 102, 0.55); }
}

.unlock-brief {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  flex: 1;
}

.ul-req { display: flex; flex-direction: column; gap: 0.22rem; }
.ul-req-line { font-size: 0.68rem; }
.ul-req-line b { color: var(--c-gold); }
.ul-gap { font-size: 0.62rem; color: var(--c-text-dim); }
.ul-gap b { color: var(--c-text); }

.ul-bar {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.ul-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--c-accent), var(--c-gold));
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.55);
  animation: ul-fill 0.9s cubic-bezier(.2,.9,.3,1) backwards;
}
@keyframes ul-fill { from { width: 0 !important; } }

.ul-head {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--c-accent-2);
  padding-top: 0.15rem;
  border-top: 1px solid rgba(127, 212, 255, 0.16);
}

.ul-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin: 0;
  padding: 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.ul-step {
  display: grid;
  grid-template-columns: 1.2rem 1fr auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.24rem 0.4rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border-left: 2px solid rgba(127, 212, 255, 0.35);
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
  animation: menu-item-in 0.4s ease backwards;
  animation-delay: calc(var(--ul-i, 0) * 45ms);
}
.ul-step:hover {
  background: rgba(55, 182, 255, 0.12);
  border-left-color: var(--c-gold);
  transform: translateX(3px);
}

.ul-num { font-size: 0.8rem; text-align: center; }
.ul-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ul-copy b { font-size: 0.64rem; }
.ul-copy small {
  font-size: 0.57rem;
  color: var(--c-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ul-xp {
  font-size: 0.6rem;
  font-family: var(--font-display);
  color: var(--c-gold);
  white-space: nowrap;
}

.ul-foot { font-size: 0.56rem; color: var(--c-text-dim); }

/* START turns into the requirement itself rather than going quietly grey. */
.btn-start.locked:disabled {
  opacity: 0.95;
  background: linear-gradient(180deg, rgba(90, 72, 30, 0.9), rgba(48, 38, 16, 0.9));
  border-color: rgba(255, 209, 102, 0.5);
  color: var(--c-gold);
}

/* The RANDOM tile gets a gently spinning die and a golden cast. */
.ride-tile.random .tile-icon { animation: dice-roll 4.5s ease-in-out infinite; }
@keyframes dice-roll {
  0%, 70%, 100% { transform: rotate(0deg) scale(1); }
  78% { transform: rotate(-18deg) scale(1.12); }
  86% { transform: rotate(16deg) scale(1.12); }
  94% { transform: rotate(-6deg) scale(1.05); }
}

.tile-icon {
  flex: 0 0 1.35rem;
  font-size: 1.1rem;
  line-height: 1;
  text-align: center;
  transition: transform 0.2s ease;
}

.tile-swatch {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin: 0 calc((1.35rem - 22px) / 2);
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.18), inset 0 -3px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}
.ride-tile:hover:not(.locked):not(.ghost) .tile-swatch { transform: scale(1.14); }

.tile-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: left;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-lock { flex: none; font-size: 0.56rem; color: var(--c-gold); white-space: nowrap; }

.tile-check {
  flex: none;
  font-size: 0.66rem;
  color: #7dffb2;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(.2,.9,.3,1.6);
}
.ride-tile.selected .tile-check { opacity: 1; transform: scale(1); }

/* ---------------- square description card ---------------- */

.ride-summary {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.desc-square {
  position: relative;
  /* A true square. Its size is driven by WIDTH (never height), because a
     height cap plus a stretched width would flatten it into a rectangle.
     The viewport-relative cap keeps the rest of the column — setup strip,
     START and the bonus row — inside the panel at every size. */
  aspect-ratio: 1 / 1;
  width: min(100%, 44vh);
  align-self: center;
  flex: none;
  padding: 0.9rem;
  overflow: hidden;
  display: flex;
}

.desc-glow {
  position: absolute;
  inset: -40%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(55, 182, 255, 0.22), transparent 70%);
  animation: desc-orbit 9s linear infinite;
}

@keyframes desc-orbit {
  0%   { transform: translate(-12%, -8%) scale(1); }
  50%  { transform: translate(12%, 8%) scale(1.15); }
  100% { transform: translate(-12%, -8%) scale(1); }
}

.desc-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  min-height: 0;
  overflow: hidden;         /* square stays square — no scrollbar */
}

.desc-square.pop { animation: desc-pop 0.4s cubic-bezier(.2,.9,.3,1.4); }
@keyframes desc-pop {
  from { transform: scale(0.965); opacity: 0.5; }
  to   { transform: scale(1); opacity: 1; }
}

#ride-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: #fff;
  text-shadow: 0 0 14px rgba(55, 182, 255, 0.6);
  line-height: 1.25;
}

#ride-desc {
  font-size: 0.76rem;
  line-height: 1.42;
  color: var(--c-text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ride-features { display: flex; flex-direction: column; gap: 0.25rem; }

.feat-line {
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--c-text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feat-line b { color: var(--c-gold); }

.feat-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(55, 182, 255, 0.25);
  border: 1px solid rgba(127, 212, 255, 0.4);
}
.feat-tag.loc { background: rgba(255, 209, 102, 0.2); border-color: rgba(255, 209, 102, 0.45); }
.feat-tag.ko { background: rgba(255, 90, 110, 0.22); border-color: rgba(255, 138, 155, 0.45); }
.feat-tag.safe { background: rgba(87, 209, 50, 0.2); border-color: rgba(140, 240, 120, 0.45); }
.feat-tag.rnd { background: rgba(255, 209, 102, 0.28); border-color: rgba(255, 226, 122, 0.6); }

.ride-best {
  margin-top: auto;
  font-size: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.ride-best b { color: var(--c-gold); }

/* ---------------- setup strip ---------------- */

.ride-setup { padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.4rem; }
.setup-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.diff-label {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--c-text-dim);
  flex: none;
}

.diff-row { display: flex; gap: 0.3rem; flex-wrap: wrap; flex: 1; }

.diff-chip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.45rem;
  font-family: var(--font-display);
  font-size: 0.6rem;
  color: var(--c-text);
  background: rgba(18, 30, 52, 0.85);
  border: 1px solid rgba(127, 212, 255, 0.2);
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease,
    box-shadow 0.15s ease, transform 0.12s ease;
}

.diff-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(127, 212, 255, 0.7);
  box-shadow: 0 0 12px rgba(55, 182, 255, 0.5);
}

.diff-chip.selected {
  border-color: var(--c-gold);
  background: rgba(80, 62, 24, 0.6);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.55);
}

.diff-desc {
  font-size: 0.64rem !important;
  color: var(--c-text-dim);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.weather-chip { font-size: 0.8rem; padding: 0.22rem 0; width: 27px; justify-content: center; }

/* ---------------- START ---------------- */

.btn-start {
  position: relative;
  overflow: hidden;
  animation: start-glow 2.4s ease-in-out infinite;
}

@keyframes start-glow {
  0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 18px rgba(55, 182, 255, 0.45); }
  50%      { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 34px rgba(55, 182, 255, 0.9); }
}

.btn-start::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 35%,
    rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  transform: translateX(-130%);
  transition: transform 0.6s ease;
}
.btn-start:hover:not(:disabled)::after { transform: translateX(130%); }
.btn-start:disabled { animation: none; }
.btn-start-label { position: relative; }

/* Setup strip stays tight so the square keeps the space. */
.ride-setup { flex: none; }
.btn-start { flex: none; padding: 0.6rem 1.4rem; font-size: 1rem; }

/* Shorter viewports: the square yields space first, then the setup strip. */
@media (max-height: 660px) {
  .desc-square { width: min(100%, 34vh); padding: 0.65rem; }
  .ride-setup { padding: 0.45rem 0.55rem; gap: 0.25rem; }
  .diff-desc { display: none; }
  #ride-desc { -webkit-line-clamp: 3; }
}

@media (max-height: 660px) {
  .tile-grid { gap: 0.22rem; }
  .ride-tile { padding: 0.15rem 0.45rem 0.15rem 0.6rem; gap: 0.4rem; }
  .tile-name { font-size: 0.64rem; }
  .tile-icon { font-size: 0.98rem; }
}

@media (max-height: 540px) {
  .desc-square { width: min(100%, 30vh); padding: 0.5rem; }
  .ride-layout { gap: 0.5rem; }
  .ride-col { padding: 0.5rem; }
  .tile-grid { gap: 0.16rem; }
  .ride-tile { padding: 0.1rem 0.35rem 0.1rem 0.5rem; border-radius: 8px; }
  .tile-name { font-size: 0.58rem; }
  .tile-icon { flex-basis: 1.1rem; font-size: 0.85rem; }
  .tile-swatch { width: 16px; height: 16px; margin: 0 calc((1.1rem - 16px) / 2); }
  .ride-summary { gap: 0.35rem; }
  #ride-desc { -webkit-line-clamp: 2; font-size: 0.66rem; }
  .feat-line { -webkit-line-clamp: 1; font-size: 0.6rem; }
  .btn-start { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
  .ride-setup { padding: 0.32rem 0.42rem; gap: 0.18rem; }
  .diff-chip { font-size: 0.5rem; padding: 0.16rem 0.3rem; gap: 0.15rem; }
  /* The weather picker carries every sky in the catalogue, so on a short
     viewport the chips have to shrink rather than wrap into another row
     and push START out of the column. */
  .weather-chip { width: 18px; font-size: 0.55rem; padding: 0.1rem 0; }
  .diff-row { gap: 0.2rem; }
  .diff-label { font-size: 0.5rem; letter-spacing: 0.12em; }
}

/* ================================================================== */
/* Retention loops: daily board, shop, deck, designer, weekly, mastery */
/* ================================================================== */

/* ---------------- Daily Mountain button ---------------- */

.btn-daily {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: none;
  text-align: left;
  background: linear-gradient(180deg, rgba(74, 52, 128, 0.92), rgba(38, 28, 68, 0.92));
  border-color: rgba(200, 160, 255, 0.42);
  transition: transform 0.2s cubic-bezier(.2,.9,.3,1.3),
    box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn-daily:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(216, 184, 255, 0.85);
  box-shadow: var(--sh-3), 0 0 24px rgba(170, 120, 255, 0.45);
}
.btn-daily:hover:not(:disabled) .daily-mark { transform: scale(1.16) rotate(-7deg); }

.daily-mark {
  font-size: 1.4rem;
  flex: none;
  transition: transform 0.24s cubic-bezier(.2,.9,.3,1.5);
}
.daily-text { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.daily-text b { font-size: 0.9rem; letter-spacing: 0.06em; }
.daily-text small {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--c-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-state {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}
.daily-state b { font-size: 0.85rem; color: var(--c-gold); }
.daily-state small { font-family: var(--font-body); font-size: 0.6rem; color: var(--c-text-dim); }
.daily-state.done b { color: #7dffb2; }

/* ---------------- daily challenge board ---------------- */

/* Inside the frame's third column now — it fills the space it is given
   rather than carrying a width of its own. */
.daily-board {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.db-reset {
  font-family: var(--font-body);
  letter-spacing: 0;
  font-size: 0.62rem;
  color: var(--c-text-dim);
}

.db-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  /* The board must read as a card, not a scroller: overflow still works
     on very short viewports, but no scrollbar is ever drawn over it. */
  overflow-y: auto;
  scrollbar-width: none;
}
.db-list::-webkit-scrollbar { display: none; }

.db-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  grid-template-areas: 'tick text prog' '. pay pay';
  align-items: center;
  gap: 0.15rem 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  font-family: var(--font-body);
  background: rgba(255, 255, 255, 0.035);
  border-left: 2px solid rgba(127, 212, 255, 0.32);
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  animation: menu-item-in 0.45s ease backwards;
  animation-delay: calc(0.3s + var(--db-i, 0) * 70ms);
}
.db-row:hover {
  background: rgba(55, 182, 255, 0.12);
  border-left-color: var(--c-accent);
  transform: translateX(3px);
}
.db-row.done {
  border-left-color: #7dffb2;
  background: rgba(125, 255, 178, 0.09);
}

.db-tick { grid-area: tick; color: var(--c-text-dim); font-size: 0.85rem; }
.db-row.done .db-tick { color: #7dffb2; }
.db-row.done .db-text b { color: #7dffb2; }

.db-text { grid-area: text; display: flex; flex-direction: column; min-width: 0; }
.db-text b { font-size: 0.76rem; }
.db-text small { font-size: 0.64rem; color: var(--c-text-dim); }

.db-prog { grid-area: prog; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.db-prog small { font-size: 0.6rem; color: var(--c-text-dim); }
.db-bar {
  width: 62px; height: 4px;
  border-radius: 3px;
  background: rgba(127, 212, 255, 0.15);
  overflow: hidden;
}
.db-bar i { display: block; height: 100%; background: var(--c-accent); border-radius: 3px;
            transition: width 0.5s ease; }
.db-row.done .db-bar i { background: #7dffb2; }

.db-pay { grid-area: pay; font-size: 0.6rem; color: var(--c-gold); }

/* The board's bottom line: what finishing all three is worth. */
.db-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: none;
  margin-top: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 9px;
  font-family: var(--font-body);
  font-size: 0.64rem;
  background: rgba(255, 209, 102, 0.09);
  border: 1px solid rgba(255, 209, 102, 0.22);
  animation: menu-item-in 0.45s ease 0.55s backwards;
}
.db-total.done { background: rgba(125, 255, 178, 0.1); border-color: rgba(125, 255, 178, 0.3); }
.dbt-left { color: var(--c-text-dim); }
.dbt-pay { color: var(--c-gold); }
.dbt-pay b { color: #fff0c4; }
.dbt-done { color: #7dffb2; }

/* ---------------- next unlock chip ---------------- */

.next-unlock { margin-top: 0.3rem; font-size: 0.66rem; }

/* A pill, not a lozenge: in a narrow column the line wraps, so it needs a
   radius and a line-height that still read as one chip on two lines. */
.nu-chip {
  display: block;
  padding: 0.22rem 0.6rem;
  border-radius: 10px;
  line-height: 1.35;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.3);
  color: var(--c-gold);
  font-family: var(--font-body);
}
.nu-chip b { color: #fff0c4; }
.nu-max { color: var(--c-gold); font-family: var(--font-body); }

/* ---------------- crystal shop ---------------- */

.shop-body {
  width: min(900px, 100%);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.shop-body h3 {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-bottom: 0.6rem;
}
.shop-body h3 small { letter-spacing: 0; text-transform: none; font-size: 0.7rem; opacity: 0.75; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem;
}

.shop-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.7rem 0.8rem;
  text-align: left;
  color: var(--c-text);
  background: var(--c-panel);
  border: 1px solid var(--c-panel-border);
  border-radius: 12px;
  box-shadow: var(--sh-2);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.shop-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3), var(--sh-glow); }
.shop-card.worn { border-color: rgba(125, 255, 178, 0.6); }
.shop-card.owned .shop-price { color: var(--c-accent-2); }
.shop-card.poor { opacity: 0.55; }
.shop-card.wide { flex-direction: row; align-items: center; gap: 0.7rem; }

.shop-swatch { width: 100%; height: 12px; border-radius: 999px; }
.shop-icon { font-size: 1.6rem; flex: none; }
.shop-text { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.shop-text b { font-size: 0.85rem; }
.shop-text small { font-size: 0.68rem; color: var(--c-text-dim); line-height: 1.35; }
.shop-held { color: var(--c-gold); font-style: normal; font-size: 0.75rem; }
.shop-name { font-size: 0.85rem; font-family: var(--font-display); }
.shop-price {
  font-size: 0.72rem;
  color: var(--c-gold);
  letter-spacing: 0.06em;
  flex: none;
}

/* ---------------- garage: stats + power deck ---------------- */

.card-perk { font-size: 0.66rem; color: var(--c-accent-2); letter-spacing: 0.04em; }
.card-perk-desc {
  font-size: 0.6rem;
  color: var(--c-text-dim);
  font-family: var(--font-body);
  line-height: 1.3;
}

.card-bars { display: flex; flex-direction: column; gap: 1px; width: 100%; margin-top: 0.15rem; }
.stat-bar {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.6rem;
}
.stat-bar i { color: var(--c-text-dim); font-style: normal; }
.stat-bar b.up { color: #7dffb2; }
.stat-bar b.down { color: #ffb35c; }

.deck-note { font-size: 0.72rem; color: var(--c-text-dim); margin-bottom: 0.5rem; }

.deck-list { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: stretch; }

.deck-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 104px;
  padding: 0.6rem 0.4rem;
  color: var(--c-text);
  background: rgba(20, 32, 54, 0.75);
  border: 1px solid var(--c-panel-border);
  border-radius: 12px;
  box-shadow: var(--sh-1);
  cursor: pointer;
  position: relative;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.deck-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.deck-card.picked { border-color: var(--c-accent); box-shadow: var(--sh-2), var(--sh-glow); }
.deck-card.full { opacity: 0.4; cursor: default; }
.deck-icon { font-size: 1.4rem; }
.deck-name { font-size: 0.62rem; text-align: center; line-height: 1.2; }
.deck-slot { font-size: 0.55rem; color: var(--c-accent-2); letter-spacing: 0.1em; min-height: 0.7rem; }
.deck-clear { align-self: center; }

/* ---------------- mountain designer & ride codes ---------------- */

.designer { margin-top: 0.3rem; font-family: var(--font-body); }

.designer > summary {
  cursor: pointer;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--c-accent-2);
  list-style: none;
  padding: 0.2rem 0;
}
.designer > summary::-webkit-details-marker { display: none; }
.designer[open] > summary { color: var(--c-text); }

.designer-body { display: flex; flex-direction: column; gap: 0.3rem; padding-top: 0.3rem; }

.dna-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.64rem;
  color: var(--c-text-dim);
}
.dna-row input[type="range"] {
  flex: 1;
  max-width: 60%;
  accent-color: var(--c-accent);
}

.code-row { display: flex; gap: 0.35rem; margin-top: 0.2rem; }
.code-row input {
  flex: 1;
  min-width: 0;
  padding: 0.32rem 0.5rem;
  font-family: monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text);
  background: #16263f;
  border: 1px solid var(--c-panel-border);
  border-radius: 7px;
}
.code-note { font-size: 0.6rem; color: var(--c-text-dim); min-height: 0.8rem; }
.code-note.danger { color: var(--c-danger); }

/* ---------------- weather wager ---------------- */

.wager-line { font-family: var(--font-body); font-size: 0.64rem; min-height: 0.9rem; }
.wager-idle { color: var(--c-text-dim); }
.wager-on { color: var(--c-gold); }
.wager-on b { color: #fff0c4; }

/* ---------------- weekly board & mastery ---------------- */

.weekly-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  padding: 0.8rem 1.1rem;
  margin-bottom: 0.7rem;
}
.weekly-head div { display: flex; flex-direction: column; }
.weekly-head span { font-size: 0.64rem; letter-spacing: 0.12em; color: var(--c-text-dim); }
.weekly-head b { font-family: var(--font-display); font-size: 1rem; }

.par { color: var(--c-text-dim); font-style: normal; font-size: 0.72rem; font-weight: 400; }

.mastery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.6rem;
}

.mastery-card {
  display: flex;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  align-items: center;
}
.mastery-card.locked { opacity: 0.5; }
.mastery-card.maxed { border-color: rgba(255, 209, 102, 0.55); }

.mastery-swatch { width: 40px; height: 40px; border-radius: 10px; flex: none; box-shadow: var(--sh-1); }
.mastery-text { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.mastery-text b { font-size: 0.85rem; }
.mastery-text span { font-size: 0.68rem; color: var(--c-accent-2); }
.mastery-text small { font-size: 0.62rem; color: var(--c-text-dim); }

/* ---------------- results: bonuses, share, chain warning ---------------- */

.results-bonuses { display: flex; flex-direction: column; gap: 0.25rem; }

.bonus-row {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
  background: rgba(127, 212, 255, 0.07);
  font-family: var(--font-body);
  font-size: 0.74rem;
  animation: fade-in-up 0.4s ease backwards;
  animation-delay: calc(0.28s + var(--row-i, 0) * 0.07s);
}
.bonus-icon { text-align: center; }
.bonus-label { letter-spacing: 0.06em; color: var(--c-text); }
.bonus-value { color: var(--c-gold); font-weight: 700; }

.results-row {
  animation: fade-in-up 0.35s ease backwards;
  animation-delay: calc(0.08s + var(--row-i, 0) * 0.055s);
}

.share-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding-top: 0.2rem;
}
.share-label { font-size: 0.6rem; letter-spacing: 0.14em; color: var(--c-text-dim); }
.share-code {
  font-family: monospace;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--c-accent-2);
  padding: 0.2rem 0.5rem;
  border-radius: 7px;
  background: rgba(127, 212, 255, 0.1);
  border: 1px solid rgba(127, 212, 255, 0.3);
}

.chain-warn {
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--c-gold);
  text-align: center;
}

/* ---------------- level-up takeover ---------------- */

#levelup {
  position: absolute;
  inset: 0;
  z-index: 78;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(12, 24, 48, 0.55), rgba(4, 8, 16, 0.85));
  opacity: 0;
}

#levelup.go { animation: lu-in 4.2s ease forwards; }

@keyframes lu-in {
  0% { opacity: 0; }
  6% { opacity: 1; }
  88% { opacity: 1; }
  100% { opacity: 0; }
}

.lu-panel {
  position: relative;
  text-align: center;
  padding: 1.6rem 2.4rem;
  max-width: min(520px, 92vw);
}

.lu-burst {
  position: absolute;
  left: 50%; top: 34%;
  width: 30vmax; height: 30vmax;
  margin: -15vmax 0 0 -15vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.4), transparent 62%);
  pointer-events: none;
}
#levelup.go .lu-burst { animation: lu-burst 1.1s ease-out; }

@keyframes lu-burst {
  0% { transform: scale(0.2); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.lu-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.5em;
  color: var(--c-gold);
}

.lu-level {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 14vw, 7rem);
  font-style: italic;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 40px rgba(255, 209, 102, 0.8);
}
#levelup.go .lu-level { animation: medal-pop 0.8s ease; }

.lu-items { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.9rem; }

.lu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.32);
  animation: fade-in-up 0.5s ease backwards;
  animation-delay: calc(0.45s + var(--row-i, 0) * 0.12s);
}
.lu-icon { font-size: 1.2rem; }
.lu-name { font-family: var(--font-display); font-size: 0.95rem; }
.lu-kind {
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-text-dim);
}
.lu-none { color: var(--c-text-dim); font-family: var(--font-body); font-size: 0.8rem; }
.lu-next { margin-top: 0.8rem; font-family: var(--font-body); font-size: 0.75rem; color: var(--c-accent-2); }

/* ---------------- HUD: run chips + combo ring ---------------- */

.hud-chips {
  position: absolute;
  top: max(2vh, 10px);
  left: 50%;
  transform: translateX(-50%);
  margin-top: 4.6rem;
  display: flex;
  gap: 0.35rem;
  pointer-events: none;
}

.hud-chip {
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--c-text);
  background: rgba(8, 16, 32, 0.62);
  border: 1px solid rgba(127, 212, 255, 0.28);
  white-space: nowrap;
}
.hud-chip b { color: var(--c-gold); }
.hud-chip i { font-style: normal; color: var(--c-accent-2); }
.hud-chip.spent { opacity: 0.45; }

.combo-ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
}

/* The draining ring: a conic sweep that empties with the combo window, so
   the pressure to bank is watched rather than guessed. */
.combo-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--c-gold) var(--combo-frac, 0deg),
    rgba(255, 209, 102, 0.13) 0);
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 61%);
  mask: radial-gradient(circle, transparent 60%, #000 61%);
}

.hud-combo.urgent .combo-ring::before { animation: pulse 0.45s ease infinite; }

.combo-bank {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #7dffb2;
  animation: pulse 1.1s ease infinite;
}

/* ---------------- shared-element run transition ---------------- */

/*
 * The loading overlay grows out of whatever the player pressed — the map
 * tile, PLAY, or the Daily Mountain — instead of cross-fading in. The
 * origin is written by UIManager.markTransitionOrigin().
 */
#session-loading.zoom {
  animation: sl-zoom 0.42s cubic-bezier(0.22, 0.8, 0.3, 1);
  transform-origin: var(--from-x, 50%) var(--from-y, 55%);
}

@keyframes sl-zoom {
  0% { opacity: 0; transform: scale(0.12); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}

.session-loading-inner { animation: fade-in-up 0.5s ease 0.18s backwards; }

/* ---------------- selectable cards (garage) ---------------- */

/*
 * `.card` and `.card-list` carried no styling at all, so the Garage was
 * rendering as default browser buttons. They now use the same panel
 * language as every other surface, with the elevation scale doing the work.
 */
.card-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
}

.card-list.horizontal { flex-wrap: wrap; }

.card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  color: var(--c-text);
  font-family: var(--font-body);
  text-align: left;
  background: var(--c-panel);
  border: 1px solid var(--c-panel-border);
  border-radius: 12px;
  box-shadow: var(--sh-2);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.3, 1),
    box-shadow 0.16s ease, border-color 0.16s ease;
}

.card:hover:not(.locked) {
  transform: translate(calc(var(--mx, 0) * 2px), -3px);
  border-color: rgba(127, 212, 255, 0.6);
  box-shadow: var(--sh-3), var(--sh-glow);
}

.card.selected {
  border-color: var(--c-map-accent, var(--c-accent));
  box-shadow: var(--sh-3), var(--sh-glow);
}

.card.locked { opacity: 0.45; cursor: default; filter: grayscale(0.55); }

.garage-card {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.22rem;
  width: 152px;
  min-height: 176px;
  padding: 0.85rem 0.7rem;
  text-align: center;
}

.card-name { font-family: var(--font-display); font-size: 0.85rem; line-height: 1.15; }
.card-stat { font-size: 0.66rem; color: var(--c-gold); letter-spacing: 0.06em; }
.card-lock {
  margin-top: auto;
  font-size: 0.66rem;
  color: var(--c-text-dim);
  letter-spacing: 0.04em;
}
.card-sel {
  margin-top: auto;
  font-size: 0.85rem;
  color: #7dffb2;
}

/* Section headings sit over a bright mountain — they need their own
   contrast rather than borrowing the panel's. */
.garage-layout h3,
.shop-body h3 {
  text-shadow: 0 1px 8px rgba(6, 11, 22, 0.9);
}

/* Content screens sit over a bright mountain, so every card gets the same
   blur the panels use — otherwise the terrain reads straight through the
   text. */
.card,
.shop-card,
.deck-card,
.mastery-card,
.weekly-head {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(11, 19, 35, 0.88);
}

.card-perk-desc,
.shop-text small,
.deck-note,
.mastery-text small {
  text-shadow: 0 1px 4px rgba(6, 11, 22, 0.8);
}
