/* 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 .ctl-left, #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 { position: absolute; left: 0; bottom: 0; width: 50%; top: 30%; z-index: 3; touch-action: none; -webkit-tap-highlight-color: transparent;
  --ts: min(34vh, 28vw, 150px); }
/* the floating thumb stick: a dark ring base and a domed rubber cap with grip rings, like a real controller's */
.tstick { position: absolute; width: var(--ts); height: var(--ts); margin: calc(var(--ts) / -2) 0 0 calc(var(--ts) / -2); pointer-events: none;
  left: calc(max(14px, env(safe-area-inset-left)) + var(--ts) / 2 + 8px); top: calc(100% - max(14px, env(safe-area-inset-bottom)) - var(--ts) / 2 - 8px);
  transition: opacity .18s; }
.tstick.rest { opacity: .38; }
.tstick.on { opacity: 1; transition: none; }
.tstick-base { position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #0b0714 0 52%, #1d1a26 58%, #3a3646 66%, #17131f 72%, #2b2735 100%);
  box-shadow: inset 0 3px 8px #000a, inset 0 -2px 3px #ffffff1f, 0 4px 10px #0008; border: 2px solid #120a1f; }
.tstick-base i { position: absolute; inset: 9%; border-radius: 50%; border: 2px solid #ffffff14;
  background: conic-gradient(from 0deg, #ffffff10 0 2deg, transparent 2deg 88deg, #ffffff10 88deg 92deg, transparent 92deg 178deg, #ffffff10 178deg 182deg, transparent 182deg 268deg, #ffffff10 268deg 272deg, transparent 272deg); }
.tstick-knob { --push: 0; position: absolute; left: 50%; top: 50%; width: 52%; height: 52%; border-radius: 50%;
  transform: translate(calc(-50% + var(--kx, 0px)), calc(-50% + var(--ky, 0px)));
  background: radial-gradient(circle at 38% 30%, #8a8796 0, #4a4756 22%, #2a2733 55%, #16141c 100%);
  box-shadow: inset 0 -4px 6px #0009, inset 0 3px 4px #ffffff30,
    calc(var(--kx, 0px) * .18) calc(6px + var(--ky, 0px) * .18) calc(10px + var(--push) * 6px) #000a, 0 0 0 2px #120a1f; }
.tstick-knob i { position: absolute; inset: 14%; border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, #ffffff12 0 1.5px, transparent 1.5px 5px), radial-gradient(circle at 40% 32%, #ffffff22, transparent 60%);
  box-shadow: inset 0 1px 2px #0008; }
.tstick.on .tstick-knob { background: radial-gradient(circle at 38% 30%, #9a97a8 0, #55526a 22%, #2e2b3a 55%, #18161f 100%); }
.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 { top: 45%; --ts: min(40vw, 22vh, 150px); }
  .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(40vw, 22vh, 150px) + 40px); }
}
@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; } }
