/* Shared look for the arcade: the picker and every game except Road Rush
   (which keeps its own copy of these rules in road-rush/css/style.css).
   Road signs everywhere: green guide signs, white plates, yellow buttons. */
:root {
  --asphalt: #1e2126;
  --asphalt-2: #2b2f36;
  --asphalt-3: #363b44;
  --sign-green: #00704a;
  --sign-green-deep: #004a31;
  --sign-blue: #1d4f91;
  --sign-blue-deep: #12335f;
  --sign-yellow: #fcc21b;
  --sign-yellow-deep: #a87800;
  --sign-red: #c8102e;
  --sign-red-deep: #7a0a1c;
  --sign-orange: #f26722;
  --sign-orange-deep: #a8400c;
  --sign-white: #f7f7f2;
  --sign-brown: #6b3f21;
  --sign-purple: #5b3a9e;
  --sign-purple-deep: #3b2468;
  --ink: #16181c;
  --ink-soft: #4b515c;
  --paper: #fbfbf8;
  --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;
  background: var(--asphalt);
  color: var(--sign-white);
  font-family: var(--font-sign);
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

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

/* ---- Sign-plate buttons -------------------------------------------------------- */
.btn-yellow, .btn-plate, .btn-red, .btn-dark {
  display: inline-block;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sign);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  padding: 14px 26px 11px;
  text-align: center;
  text-decoration: none;
  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 var(--sign-red-deep), 0 12px 22px rgba(0, 0, 0, 0.25);
}
.btn-dark {
  font-size: 15px;
  color: var(--sign-white);
  background: var(--asphalt-2);
  box-shadow: inset 0 0 0 2px var(--asphalt-2), inset 0 0 0 3.5px var(--sign-white), 0 4px 0 rgba(0, 0, 0, 0.4);
}
.btn-big { font-size: 34px; padding: 18px 46px 14px; letter-spacing: 0.1em; }
.btn-yellow.small, .btn-plate.small, .btn-red.small, .btn-dark.small { font-size: 14px; padding: 9px 12px 7px; }
.btn-yellow:hover, .btn-plate:hover, .btn-red:hover, .btn-dark:hover { transform: translateY(-2px); }
.btn-yellow:active, .btn-plate:active, .btn-red:active, .btn-dark:active { transform: translateY(4px); }
.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 var(--sign-red-deep); }
.btn-dark:active { box-shadow: inset 0 0 0 2px var(--asphalt-2), inset 0 0 0 3.5px var(--sign-white), 0 1px 0 rgba(0, 0, 0, 0.4); }
.btn-yellow:disabled, .btn-plate:disabled, .btn-red:disabled, .btn-dark:disabled { opacity: 0.5; cursor: default; transform: none; }

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

/* Back to the picker */
.arcade-back {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  z-index: 2;
  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); }

/* ---- Plates (HUD) ---------------------------------------------------------------- */
.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: 30px; font-weight: 900; font-variant-numeric: tabular-nums; margin-top: 2px; }
.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 {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  vertical-align: -2px;
  background: radial-gradient(circle at 35% 35%, #fff4b8 0 18%, #ffd23f 22% 60%, #9c6a00 64%);
  box-shadow: 0 0 0 1.5px var(--ink);
}

.icon-btn {
  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; }

/* ---- Guide signs ------------------------------------------------------------------ */
.guide-sign {
  position: relative;
  padding: 7px;
  border-radius: 14px;
  background: var(--sign-green);
  box-shadow: 0 6px 0 var(--sign-green-deep), 0 18px 40px rgba(0, 0, 0, 0.45);
}
.guide-sign.blue { background: var(--sign-blue); box-shadow: 0 6px 0 var(--sign-blue-deep), 0 18px 40px rgba(0, 0, 0, 0.45); }
.guide-sign.orange { background: var(--sign-orange); box-shadow: 0 6px 0 var(--sign-orange-deep), 0 18px 40px rgba(0, 0, 0, 0.45); }
.guide-sign.purple { background: var(--sign-purple); box-shadow: 0 6px 0 var(--sign-purple-deep), 0 18px 40px rgba(0, 0, 0, 0.45); }
.guide-inner {
  padding: 18px 20px 16px 24px;
  border: 4px solid var(--sign-white);
  border-radius: 9px;
}
.exit-tab {
  position: absolute;
  top: -30px;
  right: 28px;
  padding: 5px 5px 0;
  border-radius: 8px 8px 0 0;
  background: inherit;
}
.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;
}

/* ---- Overlay 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.5);
  overflow-y: auto;
  animation: fade-in 0.25s ease;
}
.screen > * { margin: auto 0; }
.screen.modal { background: rgba(10, 12, 16, 0.75); z-index: 5; }

/* Paper card: shop, results, trophies */
.card {
  width: min(520px, 100%);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  animation: slide-up 0.3s ease-out;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 10px;
  background: var(--ink);
  color: var(--sign-white);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; }
.card h2 { margin: 0; font-size: 32px; font-weight: 900; line-height: 1; text-wrap: balance; }
.card .hint { color: var(--ink-soft); }

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

/* Barricade card: pause */
.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; }

/* Toggle rows (settings) */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; }
.toggle {
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  border: 0;
  border-radius: 15px;
  background: #c3c7ce;
  cursor: pointer;
  transition: background 0.15s ease;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}
.toggle[aria-checked="true"] { background: var(--sign-green); }
.toggle[aria-checked="true"]::after { transform: translateX(22px); }

/* Toasts */
.toasts {
  position: absolute;
  left: 50%;
  top: max(84px, calc(env(safe-area-inset-top) + 70px));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 4;
}
.toast {
  padding: 8px 14px 6px;
  border-radius: 7px;
  background: var(--sign-yellow);
  color: var(--ink);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 2px var(--sign-yellow), inset 0 0 0 3.5px var(--ink), 0 4px 0 rgba(0, 0, 0, 0.3);
  animation: toast-in 0.25s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.toast.out { opacity: 0; transform: translateY(-8px); transition: opacity 0.3s ease, transform 0.3s ease; }

kbd {
  display: inline-block;
  min-width: 22px;
  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);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-24px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.9); } to { opacity: 1; transform: none; } }

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