/*! Snow Rider — © 2026 AppStation Studio Pte. Ltd. All rights reserved. Official site: https://snowrider.com */
:root {
  --ink: #1d2b4f;
  --plum: #1f3f6e;
  --brand: #2f8fe6;        /* winter blue */
  --brand-dark: #1d69b5;
  --ice: #a9defc;
  --mustard: #f2b134;
  --teal: #23b5a8;
  --glass: rgba(255, 255, 255, 0.82);
  --u: clamp(14px, 2.2vmin, 20px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #bcdcf3;
  font-family: "Segoe UI Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--u);
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation; /* no double-tap zoom on buttons */
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#ui button, #ui .sheet, #ui .card { pointer-events: auto; }

/* ---------- top bar ---------- */
#topbar {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 0.7rem);
  left: calc(env(safe-area-inset-left) + 0.8rem);
  right: calc(env(safe-area-inset-right) + 0.8rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  z-index: 5;
}
.pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em 0.9em 0.4em 0.6em;
  border-radius: 99px;
  background: var(--glass);
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 3px 0 rgba(42, 34, 80, 0.18);
  transition: transform 0.12s;
}
.pill.pop { transform: scale(1.18); }
#dist-wrap {
  font-weight: 900;
  font-size: 2.6rem;
  line-height: 1;
  color: #fff;
  text-shadow: 0 3px 0 rgba(42, 34, 80, 0.35), 0 0 18px rgba(42, 34, 80, 0.25);
  font-variant-numeric: tabular-nums;
}
#dist-wrap small { font-size: 0.45em; margin-left: 0.15em; opacity: 0.9; }
.top-btns { justify-self: end; display: flex; gap: 0.5rem; }

.icon-btn {
  width: 2.7rem;
  height: 2.7rem;
  border: 0;
  border-radius: 50%;
  background: var(--glass);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(42, 34, 80, 0.18);
}
.icon-btn:active { transform: translateY(2px); box-shadow: none; }
.bars { display: block; width: 0.8rem; height: 0.95rem; border-left: 0.28rem solid var(--ink); border-right: 0.28rem solid var(--ink); }

#ui:not([data-state="playing"]) #dist-wrap,
#ui:not([data-state="playing"]) #btn-pause { visibility: hidden; }
#ui[data-state="loading"] #topbar,
#ui[data-state="crashed"] #btn-pause { visibility: hidden; }

/* ---------- screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 4.5rem 1.2rem calc(1.5rem + env(safe-area-inset-bottom));
  text-align: center;
}
.screen.dim { background: rgba(35, 36, 92, 0.38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); pointer-events: auto; }
#ui[data-state="loading"] #screen-loading,
#ui[data-state="menu"] #screen-menu,
#ui[data-state="shop"] #screen-shop,
#ui[data-state="paused"] #screen-pause,
#ui[data-state="over"] #screen-over { display: flex; animation: fade 0.25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

.loading { font-weight: 800; font-size: 1.3rem; color: #fff; }

.logo {
  margin: 0 0 0.3rem;
  display: flex;
  flex-direction: column;
  font-weight: 900;
  font-size: clamp(2.6rem, 11vmin, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0.06em 0 var(--plum), 0 0.12em 0.35em rgba(42, 34, 80, 0.45);
  transform: rotate(-3deg);
}
.logo span:last-child { color: var(--ice); margin-left: 0.6em; }
.best {
  margin: 0 0 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.5em 1.2em 0.5em 0.8em;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0.22em 0 rgba(29, 43, 79, 0.25);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
}
.best .trophy { font-size: 1.5em; line-height: 1; }
.best .best-label { text-transform: uppercase; font-size: 0.72em; letter-spacing: 0.08em; color: #6b7aa0; }
.best b { font-size: 1.45em; font-weight: 900; color: var(--brand); font-variant-numeric: tabular-nums; }
.controls { margin: 0.5rem 0 0; padding: 0.5em 1.1em; border-radius: 1.2em; background: rgba(35, 36, 92, 0.5); font-weight: 700; font-size: 0.85rem; color: #fff; max-width: 30em; line-height: 1.45; }
#screen-menu .logo { margin-bottom: auto; margin-top: 1vh; }
/* the record sits in the top bar, between the gift counter and the sound button */
#screen-menu .best {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 0.7rem);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.3em 1em 0.3em 0.6em;
  white-space: nowrap;
  z-index: 6;
}
#screen-menu .tap-start { margin-top: auto; }
@media (max-width: 430px) { #screen-menu .best .best-label { display: none; } }

.btn {
  min-width: min(16rem, 80vw);
  padding: 0.85em 1.6em;
  border: 0;
  border-radius: 1.1em;
  font: inherit;
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 0.28em 0 rgba(42, 34, 80, 0.28), 0 0 0 2px rgba(29, 43, 79, 0.07);
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s, filter 0.15s;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(0.2em); box-shadow: 0 0.08em 0 rgba(42, 34, 80, 0.28); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 0.28em 0 var(--brand-dark); font-size: 1.35rem; }
.btn.primary:active { box-shadow: 0 0.08em 0 var(--brand-dark); }
.btn.primary.owned { background: #1fb5c9; box-shadow: 0 0.28em 0 #14899a; }
.btn.primary.locked { background: #b9b2cf; box-shadow: 0 0.28em 0 #958eb0; }
.btn-row { display: flex; gap: 0.6rem; width: 100%; }
.btn-row .btn { min-width: 0; flex: 1; font-size: 1rem; padding: 0.75em 0.5em; }

.card {
  width: min(22rem, 92vw);
  max-height: 100%;
  overflow-y: auto;
  padding: 1.4rem 1.3rem 1.3rem;
  border-radius: 1.6rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0.5rem 0 rgba(42, 34, 80, 0.25), 0 1.2rem 3rem rgba(42, 34, 80, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
.card h2 { margin: 0; font-size: 1.7rem; font-weight: 900; color: var(--plum); }
.card .btn { width: 100%; min-width: 0; }
.card .btn:not(.primary) { background: #e6f0fb; }
.big { font-size: 3.6rem; font-weight: 900; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.big small { font-size: 0.4em; margin-left: 0.15em; }
.rows { width: 100%; display: flex; flex-direction: column; gap: 0.15rem; margin: 0.2rem 0 0.4rem; }
.rows div { display: flex; justify-content: space-between; padding: 0.4em 0.2em; font-weight: 700; border-bottom: 2px dashed #d6e6f7; }
.rows div:last-child { border: 0; }
.badge {
  padding: 0.35em 1em;
  border-radius: 99px;
  background: var(--ice);
  color: var(--plum);
  font-weight: 900;
  transform: rotate(-3deg);
  animation: bump 0.6s ease-in-out infinite alternate;
}
@keyframes bump { to { transform: rotate(2deg) scale(1.08); } }

/* ---------- shop: bottom sheet (portrait) / side panel (landscape) ---------- */
#screen-shop { padding: 0; justify-content: flex-end; align-items: stretch; }
.sheet {
  max-height: 58%;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1.6rem 1.6rem 0 0;
  box-shadow: 0 -0.6rem 2.5rem rgba(42, 34, 80, 0.3);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  text-align: left;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.7rem; }
.sheet-head h2 { margin: 0; font-size: 1.4rem; font-weight: 900; color: var(--plum); }
.sheet-head .icon-btn { background: #e6f0fb; box-shadow: none; }
#shop-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
  gap: 0.6rem;
  align-content: start;
  padding: 0.2rem 0.2rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.sled-card {
  position: relative;
  border: 3px solid transparent;
  border-radius: 1.1rem;
  background: #eaf3fc;
  padding: 0.7rem 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.sled-card.active { border-color: var(--brand); background: #fff; }
.sled-card .swatch {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 0 rgba(42, 34, 80, 0.2);
}
.sled-card .name { font-weight: 800; font-size: 0.85rem; line-height: 1.15; text-align: center; }
.sled-card .tag { font-weight: 800; font-size: 0.8rem; color: #7a7197; }
.sled-card.selected .tag { color: var(--brand); }
.sled-card.locked .swatch { filter: saturate(0.55); }
.sheet-foot { padding-top: 0.7rem; display: flex; justify-content: center; }
.sheet-foot .btn { width: 100%; max-width: 24rem; }

@media (orientation: landscape) and (min-width: 640px) {
  #screen-shop { flex-direction: row; justify-content: flex-end; }
  .sheet {
    width: min(24rem, 42vw);
    max-height: none;
    height: 100%;
    border-radius: 1.6rem 0 0 1.6rem;
    padding: calc(4.2rem + env(safe-area-inset-top)) 1rem 1rem;
  }
}

@media (max-height: 430px) {
  .screen { gap: 0.5rem; padding-top: 3.2rem; }
  .logo { font-size: clamp(2rem, 13vh, 3.4rem); }
  .btn { padding: 0.6em 1.4em; }
  .card { padding: 0.9rem 1.1rem; gap: 0.45rem; }
  .big { font-size: 2.4rem; }
  .card h2 { font-size: 1.3rem; }
  .controls { display: none; }
}

/* ---------- hint and toast ---------- */
#hint, #toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.6em 1.2em;
  border-radius: 99px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s;
  max-width: 92vw;
}
#hint { bottom: calc(12% + env(safe-area-inset-bottom)); background: rgba(35, 36, 92, 0.6); color: #fff; font-size: 0.95rem; }
#toast { top: 22%; background: var(--plum); color: #fff; z-index: 10; }
#hint.show, #toast.show { opacity: 1; }

/* ---------- settings ---------- */
#ui[data-overlay] .screen { display: none !important; }
#ui[data-overlay="settings"] #screen-settings { display: flex !important; animation: fade 0.25s ease-out; }
#ui[data-overlay] #topbar, #ui[data-overlay] #screen-menu .best { visibility: hidden; }
#ui[data-overlay="zones"] #screen-zones { display: flex !important; animation: fade 0.25s ease-out; }
.card.settings { width: min(26rem, 94vw); gap: 0.55rem; }
.set-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; font-weight: 800; text-align: left; }
.set-row > span { flex: none; }
.seg { display: flex; background: #e6f0fb; border-radius: 0.8rem; padding: 0.2rem; gap: 0.15rem; }
.seg button {
  border: 0; background: transparent; font: inherit; font-weight: 800; font-size: 0.85rem; color: #7a7197;
  padding: 0.45em 0.8em; border-radius: 0.65rem; cursor: pointer; white-space: nowrap;
}
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 2px 0 var(--brand-dark); }
#set-volume, #set-music { flex: 1; max-width: 12rem; accent-color: var(--brand); height: 1.6rem; pointer-events: auto; }
.card .btn.danger { background: transparent; color: #b0394a; box-shadow: none; font-size: 0.9rem; padding: 0.4em; }
.card .btn.danger.confirm { background: #ffe1e1; }
.card.settings .btn.primary { margin-top: 0.3rem; }
@media (max-width: 400px) { .seg button { padding: 0.45em 0.55em; font-size: 0.8rem; } }

#shop-tabs { margin-bottom: 0.7rem; pointer-events: auto; }
#shop-tabs button { flex: 1; }

.sled-card .thumb { width: 100%; max-width: 6.5rem; aspect-ratio: 1; object-fit: contain; margin: -0.35rem 0 -0.2rem; pointer-events: none; filter: drop-shadow(0 3px 0 rgba(29, 43, 79, 0.18)); }
.sled-card.locked .thumb { filter: drop-shadow(0 3px 0 rgba(29, 43, 79, 0.18)) saturate(0.7) brightness(0.97); }

/* ---------- zones ---------- */
.zones-pill {
  display: inline-flex; align-items: center; gap: 0.5em;
  border: 0; border-radius: 99px; padding: 0.45em 1.1em;
  background: rgba(29, 43, 79, 0.55); color: #fff;
  font: inherit; font-weight: 800; font-size: 0.95rem; cursor: pointer;
}
.zones-pill b { color: var(--ice); font-variant-numeric: tabular-nums; }
.zones-pill:active { transform: translateY(2px); }
.card-note { margin: -0.2rem 0 0; font-size: 0.85rem; font-weight: 700; color: #6b7aa0; }
#zones-list div { align-items: center; gap: 0.7em; justify-content: flex-start; }
#zones-list .dot { width: 1.1em; height: 1.1em; border-radius: 50%; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 2px #d6e6f7; }
#zones-list .zname { flex: 1; text-align: left; }
#zones-list .zmeta { font-size: 0.8em; color: #6b7aa0; font-weight: 800; }
#zones-list .locked .dot { background: #cdd6e6 !important; }
#zones-list .locked .zname { color: #9aa6c0; letter-spacing: 0.15em; }
@media (max-height: 430px) { .zones-pill { display: none; } }

/* icons inside buttons */
.btn:has(.btn-ico) { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; }
.btn-ico { width: 1.35em; height: 1.35em; margin: -0.2em 0; flex: none; color: inherit; display: block; }

.card .btn.zones-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.95rem; padding: 0.6em 1em; box-shadow: none; }
.card .btn.zones-row b { color: var(--brand); font-variant-numeric: tabular-nums; }

/* snowstorm: a white veil closing in from the edges of the screen */
#weather {
  position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 255, 255, 0) 35%, rgba(235, 242, 250, 0.85) 100%);
}

/* "tap to start" prompt instead of a Play button */
.tap-start {
  margin-bottom: 0.4rem;
  font-weight: 900;
  font-size: clamp(1.2rem, 3.4vmin, 1.7rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  /* a white halo keeps the blue readable on snow, at night and in a storm alike */
  text-shadow: 0 0 0.35em #fff, 0 0 0.12em #fff, 0 0.07em 0 rgba(255, 255, 255, 0.9);
  animation: tap-pulse 1.3s ease-in-out infinite;
}
@keyframes tap-pulse { 50% { opacity: 0.45; transform: scale(0.97); } }

.card .tap-start { margin: 0.5rem 0 0.2rem; font-size: 1.15rem; text-shadow: none; }

/* ---------- image buttons (wooden signs from /img) ---------- */
.img-btn {
  display: block;
  width: min(17rem, 78vw);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 0.3rem 0.25rem rgba(29, 43, 79, 0.28));
  transition: transform 0.07s, filter 0.12s;
}
.img-btn img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.img-btn:hover { filter: drop-shadow(0 0.3rem 0.25rem rgba(29, 43, 79, 0.28)) brightness(1.06); }
.img-btn:active { transform: translateY(0.18rem) scale(0.985); filter: drop-shadow(0 0.1rem 0.1rem rgba(29, 43, 79, 0.3)) brightness(0.96); }
.card .img-btn { width: 100%; }
.btn-row .img-btn { flex: 1.35; min-width: 0; align-self: center; }
@media (max-height: 430px) { .img-btn { width: min(12.5rem, 60vw); } }

/* image buttons, second batch */
.btn-row .img-btn { flex: 1; }
.sheet-foot { align-items: center; gap: 0.6rem; }
.sheet-foot .img-btn { flex: 0 0 38%; width: auto; max-width: 11rem; }
.sheet-foot .btn { flex: 1; min-width: 0; }
.card.settings .img-btn { margin-top: 0.2rem; }
.sheet-foot .img-btn { flex: 0 0 42%; max-width: 12rem; }
.sheet-foot .btn.primary { font-size: 1.1rem; padding: 0.8em 0.6em; white-space: nowrap; }
/* the controls hint belongs to the ride only */
#ui:not([data-state="playing"]) #hint { opacity: 0 !important; }

/* ---------- blank wooden plank with a live label (shop action button) ---------- */
.plank-btn {
  flex: 1;
  min-width: 0;
  aspect-ratio: 1024 / 270;
  padding: 0 15%;
  border: 0;
  background: url(../img/plank.png?v=79c103d2) center / 100% 100% no-repeat;
  cursor: pointer;
  pointer-events: auto;
  display: grid;
  place-items: center;
  font: inherit;
  font-weight: 900;
  font-size: clamp(1rem, 4.4vw, 1.45rem);
  line-height: 1;
  white-space: nowrap;
  color: #fff4e0;
  /* chunky brown outline, like the lettering painted on the other signs */
  text-shadow:
    0.06em 0 0 #5a2b12, -0.06em 0 0 #5a2b12, 0 0.06em 0 #5a2b12, 0 -0.06em 0 #5a2b12,
    0.05em 0.05em 0 #5a2b12, -0.05em 0.05em 0 #5a2b12, 0.05em -0.05em 0 #5a2b12, -0.05em -0.05em 0 #5a2b12,
    0 0.12em 0 #4a2210;
  filter: drop-shadow(0 0.3rem 0.25rem rgba(29, 43, 79, 0.28));
  transition: transform 0.07s, filter 0.12s;
}
.plank-btn:hover { filter: drop-shadow(0 0.3rem 0.25rem rgba(29, 43, 79, 0.28)) brightness(1.06); }
.plank-btn:active { transform: translateY(0.18rem) scale(0.985); filter: drop-shadow(0 0.1rem 0.1rem rgba(29, 43, 79, 0.3)) brightness(0.96); }
/* already wearing it: calm green lettering; cannot afford it: a weathered grey plank */
.plank-btn.equipped { color: #d9ffb8; }
.plank-btn.locked { filter: drop-shadow(0 0.3rem 0.25rem rgba(29, 43, 79, 0.28)) grayscale(0.75) brightness(0.92); }
@media (orientation: landscape) and (min-width: 640px) { .plank-btn { font-size: 1.25rem; } }

/* ---------- smaller signs: they should not outweigh the rider or the cards ---------- */
.img-btn { width: min(11.5rem, 54vw); }
#screen-menu { gap: 0.45rem; }
.card .img-btn { width: min(12rem, 68%); align-self: center; }
.card { gap: 0.55rem; }
.btn-row { justify-content: center; }
.btn-row .img-btn { flex: 0 1 46%; width: auto; max-width: 9.5rem; }
.sheet-foot { justify-content: center; }
.sheet-foot .img-btn { flex: 0 0 34%; max-width: 8.5rem; }
.plank-btn { flex: 0 1 52%; max-width: 12.5rem; font-size: clamp(0.9rem, 3.7vw, 1.15rem); }
@media (orientation: landscape) and (min-width: 640px) { .plank-btn { font-size: 1.05rem; } }
@media (max-height: 430px) { .img-btn { width: min(9rem, 40vw); } }
#screen-pause .card { width: min(16rem, 84vw); }

/* ---------- results: an in-game band across the screen, no pop-up ---------- */
.over-screen {
  pointer-events: auto;           /* tap anywhere to ride again */
  justify-content: flex-end;
  gap: 0.7rem;
  padding: 0 0 calc(1.4rem + env(safe-area-inset-bottom));
}
.over-band {
  width: 112%;
  margin: 0 -6%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 0.9rem 9% 1rem;
  background: rgba(38, 40, 58, 0.55);
  transform: rotate(-2.2deg);
  animation: band-in 0.45s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
@keyframes band-in { from { transform: rotate(-2.2deg) translateX(-105%); } }
.over-stat { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.over-stat small {
  font-weight: 900; font-size: clamp(0.7rem, 2.2vmin, 0.95rem); letter-spacing: 0.12em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.78); margin-bottom: 0.25em;
}
/* chunky arcade numerals: white fill, black outline */
.over-stat b {
  font-weight: 900;
  font-style: italic;
  color: #fff;
  font-variant-numeric: tabular-nums;
  -webkit-text-stroke: 0.09em #15161f;
  paint-order: stroke fill;
  text-shadow: 0.06em 0.08em 0 #15161f;
  letter-spacing: 0.01em;
}
.over-stat.side b { font-size: clamp(1.7rem, 7vmin, 3.2rem); }
.over-stat.main b { font-size: clamp(3.2rem, 15vmin, 6.8rem); }
.over-stat.main i { font-size: 0.38em; margin-left: 0.12em; font-style: italic; }
.over-record {
  padding: 0.3em 1.1em;
  border-radius: 0.4em;
  background: #ffd23f;
  color: #15161f;
  font-weight: 900;
  font-size: clamp(1rem, 3.4vmin, 1.5rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transform: rotate(-2.2deg);
  box-shadow: 0 0.18em 0 #15161f;
  animation: bump 0.6s ease-in-out infinite alternate;
  margin-bottom: -0.2rem;
}
.over-screen .tap-start { margin: 0.5rem 0 0; }
.over-buttons { display: flex; justify-content: center; gap: 0.5rem; width: 100%; padding: 0 0.8rem; }
.over-buttons .img-btn { flex: 0 1 31%; width: auto; max-width: 10.5rem; }
@media (max-height: 430px) {
  .over-band { padding-block: 0.4rem 0.5rem; }
  .over-stat.main b { font-size: clamp(2.2rem, 16vh, 3.6rem); }
  .over-screen { gap: 0.35rem; padding-bottom: 0.5rem; }
}

/* ---------- pause: the same in-game band, the frozen scene stays visible ---------- */
.pause-screen { background: linear-gradient(rgba(20, 24, 48, 0.18), rgba(20, 24, 48, 0.4)); }
.over-stat.main.word b { font-size: clamp(2.4rem, 11vmin, 5.2rem); text-transform: uppercase; letter-spacing: 0.03em; }
.over-stat.side i { font-size: 0.45em; margin-left: 0.1em; }
@media (max-width: 430px) { .over-stat.main.word b { font-size: clamp(2rem, 10.5vw, 3rem); } .pause-screen .over-band { gap: 0.5rem 0.7rem; padding-inline: 8%; } }

/* ---------- shop: close button instead of the sound button, no Menu sign ---------- */
#ui[data-state="shop"] #btn-mute { visibility: hidden; }
.close-btn { background: #e6f0fb; box-shadow: 0 3px 0 rgba(29, 43, 79, 0.18); color: var(--ink); }
.close-btn svg { width: 1.2rem; height: 1.2rem; display: block; }
.sheet-foot .plank-btn { flex: 0 1 70%; max-width: 15rem; }
@media (orientation: landscape) and (min-width: 640px) {
  /* the panel reaches the top of the screen: its close button sits where the sound button was */
  .sheet { padding-top: calc(0.7rem + env(safe-area-inset-top)); }
  .sheet-head { margin-bottom: 0.9rem; }
}

/* ---------- logo: racing-game wordmark ---------- */
.logo {
  position: relative;
  font-family: "Racing Sans One", "Arial Black", "Segoe UI", Impact, system-ui, sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(2.6rem, 11.5vmin, 5.6rem);
  line-height: 0.86;
  letter-spacing: 0.01em;
  text-shadow: none;
  transform: rotate(-4deg) skewX(-8deg);
  align-items: center;
  filter: drop-shadow(0 0.09em 0.12em rgba(12, 22, 52, 0.45));
}
/* Three stacked copies of each word, bottom to top:
   the span itself = thick navy outline with a hard extrusion,
   ::before        = white rim (the sticker look of racing logos),
   ::after         = the gradient-filled letters. */
.logo span {
  position: relative;
  display: block;
  padding: 0 0.12em;
  color: #10204a;
  -webkit-text-stroke: 0.2em #10204a;
  text-shadow: 0.035em 0.05em 0 #10204a, 0.07em 0.1em 0 #10204a, 0.1em 0.15em 0 #0a1533;
}
.logo span:last-child { color: #10204a; }
.logo span::before,
.logo span::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  padding: inherit;
  text-shadow: none;
}
.logo span::before {
  color: #fff;
  -webkit-text-stroke: 0.075em #fff;
}
.logo span::after {
  color: transparent;
  -webkit-text-stroke: 0;
  -webkit-background-clip: text;
  background-clip: text;
}
.logo .logo-top::after {
  background-image: linear-gradient(180deg, #ffffff 0%, #ffffff 50%, #c9e8ff 51%, #8fd0ff 100%);
}
.logo .logo-bottom {
  margin-left: 0.55em;
  margin-top: -0.02em;
  font-size: 1.12em;
}
.logo .logo-bottom::after {
  background-image: linear-gradient(180deg, #8ad6ff 0%, #2f8fe6 50%, #1b62c9 51%, #123f9c 100%);
}
/* speed lines trailing off to the left */
.logo::before {
  content: "";
  position: absolute;
  right: 94%;
  top: 20%;
  width: 0.9em;
  height: 0.6em;
  background:
    linear-gradient(90deg, transparent, #fff) 0 0 / 100% 0.085em no-repeat,
    linear-gradient(90deg, transparent, #ffd23f) 100% 50% / 75% 0.085em no-repeat,
    linear-gradient(90deg, transparent, #fff) 100% 100% / 55% 0.085em no-repeat;
}
/* a yellow racing stripe under the wordmark */
.logo::after {
  content: "";
  display: block;
  align-self: stretch;
  height: 0.085em;
  margin: 0.12em 6% 0 16%;
  border-radius: 1em;
  background: linear-gradient(90deg, #ffd23f, #ff9a1f 70%, transparent);
  box-shadow: 0 0.035em 0 #10204a;
}
@media (max-height: 430px) { .logo { font-size: clamp(2rem, 14vh, 3.4rem); } }

/* ---------- settings & zones: in-game panel instead of a white card ---------- */
.band-screen {
  pointer-events: auto;
  justify-content: center;
  gap: 0.8rem;
  padding: calc(0.8rem + env(safe-area-inset-top)) 0 calc(1rem + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(20, 24, 48, 0.2), rgba(20, 24, 48, 0.45));
}
.band-screen .card {
  width: 112%;
  max-width: none;
  margin: 0 -6%;
  min-height: 0;
  flex: 0 1 auto;
  border-radius: 0;
  box-shadow: none;
  background: rgba(30, 32, 50, 0.66);
  /* keep the rows in a readable column in the middle of the full-width band */
  padding: 1rem max(9%, calc(50% - 15rem)) 1.2rem;
  gap: 0.6rem;
  transform: rotate(-1.6deg);
  animation: panel-in 0.4s cubic-bezier(0.2, 1.25, 0.4, 1) both;
  scrollbar-width: none;
}
.band-screen .card::-webkit-scrollbar { display: none; }
@keyframes panel-in { from { transform: rotate(-1.6deg) translateX(-105%); } }

.band-screen .card h2 {
  font-size: clamp(1.9rem, 8vmin, 3.2rem);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  -webkit-text-stroke: 0.09em #15161f;
  paint-order: stroke fill;
  text-shadow: 0.06em 0.08em 0 #15161f;
  margin-bottom: 0.2rem;
}
.band-screen .set-row { color: #fff; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.band-screen .card-note { color: rgba(255, 255, 255, 0.75); }

/* chunky arcade switches: black socket, yellow key */
.band-screen .seg { background: rgba(0, 0, 0, 0.42); border-radius: 0.55rem; padding: 0.22rem; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35); }
.band-screen .seg button { color: rgba(255, 255, 255, 0.72); text-transform: uppercase; letter-spacing: 0.04em; border-radius: 0.4rem; font-size: 0.78rem; font-weight: 900; }
.band-screen .seg button.on { background: #ffd23f; color: #15161f; box-shadow: 0 0.18em 0 #a8790a; }

/* sliders: thick groove, yellow knob */
.band-screen input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; accent-color: #ffd23f; height: 1.8rem; }
.band-screen input[type="range"]::-webkit-slider-runnable-track { height: 0.55rem; border-radius: 1rem; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35); }
.band-screen input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 1.35rem; height: 1.35rem; margin-top: -0.4rem; border-radius: 50%; background: #ffd23f; border: 0.16rem solid #15161f; box-shadow: 0 0.14rem 0 #15161f; }
.band-screen input[type="range"]::-moz-range-track { height: 0.55rem; border-radius: 1rem; background: rgba(0, 0, 0, 0.45); }
.band-screen input[type="range"]::-moz-range-thumb { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #ffd23f; border: 0.16rem solid #15161f; }

/* "zones discovered" row: a dark key with a yellow counter */
.band-screen .card .btn.zones-row { background: rgba(0, 0, 0, 0.42); color: #fff; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; border-radius: 0.55rem; }
.band-screen .card .btn.zones-row b { color: #ffd23f; font-size: 1.15em; }

/* zone list */
.band-screen #zones-list div { border-bottom-color: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.9rem; }
.band-screen #zones-list .zmeta { color: #ffd23f; }
.band-screen #zones-list .locked .zname { color: rgba(255, 255, 255, 0.4); }
.band-screen #zones-list .locked .zmeta { color: rgba(255, 255, 255, 0.55); }
.band-screen #zones-list .dot { box-shadow: 0 0 0 2px #15161f; }
.band-screen #zones-list .locked .dot { background: rgba(255, 255, 255, 0.2) !important; }

/* buttons under the panel */
.band-screen .over-buttons .img-btn { flex: 0 1 12rem; }
.band-screen .btn.danger { background: none; box-shadow: none; min-width: 0; padding: 0.2em 0.8em; font-size: 0.85rem; color: #ffb4b4; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); text-transform: uppercase; letter-spacing: 0.06em; }
.band-screen .btn.danger.confirm { background: rgba(160, 30, 40, 0.75); color: #fff; border-radius: 0.5rem; }
@media (max-height: 560px) {
  .band-screen { gap: 0.35rem; }
  .band-screen .card { gap: 0.3rem; padding-block: 0.5rem 0.6rem; overflow-y: auto; }
  .band-screen .card h2 { font-size: 1.5rem; }
}
@media (max-height: 560px) {
  .band-screen .over-buttons .img-btn { flex-basis: 8.5rem; }
  .band-screen .btn.danger { position: absolute; right: 0.8rem; bottom: calc(0.9rem + env(safe-area-inset-bottom)); }
}

/* ---------- shop: in-game dark panel instead of a white sheet ---------- */
.sheet {
  position: relative;
  background: none;
  border-radius: 0;
  box-shadow: none;
  padding-top: 1.7rem;
  animation: sheet-up 0.4s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
/* the panel body is a separate layer, so its slanted edge does not clip the content */
.sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(30, 32, 50, 0.74);
  clip-path: polygon(0 1.5rem, 100% 0, 100% 100%, 0 100%);
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-head h2 {
  font-size: clamp(1.7rem, 6.5vmin, 2.4rem);
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  -webkit-text-stroke: 0.09em #15161f;
  paint-order: stroke fill;
  text-shadow: 0.06em 0.08em 0 #15161f;
}
.sheet-head .icon-btn.close-btn { background: #ffd23f; color: #15161f; box-shadow: 0 0.2rem 0 #a8790a; border-radius: 0.6rem; }
.sheet-head .icon-btn.close-btn:active { transform: translateY(0.15rem); box-shadow: 0 0.05rem 0 #a8790a; }

#shop-tabs { background: rgba(0, 0, 0, 0.42); border-radius: 0.55rem; padding: 0.22rem; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35); }
#shop-tabs button { color: rgba(255, 255, 255, 0.72); text-transform: uppercase; letter-spacing: 0.04em; border-radius: 0.4rem; font-size: 0.78rem; font-weight: 900; }
#shop-tabs button.on { background: #ffd23f; color: #15161f; box-shadow: 0 0.18em 0 #a8790a; }

#shop-grid { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.3) transparent; }
.sled-card {
  background: rgba(0, 0, 0, 0.34);
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.7rem;
  color: #fff;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.sled-card:hover { background: rgba(0, 0, 0, 0.22); }
.sled-card.active { border-color: #ffd23f; background: rgba(255, 210, 63, 0.16); transform: translateY(-2px); box-shadow: 0 0.25rem 0 rgba(0, 0, 0, 0.35); }
.sled-card .name { text-transform: uppercase; letter-spacing: 0.04em; font-weight: 900; font-size: 0.78rem; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.sled-card .tag { color: rgba(255, 255, 255, 0.7); font-weight: 900; }
.sled-card.selected .tag { color: #9dff7a; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.72rem; }
.sled-card.locked .tag { color: #ffd23f; }
.sled-card .thumb { filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)); }
.sled-card.locked .thumb { filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)) saturate(0.75) brightness(0.9); }
.sled-card .swatch { border-color: #15161f; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); }

@media (orientation: landscape) and (min-width: 640px) {
  .sheet { border-radius: 0; padding-left: 2.2rem; animation-name: sheet-side; }
  .sheet::before { clip-path: polygon(1.6rem 0, 100% 0, 100% 100%, 0 100%); }
}
@keyframes sheet-side { from { transform: translateX(100%); } }
.sheet { isolation: isolate; }
#shop-tabs button { padding: 0.5em 0.2em; min-width: 0; letter-spacing: 0.02em; }

/* ---------- top bar: in-game plates instead of white pills ---------- */
.pill, .icon-btn, #screen-menu .best {
  background: rgba(30, 32, 50, 0.66);
  color: #fff;
  border-radius: 0.6rem;
  box-shadow: 0 0.2rem 0 rgba(0, 0, 0, 0.35);
}
.pill, #screen-menu .best { transform: skewX(-8deg); }
#screen-menu .best { transform: translateX(-50%) skewX(-8deg); padding: 0.28em 0.9em 0.28em 0.6em; }
.pill > *, .best > * { transform: skewX(8deg); }
.pill.pop { transform: skewX(-8deg) scale(1.18); }
.pill #gift-count, .best b, #dist-wrap {
  font-style: italic;
  font-weight: 900;
  -webkit-text-stroke: 0.09em #15161f;
  paint-order: stroke fill;
  text-shadow: 0.06em 0.08em 0 #15161f;
  letter-spacing: 0.02em;
}
.pill #gift-count { color: #ffd23f; font-size: 1.2em; padding-right: 0.15em; }
.best b { color: #ffd23f; }
.best .best-label { color: rgba(255, 255, 255, 0.78); font-weight: 900; }
#dist-wrap { -webkit-text-stroke: 0.07em #15161f; }
.icon-btn { border-radius: 0.6rem; }
.icon-btn:active { transform: translateY(0.15rem); box-shadow: 0 0.05rem 0 rgba(0, 0, 0, 0.35); }
.icon-btn svg { width: 1.45rem; height: 1.45rem; display: block; }
.icon-btn.off { color: rgba(255, 255, 255, 0.5); }
.bars { border-color: #fff; }

/* ---------- controls hint and toast: in-game style ---------- */
#hint {
  left: -6%;
  right: -6%;
  max-width: none;
  transform: rotate(-1.6deg) translateX(-105%);
  border-radius: 0;
  padding: 0.55rem 9%;
  background: rgba(30, 32, 50, 0.66);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1.3rem;
  opacity: 1;
  transition: transform 0.45s cubic-bezier(0.2, 1.2, 0.4, 1);
}
#hint.show { transform: rotate(-1.6deg); }
#ui:not([data-state="playing"]) #hint { transform: rotate(-1.6deg) translateX(-105%); }
.hint-item { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.hint-item kbd {
  font: inherit;
  font-weight: 900;
  font-size: 0.8rem;
  min-width: 1.7em;
  padding: 0.22em 0.5em;
  border-radius: 0.4rem;
  background: #ffd23f;
  color: #15161f;
  box-shadow: 0 0.18em 0 #a8790a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.hint-item em {
  margin-left: 0.2rem;
  font-style: italic;
  font-weight: 900;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
#toast {
  top: 20%;
  padding: 0.35em 1.2em;
  border-radius: 0.4em;
  background: #ffd23f;
  color: #15161f;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(1rem, 3.4vmin, 1.4rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 0.18em 0 #15161f;
  transform: translateX(-50%) rotate(-2.2deg) scale(0.6);
  transition: opacity 0.2s, transform 0.3s cubic-bezier(0.2, 1.6, 0.4, 1);
}
#toast.show { transform: translateX(-50%) rotate(-2.2deg); }
#toast { width: max-content; max-width: 90vw; }

/* ---------- button rows: the PNG signs have different proportions (share 3.64:1, shop 3.42:1,
   menu 3.07:1), so equal widths gave unequal heights. Rows size the signs by height instead. ---------- */
.over-buttons { align-items: center; --sign-h: min(3.1rem, calc((100vw - 2.8rem) / 10.2)); }
.over-buttons .img-btn,
.band-screen .over-buttons .img-btn { flex: 0 0 auto; width: auto; max-width: none; }
.over-buttons .img-btn img { height: var(--sign-h); width: auto; }
@media (max-height: 430px) { .over-buttons { --sign-h: min(2.5rem, calc((100vw - 2.8rem) / 10.2)); } }
.band-screen .over-buttons { --sign-h: 3.4rem; }
@media (max-height: 560px) { .band-screen .over-buttons { --sign-h: 2.6rem; } }

/* ---------- loading: logo over a winter sky, in-game band with a striped progress bar ---------- */
#screen-loading {
  padding: 0;
  gap: 1.6rem;
  background: linear-gradient(#5aa9ec 0%, #a9d6f7 48%, #eef6fd 72%, #ffffff 100%);
  pointer-events: auto;
  overflow: hidden;
}
#screen-loading .logo { margin: 0; animation: logo-float 1.6s ease-in-out infinite alternate; }
@keyframes logo-float { to { transform: rotate(-4deg) skewX(-8deg) translateY(-0.08em); } }
.load-band {
  width: 112%;
  margin: 0 -6%;
  padding: 0.8rem 9% 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  background: rgba(30, 32, 50, 0.66);
  transform: rotate(-2.2deg);
}
.load-band .loading {
  margin: 0;
  font-size: clamp(1.5rem, 6vmin, 2.4rem);
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  -webkit-text-stroke: 0.09em #15161f;
  paint-order: stroke fill;
  text-shadow: 0.06em 0.08em 0 #15161f;
}
.load-band .loading::after { content: "..."; display: inline-block; width: 1.2em; text-align: left; overflow: hidden; vertical-align: bottom; animation: load-dots 1.2s steps(4, jump-none) infinite; }
@keyframes load-dots { from { width: 0; } to { width: 1.2em; } }
.load-bar {
  width: min(20rem, 70vw);
  height: 1rem;
  padding: 0.18rem;
  border-radius: 0.55rem;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35);
  transform: skewX(-12deg);
  overflow: hidden;
}
.load-bar i {
  display: block;
  height: 100%;
  border-radius: 0.35rem;
  background: repeating-linear-gradient(-55deg, #ffd23f 0 0.6rem, #ff9a1f 0.6rem 1.2rem);
  background-size: 1.465rem 100%;
  animation: load-stripes 0.5s linear infinite, load-fill 2.4s ease-out both;
}
@keyframes load-stripes { to { background-position: 1.465rem 0; } }
@keyframes load-fill { from { width: 8%; } to { width: 100%; } }
/* start-up error: plain readable text, no animation */
#screen-loading.failed .load-bar { display: none; }
#screen-loading.failed .loading { font-size: 1rem; font-style: normal; text-transform: none; letter-spacing: 0; -webkit-text-stroke: 0; text-shadow: none; max-width: 30rem; }
#screen-loading.failed .loading::after { content: none; }

/* ---------- plank label: lettering as large as on the painted signs, scales with the plank ---------- */
.plank-btn { container-type: inline-size; padding: 0 11%; font-size: 1.3rem; }
.plank-btn > span { font-size: 15.5cqw; letter-spacing: 0; transform: translateY(-0.04em); }
@media (orientation: landscape) and (min-width: 640px) { .plank-btn { font-size: 1.3rem; } }

/* ---------- achievements ---------- */
#btn-ach { position: relative; color: #ffd23f; }
#ui:not([data-state="menu"]):not([data-state="over"]) #btn-ach { display: none; }
#ui:not([data-state="playing"]) #btn-pause { display: none; }
#ach-badge {
  position: absolute; top: -0.35rem; right: -0.35rem;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.3rem;
  border-radius: 1rem; background: #ff4d5e; color: #fff;
  font-size: 0.72rem; font-weight: 900; line-height: 1.25rem; text-align: center;
  box-shadow: 0 0 0 2px #15161f;
  animation: bump 0.6s ease-in-out infinite alternate;
}
#ach-badge[hidden] { display: none; }
#ui[data-overlay="ach"] #screen-ach { display: flex !important; animation: fade 0.25s ease-out; }
.band-screen .card.ach-card { background: rgba(30, 32, 50, 0.82); padding-inline: max(8.5%, calc(50% - 22rem)); min-height: 0; flex: 0 1 auto; max-height: 78%; transform: rotate(-1deg); }
.band-screen .card.ach-card h2 span { font-size: 0.5em; color: #ffd23f; margin-left: 0.4em; }
#ach-list {
  width: 100%; min-height: 0; flex: 1 1 auto; overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.4rem; padding: 0.1rem 0.3rem 0.3rem 0;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  pointer-events: auto; text-align: left;
}
.ach-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.7rem;
  padding: 0.4rem 0.6rem 0.4rem 0.4rem; border-radius: 0.6rem;
  background: rgba(0, 0, 0, 0.34); border: 2px solid rgba(255, 255, 255, 0.08); color: #fff;
}
.ach-row.ready { border-color: #ffd23f; background: rgba(255, 210, 63, 0.16); }
.ach-row.claimed { opacity: 0.6; }
.ach-icon {
  width: 3.3rem; height: 3.3rem; border-radius: 0.5rem; border: 2px solid #15161f;
  box-shadow: inset 0 -0.35rem 0 rgba(0, 0, 0, 0.18), 0 0.15rem 0 rgba(0, 0, 0, 0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.05rem;
}
.ach-icon span { font-size: 1.45rem; line-height: 1; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); }
.ach-icon small { font-size: 0.52rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5); }
.ach-row:not(.ready):not(.claimed) .ach-icon { filter: saturate(0.55) brightness(0.85); }
.ach-main { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.ach-main b { font-size: 1rem; font-weight: 900; font-style: italic; letter-spacing: 0.02em; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); }
.ach-main > small { font-size: 0.72rem; font-weight: 700; color: rgba(255, 255, 255, 0.72); }
.ach-bar { position: relative; height: 0.95rem; margin-top: 0.1rem; border-radius: 0.4rem; background: rgba(0, 0, 0, 0.5); overflow: hidden; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.35); }
.ach-bar i { display: block; height: 100%; min-width: 0.25rem; border-radius: 0.4rem; background: linear-gradient(#ffd23f, #ff9a1f); }
.ach-bar em { position: absolute; inset: 0; font-style: normal; font-size: 0.66rem; font-weight: 900; line-height: 0.95rem; text-align: center; text-shadow: 0 1px 0 #000, 0 0 3px #000; font-variant-numeric: tabular-nums; }
.ach-side { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; min-width: 4.6rem; }
.ach-reward { font-weight: 900; font-style: italic; color: #ffd23f; font-size: 0.95rem; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45); white-space: nowrap; }
.ach-state { font-size: 0.66rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.3em 0.7em; border-radius: 0.35rem; background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.65); white-space: nowrap; }
.ach-row.claimed .ach-state { color: #9dff7a; }
.ach-side button {
  border: 0; font: inherit; font-size: 0.78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.4em 1em; border-radius: 0.4rem; background: #ffd23f; color: #15161f; box-shadow: 0 0.2em 0 #a8790a; cursor: pointer;
  animation: bump 0.6s ease-in-out infinite alternate;
}
.ach-side button:active { transform: translateY(0.15em); box-shadow: 0 0.05em 0 #a8790a; }
@media (max-width: 430px) {
  .ach-row { gap: 0.5rem; }
  .ach-icon { width: 2.8rem; height: 2.8rem; }
  .ach-main b { font-size: 0.88rem; }
  .ach-side { min-width: 3.9rem; }
}
@media (max-height: 560px) { .band-screen .card.ach-card { max-height: 70%; } }

/* ---------- menu: Achievements sign under Shop; Settings is a gear in the top bar ---------- */
#ui:not([data-state="menu"]) #btn-settings { display: none; }
#btn-ach { color: #fff4e0; }
/* same height as the painted Shop sign (3.42:1) although the blank plank is longer (3.82:1) */
.plank-btn.menu-plank { position: relative; flex: none; width: calc(min(11.5rem, 54vw) * 1.1); max-width: none; display: grid; }
@media (max-height: 430px) { .plank-btn.menu-plank { width: calc(min(9rem, 40vw) * 1.1); } }
.plank-btn.menu-plank > span { display: inline-flex; align-items: center; gap: 0.28em; font-size: 16cqw; }
.plank-btn.menu-plank svg { width: 1.05em; height: 1.05em; flex: none; filter: drop-shadow(0.05em 0.08em 0 #4a2210) drop-shadow(-0.04em 0 0 #5a2b12) drop-shadow(0.04em 0 0 #5a2b12) drop-shadow(0 -0.04em 0 #5a2b12); }
.plank-btn.menu-plank #ach-badge { top: -0.15rem; right: 0.2rem; font-size: 0.78rem; text-shadow: none; }
.plank-btn.menu-plank { padding: 0 1.3rem; }
.plank-btn.menu-plank > span { font-size: 14.5cqw; }

/* ---------- Achievements sign: painted PNG; longer than Shop (3.77:1 vs 3.42:1), so wider for the same height ---------- */
.img-btn.menu-ach { position: relative; width: calc(min(11.5rem, 54vw) * 1.1); }
@media (max-height: 430px) { .img-btn.menu-ach { width: calc(min(9rem, 40vw) * 1.1); } }
.img-btn.menu-ach #ach-badge { top: -0.15rem; right: 0.2rem; font-size: 0.78rem; }

/* ---------- audio switch lives in Settings; sliders fade while audio is off ---------- */
.vol-row.muted input[type="range"] { opacity: 0.35; }

/* ---------- copyright line ---------- */
#credit {
  left: 50%;
  bottom: calc(0.3rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(29, 43, 79, 0.55);
  display: none;
}
#credit:hover { color: #2f8fe6; }
#ui[data-state="menu"] #credit, #ui[data-state="loading"] #credit, #ui[data-overlay="settings"] #credit { display: block; }
#ui[data-overlay="settings"] #credit { color: rgba(255, 255, 255, 0.6); }
#ui[data-overlay="ach"] #credit, #ui[data-overlay="zones"] #credit { display: none; }
/* served from somewhere else: the badge never leaves the screen */
#credit.foreign {
  display: block !important;
  left: 0.5rem;
  bottom: calc(0.5rem + env(safe-area-inset-bottom));
  transform: none;
  padding: 0.35em 0.8em;
  border-radius: 0.4rem;
  background: rgba(30, 32, 50, 0.8);
  color: #ffd23f !important;
  font-size: 0.72rem;
}

/* ---------- results: the band sits higher, right under the wreck, not glued to the bottom edge ---------- */
#screen-over.over-screen { padding-bottom: calc(10vh + env(safe-area-inset-bottom)); }
@media (max-height: 560px) { #screen-over.over-screen { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); } }

/* ---------- wooden signs: about 15% larger everywhere ---------- */
.img-btn { width: min(13.2rem, 60vw); }
.img-btn.menu-ach { width: calc(min(13.2rem, 60vw) * 1.1); }
@media (max-height: 430px) { .img-btn { width: min(10.3rem, 44vw); } .img-btn.menu-ach { width: calc(min(10.3rem, 44vw) * 1.1); } }
.over-buttons { --sign-h: min(3.6rem, calc((100vw - 2.8rem) / 9.2)); }
@media (max-height: 430px) { .over-buttons { --sign-h: min(2.9rem, calc((100vw - 2.8rem) / 9.2)); } }
.band-screen .over-buttons { --sign-h: 3.9rem; }
@media (max-height: 560px) { .band-screen .over-buttons { --sign-h: 3rem; } }
.sheet-foot .plank-btn { flex: 0 1 80%; max-width: 17rem; }
/* results band closer to the middle; more so on tall (portrait) screens */
#screen-over.over-screen { padding-bottom: calc(13vh + env(safe-area-inset-bottom)); }
@media (orientation: portrait) and (min-height: 561px) { #screen-over.over-screen { padding-bottom: calc(20vh + env(safe-area-inset-bottom)); } }

/* ---------- phones in portrait: results / pause signs stacked in a column ---------- */
@media (orientation: portrait) and (max-width: 600px) {
  #screen-over .over-buttons, #screen-pause .over-buttons { flex-direction: column; align-items: center; gap: 0.45rem; --sign-h: 3.5rem; }
  #screen-pause .over-buttons { --sign-h: 3.1rem; }
  #screen-pause.over-screen { padding-bottom: calc(2.2rem + env(safe-area-inset-bottom)); }
  #screen-over.over-screen { padding-bottom: calc(11vh + env(safe-area-inset-bottom)); }
}
/* stacked signs share one width and height; the planks are stretched by a few % to match */
@media (orientation: portrait) and (max-width: 600px) {
  #screen-over .over-buttons .img-btn, #screen-pause .over-buttons .img-btn { width: min(13rem, 62vw); }
  #screen-over .over-buttons .img-btn img, #screen-pause .over-buttons .img-btn img { width: 100%; height: var(--sign-h); object-fit: fill; }
  #screen-over .over-buttons { --sign-h: 3.7rem; }
  #screen-pause .over-buttons { --sign-h: 3.3rem; }
}
