/* Full-bleed 3D city with chunky kid-friendly HUD chips; navy cards with lime and orange accents. One committed dark look. */
:root {
  color-scheme: dark;
  --navy: #14213d;
  --navy2: #24396b;
  --lime: #9be15d;
  --lime-dk: #4c8a22;
  --orange: #ff8a2a;
  --orange-dk: #b55a12;
  --cream: #fff7e6;
  --red: #e63946;
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--navy); color: var(--cream); font-family: var(--body);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font-family: var(--display); cursor: pointer; border: 0; color: inherit; letter-spacing: .3px; }

/* HUD */
.chip { background: rgba(20, 33, 61, .85); border: 2px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: 6px 14px;
  font-family: var(--display); font-size: 20px; box-shadow: 0 3px 0 rgba(0, 0, 0, .3); color: var(--cream); }
.chip b { color: var(--lime); font-weight: normal; }
#topLeft { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); display: flex; gap: 8px; }
#minimap { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); width: 150px; height: 150px;
  border-radius: 50%; border: 3px solid rgba(255, 255, 255, .75); box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
#topRight { position: fixed; top: calc(170px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); display: flex; gap: 8px; }
#alert { position: fixed; top: calc(60px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: var(--red); color: #fff;
  font-family: var(--display); font-size: 21px; padding: 8px 18px; border-radius: 14px; box-shadow: 0 4px 0 #8a1020; text-align: center;
  max-width: min(70vw, 560px); pointer-events: none; animation: pop .3s; }
#toasts { position: fixed; top: calc(118px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column;
  gap: 6px; align-items: center; pointer-events: none; width: max-content; max-width: 70vw; }
.toast { background: var(--lime); color: var(--navy); font-family: var(--display); font-size: 19px; padding: 7px 16px; border-radius: 12px;
  box-shadow: 0 4px 0 var(--lime-dk); animation: pop .3s; text-align: center; }
.toast.gold { background: #ffd23f; box-shadow: 0 4px 0 #b28d10; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
#hint { position: fixed; bottom: calc(80px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 15px;
  text-shadow: 0 2px 3px #000, 0 0 8px #000; text-align: center; width: max-content; max-width: 80vw; pointer-events: none; transition: opacity .8s; }
#cross { position: fixed; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .55); pointer-events: none; }
.ret { position: fixed; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid var(--lime);
  pointer-events: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); }
.ret.miss { border-color: rgba(255, 255, 255, .4); border-style: dashed; box-shadow: none; }
.ret.crook { border-color: #ff3b3b; width: 36px; height: 36px; margin: -18px 0 0 -18px; }
.wandDot { position: fixed; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 5px solid #fff;
  pointer-events: none; opacity: .9; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.wandDot.grip { border-color: #ffd23f !important; transform: scale(1.3); }
.arr { position: fixed; left: 0; top: 0; pointer-events: none; font-family: var(--display); font-size: 13px; color: #fff; text-shadow: 0 1px 2px #000; }
.arr i { display: block; width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-bottom: 24px solid #ff3b3b;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .6)); margin: 0 auto 2px; }
.arr span { display: block; text-align: center; }
.fl { position: fixed; left: 0; top: 0; font-family: var(--display); font-size: 26px; color: var(--lime); white-space: nowrap; pointer-events: none;
  text-shadow: 0 3px 0 #000, 0 0 6px #000; }
#gadgetBar { position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; }
#gadgetChip { background: rgba(20, 33, 61, .9); border: 3px solid var(--orange); border-radius: 18px; padding: 6px 16px 10px; display: flex; align-items: center;
  gap: 10px; font-family: var(--display); font-size: 21px; position: relative; min-width: 210px; justify-content: center; }
#gIcon { font-size: 28px; }
#fuel { position: absolute; left: 14px; right: 14px; bottom: 4px; height: 5px; background: rgba(255, 255, 255, .2); border-radius: 3px; overflow: hidden; }
#fuel i { display: block; height: 100%; width: 100%; background: var(--orange); }
.gArrow { width: 44px; height: 44px; border-radius: 50%; background: rgba(20, 33, 61, .88); border: 2px solid rgba(255, 255, 255, .25); font-size: 17px; }
#camView { position: fixed; left: calc(10px + env(safe-area-inset-left)); top: calc(60px + env(safe-area-inset-top)); width: 160px; height: 120px;
  border-radius: 12px; border: 2px solid rgba(255, 255, 255, .5); pointer-events: none; }

/* Touch controls */
#touchUI { display: none; }
body.touch #touchUI { display: block; }
body.touch #gadgetBar { bottom: calc(12px + env(safe-area-inset-bottom)); }
body.touch #cross, body.touch .ret { opacity: .75; }
#stick { position: fixed; left: 0; top: 0; width: 140px; height: 140px; margin: -70px 0 0 -70px; border-radius: 50%; background: rgba(255, 255, 255, .08);
  border: 3px solid rgba(255, 255, 255, .25); pointer-events: none; opacity: 0; transition: opacity .15s; }
#stick.on { opacity: 1; }
#knob { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: rgba(255, 255, 255, .4); }
.tbtn { position: fixed; width: 84px; height: 84px; border-radius: 50%; background: rgba(20, 33, 61, .72); border: 3px solid rgba(255, 255, 255, .35);
  font-size: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; touch-action: none; }
.tbtn small { font-family: var(--body); font-size: 11px; font-weight: 800; margin-top: 3px; }
.tbtn.on { background: var(--orange); border-color: #fff; }
#tHookL { left: calc(24px + env(safe-area-inset-left)); bottom: calc(200px + env(safe-area-inset-bottom)); border-color: var(--lime); }
#tHookR { right: calc(24px + env(safe-area-inset-right)); bottom: calc(110px + env(safe-area-inset-bottom)); width: 100px; height: 100px; border-color: var(--lime); }
#tJump { right: calc(140px + env(safe-area-inset-right)); bottom: calc(30px + env(safe-area-inset-bottom)); }
#tGadget { right: calc(24px + env(safe-area-inset-right)); bottom: calc(225px + env(safe-area-inset-bottom)); border-color: var(--orange); }
#tReel { right: calc(140px + env(safe-area-inset-right)); bottom: calc(130px + env(safe-area-inset-bottom)); width: 66px; height: 66px; font-size: 22px; }

#update { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 40; font-family: var(--display);
  font-size: 18px; padding: 10px 18px; border-radius: 14px; background: #ffd23f; color: var(--navy); box-shadow: 0 4px 0 #b28d10; }

/* Menu and Lab */
#menu, #lab { position: fixed; inset: 0; display: flex; padding: 16px; overflow-y: auto; touch-action: pan-y;
  background: radial-gradient(ellipse at top, rgba(36, 57, 107, .55), rgba(8, 14, 30, .88)); z-index: 10; }
.card { background: var(--navy); border: 3px solid var(--navy2); border-radius: 24px; padding: 24px; max-width: 640px; width: 100%;
  box-shadow: 0 10px 0 rgba(0, 0, 0, .35); margin: auto; }
h1 { font-family: var(--display); font-size: clamp(48px, 11vw, 84px); margin: 0; line-height: .92; color: var(--lime); text-shadow: 0 5px 0 #2e5a12;
  font-weight: normal; letter-spacing: 1px; }
h1 span { color: var(--orange); text-shadow: 0 5px 0 #8a3d05; }
h2 { font-family: var(--display); font-weight: normal; font-size: 36px; margin: 0 0 4px; color: var(--lime); }
.tag { font-family: var(--display); color: #8fb4ff; margin: 6px 0 12px; font-size: 18px; letter-spacing: 1px; }
.small { font-size: 14px; opacity: .9; }
.big { display: block; width: 100%; font-size: 28px; padding: 13px; border-radius: 18px; background: var(--orange); color: var(--navy);
  box-shadow: 0 6px 0 var(--orange-dk); margin: 14px 0 8px; }
.big:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--orange-dk); }
.big.alt { background: var(--lime); box-shadow: 0 6px 0 var(--lime-dk); }
.big:focus-visible, .gbtn:focus-visible, .pill:focus-visible, .seg button:focus-visible, .chip:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.seg { display: inline-flex; background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { padding: 8px 14px; border-radius: 9px; background: transparent; font-size: 16px; }
.seg button[aria-pressed=true] { background: var(--lime); color: var(--navy); }
.pill { padding: 8px 14px; border-radius: 10px; background: rgba(255, 255, 255, .12); font-size: 15px; }
.row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 10px 0; font-weight: 800; }
details { background: rgba(255, 255, 255, .05); border-radius: 14px; padding: 10px 14px; margin: 8px 0; }
summary { font-family: var(--display); font-size: 20px; cursor: pointer; }
table { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 6px; }
td { padding: 4px 6px; border-bottom: 1px solid rgba(255, 255, 255, .08); vertical-align: top; }
td:first-child { font-weight: 800; color: var(--lime); white-space: nowrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; display: inline-block; border: 3px solid #fff; }
.foot { text-align: center; margin-top: 14px; }
.link { background: none; font-family: var(--body); font-weight: 800; font-size: 13px; color: #ff9aa2; text-decoration: underline; }
#wandCalView { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(90vw, 640px); height: auto; border-radius: 16px;
  border: 4px solid #fff; z-index: 30; }
.gcard { display: grid; grid-template-columns: 54px 1fr auto; gap: 2px 12px; align-items: center; background: rgba(255, 255, 255, .06);
  border-radius: 16px; padding: 12px 14px; margin: 10px 0; border: 3px solid transparent; }
.gcard.eq { border-color: var(--orange); }
.gcard.locked .ic { filter: grayscale(.8); opacity: .6; }
.gcard .ic { font-size: 40px; grid-row: span 2; text-align: center; }
.gcard h3 { margin: 0; font-family: var(--display); font-weight: normal; font-size: 22px; }
.gcard p { margin: 0; font-size: 14px; opacity: .85; grid-column: 2; }
.gcard .act { grid-row: 1 / span 2; grid-column: 3; }
.gcard ul { grid-column: 1 / -1; font-size: 14px; margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.gcard li::before { content: '⬜ '; }
.gcard li.done { color: var(--lime); }
.gcard li.done::before { content: '✅ '; }
.gcard li em { font-style: normal; color: #ffd23f; font-weight: 800; }
.gbtn { padding: 10px 16px; border-radius: 12px; background: var(--lime); color: var(--navy); font-size: 18px; box-shadow: 0 4px 0 var(--lime-dk); }
.gbtn.buy { background: var(--orange); box-shadow: 0 4px 0 var(--orange-dk); }
.gbtn:disabled { opacity: .45; cursor: default; }
.gtag { font-family: var(--display); color: var(--orange); font-size: 16px; }
@media (max-width: 600px) {
  .chip { font-size: 16px; padding: 5px 10px; }
  #minimap { width: 110px; height: 110px; }
  #topRight { top: calc(128px + env(safe-area-inset-top)); }
  #gadgetChip { min-width: 0; font-size: 17px; }
  #alert { font-size: 16px; top: calc(52px + env(safe-area-inset-top)); }
  .gcard { grid-template-columns: 44px 1fr; }
  .gcard .act { grid-row: auto; grid-column: 1 / -1; }
}
