/* Layout: road signage floating over the live road. The title is a green
   highway guide sign, the HUD is roadside plates pinned to the corners, the
   pause screen is a barricade and game over is a traffic incident report. */
:root {
  --asphalt: #1e2126;
  --asphalt-2: #2b2f36;
  --sign-green: #00704a;
  --sign-blue: #1d4f91;
  --sign-yellow: #fcc21b;
  --sign-yellow-deep: #a87800;
  --sign-red: #c8102e;
  --sign-orange: #f26722;
  --sign-white: #f7f7f2;
  --sign-brown: #6b3f21;
  --sign-purple: #5b3a9e;
  --ink: #16181c;
  --ink-soft: #4b515c;
  --paper: #fbfbf8;
  --form-ink: #1f3a66;
  --form-line: #b9c6d8;
  --muted: #c9ced6;
  --font-sign: 'Overpass', 'Arial Narrow', Arial, system-ui, sans-serif;
  --font-mono: 'Overpass Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--asphalt);
  color: var(--sign-white);
  font-family: var(--font-sign);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game { position: fixed; inset: 0; overflow: hidden; touch-action: none; }

#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: filter 0.3s ease;
}
#view.stunned { filter: blur(1.2px) saturate(0.85); }
#view.mini { filter: saturate(1.45) contrast(1.08); }
#view.stunned.mini { filter: blur(1.2px) saturate(1.2); }

.hidden { display: none !important; }

button { font-family: var(--font-sign); }
button:focus-visible { outline: 3px solid var(--sign-white); outline-offset: 3px; }

/* ---- Sign-plate buttons ------------------------------------------------------ */
.btn-yellow, .btn-plate, .btn-red {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  padding: 14px 26px 11px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-yellow {
  font-size: 22px;
  color: var(--ink);
  background: var(--sign-yellow);
  box-shadow: inset 0 0 0 3px var(--sign-yellow), inset 0 0 0 5px var(--ink), 0 5px 0 var(--sign-yellow-deep), 0 12px 22px rgba(0, 0, 0, 0.3);
}
.btn-plate {
  font-size: 17px;
  color: var(--ink);
  background: var(--sign-white);
  box-shadow: inset 0 0 0 3px var(--sign-white), inset 0 0 0 5px var(--ink), 0 5px 0 #9a9c95, 0 12px 22px rgba(0, 0, 0, 0.25);
}
.btn-red {
  font-size: 17px;
  color: var(--sign-white);
  background: var(--sign-red);
  box-shadow: inset 0 0 0 3px var(--sign-red), inset 0 0 0 5px var(--sign-white), 0 5px 0 #7a0a1c, 0 12px 22px rgba(0, 0, 0, 0.25);
}
.btn-big { font-size: 34px; padding: 18px 46px 14px; letter-spacing: 0.1em; }
.btn-yellow:hover, .btn-plate:hover, .btn-red:hover { transform: translateY(-2px); }
.btn-yellow:active, .btn-plate:active, .btn-red:active { transform: translateY(4px); box-shadow: inset 0 0 0 3px currentColor, 0 1px 0 rgba(0, 0, 0, 0.4); }
.btn-yellow:active { box-shadow: inset 0 0 0 3px var(--sign-yellow), inset 0 0 0 5px var(--ink), 0 1px 0 var(--sign-yellow-deep); }
.btn-plate:active { box-shadow: inset 0 0 0 3px var(--sign-white), inset 0 0 0 5px var(--ink), 0 1px 0 #9a9c95; }
.btn-red:active { box-shadow: inset 0 0 0 3px var(--sign-red), inset 0 0 0 5px var(--sign-white), 0 1px 0 #7a0a1c; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---- HUD ------------------------------------------------------------------ */
#hud { position: absolute; inset: 0; pointer-events: none; }

.hud-l, .hud-r {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hud-l { left: max(16px, env(safe-area-inset-left)); align-items: flex-start; }
.hud-r { right: max(16px, env(safe-area-inset-right)); align-items: flex-end; }

.plate {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 78px;
  padding: 8px 12px 5px;
  border-radius: 7px;
  line-height: 1;
}
.plate-lbl { font-size: 11px; font-weight: 900; letter-spacing: 0.16em; }
.plate b { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; margin-top: 2px; }
.plate b.bump { animation: bump 0.22s ease; }
.plate.guide {
  background: var(--sign-green);
  color: var(--sign-white);
  box-shadow: inset 0 0 0 3px var(--sign-green), inset 0 0 0 5px var(--sign-white), 0 4px 0 rgba(0, 0, 0, 0.3), 0 10px 18px rgba(0, 0, 0, 0.25);
}
.plate.limit {
  background: var(--sign-white);
  color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--sign-white), inset 0 0 0 5px var(--ink), 0 4px 0 rgba(0, 0, 0, 0.3), 0 10px 18px rgba(0, 0, 0, 0.25);
}
.plate.coinplate {
  flex-direction: row;
  gap: 7px;
  min-width: 0;
  padding: 5px 10px 3px 7px;
  background: var(--sign-yellow);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--sign-yellow), inset 0 0 0 3.5px var(--ink), 0 3px 0 rgba(0, 0, 0, 0.3);
}
.plate.coinplate b { font-size: 18px; margin: 0; }
.coin-ico {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff4b8 0 18%, #ffd23f 22% 60%, #9c6a00 64%);
  box-shadow: 0 0 0 1.5px var(--ink);
}

.hud-btns { display: flex; gap: 8px; }
.icon-btn {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: var(--asphalt-2);
  color: var(--sign-white);
  box-shadow: inset 0 0 0 2px var(--asphalt-2), inset 0 0 0 3.5px var(--sign-white), 0 3px 0 rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.1s ease;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(2px); }
.icon-btn.off { color: #ff8a8a; }

#powers {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.pw {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 7px;
  background: var(--asphalt-2);
  box-shadow: inset 0 0 0 2px var(--c), 0 3px 0 rgba(0, 0, 0, 0.35);
  animation: pop-in 0.25s ease-out;
}
.pw img { width: 28px; height: 28px; display: block; }
.pw-info { display: flex; flex-direction: column; gap: 4px; }
.pw-name { font-size: 12px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.pw-bar { display: block; width: 64px; height: 5px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.pw-bar i { display: block; height: 100%; background: var(--c); transform-origin: left center; }
.pw-pips { color: var(--c); font-size: 11px; font-weight: 900; letter-spacing: 0.12em; }
.pw.ending { animation: blink 0.3s steps(2) infinite; }

/* ---- Screens ------------------------------------------------------------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  background: rgba(14, 16, 20, 0.45);
  overflow-y: auto;
  animation: fade-in 0.25s ease;
}
.screen.modal { background: rgba(10, 12, 16, 0.72); z-index: 5; }
.screen > * { margin: auto 0; }

.hint { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }

/* Back to the arcade picker (top left of the title screen) */
.arcade-back {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  z-index: 2;
  margin: 0;
  padding: 8px 12px 6px;
  border-radius: 7px;
  background: var(--asphalt-2);
  color: var(--sign-white);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--asphalt-2), inset 0 0 0 3.5px var(--sign-white), 0 3px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease;
}
.arcade-back:hover { transform: translateY(-1px); }
.arcade-back:active { transform: translateY(2px); }
.arcade-back:focus-visible { outline: 3px solid var(--sign-white); outline-offset: 3px; }

/* Title: a guide sign with an exit tab and an up arrow */
.title-stack {
  width: min(540px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: drop-in 0.5s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.guide-sign {
  position: relative;
  margin-top: 30px;
  padding: 7px;
  border-radius: 14px;
  background: var(--sign-green);
  box-shadow: 0 6px 0 #004a31, 0 18px 40px rgba(0, 0, 0, 0.45);
}
.exit-tab {
  position: absolute;
  top: -30px;
  right: 28px;
  padding: 5px 5px 0;
  border-radius: 8px 8px 0 0;
  background: var(--sign-green);
}
.exit-tab span {
  display: block;
  padding: 5px 12px 4px;
  border: 3px solid var(--sign-white);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.1em;
}
.guide-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px 24px;
  border: 4px solid var(--sign-white);
  border-radius: 9px;
}
.guide-text { min-width: 0; }
.logo {
  margin: 0;
  font-size: clamp(50px, 13vw, 92px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.tag { margin: 8px 0 0; font-size: clamp(16px, 3.8vw, 21px); font-weight: 700; letter-spacing: 0.02em; }
.sign-arrow { flex: none; width: clamp(40px, 11vw, 72px); height: auto; color: var(--sign-white); }

/* Power-ups on a blue "services" sign */
.service-sign {
  padding: 5px;
  border-radius: 10px;
  background: var(--sign-blue);
  box-shadow: 0 4px 0 #12335f, 0 12px 26px rgba(0, 0, 0, 0.35);
}
.service-inner { padding: 10px 14px 12px; border: 3px solid var(--sign-white); border-radius: 7px; }
.service-title { margin: 0 0 8px; font-size: 13px; font-weight: 900; letter-spacing: 0.16em; }
.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 8px 12px;
}
.legend li { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }
.legend img { width: 28px; height: 28px; display: block; }

.diamond {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--sign-yellow);
  box-shadow: inset 0 0 0 2px var(--sign-yellow), inset 0 0 0 3.5px var(--ink);
  transform: rotate(45deg);
}
.diamond span { transform: rotate(-45deg); color: var(--ink); font-weight: 900; font-size: 18px; line-height: 1; }
.diamond.big { width: 40px; height: 40px; box-shadow: inset 0 0 0 3px var(--ink); }
.diamond.big span { font-size: 24px; }

.title-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.controls, .meta { margin: 0; font-size: 14px; font-weight: 700; color: var(--muted); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }
.meta b { color: var(--sign-white); }
kbd {
  display: inline-block;
  min-width: 24px;
  margin: 0 2px;
  padding: 3px 5px 1px;
  border-radius: 4px;
  background: var(--sign-white);
  color: var(--ink);
  font: 800 12px var(--font-sign);
  text-align: center;
  box-shadow: inset 0 0 0 1.5px var(--ink), 0 2px 0 rgba(0, 0, 0, 0.4);
}
@media (hover: none) { .controls.kb { display: none; } }
@media (hover: hover) { .controls.touch { display: none; } }
.gore-badge {
  padding: 4px 8px 2px;
  border-radius: 4px;
  background: var(--sign-red);
  color: var(--sign-white);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

/* Pause: road-closed barricade */
.barricade-card {
  width: min(360px, 100%);
  overflow: hidden;
  border-radius: 10px;
  background: var(--asphalt-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  animation: slide-up 0.3s ease-out;
}
.barricade { height: 26px; background: repeating-linear-gradient(-45deg, var(--sign-orange) 0 18px, var(--sign-white) 18px 36px); }
.barricade-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 20px 20px; }
.barricade-body h2 { margin: 0; font-size: 34px; font-weight: 900; letter-spacing: 0.08em; }

/* Game over: a traffic incident report on a clipboard */
.report {
  position: relative;
  width: min(400px, 100%);
  margin-top: 26px;
  padding: 0 0 18px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--form-ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  transform: rotate(-1deg);
  animation: slide-up 0.4s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.report::before { /* clipboard clip */
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 26px;
  margin-left: -55px;
  border-radius: 6px;
  background: linear-gradient(#8d939c, #5d636c);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
}
.report-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 24px 20px 8px;
  border-bottom: 2px solid var(--form-ink);
  font: 700 12px var(--font-mono);
  letter-spacing: 0.06em;
}
.report h2 { color: var(--ink); font-size: 36px; font-weight: 900; line-height: 1; }
.fields { margin: 6px 20px 0; }
.fields div {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 8px 0 5px;
  border-bottom: 1px solid var(--form-line);
}
.fields dt { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.fields dd { margin: 0; color: var(--ink); font: 700 17px var(--font-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.report-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 12px 20px 2px; }
.report-title h2 { margin: 0; }
.stamp {
  padding: 5px 10px 2px;
  border: 3px solid var(--sign-red);
  border-radius: 4px;
  color: var(--sign-red);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.12em;
  opacity: 0.85;
  transform: rotate(-10deg);
  animation: stamp 0.35s 0.25s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.report .actions { padding: 18px 20px 0; }
.report .hint { margin: 10px 20px 0; color: #5d6b82; }

/* Settings: white regulatory sign */
.reg-sign {
  width: min(460px, 100%);
  padding: 6px;
  border-radius: 12px;
  background: var(--sign-white);
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  animation: slide-up 0.25s ease-out;
}
.reg-inner { display: flex; flex-direction: column; padding: 16px 18px 18px; border: 4px solid var(--ink); border-radius: 8px; }
.reg-inner h2 { margin: 0 0 6px; font-size: 26px; font-weight: 900; letter-spacing: 0.12em; }
.reg-inner > .btn-yellow { align-self: flex-start; margin-top: 12px; }
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 2px solid rgba(22, 24, 28, 0.12);
}
.set-row > div { min-width: 0; }
.set-row b { display: block; font-size: 18px; font-weight: 800; }
.set-row span { display: block; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.35; }
.toggle {
  position: relative;
  flex: none;
  width: 58px;
  height: 32px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: #d9dbe0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.toggle i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 3px;
  background: var(--ink);
  transition: transform 0.15s ease, background 0.15s ease;
}
.toggle[aria-checked="true"] { background: var(--sign-green); }
.toggle[aria-checked="true"] i { transform: translateX(26px); background: var(--sign-white); }
.set-row.gore .toggle[aria-checked="true"] { background: var(--sign-red); }
.reg-sign button:focus-visible, .warn-card button:focus-visible { outline-color: var(--sign-blue); }

/* Warning: yellow warning sign */
.warn-card {
  width: min(480px, 100%);
  padding: 6px;
  border-radius: 12px;
  background: var(--sign-yellow);
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  animation: slide-up 0.25s ease-out;
}
.warn-inner { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 4px solid var(--ink); border-radius: 8px; }
.warn-head { display: flex; align-items: center; gap: 16px; }
.warn-head h2 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
.warn-inner p { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4; }


.btn-yellow.small, .btn-plate.small, .btn-red.small { font-size: 14px; padding: 9px 12px 7px; }
.btn-yellow:disabled, .btn-plate:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-yellow .coin-ico { display: inline-block; vertical-align: -2px; }

/* ---- Missions: orange construction sign ------------------------------------- */
.work-sign { padding: 5px; border-radius: 10px; background: var(--sign-orange); box-shadow: 0 4px 0 #a8440f, 0 12px 26px rgba(0, 0, 0, 0.35); color: var(--ink); }
.work-inner { padding: 10px 14px 12px; border: 3px solid var(--ink); border-radius: 7px; }
.work-title { margin: 0 0 8px; font-size: 13px; font-weight: 900; letter-spacing: 0.14em; }
.missions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.missions li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; font-size: 15px; font-weight: 800; }
.m-text { min-width: 0; }
.m-reward { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.m-bar { grid-column: 1 / -1; height: 5px; background: rgba(0, 0, 0, 0.18); overflow: hidden; }
.m-bar i { display: block; height: 100%; background: var(--sign-green); transform-origin: left center; }
.missions.dark li { color: var(--sign-white); font-size: 14px; }
.missions.dark .m-bar { background: rgba(255, 255, 255, 0.15); }
.missions.dark .m-bar i { background: var(--sign-yellow); }
.missions.paper { margin: 12px 20px 0; }
.missions.paper li { font: 700 13px var(--font-mono); color: var(--ink); }
.missions.paper .m-bar i { background: var(--form-ink); }

/* ---- HUD extras ------------------------------------------------------------- */
.plate.combo {
  min-width: 0;
  padding: 6px 10px 4px;
  background: #0f6e8c;
  color: var(--sign-white);
  box-shadow: inset 0 0 0 2px #0f6e8c, inset 0 0 0 3.5px var(--sign-white), 0 3px 0 rgba(0, 0, 0, 0.3);
  animation: pop-in 0.2s ease-out;
}
.plate.combo b { font-size: 24px; margin: 0; }
.plate.combo span { font-size: 9px; font-weight: 900; letter-spacing: 0.14em; }

.toasts {
  position: absolute;
  top: calc(max(14px, env(safe-area-inset-top)) + 64px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 16px 7px;
  border-radius: 8px;
  text-align: center;
  animation: drop-in 0.3s cubic-bezier(0.2, 1.3, 0.4, 1);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.toast.out { opacity: 0; transform: translateY(-10px); }
.toast b { font-size: 17px; font-weight: 900; letter-spacing: 0.08em; }
.toast span { font-size: 13px; font-weight: 700; }
.t-event { background: var(--sign-purple); color: var(--sign-white); box-shadow: inset 0 0 0 2px var(--sign-purple), inset 0 0 0 4px var(--sign-white), 0 6px 18px rgba(0, 0, 0, 0.35); }
.t-weather { background: var(--sign-yellow); color: var(--ink); box-shadow: inset 0 0 0 2px var(--sign-yellow), inset 0 0 0 4px var(--ink), 0 6px 18px rgba(0, 0, 0, 0.35); }
.t-mission { background: var(--sign-orange); color: var(--ink); box-shadow: inset 0 0 0 2px var(--sign-orange), inset 0 0 0 4px var(--ink), 0 6px 18px rgba(0, 0, 0, 0.35); }

/* ---- Skin shop: brown attraction sign ------------------------------------------- */
.brown-sign { width: min(620px, 100%); padding: 6px; border-radius: 12px; background: var(--sign-brown); color: var(--sign-white); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); animation: slide-up 0.25s ease-out; }
.brown-inner { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; border: 4px solid var(--sign-white); border-radius: 8px; }
.brown-inner > .btn-yellow { align-self: flex-start; }
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shop-head h2 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: 0.12em; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.skin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}
.skin.equipped { box-shadow: inset 0 0 0 3px var(--sign-yellow); }
.skin canvas { width: 96px; height: 96px; }
.skin b { font-size: 15px; font-weight: 800; text-align: center; }

/* ---- Report extras ------------------------------------------------------------ */
.report.bloody::after { /* evidence */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 86% 18%, rgba(140, 8, 20, 0.75) 0 16px, transparent 17px),
    radial-gradient(circle at 80% 24%, rgba(140, 8, 20, 0.7) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 28%, rgba(140, 8, 20, 0.65) 0 4px, transparent 5px),
    radial-gradient(circle at 10% 88%, rgba(140, 8, 20, 0.6) 0 10px, transparent 11px),
    radial-gradient(circle at 16% 82%, rgba(140, 8, 20, 0.55) 0 4px, transparent 5px),
    radial-gradient(ellipse 6px 26px at 88% 34%, rgba(140, 8, 20, 0.55) 0 100%, transparent 101%);
  mix-blend-mode: multiply;
}


/* ---- Title menu: PLAY, a row of modes, and a small row of extras ------------------- */
.title-stack { width: min(460px, 100%); gap: 14px; }
.play-main { width: 100%; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 56px;
  padding: 8px 6px 6px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s ease;
}
.mode-btn b { font-size: 14px; font-weight: 900; letter-spacing: 0.04em; line-height: 1.1; }
.mode-btn em { font-style: normal; font: 700 11px var(--font-mono); opacity: 0.8; }
.mode-btn em:empty { display: none; }
.mode-btn:hover { transform: translateY(-2px); }
.mode-btn:active { transform: translateY(3px); }
.m-hardcore { background: var(--ink); color: #ff5a6e; box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--sign-red), 0 4px 0 #000; }
.m-hardcore em { color: var(--sign-white); }
.m-time { background: var(--sign-white); color: var(--ink); box-shadow: inset 0 0 0 2px var(--sign-white), inset 0 0 0 4px var(--ink), 0 4px 0 #9a9a94; }
.m-versus { background: var(--sign-green); color: var(--sign-white); box-shadow: inset 0 0 0 2px var(--sign-green), inset 0 0 0 4px var(--sign-white), 0 4px 0 #004a31; }
.mode-hint { margin: -4px 0 0; min-height: 1.3em; font-size: 13px; font-weight: 700; text-align: center; color: var(--sign-white); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7); }
.menu-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.title-stack > .meta { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.title-stack > .meta .coin-ico { display: inline-block; }
.title-stack > .meta .gore-badge { margin-left: 8px; }
.count { font: 700 13px var(--font-mono); opacity: 0.7; margin-left: 4px; }

/* ---- HUD extras ---------------------------------------------------------------- */
.plate.mode-badge { min-width: 0; padding: 6px 10px 4px; font-size: 12px; font-weight: 900; letter-spacing: 0.14em; }
.plate.mode-badge.hardcore { background: var(--ink); color: #ff5a6e; box-shadow: inset 0 0 0 2px var(--sign-red), 0 4px 10px rgba(0, 0, 0, 0.3); }
.plate.mode-badge.time { background: var(--sign-white); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink), 0 4px 10px rgba(0, 0, 0, 0.3); }
.plate.guide.p1 { box-shadow: inset 0 0 0 3px #ff5c5c, 0 6px 14px rgba(0, 0, 0, 0.3); }
.plate.guide.p2 { box-shadow: inset 0 0 0 3px #4da3ff, 0 6px 14px rgba(0, 0, 0, 0.3); }
.timer {
  position: absolute;
  top: calc(max(14px, env(safe-area-inset-top)) - 2px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 78px;
  padding: 6px 12px 3px;
  border-radius: 8px;
  background: var(--sign-white);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--sign-white), inset 0 0 0 4px var(--ink), 0 6px 14px rgba(0, 0, 0, 0.3);
}
.timer span { font-size: 10px; font-weight: 900; letter-spacing: 0.18em; }
.timer b { font: 900 32px/1 var(--font-sign); font-variant-numeric: tabular-nums; }
.timer.low { background: var(--sign-yellow); box-shadow: inset 0 0 0 2px var(--sign-yellow), inset 0 0 0 4px var(--ink), 0 6px 14px rgba(0, 0, 0, 0.3); animation: blink 0.5s steps(2) infinite; }
.vs-tally {
  position: absolute;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 4px);
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px 5px;
  border-radius: 8px;
  background: rgba(14, 16, 20, 0.7);
  font: 700 14px var(--font-mono);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

/* ---- Replay ---------------------------------------------------------------- */
#replay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 3; cursor: pointer; }

/* ---- Settings extras ------------------------------------------------------------- */
.reg-sign { max-height: none; }
.set-head { margin: 14px 0 2px; font-size: 12px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.set-note { margin: 8px 0 0; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--ink-soft); }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 6px; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; font-weight: 800; }
.key-btn {
  min-width: 64px;
  padding: 7px 10px 5px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--sign-white);
  font: 700 15px var(--font-mono);
  cursor: pointer;
}
.key-btn.listening { background: var(--sign-yellow); color: var(--ink); animation: blink 0.6s steps(2) infinite; }
.keys-reset { align-self: flex-start; margin-top: 10px; }

/* ---- Tabs (shop and trophy room) -------------------------------------------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  padding: 8px 14px 6px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--sign-white); color: var(--ink); }
.skin.locked b { opacity: 0.8; }
.skin .unlock { font-size: 12px; font-weight: 700; line-height: 1.3; text-align: center; color: #f3d9b8; }

/* ---- Trophy room: blue services sign ---------------------------------------------- */
.blue-sign { width: min(640px, 100%); padding: 6px; border-radius: 12px; background: var(--sign-blue); color: var(--sign-white); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); animation: slide-up 0.25s ease-out; }
.blue-inner { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; border: 4px solid var(--sign-white); border-radius: 8px; }
.blue-inner > .btn-yellow { align-self: flex-start; }
.trophy-progress { font: 700 16px var(--font-mono); }
.trophy-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.trophy-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0.62;
}
.trophy-list li.got { background: rgba(255, 255, 255, 0.14); opacity: 1; }
.trophy-list b { display: block; font-size: 15px; font-weight: 900; }
.trophy-list span { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.trophy-list em { display: block; margin-top: 2px; font-style: normal; font-size: 12px; font-weight: 800; color: var(--sign-yellow); }
.trophy-list i { font-style: normal; font-size: 11px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; }
.cup {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}
.got .cup { background: radial-gradient(circle at 35% 35%, #fff3b0 0 20%, var(--sign-yellow) 21% 100%); box-shadow: inset 0 0 0 2px #a87800; }
.stats-title { margin: 4px 0 6px; font-size: 12px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.85; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 16px; margin: 0 0 10px; }
.stat-grid div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.stat-grid dt { font-size: 14px; font-weight: 700; }
.stat-grid dd { margin: 0; font: 700 14px var(--font-mono); font-variant-numeric: tabular-nums; }
.death-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.death-bars li { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 3em; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.death-bars li.empty { display: block; opacity: 0.8; }
.death-bars .bar { height: 10px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.death-bars .bar i { display: block; height: 100%; background: var(--sign-yellow); }
.death-bars b { font: 700 13px var(--font-mono); text-align: right; }

/* ---- Report extras --------------------------------------------------------------- */
.trophy-strip { list-style: none; margin: 12px 20px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.trophy-strip li { padding: 6px 10px 5px; border-radius: 4px; background: #fff3c4; color: var(--ink); font: 700 13px var(--font-mono); box-shadow: inset 3px 0 0 var(--sign-yellow-deep); }
.trophy-strip li::before { content: 'TROPHY  '; font-weight: 700; color: var(--sign-yellow-deep); }
@media (min-width: 980px) {
  #screen-over { justify-content: flex-start; padding-left: max(5vw, 32px); background: linear-gradient(90deg, rgba(14, 16, 20, 0.55), rgba(14, 16, 20, 0.05) 60%); }
}

/* ---- Levels -------------------------------------------------------------------- */
.xp-block { margin: 12px 20px 0; padding: 9px 12px 8px; border-radius: 6px; background: #eef3fb; box-shadow: inset 0 0 0 1.5px var(--form-line); color: var(--ink); }
.xp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.xp-top b { font-size: 15px; font-weight: 900; letter-spacing: 0.1em; color: var(--form-ink); }
.xp-top span { font: 700 14px var(--font-mono); color: var(--form-ink); }
.xp-bar { height: 8px; margin-top: 6px; border-radius: 4px; background: rgba(31, 58, 102, 0.15); overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #3a86ff, #7b5cff); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.xp-rewards { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.xp-rewards li { font: 700 13px var(--font-mono); color: #7a4b00; }
.xp-rewards li.next { color: var(--ink-soft); font-weight: 400; }
.lvl { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.lvl b { padding: 3px 7px 1px; border-radius: 4px; background: #7b5cff; color: #fff; font-size: 12px; letter-spacing: 0.08em; }
.lvl-bar { display: inline-block; width: 54px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.lvl-bar i { display: block; height: 100%; background: #b9a8ff; }

/* ---- Admin panel: a hazard-striped work order ------------------------------------ */
.exit-tab { cursor: pointer; }
.exit-tab.tapped { animation: tap-wiggle 0.2s ease; }
@keyframes tap-wiggle { 50% { transform: translateY(2px) rotate(-3deg); } }
.admin-card { width: min(640px, 100%); border-radius: 12px; overflow: hidden; background: var(--ink); color: var(--sign-white); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); animation: slide-up 0.25s ease-out; }
.admin-stripes { height: 16px; background: repeating-linear-gradient(-45deg, var(--sign-yellow) 0 14px, var(--ink) 14px 28px); }
.admin-inner { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 18px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-top h2 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: 0.2em; color: var(--sign-yellow); }
.admin-status { margin: 0; font: 700 13px var(--font-mono); color: var(--muted); min-height: 1.3em; }
.admin-status.pop { color: var(--sign-yellow); }
.admin-head { margin: 12px 0 6px; font-size: 11px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.admin-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.admin-btn {
  padding: 8px 11px 6px;
  border: 0;
  border-radius: 6px;
  background: var(--asphalt-2);
  color: var(--sign-white);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.18);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.admin-btn:hover { background: #3a3f48; }
.admin-btn:active { transform: translateY(2px); }
.admin-btn.go { background: var(--sign-yellow); color: var(--ink); box-shadow: none; }
.admin-btn.gold { background: #6b4f00; box-shadow: inset 0 0 0 1.5px var(--sign-yellow); color: #ffe27a; }
.admin-btn.danger { background: #4a0d15; box-shadow: inset 0 0 0 1.5px var(--sign-red); color: #ff9aa8; }
.admin-btn.flip[aria-pressed="true"] { background: var(--sign-green); box-shadow: inset 0 0 0 1.5px #5fd39c; }
.admin-field { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; border-radius: 6px; background: var(--asphalt-2); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.18); }
.admin-field span { font-size: 12px; font-weight: 800; color: var(--muted); }
.admin-field input { width: 110px; padding: 7px 4px; border: 0; background: transparent; color: var(--sign-white); font: 700 15px var(--font-mono); -webkit-user-select: text; user-select: text; }
.admin-field input:focus { outline: none; }
.admin-field:focus-within { box-shadow: inset 0 0 0 2px var(--sign-yellow); }
.admin-card button:focus-visible { outline-color: var(--sign-yellow); }
.admin-slider { flex: 1 1 200px; min-width: 0; accent-color: var(--sign-yellow); }
.admin-speed-val { align-self: center; min-width: 3.5em; font: 700 15px var(--font-mono); color: var(--sign-yellow); }
.freecam-banner { position: absolute; left: 50%; bottom: calc(max(14px, env(safe-area-inset-bottom)) + 4px); transform: translateX(-50%); padding: 8px 14px 6px; border-radius: 8px; background: repeating-linear-gradient(-45deg, var(--sign-yellow) 0 10px, var(--ink) 10px 20px); color: var(--ink); font-size: 13px; font-weight: 900; letter-spacing: 0.06em; white-space: nowrap; box-shadow: inset 0 0 0 100px rgba(252, 194, 27, 0.92); }
.skin .perk { color: #ffe9b0; }

/* ---- Toasts --------------------------------------------------------------------- */
.t-zone { background: var(--sign-green); color: var(--sign-white); box-shadow: inset 0 0 0 2px var(--sign-green), inset 0 0 0 4px var(--sign-white), 0 6px 18px rgba(0, 0, 0, 0.35); }
.t-trophy { background: var(--sign-blue); color: var(--sign-white); box-shadow: inset 0 0 0 2px var(--sign-blue), inset 0 0 0 4px var(--sign-yellow), 0 6px 18px rgba(0, 0, 0, 0.35); }

/* ---- Reduced motion (setting) ------------------------------------------------------ */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; }

/* ---- Animations --------------------------------------------------------- */
@keyframes bump { 45% { transform: scale(1.16); } }
@keyframes pop-in { from { transform: scale(0.6); opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }
@keyframes drop-in { from { transform: translateY(-30px); opacity: 0; } }
@keyframes blink { 50% { opacity: 0.45; } }
@keyframes stamp { from { transform: rotate(-10deg) scale(2.2); opacity: 0; } }

@media (max-width: 560px) {
  .toasts { top: calc(max(14px, env(safe-area-inset-top)) + 150px); }
  .toast b { font-size: 15px; }
  .timer { top: calc(max(14px, env(safe-area-inset-top)) + 82px); }
  .keys { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .plate { min-width: 64px; padding: 7px 10px 4px; }
  .plate b { font-size: 28px; }
  .btn-big { font-size: 28px; padding: 16px 34px 12px; }
  .guide-inner { padding: 14px 14px 12px 16px; }
  .report h2 { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Egg-only pets, the hatch toast, rage and reverse day ---------------------- */
.skin .rarity { font-size: 9.5px; font-weight: 900; letter-spacing: 0.08em; white-space: nowrap; padding: 2px 7px; border-radius: 4px; color: #1d1b3a; }
.rarity.r-legendary { background: linear-gradient(90deg, #ffd23f, #ff8a2a, #ff4fa3); }
.rarity.r-epic { background: #c79bff; }
.rarity.r-rare { background: #7fd6ff; }
.skin.egg:not(.locked) { box-shadow: inset 0 0 0 2px #ffd23f; }
.t-hatch { background: linear-gradient(135deg, #ffd23f, #ff8a2a); color: var(--ink); box-shadow: inset 0 0 0 2px #ffd23f, inset 0 0 0 4px var(--ink), 0 6px 24px rgba(255, 180, 40, 0.55); }
.t-rage { background: #b3120c; color: var(--sign-white); box-shadow: inset 0 0 0 2px #b3120c, inset 0 0 0 4px var(--sign-white), 0 6px 24px rgba(255, 40, 20, 0.5); }
.t-reverse { background: #1d1b3a; color: #ffd23f; box-shadow: inset 0 0 0 2px #1d1b3a, inset 0 0 0 4px #ffd23f, 0 6px 24px rgba(0, 0, 0, 0.5); }
.pw.rage-full { animation: rage-pulse 0.35s ease-in-out infinite alternate; }
@keyframes rage-pulse { from { box-shadow: inset 0 0 0 2px var(--c), 0 3px 0 rgba(0, 0, 0, 0.35); } to { box-shadow: inset 0 0 0 3px #fff, 0 0 18px rgba(255, 60, 30, 0.9); } }

/* ---- Shop collection progress ------------------------------------------------- */
.collection { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 900; letter-spacing: 0.12em; }
.collection-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
.collection-bar i { display: block; height: 100%; width: 0; background: var(--sign-yellow); transition: width 0.3s ease; }
.tab small { font-size: 11px; font-weight: 800; opacity: 0.7; margin-left: 2px; }
#btn-reset-data { flex-shrink: 0; }
/* two columns of shop cards on phones (there are a lot of them now) */
@media (max-width: 480px) {
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .skin { padding: 8px 6px 10px; gap: 6px; }
  .skin canvas { width: 80px; height: 80px; }
  .skin b { font-size: 13px; }
  .skin .unlock { font-size: 11px; }
}

.t-calm { background: #1a4fb8; color: var(--sign-white); box-shadow: inset 0 0 0 2px #1a4fb8, inset 0 0 0 4px var(--sign-white), 0 6px 24px rgba(40, 110, 255, 0.45); }
.t-fever { background: linear-gradient(135deg, #ffe066, #ffb000); color: var(--ink); box-shadow: inset 0 0 0 2px #ffd23f, inset 0 0 0 4px var(--ink), 0 6px 24px rgba(255, 190, 40, 0.6); }

/* ---- Outfits, titles, mystery boxes, pet levels ------------------------------- */
.outfits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.outfit { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); }
.outfit canvas { width: 52px; height: 52px; }
.outfit.empty canvas { opacity: 0.25; }
.outfit b { font-size: 12px; font-weight: 900; letter-spacing: 0.08em; }
.outfit-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.outfit-btns button { font-size: 11px !important; padding: 6px 8px 4px !important; }
.skin .petlv { color: #b9f2a6; font-size: 11px; }
.skin.boxed:not(.locked) { box-shadow: inset 0 0 0 2px #c79bff; }
.rarity.r-mystery { background: linear-gradient(90deg, #a95cff, #ff5c8a); color: #fff; }
.title-plate { align-self: flex-start; padding: 3px 8px 2px; border-radius: 4px; background: #1d1b3a; color: #ffd23f; font-size: 11px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; box-shadow: inset 0 0 0 1.5px #ffd23f; }
.box-strip { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.box-strip li { font-size: 13px; font-weight: 800; color: #6a35cc; }
.box-strip li.rare { color: #c0108a; animation: pop-in 0.4s ease-out; }
.box-strip li.pet { color: #2e7d32; }

/* ---- Upgrades tab in the shop ------------------------------------------------------- */
.shop-grid.upg-grid { display: flex; flex-direction: column; gap: 6px; }
.upg-note { margin: 0 0 4px; font-size: 14px; font-weight: 600; line-height: 1.4; opacity: 0.9; }
.upg-cat { margin: 8px 0 0; font-size: 12px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sign-white); display: flex; align-items: center; gap: 8px; }
.upg-cat::before { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.upg-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.22); box-shadow: inset 3px 0 0 var(--c); }
.upg-row.maxed { background: rgba(255, 255, 255, 0.1); }
.upg-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fbfbf8; }
.upg-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.upg-txt b { font-size: 15px; font-weight: 900; }
.upg-txt span { font-size: 13px; font-weight: 600; }
.upg-txt em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--sign-yellow); }
.maxed .upg-txt em { color: #b8f0c8; }
.upg-pips { display: flex; gap: 3px; }
.upg-pips i { width: 9px; height: 14px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); }
.upg-pips i.on { background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3); }
.upg-row .btn-yellow, .upg-row .btn-plate { min-width: 84px; }
.tab.tab-upg { box-shadow: inset 0 -3px 0 var(--sign-yellow); }
@media (max-width: 520px) {
  .upg-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .upg-pips { grid-column: 2; grid-row: 2; }
  .upg-row .btn-yellow, .upg-row .btn-plate { grid-column: 3; grid-row: 1 / span 2; }
}

/* ---- Goals: a green guide sign ------------------------------------------------------- */
.green-sign { width: min(680px, 100%); padding: 6px; border-radius: 12px; background: var(--sign-green); color: var(--sign-white); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5); animation: slide-up 0.25s ease-out; }
.green-inner { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; border: 4px solid var(--sign-white); border-radius: 8px; }
.green-inner > .btn-yellow { align-self: flex-start; }
.goals-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.goals-note { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; opacity: 0.9; }
.mastery-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.mastery-list > li { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.22); box-shadow: inset 4px 0 0 var(--zone); }
.mastery-list > li.done { background: rgba(255, 255, 255, 0.14); }
.m-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.m-head b { font-size: 16px; font-weight: 900; }
.m-stars { font-size: 18px; letter-spacing: 0.08em; color: var(--sign-yellow); }
.m-goals { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-weight: 600; opacity: 0.75; }
.m-goals li.got { opacity: 1; color: var(--sign-yellow); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.mastery-list em, .roadex-page em { font-style: normal; font-size: 12px; font-weight: 800; color: #b8f0c8; }
.done em { color: var(--sign-yellow); }
.roadex-page { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.22); }
.roadex-page.done { background: rgba(255, 255, 255, 0.14); }
.rx-head { display: flex; justify-content: space-between; align-items: baseline; }
.rx-head b { font-size: 16px; font-weight: 900; }
.rx-count { font: 700 14px var(--font-mono); }
.rx-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.rx-grid li { padding: 3px 7px 2px; border-radius: 4px; background: rgba(0, 0, 0, 0.25); font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.45); }
.rx-grid li.seen { background: var(--sign-white); color: var(--sign-green); }
.prestige-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 8px; background: rgba(0, 0, 0, 0.22); }
.prestige-card p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.prestige-card .p-now { font: 700 13px var(--font-mono); color: var(--sign-yellow); }
.p-stars { font-size: 30px; letter-spacing: 0.08em; color: var(--sign-yellow); }
.p-rewards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; font-weight: 700; opacity: 0.8; }
.p-rewards li.got { color: var(--sign-yellow); opacity: 1; }

/* ---- Shards, evolutions and the new toasts --------------------------------------------- */
.shop-wallet { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.shard-ico { display: inline-block; width: 13px; height: 13px; transform: rotate(45deg); background: linear-gradient(135deg, #f1dcff, #a95cff 60%, #6a35cc); box-shadow: 0 0 0 1.5px var(--ink); vertical-align: -1px; }
.plate.shardplate { flex-direction: row; align-items: center; gap: 7px; min-width: 0; padding: 5px 10px 3px 9px; background: #e9dcff; color: var(--ink); box-shadow: inset 0 0 0 2px #e9dcff, inset 0 0 0 3.5px var(--ink), 0 3px 0 rgba(0, 0, 0, 0.3); }
.plate.shardplate b { font-size: 18px; margin: 0; }
.shop-wallet { align-items: center; }
.skin.evolved { box-shadow: inset 0 0 0 2px #ffd23f, 0 0 18px rgba(255, 210, 60, 0.35); }
.evolve-btn { margin-top: 2px; }
.t-upgrade { background: linear-gradient(135deg, #f1ecfb, #d9c8ff); color: var(--ink); box-shadow: inset 0 0 0 2px #a95cff, inset 0 0 0 4px var(--ink); }
.t-golden { background: linear-gradient(135deg, #fff3b0, #ffd23f 55%, #f0b400); color: var(--ink); box-shadow: inset 0 0 0 2px #fff6d0, inset 0 0 0 4px var(--ink), 0 6px 24px rgba(255, 200, 40, 0.6); }
.t-room { background: #2b2622; color: #ffe9b0; box-shadow: inset 0 0 0 2px #ffd23f, inset 0 0 0 4px #2b2622; }
.t-mastery { background: var(--sign-green); color: var(--sign-white); box-shadow: inset 0 0 0 2px var(--sign-white), inset 0 0 0 4px var(--sign-green); }
.t-roadex { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--sign-green), inset 0 0 0 4px var(--paper); }

/* ---- Claw machine: a neon arcade cabinet ----------------------------------------------- */
.claw-cab { width: min(440px, 100%); padding: 6px; border-radius: 16px; background: linear-gradient(180deg, #5b2a9e, #2a1450); color: var(--sign-white); box-shadow: 0 0 0 3px #ff4fe0, 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 80, 230, 0.35); animation: slide-up 0.25s ease-out; }
.claw-inner { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; border: 3px solid rgba(255, 255, 255, 0.85); border-radius: 12px; }
.claw-inner h2 { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: 0.12em; color: #ffe95c; text-shadow: 0 0 10px rgba(255, 233, 92, 0.6); }
.claw-canvas { display: block; width: 100%; max-width: 360px; aspect-ratio: 4 / 3; align-self: center; border-radius: 8px; box-shadow: inset 0 0 0 2px #4df0ff, 0 0 18px rgba(77, 240, 255, 0.25); }
.claw-result { min-height: 1.4em; margin: 0; text-align: center; font-size: 15px; font-weight: 800; }
.claw-result.win { color: #c79bff; animation: pop-in 0.4s ease-out; }
.claw-result.jackpot { color: #ffe95c; font-size: 17px; text-shadow: 0 0 12px rgba(255, 233, 92, 0.8); animation: pop-in 0.5s ease-out; }
.claw-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.claw-btns .coin-ico { display: inline-block; vertical-align: -2px; }
.claw-btns .gold { background: linear-gradient(180deg, #fff3b0, #ffd23f); }
.claw-hint { margin: 0; text-align: center; font-size: 13px; font-weight: 800; color: #4df0ff; }
.claw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.claw-stats div { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.28); }
.claw-stats dt { font-size: 10px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75; }
.claw-stats dd { margin: 0; font: 700 17px var(--font-mono); font-variant-numeric: tabular-nums; color: #ffe95c; }
.claw-inner > .btn-plate { align-self: flex-start; }
.rarity.r-claw { background: #ff4fe0; color: #fff; }
.rarity.r-jackpot { background: linear-gradient(90deg, #ffd23f, #ff4fe0, #4df0ff); color: var(--ink); }

/* ---- "So close" notes on the report ------------------------------------------------- */
.close-list { list-style: none; margin: 10px 20px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.close-list li { padding: 5px 10px 4px; border-radius: 4px; background: #e8f6ee; color: #1f5c3a; font: 700 13px var(--font-mono); box-shadow: inset 3px 0 0 #2fa84f; }
.close-list li::before { content: 'SO CLOSE  '; color: #2fa84f; }
.claw-stage { position: relative; align-self: center; width: 100%; max-width: 360px; }
.claw-stage .claw-canvas { width: 100%; touch-action: none; cursor: crosshair; }
.claw-btns.steer .steer-btn { min-width: 64px; font-size: 20px; touch-action: none; }
.claw-btns.steer .drop-btn { min-width: 120px; font-size: 20px; letter-spacing: 0.1em; }
.claw-win { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; border-radius: 8px; background: rgba(12, 6, 26, 0.72); animation: fade-in 0.2s ease; }
.claw-win-card { display: flex; flex-direction: column; align-items: center; gap: 4px; width: min(300px, 100%); padding: 12px 14px 14px; border-radius: 12px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 0 0 3px #ffd23f, 0 12px 30px rgba(0, 0, 0, 0.5); animation: pop-in 0.35s ease-out; }
.claw-win.cosmetic .claw-win-card { box-shadow: 0 0 0 3px #a95cff, 0 0 30px rgba(169, 92, 255, 0.6); }
.claw-win.jackpot .claw-win-card { box-shadow: 0 0 0 3px #ffd23f, 0 0 0 6px #ff4fe0, 0 0 40px rgba(255, 210, 60, 0.8); }
.claw-win-kicker { margin: 0; font: 700 11px var(--font-mono); letter-spacing: 0.2em; color: #a95cff; }
.claw-win-art { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle, #fff6d0 0, #f1ecfb 60%, transparent 72%); }
.claw-win-art canvas { width: 92px; height: 92px; }
.big-coin { width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4b8 0 18%, #ffd23f 22% 60%, #9c6a00 64%); box-shadow: 0 0 0 3px var(--ink), 0 0 24px rgba(255, 200, 40, 0.8); animation: coin-spin 1.4s ease-in-out infinite; }
@keyframes coin-spin { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.25); } }
.claw-win-card h3 { margin: 2px 0 0; font-size: 19px; font-weight: 900; line-height: 1.15; text-wrap: balance; }
.claw-win-card p:not(.claw-win-kicker) { margin: 0 0 6px; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ink-soft); text-wrap: balance; }

/* ---- Shop: tidy layout ----------------------------------------------------------------- */
/* tabs: a 4 x 2 grid of tiles that stays at the top while you scroll */
.shop-tabs {
  position: sticky; top: calc(-20px - env(safe-area-inset-top, 0px)); z-index: 3;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px;
  margin: 0 -8px; padding: 8px; border-radius: 8px;
  background: var(--sign-brown); box-shadow: 0 8px 12px -8px rgba(0, 0, 0, 0.5);
}
.shop-tabs .tab { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; padding: 7px 4px 5px; font-size: 14px; }
.shop-tabs .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-tabs .tab small { margin: 0; font: 700 10px var(--font-mono); opacity: 0.65; }
.shop-tabs .tab[aria-selected="true"] small { opacity: 0.8; }
.shop-tabs .tab.tab-upg { box-shadow: inset 0 -3px 0 var(--sign-yellow); }

/* section headings inside the grid */
.shop-section { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 6px 0 -2px; font-size: 12px; font-weight: 900; letter-spacing: 0.16em; text-transform: uppercase; }
.shop-section:first-child { margin-top: 0; }
.shop-section::after { content: ''; flex: 1; height: 1.5px; background: rgba(255, 255, 255, 0.2); }
.shop-section small { padding: 1px 6px 0; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font: 700 11px var(--font-mono); letter-spacing: 0; }
.shop-section.locked { opacity: 0.8; }

/* cards: same layout every time, button pinned to the bottom */
.shop-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; align-items: stretch; }
.skin { position: relative; gap: 4px; padding: 14px 8px 10px; min-width: 0; }
.skin canvas { width: 88px; height: 88px; }
.skin b { font-size: 14px; line-height: 1.15; min-height: 2.3em; display: flex; align-items: center; justify-content: center; text-wrap: balance; }
.skin .rarity { position: absolute; top: -7px; left: 50%; transform: translateX(-50%); font-size: 9px; padding: 2px 6px 1px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.skin .card-info { font-size: 11px; font-weight: 700; line-height: 1.3; text-align: center; color: #ffe9b0; opacity: 0.9;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skin .card-info.petlv { color: #b9f2a6; }
.card-foot { margin-top: auto; padding-top: 4px; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; }
.card-foot .how { font-size: 11px; font-weight: 800; line-height: 1.25; text-align: center; color: #f3d9b8; }
.card-foot .how::before { content: ''; display: inline-block; width: 9px; height: 11px; margin-right: 4px; vertical-align: -1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M2 5V3.5a3 3 0 0 1 6 0V5h1v7H1V5zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M2 5V3.5a3 3 0 0 1 6 0V5h1v7H1V5zm1.5 0h3V3.5a1.5 1.5 0 0 0-3 0z'/%3E%3C/svg%3E") center / contain no-repeat; }
.skin.locked { background: rgba(0, 0, 0, 0.18); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.1); }
.skin.locked canvas, .skin.locked b { opacity: 0.6; }
.skin.locked.boxed canvas { opacity: 1; }
.skin.equipped { background: rgba(255, 210, 63, 0.12); }

/* outfits: one slim row */
.outfits { gap: 6px; }
.outfit { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 6px; row-gap: 3px; align-items: center; justify-items: start; padding: 5px 8px 5px 4px; }
.outfit canvas { grid-row: 1 / span 2; width: 40px; height: 40px; }
.outfit b { font-size: 11px; }
@media (max-width: 480px) {
  .shop-tabs .tab { font-size: 12px; padding: 6px 2px 4px; }
  .shop-grid { gap: 8px; }
  .skin canvas { width: 76px; height: 76px; }
  .skin b { font-size: 13px; }
  .outfit { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 5px 4px; }
  .outfit canvas { grid-row: auto; width: 34px; height: 34px; }
}
/* nine tabs: 5 + 4 with Upgrades taking two spaces (3 x 3 on phones) */
.shop-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.shop-tabs .tab.tab-upg { grid-column: span 2; }
.skin canvas.playable { cursor: pointer; }
@media (max-width: 480px) {
  .shop-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-tabs .tab.tab-upg { grid-column: auto; }
}

/* ---- Polish: title menu, pause card, report discoveries -------------------------------- */
/* the five menu buttons as two even rows, as wide as PLAY */
.menu-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; width: 100%; }
.menu-row > button { grid-column: span 2; min-width: 0; white-space: nowrap; }
.menu-row > #btn-claw, .menu-row > #btn-settings { grid-column: span 3; }
/* pause: RESUME across the top, the rest in an even row */
.barricade-body .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.barricade-body .actions #btn-resume { grid-column: 1 / -1; }
.barricade-body .actions #btn-pause-admin { grid-column: 1 / -1; }
/* what you found this run */
.found-list { list-style: none; margin: 10px 20px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.found-list li { padding: 5px 10px 4px; border-radius: 4px; background: #eaf2fb; color: #1f3a66; font: 700 12.5px/1.35 var(--font-mono); box-shadow: inset 3px 0 0 #3a86ff; }
.found-list li.star { background: #fff6d6; color: #7a5200; box-shadow: inset 3px 0 0 #e0a800; }
.found-list li.big { background: #e8f6ee; color: #1f5c3a; box-shadow: inset 3px 0 0 #2fa84f; }
.barricade-body .actions > button { white-space: nowrap; min-width: 0; padding-left: 8px; padding-right: 8px; }
@media (max-width: 480px) {
  .menu-row > button { padding-left: 2px; padding-right: 2px; font-size: 12px; letter-spacing: 0.02em; }
  .menu-row .count { font-size: 10px; }
  .barricade-body .actions > button:not(#btn-resume) { font-size: 15px; }
}
