/* Squirrel Ops' own look: Comic Neon from the arcade's style library. Cel-shaded comic book, thick ink outlines,
   halftone dots, neon orange and electric blue at night. Luckiest Guy for headings and buttons (self-hosted, Apache
   2.0), Inter for reading. Loaded after games.css, which keeps the shared base rules. */
@font-face { font-family: 'Luckiest Guy'; src: url(/fonts/luckiest-guy.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/Inter.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/Inter-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
:root { --ink: #120a1f; --or: #ff7a1a; --bl: #19c6ff; --pk: #ff3d8b; --night: #120f33; --text: #fff7ee; --soft: #c9c2ea; }
body.so {
  font: 400 16px/1.42 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text);
  background:
    radial-gradient(circle, #ffffff10 1.2px, transparent 1.6px) 0 0 / 9px 9px,
    radial-gradient(circle at 80% -10%, #19c6ff33, transparent 45%),
    radial-gradient(circle at 10% 110%, #ff7a1a33, transparent 45%),
    linear-gradient(180deg, #0b0826, var(--night) 60%, #2a1550);
  background-attachment: fixed; min-height: 100dvh; overflow-x: hidden;
}
.so h1, .so h2, .so .go b, .so .chip, .so .btn b { font-family: 'Luckiest Guy', Impact, sans-serif; font-weight: 400; letter-spacing: .03em; }
.so a { color: var(--bl); }
.so button { border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink); color: var(--ink); background: #fff; cursor: pointer; }
.so button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.so .muted { color: var(--soft); }
.hidden { display: none !important; }

.so-top { position: fixed; top: 0; left: 0; right: 0; z-index: 6; display: flex; align-items: center; gap: 8px; padding: max(6px, env(safe-area-inset-top)) 10px 0; pointer-events: none; }
.so-top > * { pointer-events: auto; }
.so-top .grow { flex: 1; pointer-events: none; }
.so .icon { min-width: 44px; min-height: 44px; padding: 0; font-size: 18px; background: #ffffff18; border: 2px solid #ffffff44; box-shadow: none; color: #fff; }

.home { max-width: 560px; margin: 0 auto; padding: 60px 16px 24px; display: grid; gap: 12px; text-align: center; }
.logo { font-size: clamp(42px, 13vw, 76px); line-height: .9; margin: 0; color: var(--or); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 4px 5px 0 var(--ink), 0 0 26px #ff7a1a88; transform: rotate(-3deg); }
.logo em { font-style: normal; color: var(--bl); text-shadow: 4px 5px 0 var(--ink), 0 0 26px #19c6ff88; }
.tag { margin: 0; color: var(--soft); }
.chips { display: flex; gap: 8px; justify-content: center; }
.so .chip { padding: 8px 16px; font-size: 18px; background: #2a2160; color: #fff; box-shadow: 0 4px 0 var(--ink); }
.so .chip[aria-pressed="true"] { background: var(--bl); color: var(--ink); }
.big { min-height: 56px; padding: 10px 18px; font-size: 20px; }
.so .go { background: linear-gradient(180deg, #ffb36b, var(--or)); display: grid; gap: 2px; }
.go b { font-size: 26px; font-weight: 400; }
.go .sub { font-size: 14px; font-weight: 700; }
.best { margin: 0; min-height: 1.2em; color: #ffd27a; font-weight: 700; }
.links { display: flex; gap: 18px; justify-content: center; align-items: center; }
.link { background: none !important; border: 0 !important; box-shadow: none !important; color: var(--bl) !important; text-decoration: underline; font: 700 16px Inter, sans-serif; min-height: 44px; }
.panel { background: #241c57; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 6px 7px 0 var(--ink); padding: 18px; text-align: left; }
.panel h2 { margin: 0 0 8px; color: var(--or); -webkit-text-stroke: 1.5px var(--ink); font-size: 30px; text-align: center; }
.panel ul { padding-left: 20px; margin: 0 0 14px; display: grid; gap: 8px; }
.stars { text-align: center; font-size: 40px; margin: 0; letter-spacing: 6px; color: #ffd23f; -webkit-text-stroke: 2px var(--ink); }
.rows { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; gap: 6px; }
.rows li { display: flex; justify-content: space-between; gap: 10px; background: #0003; border-radius: 10px; padding: 6px 10px; }
.rows li.total { background: var(--or); color: var(--ink); font-weight: 700; }

/* ---------- the 3D street fills the screen behind everything; menus sit on a soft shade ---------- */
#cv { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; z-index: 0; }
.shade { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, #1a0f2ecc, #1a0f2e66 40%, #1a0f2ecc); transition: opacity .3s; }
body.playing .shade { opacity: 0; }
main { position: relative; z-index: 2; }
.modes { display: grid; gap: 10px; }
.so .go.alt { background: linear-gradient(180deg, #8fe3ff, var(--bl)); }
.panel ul li { line-height: 1.35; }
.card ul { text-align: left; margin: 8px 0 0; padding-left: 22px; font-weight: 700; }

#play { position: fixed; inset: 0; z-index: 2; touch-action: none; pointer-events: none; }
#play .ctl, #play .card { pointer-events: auto; }
.hud { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.pill { background: #120a1fcc; color: #fff; border: 2px solid #ffffff55; border-radius: 999px; padding: 4px 12px; font: 400 18px 'Luckiest Guy', Impact, sans-serif; letter-spacing: .04em; white-space: nowrap; }
.pill.hearts { color: #ff5c8f; }
.goals { position: absolute; top: max(58px, calc(env(safe-area-inset-top) + 52px)); left: max(10px, env(safe-area-inset-left)); margin: 0; padding: 6px 10px; list-style: none; z-index: 3;
  background: #120a1fb3; border-radius: 12px; font: 700 13px/1.35 Inter, sans-serif; color: #fff; max-width: min(46vw, 300px); }
.goals li { display: flex; gap: 6px; align-items: baseline; }
.goals li span { color: #ffd23f; width: 1em; flex: none; }
.goals li b { color: #ffd23f; margin-left: auto; padding-left: 6px; }
.goals li.done { color: #9be8b4; text-decoration: line-through; text-decoration-thickness: 2px; }
.goals li.done span { color: #3ddc84; }
.balance { position: absolute; top: max(52px, calc(env(safe-area-inset-top) + 46px)); left: 50%; transform: translateX(-50%); width: min(44vw, 280px); height: 16px; z-index: 3;
  background: linear-gradient(90deg, #ff3d8b, #ffd23f 30%, #3ddc84 42%, #3ddc84 58%, #ffd23f 70%, #ff3d8b); border: 3px solid var(--ink); border-radius: 10px; }
.balance i { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.balance b { position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); transform: translate(-50%, -50%); }
.balance.warn b { background: #ff3d8b; }
.lock { position: absolute; left: 0; top: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 4px solid #ffd23f; border-radius: 50%; z-index: 2;
  box-shadow: 0 0 12px #ffd23faa, inset 0 0 8px #ffd23f88; pointer-events: none; animation: so-lock 1s ease-in-out infinite; }
@keyframes so-lock { 50% { scale: .8; } }
.words { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.words .w { position: absolute; left: 0; top: 0; font: 400 26px 'Luckiest Guy', Impact, sans-serif; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); white-space: nowrap; }
.words .w.big { font-size: 40px; }
.tip { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; margin: 0; max-width: min(50vw, 420px); text-align: center;
  background: #fff7ee; color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px; font: 700 14px/1.3 Inter, sans-serif; box-shadow: 4px 4px 0 var(--ink); }
.ctl { position: absolute; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 3; }
.ctl-left { left: max(10px, env(safe-area-inset-left)); }
.ctl-left .dpad { --dp-size: min(40vh, 34vw, 200px); --dp-face: #24304acc; --dp-edge: #120a1f; --dp-hub: #120a1f99; --dp-0: #fff; --dp-1: #fff; --dp-2: #fff; --dp-3: #fff; opacity: .9; }
.ctl-right { right: max(10px, env(safe-area-inset-right)); display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; gap: 6px; align-items: end; }
.so .btn { width: min(20vh, 17vw, 96px); height: min(20vh, 17vw, 96px); border-radius: 50% !important; display: grid; place-items: center; align-content: center; gap: 0; padding: 0; touch-action: none; -webkit-tap-highlight-color: transparent; opacity: .92; }
.btn b { font-size: min(7vh, 7vw, 34px); line-height: 1; }
.btn span { font: 700 11px/1 Inter, sans-serif; text-transform: uppercase; letter-spacing: .03em; }
.so .btn-a { grid-area: 1 / 2; background: radial-gradient(circle at 40% 30%, #9ff0b4, #3ddc84 60%, #1d9a52); }
.so .btn-b { grid-area: 2 / 1; background: radial-gradient(circle at 40% 30%, #ffb0a0, #ff5c5c 60%, #b52a2a); }
.btn.down { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.card { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) rotate(-2deg); z-index: 4; max-width: min(88vw, 460px); text-align: center;
  background: #fff7ee; color: var(--ink); border: 4px solid var(--ink); border-radius: 18px; box-shadow: 7px 8px 0 var(--ink); padding: 14px 18px; }
.card h2 { margin: 0; font-family: 'Luckiest Guy', Impact, sans-serif; font-weight: 400; font-size: 32px; color: var(--or); -webkit-text-stroke: 1.5px var(--ink); }
.card p { margin: 6px 0 0; font-weight: 700; }
.card .tap { font: 400 15px 'Luckiest Guy', Impact, sans-serif; color: var(--bl); -webkit-text-stroke: .6px var(--ink); }
/* upright devices: the controls take the bottom strip and the world sits above */
@media (orientation: portrait) {
  .ctl-left .dpad { --dp-size: min(44vw, 26vh, 200px); }
  .so .btn { width: min(22vw, 13vh, 96px); height: min(22vw, 13vh, 96px); }
  .goals { max-width: 60vw; font-size: 12px; top: 106px; }
  .hud { top: max(60px, calc(env(safe-area-inset-top) + 54px)); }
  .balance { top: 150px; }
  .tip { max-width: 86vw; bottom: calc(min(44vw, 26vh, 200px) + 24px); }
}
@media (max-height: 430px) and (orientation: landscape) {
  .goals { font-size: 11.5px; top: 50px; padding: 4px 8px; }
  .pill { font-size: 15px; padding: 2px 10px; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .home { padding-top: 56px; gap: 8px; }
  .stars { font-size: 28px; }
  .rows li { padding: 3px 10px; }
}
@media (prefers-reduced-motion: reduce) { .logo { transform: none; } .so button:active { transform: none; } }
