:root {
  --neon: #a8ff3e;
  --neon-soft: rgba(168, 255, 62, .55);
  --neon-faint: rgba(168, 255, 62, .18);
  --ink: #07030f;
  --panel: rgba(6, 12, 3, .88);
  --purple: #b45cff;
  --pink: #ff4fd8;
  --amber: #ffc93e;
  --red: #ff3150;
  --blue: #4fb8ff;
  --text: #e4ffc8;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--ink); color: var(--neon);
  font-family: 'Teko', system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button, a { font: inherit; color: inherit; }

#map { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#map.hovering { cursor: pointer; }
#map.dragging { cursor: grabbing; }

.glow { text-shadow: 0 0 6px rgba(168,255,62,.85), 0 0 20px rgba(168,255,62,.45); }

/* CRT scanlines + vignette */
#fx {
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(4,0,10,.8) 100%);
}

@font-face { font-family: 'JuanAlzada'; src: url('../assets/fonts/juanalzada.ttf') format('truetype'); font-display: block; }

/* ── Pins ────────────────────────────────── */
#pins { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
.pin { position: absolute; left: 0; top: 0; will-change: transform; }
.pin.off { display: none; }
.pin-marker {
  position: absolute; left: 0; bottom: 0; transform: translateX(-50%);
  pointer-events: auto; cursor: pointer; display: flex; flex-direction: column; align-items: center;
  animation: bob 2.4s ease-in-out infinite;
}
.pin-bubble {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid var(--neon);
  background: radial-gradient(circle, rgba(40,72,10,.92), rgba(6,14,3,.95));
  box-shadow: 0 0 14px rgba(168,255,62,.75), inset 0 0 12px rgba(168,255,62,.35);
  display: grid; place-items: center; transition: transform .18s, box-shadow .18s;
}
.pin-bubble svg { width: 34px; height: 34px; filter: drop-shadow(0 0 4px rgba(168,255,62,.9)); }
.pin-ape-tile {
  display: none; width: 72%; height: 72%; background: var(--neon);
  -webkit-mask: url('../assets/img/ape-tile.png') center / contain no-repeat;
  mask: url('../assets/img/ape-tile.png') center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(168,255,62,.9));
}
.pin:not(.pin-locked):not(.pin-blue) .pin-ape-tile { display: block; }
.pin:not(.pin-locked):not(.pin-blue) .pin-bubble:has(.pin-ape-tile) > svg { display: none; }
.pin-tail {
  width: 0; height: 0; margin-top: -2px;
  border-left: 9px solid transparent; border-right: 9px solid transparent; border-top: 15px solid var(--neon);
  filter: drop-shadow(0 0 5px var(--neon));
}
.pin-label {
  position: absolute; left: 38px; bottom: 34px; white-space: nowrap;
  pointer-events: auto; cursor: pointer;
  background: var(--panel); border: 2px solid var(--neon-soft); border-left-width: 4px;
  padding: 5px 12px 2px; box-shadow: 0 0 18px rgba(0,0,0,.6);
}
.pin-label::before {
  content: ''; position: absolute; top: 100%; left: -4px; width: 2px; height: var(--lead, 0px);
  background: linear-gradient(var(--neon-soft), transparent); pointer-events: none;
}
.pin.flip .pin-label::before { left: auto; right: -4px; }
.pin-label::after {
  content: ''; position: absolute; bottom: 100%; left: -4px; width: 2px; height: var(--lead-up, 0px);
  background: linear-gradient(transparent, var(--neon-soft)); pointer-events: none;
}
.pin.flip .pin-label::after { left: auto; right: -4px; }
.pin.pin-locked .pin-label::after { background: linear-gradient(transparent, rgba(255,201,62,.6)); }
.pin.pin-locked .pin-label::before { background: linear-gradient(rgba(255,201,62,.6), transparent); }
.pin-name { font-size: 30px; line-height: .85; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.pin-status { font-family: 'Share Tech Mono', monospace; font-size: 12px; color: var(--text); opacity: .9; margin: 3px 0 2px; text-transform: uppercase; }
.pin-alert {
  position: absolute; left: -62px; bottom: 44px; z-index: 2; color: var(--amber); font-weight: 700; font-size: 38px; line-height: 1;
  text-shadow: 0 0 8px var(--amber); animation: blink 1.6s ease-in-out infinite; display: none;
}
.pin.pin-alert-on .pin-alert { display: block; }
.pin.pin-warn .pin-status { color: var(--amber); }
.pin.pin-alert-on .pin-status { color: #ff8a9a; }
.pin.flip .pin-label { left: auto; right: 38px; border-left-width: 2px; border-right-width: 4px; text-align: right; }
.pin.flip .pin-alert { left: 34px; }
.pin.hot .pin-bubble { transform: scale(1.14); box-shadow: 0 0 26px rgba(168,255,62,1), inset 0 0 16px rgba(168,255,62,.6); }
.pin.hot .pin-label { border-color: var(--neon); }
.pin .pin-label { transition: opacity .2s; }
.pin.tucked .pin-label { opacity: 0; pointer-events: none; }
.pin.tucked.hot .pin-label { opacity: 1; z-index: 3; }
.pin.hot { z-index: 2; }

.pin.waypoint .pin-bubble { border-color: var(--pink); color: var(--pink); width: 40px; height: 40px;
  box-shadow: 0 0 16px rgba(255,79,216,.8); background: rgba(30,4,24,.9); }
.pin.waypoint .pin-bubble svg { width: 24px; height: 24px; filter: drop-shadow(0 0 4px var(--pink)); }
.pin.waypoint .pin-tail { border-top-color: var(--pink); filter: drop-shadow(0 0 5px var(--pink)); }
/* you: the waypoint pin in green, with a small menu to move or clear it */
.pin.waypoint.me .pin-bubble { border-color: var(--neon); color: var(--neon); box-shadow: 0 0 16px rgba(168,255,62,.75); background: rgba(10,24,4,.9); }
.pin.waypoint.me .pin-bubble svg { filter: drop-shadow(0 0 4px var(--neon)); }
.pin.waypoint.me .pin-tail { border-top-color: var(--neon); filter: drop-shadow(0 0 5px var(--neon)); }
.me-menu { position: absolute; left: 0; bottom: 64px; transform: translateX(-50%); display: none; flex-direction: column; gap: 4px;
  padding: 6px; background: rgba(19, 8, 31, .96); border: 2px solid var(--neon); border-radius: 5px; box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 12px rgba(168,255,62,.35);
  pointer-events: auto; white-space: nowrap; z-index: 4; }
.pin.menu-open .me-menu { display: flex; }
.me-menu button { font: 500 17px/1 Teko, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--text); background: transparent;
  border: 0; border-radius: 3px; padding: 6px 10px 4px; text-align: left; cursor: pointer; }
.me-menu button:hover, .me-menu button:focus-visible { background: rgba(168,255,62,.16); color: var(--neon); outline: none; }
#btnMe.active { box-shadow: 0 0 14px rgba(168,255,62,.7); }
canvas.dropping { cursor: crosshair !important; }

/* ── Assets hologram ─────────────────────── */
#assets {
  position: fixed; top: 16px; left: 50%; z-index: 7;
  transform: translateX(-50%) perspective(900px) rotateX(16deg);
  min-width: min(520px, 88vw); padding: 12px 26px 16px; text-align: center;
  background: linear-gradient(180deg, rgba(26,52,6,.78), rgba(6,16,2,.7));
  border: 2px solid var(--neon-soft);
  box-shadow: 0 0 24px rgba(168,255,62,.35), inset 0 0 30px rgba(168,255,62,.12);
  pointer-events: none;
}
#assets::before, #assets::after {
  content: ''; position: absolute; width: 22px; height: 22px; border: 3px solid var(--neon);
}
#assets::before { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
#assets::after { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }
.a-title { font-size: 26px; letter-spacing: 3px; line-height: 1; opacity: .9; }
.a-value { font-size: 66px; font-weight: 700; line-height: .95; letter-spacing: 1px; }
.coins { display: flex; gap: 12px; justify-content: center; margin-top: 6px; }
.coin {
  width: 52px; height: 52px; border-radius: 50%; border: 2.5px solid var(--neon);
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, rgba(168,255,62,.35), rgba(10,24,3,.92) 70%);
  box-shadow: 0 0 10px rgba(168,255,62,.55), inset 0 0 8px rgba(168,255,62,.4);
  animation: coinFlip 7s ease-in-out infinite;
}
.coin svg { width: 32px; height: 32px; }

/* ── Bottom HUD ──────────────────────────── */
#nav { position: fixed; left: 18px; bottom: 18px; z-index: 7; display: flex; align-items: flex-end; gap: 10px; }
#navBtns { display: flex; gap: 10px; }
#compass { width: 92px; height: 92px; filter: drop-shadow(0 0 6px rgba(168,255,62,.6)); }
#compassRose { transform-origin: 50px 50px; }
.hud-btn {
  background: var(--panel); border: 2px solid var(--neon-soft); color: var(--neon);
  width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer; padding: 0;
}
.hud-btn:hover { border-color: var(--neon); box-shadow: 0 0 12px rgba(168,255,62,.6); }
.hud-btn svg { width: 22px; height: 22px; }

#legend {
  position: fixed; right: 18px; bottom: 18px; z-index: 7;
  background: var(--panel); border: 2px solid var(--neon-soft); padding: 8px 14px 6px;
  font-family: 'Share Tech Mono', monospace; font-size: 12px; color: var(--text);
}
#legend h4 { margin: 0 0 4px; font-family: 'Teko', sans-serif; font-size: 20px; font-weight: 500; letter-spacing: 2px; color: var(--neon); }
#legend div { display: flex; align-items: center; gap: 8px; margin: 3px 0; text-transform: uppercase; }
#legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
#legend i.sq { width: 10px; height: 10px; border: 2px solid var(--neon); border-radius: 0; background: rgba(168,255,62,.25); }
#legend .hint { margin-top: 6px; opacity: .6; font-size: 10px; }

/* ── Hover tooltip ───────────────────────── */
#tip {
  position: fixed; z-index: 8; pointer-events: none; display: none;
  background: var(--panel); border: 1px solid var(--neon-soft); padding: 3px 9px 1px;
  transform: translate(14px, 14px); white-space: nowrap;
}
#tip b { display: block; font-size: 20px; font-weight: 500; line-height: 1; letter-spacing: .5px; }
#tip small { font-family: 'Share Tech Mono', monospace; font-size: 11px; color: var(--text); opacity: .75; text-transform: uppercase; }

/* ── Info panel ──────────────────────────── */
#info {
  position: fixed; z-index: 9; right: 18px; top: 50%; width: 330px;
  transform: translate(calc(100% + 40px), -50%); visibility: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), visibility 0s .35s;
  background: linear-gradient(180deg, rgba(14,28,4,.94), rgba(5,10,2,.95));
  border: 2px solid var(--neon-soft); border-left: 5px solid var(--neon);
  box-shadow: 0 0 30px rgba(168,255,62,.25); padding: 16px 18px 18px;
}
#info.open { transform: translate(0, -50%); visibility: visible; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
#info .close {
  position: absolute; top: 8px; right: 10px; z-index: 3; background: none; border: 0; cursor: pointer;
  font-size: 28px; line-height: 1; color: var(--neon); padding: 4px 8px;
}
.i-kicker { margin-right: 34px; font-family: 'Share Tech Mono', monospace; font-size: 12px; letter-spacing: 1px; color: var(--text); opacity: .7; text-transform: uppercase; }
.i-name { margin: 6px 32px 8px 0; padding-top: .06em; font-size: 36px; line-height: .98; font-weight: 600; text-transform: uppercase; overflow-wrap: anywhere; }
.i-emo { display: inline-block; font-size: .72em; margin-right: .18em; vertical-align: .12em; }   /* the icon sits on the lettering's line, not above it */
.i-status { display: inline-flex; align-items: center; gap: 8px; font-family: 'Share Tech Mono', monospace; font-size: 13px; text-transform: uppercase; padding: 3px 10px; border: 1px solid currentColor; }
.i-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; animation: blink 1.8s ease-in-out infinite; }
.lvl-ok { color: var(--neon); } .lvl-warn { color: var(--amber); } .lvl-alert { color: var(--red); } .lvl-dim { color: #9a8fb0; }
.i-lines { list-style: none; padding: 0; margin: 12px 0; font-family: 'Share Tech Mono', monospace; font-size: 13px; color: var(--text); }
.i-lines li { padding: 3px 0; border-bottom: 1px dashed var(--neon-faint); text-transform: uppercase; }
.i-lines li::before { content: '› '; color: var(--neon); }
.i-note { font-family: 'Share Tech Mono', monospace; font-size: 12px; color: var(--text); opacity: .7; font-style: italic; }
.i-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.i-stats div { background: rgba(168,255,62,.07); border: 1px solid var(--neon-faint); padding: 4px 8px 2px; }
.i-stats span { display: block; font-family: 'Share Tech Mono', monospace; font-size: 10px; color: var(--text); opacity: .7; }
.i-stats b { font-size: 22px; font-weight: 500; line-height: 1.1; white-space: nowrap; }
.stars { color: var(--amber); letter-spacing: 1px; font-size: 17px !important; }
.i-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  flex: 1 1 auto; text-align: center; text-decoration: none; cursor: pointer;
  font-size: 21px; letter-spacing: 1px; text-transform: uppercase; line-height: 1;
  padding: 9px 12px 5px; border: 2px solid var(--neon-soft); background: rgba(168,255,62,.06);
  transition: background .15s, box-shadow .15s;
}
.btn:hover { background: rgba(168,255,62,.18); box-shadow: 0 0 14px rgba(168,255,62,.45); border-color: var(--neon); }
.btn.primary { flex-basis: 100%; background: var(--neon); color: #0b1403; border-color: var(--neon); font-weight: 600; }
.btn.primary:hover { background: #c6ff78; }
.btn.pink { border-color: rgba(255,79,216,.6); color: var(--pink); }
.btn.pink:hover { background: rgba(255,79,216,.15); box-shadow: 0 0 14px rgba(255,79,216,.5); }

/* ── Confirm modal — styled in-game replacement for window.confirm(), which
   renders as a plain browser dialog ("apecity.wtf says...") that reads as a
   phishing popup, not part of the game. ── */
.confirm-backdrop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: rgba(4, 1, 10, .7); backdrop-filter: blur(3px);
}
.confirm-modal {
  width: min(420px, calc(100vw - 32px)); padding: 22px 24px 20px; text-align: center;
  background: var(--panel); border: 2px solid var(--neon); box-shadow: 0 0 24px rgba(168, 255, 62, .35);
}
.confirm-modal h3 {
  margin: 0 0 12px; font-family: 'Teko', sans-serif; font-weight: 600; font-size: 28px; letter-spacing: 1px;
  color: var(--neon); text-transform: uppercase;
}
.confirm-modal p {
  margin: 0 0 18px; font-family: 'Share Tech Mono', monospace; font-size: 13px; line-height: 1.6; color: var(--text);
  white-space: pre-line;
}
.confirm-modal .i-actions { gap: 10px; }

/* ── Toast / feed ────────────────────────── */
#feed { position: fixed; left: 18px; top: 250px; z-index: 7; display: flex; flex-direction: column; gap: 6px; max-width: 300px; pointer-events: none; }
.feed-item {
  background: var(--panel); border-left: 3px solid var(--neon); padding: 4px 10px 2px;
  font-family: 'Share Tech Mono', monospace; font-size: 12px; color: var(--text); text-transform: uppercase;
  animation: feedIn .3s ease-out, feedOut .5s ease-in 5.5s forwards;
}
.feed-item.lvl-warn { border-color: var(--amber); } .feed-item.lvl-alert { border-color: var(--red); }

/* ── Player silhouette ───────────────────── */
#ape {
  position: fixed; left: 50%; bottom: 0; z-index: 4; pointer-events: none;
  width: clamp(200px, 26vw, 380px); transform: translate(-50%, 6%);
  filter: drop-shadow(0 0 10px rgba(168,255,62,.45));
  transition: filter .18s, transform .18s;
}
#ape.clickable path { pointer-events: visiblePainted; cursor: pointer; }      /* your ape: opens the wardrobe */
#ape.clickable:hover, #ape.clickable:focus-visible { filter: drop-shadow(0 0 16px rgba(168,255,62,.95)) brightness(1.15); transform: translate(-50%, 3%); outline: none; }

@keyframes blink { 50% { opacity: .4; } }
@keyframes bob { 50% { transform: translate(-50%, -5px); } }
@keyframes coinFlip { 0%, 84%, 100% { transform: rotateY(0); } 92% { transform: rotateY(180deg); } }
@keyframes feedIn { from { opacity: 0; transform: translateX(-20px); } }
@keyframes feedOut { to { opacity: 0; transform: translateX(-20px); } }


/* ── Locked locations ────────────────────── */
.pin-bubble { position: relative; }
.pin-lock {
  position: absolute; right: -8px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%;
  display: none; place-items: center; background: #1a0f00; border: 2px solid var(--amber);
  color: var(--amber); box-shadow: 0 0 10px rgba(255,170,40,.8);
}
.pin-lock svg { width: 13px !important; height: 13px !important; filter: none !important; }
.pin.pin-locked .pin-lock { display: grid; }
.pin.pin-locked .pin-bubble {
  border-color: var(--amber); color: var(--amber);
  background: radial-gradient(circle, rgba(70,40,4,.92), rgba(16,9,2,.95));
  box-shadow: 0 0 14px rgba(255,170,40,.7), inset 0 0 12px rgba(255,170,40,.3);
}
.pin.pin-locked .pin-bubble > svg { filter: drop-shadow(0 0 4px rgba(255,170,40,.9)); opacity: .75; }
.pin.pin-locked .pin-tail { border-top-color: var(--amber); filter: drop-shadow(0 0 5px var(--amber)); }
.pin.pin-locked .pin-label { border-color: rgba(255,201,62,.5); }
.pin.pin-locked .pin-status { color: var(--amber); }
.pin.pin-locked.hot .pin-bubble { box-shadow: 0 0 28px rgba(255,170,40,1), inset 0 0 16px rgba(255,170,40,.6); }
.pin.pin-locked.hot .pin-label { border-color: var(--amber); }

.i-locked::before { animation: none; }
#info.is-locked { border-color: rgba(255,201,62,.5); border-left-color: var(--amber); box-shadow: 0 0 30px rgba(255,170,40,.22); }
#info.is-locked .close { color: var(--amber); }
@media (max-width: 700px) { #info.is-locked { border-top-color: var(--amber); } }
.i-headline {
  margin: 14px 0 6px; font-size: 30px; line-height: .95; font-weight: 600; color: var(--amber);
  text-shadow: 0 0 8px rgba(255,170,40,.7);
}
.i-story { font-family: 'Share Tech Mono', monospace; font-size: 13px; color: var(--text); }
.i-story p { margin: 2px 0; }
.burn { margin: 14px 0 8px; }
.burn-label { font-family: 'Share Tech Mono', monospace; font-size: 11px; letter-spacing: 2px; color: var(--text); opacity: .75; margin-bottom: 5px; }
.burn-bar { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; height: 16px; }
.burn-bar i { background: rgba(255,201,62,.08); border: 1px solid rgba(255,201,62,.28); }
.burn-bar i.on { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 6px rgba(255,170,40,.8); }
.burn-bar i.part { background: linear-gradient(90deg, var(--amber) var(--p), rgba(255,201,62,.08) var(--p)); }
.burn-nums { display: flex; justify-content: space-between; margin-top: 5px; font-family: 'Share Tech Mono', monospace; font-size: 13px; color: var(--amber); }
.i-req { font-family: 'Share Tech Mono', monospace; font-size: 13px; color: var(--text); text-transform: uppercase; margin-top: 8px; }
.i-unlock { font-size: 24px; line-height: 1.1; margin-top: 6px; letter-spacing: .5px; }
.i-unlock b { font-weight: 600; text-shadow: 0 0 8px rgba(168,255,62,.8); }
.i-footer {
  margin: 10px 0 14px; padding-top: 8px; border-top: 1px dashed rgba(255,201,62,.3);
  font-family: 'Share Tech Mono', monospace; font-size: 12px; font-style: italic; color: var(--text); opacity: .85;
}
.btn.primary.locked, .btn.primary.locked:hover {
  background: rgba(255,201,62,.1); color: var(--amber); border-color: rgba(255,201,62,.6);
  box-shadow: none; cursor: not-allowed; font-weight: 500;
}

/* ── Global Progress HUD ─────────────────── */
#progress {
  position: fixed; left: 18px; top: 18px; z-index: 7; width: 270px; cursor: pointer;
  background: var(--panel); border: 2px solid var(--neon-soft); border-left: 4px solid var(--neon);
  padding: 8px 12px 10px; box-shadow: 0 0 18px rgba(168,255,62,.18);
  font-family: 'Share Tech Mono', monospace; font-size: 12px; color: var(--text);
}
#progress:hover { border-color: var(--neon); box-shadow: 0 0 22px rgba(168,255,62,.35); }
.p-title { font-family: 'Teko', sans-serif; font-size: 28px; font-weight: 600; line-height: .9; letter-spacing: 2px; color: var(--neon); margin-bottom: 4px; }
.p-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 2px 0; text-transform: uppercase; }
.p-row b { font-family: 'Teko', sans-serif; font-size: 22px; font-weight: 500; line-height: 1; color: var(--neon); letter-spacing: .5px; }
.p-row span { opacity: .75; }
#progress .burn-bar { margin: 5px 0 3px; height: 12px; gap: 2px; }
.p-sub { font-size: 11px; } .p-sub b { font-size: 17px; }
.p-next b { color: var(--amber); font-size: 20px; text-shadow: 0 0 8px rgba(255,170,40,.6); }
.p-msg { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--neon-faint); font-size: 10px; line-height: 1.35; opacity: .8; }

/* Locked panel: the crew is casing it (not a disabled button) */
.casing {
  position: relative; overflow: hidden; flex-basis: 100%; display: flex; align-items: center; gap: 8px;
  padding: 9px 12px 7px; border: 2px dashed rgba(255,201,62,.55); background: rgba(255,170,40,.07);
  font-family: 'Share Tech Mono', monospace; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; color: var(--amber);
}
.casing-eye { font-size: 14px; animation: blink 2.4s ease-in-out infinite; text-shadow: 0 0 8px var(--amber); }
.casing-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, rgba(255,201,62,.18) 50%, transparent 100%);
  width: 40%; animation: casingScan 3.2s ease-in-out infinite alternate;
}
@keyframes casingScan { from { transform: translateX(-60%); } to { transform: translateX(260%); } }

/* ── Mid-size screens (tablets / small laptops): assets panel moves top-right ── */
/* ── Wallet ──────────────────────────────── */
#wallet { position: fixed; top: 16px; right: 16px; z-index: 8; font-family: 'Share Tech Mono', monospace; }
.w-btn {
  display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 8px 14px 8px 11px;
  background: var(--panel); border: 2px solid var(--neon-soft); color: var(--neon);
  font-family: inherit; font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
  box-shadow: 0 0 14px rgba(168,255,62,.2); transition: box-shadow .15s, border-color .15s;
}
.w-btn:hover, #wallet.open .w-btn { border-color: var(--neon); box-shadow: 0 0 16px rgba(168,255,62,.55); }
.w-btn svg { width: 20px; height: 20px; flex: none; }
.w-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a4d70; flex: none; }
#wallet[data-status="connected"] .w-dot { background: var(--neon); box-shadow: 0 0 8px var(--neon); }
#wallet[data-status="connecting"] .w-dot { background: var(--amber); animation: blink 1s ease-in-out infinite; }
#wallet.wrong-chain .w-btn { border-color: rgba(255,201,62,.7); color: var(--amber); }
#wallet.wrong-chain .w-dot { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.w-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: 12px;
  background: linear-gradient(180deg, rgba(14,28,4,.96), rgba(5,10,2,.97));
  border: 2px solid var(--neon-soft); border-top: 4px solid var(--neon);
  box-shadow: 0 0 26px rgba(168,255,62,.25); display: flex; flex-direction: column; gap: 8px;
}
.w-menu[hidden] { display: none; }
.w-head { font-family: 'Teko', sans-serif; font-size: 22px; letter-spacing: 1px; line-height: 1; text-transform: uppercase; }
.w-addr { font-size: 15px; color: var(--text); }
.w-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text); opacity: .9; }
.w-row b { color: var(--neon); font-weight: 400; } .w-row b.warn { color: var(--amber); }
.w-menu .btn { font-family: 'Teko', sans-serif; font-size: 18px; padding: 7px 10px 3px; }
.btn.amber { border-color: rgba(255,201,62,.7); color: var(--amber); }
.btn.amber:hover { background: rgba(255,201,62,.15); box-shadow: 0 0 14px rgba(255,201,62,.45); }
.w-opt {
  display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 7px 10px; text-align: left;
  background: rgba(168,255,62,.06); border: 2px solid var(--neon-faint); color: var(--text);
  font-family: inherit; font-size: 14px;
}
.w-opt:hover { border-color: var(--neon); background: rgba(168,255,62,.15); }
.w-opt img, .w-ic { width: 24px; height: 24px; flex: none; }
.w-ic svg { width: 24px; height: 24px; color: var(--neon); }
.w-none { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text); }
.w-none a { color: var(--neon); }

@media (min-width: 701px) and (max-width: 1180px) {
  #assets { left: auto; right: 16px; transform: perspective(900px) rotateX(16deg); transform-origin: top right;
    min-width: 0; width: 330px; padding: 8px 16px 10px; }
  .a-title { font-size: 18px; }
  .a-value { font-size: 42px; }
  .coin { width: 32px; height: 32px; }
  .coin svg { width: 20px; height: 20px; }
  .coins { gap: 8px; }
  #wallet { top: 150px; }
}
@media (min-width: 701px) and (max-height: 620px) { #legend { display: none; } }

/* ── Mobile ──────────────────────────────── */
@media (max-width: 700px) {
  #assets { top: 10px; min-width: 0; width: calc(100vw - 32px); padding: 6px 12px 8px; }
  .a-title { font-size: 16px; }
  .a-value { font-size: 38px; }
  .coin { width: 30px; height: 30px; border-width: 2px; }
  .coin svg { width: 19px; height: 19px; }
  .coins { gap: 8px; margin-top: 2px; }
  .pin-bubble { width: 42px; height: 42px; }
  .pin-bubble svg { width: 26px; height: 26px; }
  .pin-lock { width: 19px; height: 19px; right: -6px; bottom: -4px; }
  .i-headline { font-size: 26px; }
  .pin-tail { border-top-width: 11px; border-left-width: 7px; border-right-width: 7px; }
  .pin-label { left: 26px; bottom: 28px; padding: 3px 8px 1px; }
  .pin-name { font-size: 20px; }
  .pin-status { font-size: 9px; display: none; }
  .pin.hot .pin-status { display: block; }
  .pin-alert { font-size: 26px; left: -44px; bottom: 34px; }
  #legend { display: none; }
  #progress { left: 16px; right: 16px; width: auto; top: 118px; padding: 5px 10px 6px; }
  .p-title, .p-msg, .p-sub { display: none; }
  #progress .p-row { font-size: 10px; margin: 0; }
  #progress .p-row b { font-size: 16px; }
  #progress .burn-bar { height: 8px; margin: 3px 0 2px; }
  body.info-open #progress { opacity: 0; pointer-events: none; }
  #nav { left: 12px; bottom: 12px; }
  #navBtns { position: fixed; right: 12px; bottom: 16px; flex-direction: column; }
  #navBtns .hud-btn { width: 46px; height: 46px; }
  #compass { width: 70px; height: 70px; }
  #feed { top: auto; bottom: 96px; left: 12px; max-width: 70vw; }
  #info {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 58vh; overflow-y: auto;
    transform: translateY(105%); border-left: 2px solid var(--neon-soft); border-top: 4px solid var(--neon);
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  }
  #info.open { transform: translateY(0); }
  .i-name { font-size: 32px; }
  .pin.flip .pin-label { right: 26px; }
  body.info-open #ape, body.info-open #nav, body.info-open #feed { opacity: 0; }
  #ape { width: 180px; }
  #wallet { top: auto; right: 12px; bottom: 124px; }
  .w-btn { width: 46px; height: 46px; padding: 0; justify-content: center; position: relative; }
  .w-label { display: none; }
  .w-dot { position: absolute; top: 5px; right: 5px; }
  .w-menu { top: auto; bottom: calc(100% + 8px); width: min(280px, calc(100vw - 24px)); }
  body.info-open #wallet { opacity: 0; pointer-events: none; }
}

/* ── Music player (audio.js) ─────────────── */
#legend { bottom: 74px; width: 244px; box-sizing: border-box; }
#music {
  position: fixed; right: 18px; bottom: 18px; z-index: 9; width: 244px; height: 48px; box-sizing: border-box;
  display: flex; align-items: center; gap: 6px; padding: 5px 6px;
  background: var(--panel); border: 2px solid var(--neon-soft);
  font-family: 'Share Tech Mono', monospace; color: var(--text);
}
.m-btn {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: transparent; border: 2px solid var(--neon-faint); color: var(--neon);
}
.m-btn:hover, .m-btn:focus-visible { border-color: var(--neon); box-shadow: 0 0 10px rgba(168,255,62,.5); outline: none; }
.m-btn svg { width: 18px; height: 18px; }
.m-toggle.on, .m-shuffle.on, #music.open .m-list { background: rgba(168,255,62,.16); border-color: var(--neon); }
.m-now { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.05; }
.m-kicker { font-size: 9px; letter-spacing: 1px; opacity: .6; }
.m-title { overflow: hidden; white-space: nowrap; font-family: 'Teko', sans-serif; font-size: 19px; color: var(--neon); }
.m-title span { display: inline-block; }
#music.playing .m-title.scroll span { animation: mMarquee 9s ease-in-out infinite alternate; }
@keyframes mMarquee { 0%, 12% { transform: translateX(0); } 88%, 100% { transform: translateX(min(0px, calc(-100% + 112px))); } }
.m-menu {
  position: absolute; right: -2px; bottom: calc(100% + 8px); width: 244px; box-sizing: border-box; max-height: min(420px, 70vh);
  display: flex; flex-direction: column; padding: 8px 10px 10px;
  background: var(--panel); border: 2px solid var(--neon); box-shadow: 0 0 18px rgba(168,255,62,.25);
}
.m-menu[hidden] { display: none; }
.m-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.m-head h4 { flex: 1; margin: 0; font-family: 'Teko', sans-serif; font-size: 20px; font-weight: 500; letter-spacing: 2px; color: var(--neon); }
.m-head .m-btn { width: 28px; height: 28px; }
.m-head .m-btn svg { width: 15px; height: 15px; }
.m-tracks { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.m-track {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin: 0 0 3px; cursor: pointer; text-align: left;
  background: rgba(168,255,62,.05); border: 2px solid transparent; color: var(--text); font-family: inherit; font-size: 13px; text-transform: uppercase;
}
.m-track:hover { border-color: var(--neon-soft); background: rgba(168,255,62,.12); }
.m-track.on { border-color: var(--neon); color: var(--neon); background: rgba(168,255,62,.16); }
.m-radio { display: flex; align-items: center; gap: 8px; flex: none; width: 100%; margin-top: 8px; padding: 10px 8px; cursor: pointer;
  border: 2px solid var(--neon-soft); color: var(--neon); background: rgba(168,255,62,.06); font: inherit; text-align: left; }
.m-radio svg { width: 22px; height: 22px; flex: none; }
.m-radio span { font-size: 14px; white-space: nowrap; }
.m-radio small { margin-left: auto; font-size: 8px; letter-spacing: .5px; }
.m-radio.on, .m-radio:hover, .m-radio:focus-visible { border-color: var(--neon); background: rgba(168,255,62,.18); }
.m-radio:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; }
.m-status { flex: none; margin: 6px 0 0; font-size: 10px; color: var(--neon); }
.m-status:empty { display: none; }
.m-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-eq { width: 14px; height: 12px; display: flex; align-items: flex-end; gap: 2px; flex: none; opacity: 0; }
.m-eq i { width: 3px; height: 100%; background: var(--neon); transform-origin: bottom; transform: scaleY(.3); }
.m-track.on .m-eq { opacity: 1; }
#music.playing .m-track.on .m-eq i { animation: mEq .8s ease-in-out infinite alternate; }
#music.playing .m-track.on .m-eq i:nth-child(2) { animation-delay: -.3s; }
#music.playing .m-track.on .m-eq i:nth-child(3) { animation-delay: -.55s; }
@keyframes mEq { from { transform: scaleY(.25); } to { transform: scaleY(1); } }
.m-vol { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 10px; letter-spacing: 1px; opacity: .85; }
.m-vol span { width: 38px; }
.m-vol input { flex: 1; accent-color: var(--neon); }
#musicBackdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55); }
#musicBackdrop[hidden] { display: none; }
@media (min-width: 701px) and (max-height: 620px) { #music { bottom: 12px; } }
@media (max-width: 700px) {
  #music { left: 12px; right: auto; bottom: 12px; width: auto; height: auto; padding: 0; gap: 8px; background: none; border: none; }
  #music .m-now, #music .m-next { display: none; }
  #music > .m-btn { width: 46px; height: 46px; background: var(--panel); border-color: var(--neon-soft); }
  #music > .m-btn svg { width: 22px; height: 22px; }
  #music.open { z-index: 31; }
  #nav { bottom: 68px; }
  #feed { bottom: 150px; }
  body.info-open #music { opacity: 0; pointer-events: none; }
  .m-menu {                                            /* a bottom sheet: room for every track */
    position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh;
    border-width: 4px 0 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  }
  .m-head h4 { font-size: 26px; }
  .m-head .m-btn { width: 40px; height: 40px; }
  .m-head .m-btn svg { width: 20px; height: 20px; }
  .m-track { padding: 12px 12px; font-size: 16px; margin-bottom: 6px; }
  .m-vol { font-size: 12px; margin-top: 10px; }
}

/* ── Laptop-height screens: compact top HUD so it doesn't crowd the map ── */
@media (min-width: 701px) and (max-height: 900px) {
  #assets { min-width: 0; width: 330px; padding: 6px 16px 9px; top: 10px; }
  #assets::before, #assets::after { width: 14px; height: 14px; }
  .a-title { font-size: 17px; letter-spacing: 2px; }
  .a-value { font-size: 40px; }
  .coin { width: 32px; height: 32px; border-width: 2px; }
  .coin svg { width: 20px; height: 20px; }
  .coins { gap: 8px; margin-top: 4px; }
  #progress { transform: scale(.8); transform-origin: top left; }
}

/* Pin name tags: hidden until the pin is hovered; gone again once it's selected (the info panel takes over) */
.pin .pin-label, .pin.tucked.hot .pin-label { opacity: 0; pointer-events: none; }
.pin.hover:not(.sel) .pin-label { opacity: 1; pointer-events: auto; z-index: 3; }

/* ── Holdings (holdings.js): a chip under the wallet button, only while a wallet is connected ── */
#holdings { position: fixed; top: 72px; right: 16px; z-index: 8; font-family: 'Share Tech Mono', monospace; color: var(--text); }
#holdings[hidden] { display: none; }
.h-chip {
  margin-left: auto; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; cursor: pointer;
  background: var(--panel); border: 2px solid var(--neon-soft); color: var(--neon); font-family: inherit;
}
.h-chip:hover, #holdings.open .h-chip { border-color: var(--neon); box-shadow: 0 0 14px rgba(168,255,62,.5); }
.h-chip svg { width: 18px; height: 18px; flex: none; }
.h-chip b { font-family: 'Teko', sans-serif; font-size: 22px; font-weight: 600; line-height: 1; padding-top: 3px; }
.h-unit { font-size: 11px; opacity: .75; }
.h-sep { width: 1px; height: 20px; background: var(--neon-faint); margin: 0 2px; }
.h-chev { width: 14px !important; height: 14px !important; transition: transform .2s; }
#holdings.open .h-chev { transform: rotate(180deg); }
.h-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px; max-height: min(520px, calc(100vh - 140px));
  display: flex; flex-direction: column; box-sizing: border-box; padding: 10px 12px 12px;
  background: var(--panel); border: 2px solid var(--neon); box-shadow: 0 0 20px rgba(168,255,62,.25);
}
.h-panel[hidden] { display: none; }
.h-head { display: flex; align-items: center; }
.h-head h4 { flex: 1; margin: 0; font-family: 'Teko', sans-serif; font-size: 22px; font-weight: 500; letter-spacing: 2px; color: var(--neon); }
.h-close { background: none; border: 2px solid var(--neon-faint); color: var(--neon); width: 28px; height: 28px; font-size: 18px; line-height: 1; cursor: pointer; }
.h-close:hover { border-color: var(--neon); }
.h-balance { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 8px; padding: 6px 8px; background: rgba(168,255,62,.07); border-left: 3px solid var(--neon); font-size: 11px; letter-spacing: 1px; }
.h-balance b { font-family: 'Teko', sans-serif; font-size: 26px; font-weight: 600; color: var(--neon); letter-spacing: 0; }
.h-balance-chains { display: flex; gap: 6px; margin: -4px 0 8px; }
.h-balance-row { flex: 1; display: flex; justify-content: space-between; align-items: baseline; padding: 4px 8px; background: rgba(168,255,62,.04); border-left: 2px solid var(--neon-faint); font-size: 9px; letter-spacing: 1px; opacity: .85; }
.h-balance-row b { font-family: 'Teko', sans-serif; font-size: 15px; font-weight: 600; color: var(--neon); letter-spacing: 0; }
.h-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
.h-tools { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; }
.h-sort, .h-step {
  padding: 3px 8px 2px; cursor: pointer; border: 2px solid var(--neon-faint); background: rgba(168,255,62,.05);
  color: var(--text); font-family: inherit; font-size: 10px; letter-spacing: .6px; text-transform: uppercase;
}
.h-sort.on, .h-sort:hover, .h-step:hover { border-color: var(--neon); color: var(--neon); }
.h-step:disabled { opacity: .35; cursor: default; }
.h-page { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.h-page[hidden] { display: none; }
.h-page-label { font-size: 10px; letter-spacing: .6px; opacity: .75; }
.h-tab {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 5px 9px; cursor: pointer; white-space: nowrap;
  background: rgba(168,255,62,.05); border: 2px solid var(--neon-faint); color: var(--text); font-family: inherit; font-size: 11px; text-transform: uppercase;
}
.h-tab i { font-style: normal; min-width: 16px; padding: 0 4px; background: rgba(168,255,62,.15); color: var(--neon); text-align: center; }
.h-tab:hover { border-color: var(--neon-soft); }
.h-tab.on { border-color: var(--neon); color: var(--neon); background: rgba(168,255,62,.14); }
.h-items { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin-top: 4px; scrollbar-width: thin; scrollbar-color: var(--neon-faint) transparent; }
.h-items::-webkit-scrollbar { width: 6px; }
.h-items::-webkit-scrollbar-thumb { background: var(--neon-faint); }
.h-items::-webkit-scrollbar-track { background: transparent; }
.h-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.h-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 5px; text-align: left; cursor: default;
  background: rgba(168,255,62,.05); border: 2px solid var(--neon-faint); color: var(--text); font-family: inherit;
  min-width: 0;   /* a flex container's default min-width is its content's min-content size, not 0 — without this,
                     a long staked-amount label (e.g. "3,333 staked") forces the whole grid column wider than its
                     1fr share even with overflow/ellipsis set on the text itself, causing real horizontal overflow. */
}
.h-card img, .h-ph { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; background: rgba(0,0,0,.35); color: var(--neon-soft); }
.h-ph svg { width: 55%; height: 55%; }
.h-name { font-size: 11px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-sub { font-size: 9px; opacity: .65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-go { font-size: 9px; color: var(--neon); }
.h-card.is-parcel, .h-card.is-ape { cursor: pointer; }
.h-card.is-parcel:hover, .h-card.is-ape:hover { border-color: var(--neon); background: rgba(168,255,62,.14); }
.h-empty { margin: 10px 2px; font-size: 12px; opacity: .7; }
@media (min-width: 701px) and (max-width: 1180px) { #wallet { top: 16px; } }
@media (max-width: 700px) {
  #progress { top: 10px; }
  #holdings { top: 90px; right: 12px; }
  .h-chip { height: 34px; }
  .h-panel { position: fixed; left: 12px; right: 12px; top: 132px; width: auto; max-height: calc(100vh - 270px); }
  .h-grid { grid-template-columns: repeat(3, 1fr); }
  body.info-open #holdings { opacity: 0; pointer-events: none; }
}

/* ── The Duffle: per-ape ERC-6551 wallet viewer (js/duffle.js) — a centered
   modal above everything else (including holdings/gamewin), since it opens
   from on top of the already-open holdings panel. ── */
#duffle[hidden] { display: none; }
#duffle { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; font-family: 'Share Tech Mono', monospace; color: var(--text); }
.d-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.d-panel {
  position: relative; width: min(400px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 80px));
  display: flex; flex-direction: column; box-sizing: border-box; padding: 12px 14px 14px;
  background: var(--panel); border: 2px solid var(--neon); box-shadow: 0 0 28px rgba(168,255,62,.3);
}
.d-head { display: flex; align-items: flex-start; gap: 10px; }
.d-ape { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.d-art { width: 52px; height: 52px; flex: none; overflow: hidden; background: rgba(0,0,0,.35); display: grid; place-items: center; color: var(--neon-soft); }
.d-art img { width: 100%; height: 100%; object-fit: cover; }
.d-art .h-ph svg { width: 55%; height: 55%; }
.d-name { margin: 0 0 2px; font-family: 'Teko', sans-serif; font-size: 20px; font-weight: 500; letter-spacing: 1px; color: var(--neon); line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-tba { display: block; font-size: 10px; color: var(--neon-soft); text-decoration: none; opacity: .8; }
.d-tba:hover { opacity: 1; text-decoration: underline; }
.d-close { background: none; border: 2px solid var(--neon-faint); color: var(--neon); width: 28px; height: 28px; font-size: 18px; line-height: 1; cursor: pointer; flex: none; }
.d-close:hover { border-color: var(--neon); }
.d-body { margin-top: 10px; overflow-y: auto; }
.d-loading, .d-empty { margin: 14px 2px; font-size: 12px; opacity: .7; }
.d-retry { margin: 0 2px; padding: 6px 16px; }
.d-rows { display: flex; flex-direction: column; gap: 6px; }
.d-row {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 9px;
  background: rgba(168,255,62,.06); border-left: 3px solid var(--neon-faint);
}
.d-sym { font-size: 12px; font-weight: 700; color: var(--neon); min-width: 46px; }
.d-rname { flex: 1; font-size: 10px; opacity: .65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-amt { font-family: 'Teko', sans-serif; font-size: 20px; font-weight: 600; letter-spacing: 0; color: var(--text); }
.d-withdraw-all { flex: none; background: none; border: 2px solid var(--neon-faint); color: var(--neon); font-family: inherit; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; padding: 3px 8px; cursor: pointer; }
.d-withdraw-all:hover { border-color: var(--neon); }
.d-withdraw-all:disabled { opacity: .5; cursor: default; }
.d-withdraw-note { margin: -2px 2px 0; font-size: 10px; opacity: .65; min-height: 12px; }
.d-withdraw-note:empty { display: none; }
.d-withdraw-note.warn { color: var(--amber); opacity: 1; }

/* ── Rarity & activation (js/ape-progression.js) — Based Ape Gang only ── */
.d-prog { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--neon-faint); }
.d-prog-head { display: flex; align-items: center; justify-content: space-between; font-size: 10px; letter-spacing: 1px; opacity: .7; }
.d-state { font-family: 'Teko', sans-serif; font-size: 14px; letter-spacing: 1px; padding: 1px 8px; background: rgba(168,255,62,.08); color: var(--text); opacity: .8; }
.d-state.warn { color: var(--amber); background: rgba(255,170,40,.12); opacity: 1; }
.d-state.ok { color: var(--neon); background: rgba(168,255,62,.16); opacity: 1; }
.d-prog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 8px; }
.d-prog-grid div { display: flex; flex-direction: column; gap: 1px; }
.d-prog-grid span { font-size: 9px; opacity: .55; text-transform: uppercase; letter-spacing: .5px; }
.d-prog-grid b { font-family: 'Teko', sans-serif; font-size: 18px; font-weight: 600; color: var(--text); }
.d-note { margin: 8px 2px 0; font-size: 10px; line-height: 1.4; opacity: .6; }
.d-tier { margin: 8px 2px 0; font-size: 11px; line-height: 1.4; opacity: .85; }
.d-tier b { color: var(--neon); font-weight: 700; }
.d-burn { margin-top: 10px; padding: 8px 10px; background: rgba(168,255,62,.05); border: 2px solid var(--neon-faint); }
.d-burn-head { display: flex; align-items: center; justify-content: space-between; font-size: 10px; opacity: .7; }
.d-burn .d-fill { background: none; border: 0; color: var(--neon); font-size: 10px; text-decoration: underline; cursor: pointer; font-family: inherit; padding: 0; }
.d-burn-row { margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.d-burn-input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--text); font-family: 'Teko', sans-serif; font-size: 20px; font-weight: 600; }
.d-burn-row span { font-size: 11px; opacity: .6; }
.d-flow-note { margin: 6px 2px 0; font-size: 10px; opacity: .6; min-height: 12px; }
.d-flow-note.warn { color: var(--amber); opacity: 1; }
.d-burn-btn { width: 100%; margin-top: 8px; }
.d-flow[hidden] { display: none; }
.d-flow { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.d-step { display: flex; align-items: center; gap: 8px; font-size: 11px; opacity: .5; }
.d-step i { flex: none; width: 16px; height: 16px; display: grid; place-items: center; font-style: normal; font-size: 9px; font-weight: 700; background: rgba(255,255,255,.08); color: var(--text); }
.d-step.active { opacity: 1; }
.d-step.active i { background: var(--neon); color: #12071f; }
.d-step.done { opacity: .85; }
.d-step.done i { background: var(--neon-soft); color: #12071f; }
.d-error { margin: 2px 2px 0; font-size: 10px; color: var(--red); }
@media (max-width: 700px) {
  .d-panel { width: calc(100vw - 24px); }
}

/* ═════════════════════════════════════════════════════════════
   Graffiti HUD — spray-painted frames round the HUD panels (graffiti.js) and rough hand-drawn small boxes;
   the lettering stays the original GTA-style type. Filters (#spray, #rough, #sprayFill) live in index.html.
   ═════════════════════════════════════════════════════════════ */
:root {
  --panel: rgba(22, 9, 36, .86);
}
/* panels: dark purple, a touch of wall grain; the neon outline is painted on by graffiti.js */
#progress, #legend, #music, .w-btn, .h-chip, .hud-btn, .w-menu, .h-panel, .m-menu {
  background:
    radial-gradient(130% 90% at 15% 0%, rgba(96, 36, 140, .32), transparent 62%),
    radial-gradient(90% 70% at 100% 100%, rgba(60, 20, 90, .3), transparent 70%),
    var(--panel);
  border-color: transparent !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
#progress:hover, .w-btn:hover, #wallet.open .w-btn, .h-chip:hover, #holdings.open .h-chip, .hud-btn:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.w-btn, .h-chip, .hud-btn { position: relative; }
.spray-frame {
  position: absolute; pointer-events: none; overflow: visible; z-index: 0; color: var(--neon);
  filter: drop-shadow(0 0 3px rgba(168, 255, 62, .38));
  transition: filter .15s;
}
#progress:hover > .spray-frame, .w-btn:hover > .spray-frame, #wallet.open .w-btn > .spray-frame, .h-chip:hover > .spray-frame,
#holdings.open .h-chip > .spray-frame, .hud-btn:hover > .spray-frame {
  filter: drop-shadow(0 0 8px rgba(168, 255, 62, .95)) brightness(1.2);
}
#wallet.wrong-chain .w-btn > .spray-frame { color: var(--amber); filter: drop-shadow(0 0 4px rgba(255, 170, 40, .6)); }

/* ── Lettering: the original GTA-style type (Teko + Share Tech Mono) ── */

/* ── Legend swatches + tag ── */
#legend i.sq { width: 13px; height: 13px; border: 2px solid var(--c, var(--neon)); background: transparent; filter: url(#rough) drop-shadow(0 0 3px var(--c, var(--neon))); }
#legend i.ln {
  width: 30px; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--c) 16%, var(--c) 84%, transparent);
  box-shadow: 0 0 8px var(--c); filter: url(#rough);
}
.l-tag { position: absolute; right: 18px; top: 50%; width: 62px; height: auto; pointer-events: none; opacity: .26; transform: translateY(-38%) rotate(-11deg); }   /* a faded tag in the space right of the key */

/* ── Small boxes: hand-drawn edges (the icons and text stay crisp) ── */
.m-btn, .h-tab, .w-opt, .h-close { position: relative; z-index: 0; border-color: transparent !important; }
.m-btn::before, .h-tab::before, .w-opt::before, .h-close::before {
  content: ''; position: absolute; inset: -2px; z-index: -1; pointer-events: none;
  border: 2px solid var(--rb, rgba(168, 255, 62, .5)); filter: url(#rough);
}
.m-btn:hover::before, .m-btn:focus-visible::before, .h-tab:hover::before, .h-tab.on::before, .w-opt:hover::before, .h-close:hover::before,
.m-toggle.on::before, .m-shuffle.on::before, #music.open .m-list::before { border-color: var(--neon); box-shadow: 0 0 8px rgba(168, 255, 62, .5); }
.m-btn:hover, .m-btn:focus-visible { box-shadow: none; }

/* ── Compass: the ring + drips are fixed paint; only the rose turns, and its letters stay upright ── */
#compass { width: 100px; height: 100px; overflow: visible; filter: drop-shadow(0 0 5px rgba(168, 255, 62, .55)); }
.c-letters text { transform-box: fill-box; transform-origin: center; }

/* ── Feed: sprayed tags ── */
.feed-item {
  --c: var(--neon); position: relative; border-left: 0; padding: 5px 12px 4px;
  background: var(--panel); box-shadow: inset 3px 0 0 var(--c), -1px 0 8px color-mix(in srgb, var(--c) 45%, transparent);
}
.feed-item::after { content: ''; position: absolute; left: 1px; top: 100%; width: 2px; height: 7px; background: var(--c); border-radius: 0 0 2px 2px; }
.feed-item.lvl-warn { --c: var(--amber); } .feed-item.lvl-alert { --c: var(--red); }

@media (max-width: 700px) {
  #compass { width: 78px; height: 78px; }
}

/* ── Legend: collapses into a button ── */
#legend[hidden], #legendBtn[hidden] { display: none; }
.l-hide {
  position: absolute; top: 8px; right: 10px; z-index: 1; width: 26px; height: 26px; padding: 0; display: grid; place-items: center;
  background: transparent; border: 0; color: var(--neon); cursor: pointer; opacity: .8;
}
.l-hide::before { content: ''; position: absolute; inset: 0; z-index: -1; border: 2px solid rgba(168, 255, 62, .45); filter: url(#rough); }
.l-hide:hover, .l-hide:focus-visible { opacity: 1; outline: none; }
.l-hide:hover::before, .l-hide:focus-visible::before { border-color: var(--neon); box-shadow: 0 0 8px rgba(168, 255, 62, .5); }
.l-hide svg { width: 16px; height: 16px; }
#legendBtn {                                               /* the legend, collapsed: just the crowned ape */
  position: fixed; right: 18px; bottom: 74px; z-index: 7; width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
  cursor: pointer; color: var(--neon); border: 0;
  background: radial-gradient(130% 90% at 15% 0%, rgba(96, 36, 140, .32), transparent 62%), var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
#legendBtn img { height: 32px; width: auto; filter: drop-shadow(0 0 3px rgba(168, 255, 62, .55)); transition: transform .15s; }
#legendBtn:hover img, #legendBtn:focus-visible img { transform: scale(1.08) rotate(-4deg); }
#legendBtn:hover > .spray-frame, #legendBtn:focus-visible > .spray-frame { filter: drop-shadow(0 0 8px rgba(168, 255, 62, .95)) brightness(1.2); }
#legendBtn:focus-visible { outline: none; }
@media (max-width: 700px), (min-width: 701px) and (max-height: 620px) { #legendBtn { display: none !important; } }

/* ── Pop-up menus are solid, so nothing shows through them ── */
.m-menu, .w-menu, .h-panel {
  background: radial-gradient(130% 70% at 15% 0%, rgba(80, 30, 118, .55), transparent 62%), #13081f;
}

/* ── Connect wallet: the painted wallet + lettering (the address shows as text once connected) ── */
.w-glow { display: flex; align-items: center; gap: 9px; filter: drop-shadow(0 0 3px rgba(168, 255, 62, .6)); }
.w-ico, .w-art { display: block; flex: none; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.w-ico { --m: url(../assets/img/Connectwalletbutton.svg); width: 21px; height: 26px; }
.w-art { --m: url(../assets/img/connectwallettext.svg); width: 118px; height: 26px; display: none; }
#wallet[data-status="disconnected"] .w-art { display: block; }
#wallet[data-status="disconnected"] .w-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) { #wallet[data-status="disconnected"] .w-art { display: none; } }

/* ── The next unlock: bold neon yellow, no glow ── */
#progress .p-next b { color: #ffee00; text-shadow: none; -webkit-text-stroke: 0.6px #ffee00; }
#progress .p-next b .p-emo { -webkit-text-stroke: 0; }

/* ── Painted panel titles (assets/img/*font.svg, in the neon) ── */
.p-title-art { display: none; }
.p-title-art { filter: drop-shadow(0 0 4px rgba(168, 255, 62, .55)); margin: 1px 0 5px; }
.p-title-art i, #legend .l-title > i { display: block; border-radius: 0; background: var(--neon); -webkit-mask: var(--m) left center / contain no-repeat; mask: var(--m) left center / contain no-repeat; }
.p-title-art i { --m: url(../assets/img/thehoodfont.svg); width: 138px; height: 41px; }
#progress.has-art .p-title-art { display: block; }
#progress.has-art #pTitle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#legend h4.l-title { margin: 0 0 6px; filter: drop-shadow(0 0 4px rgba(168, 255, 62, .55)); }
#legend .l-title > i { --m: url(../assets/img/legendfont.svg); width: 82px; height: 33px; }
#legend .l-title > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) { #progress.has-art .p-title-art { display: none; } }

/* ── Progress meter: a slanted HUD bar, gradient fill with slow flowing stripes, a bright leading edge, quarter ticks ── */
.burn-bar, #progress .burn-bar { display: block; height: auto; gap: 0; }
.meter {
  --c1: #3f8a10; --c2: var(--neon); --glow: rgba(168, 255, 62, .55);
  position: relative; height: 12px; margin: 7px 0 5px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5), rgba(255, 255, 255, .03)), rgba(168, 255, 62, .07);
  box-shadow: inset 0 0 0 1px rgba(168, 255, 62, .3), inset 0 2px 5px rgba(0, 0, 0, .65);
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.burn .meter { --c1: #9a5c0c; --c2: var(--amber); --glow: rgba(255, 190, 60, .55); margin: 4px 0 6px; }
.meter-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--p); transition: width 1.1s cubic-bezier(.2, .8, .2, 1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 55%),
    repeating-linear-gradient(-60deg, rgba(255, 255, 255, .13) 0 4px, transparent 4px 10px),
    linear-gradient(90deg, var(--c1), var(--c2));
  background-size: 100% 100%, 20px 100%, 100% 100%;
  animation: meterFlow 1.4s linear infinite;
  box-shadow: 0 0 12px var(--glow);
}
.meter-fill::after {                                       /* the leading edge */
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 3px;
  background: #f6ffe6; box-shadow: 0 0 6px 1px var(--c2);
}
.meter.empty .meter-fill::after { display: none; }
.meter-ticks {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(7, 3, 15, .7) calc(25% - 1px) 25%);
}
@keyframes meterFlow { to { background-position: 0 0, 20px 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .meter-fill { animation: none; } }
@media (max-width: 700px) { #progress .meter { height: 8px; margin: 3px 0 2px; } }

/* ── Holdings chip: slides out of the wallet menu's way ── */
#holdings { transform: translateY(var(--push, 0px)); transition: transform .32s cubic-bezier(.2, .8, .2, 1); }

/* ── Compass: the sprayed ring sits under the turning rose ── */
#compassWrap { position: relative; line-height: 0; }
#compassWrap #compass { position: relative; z-index: 1; }
.compass-ring { position: absolute; pointer-events: none; z-index: 0; color: var(--neon); filter: drop-shadow(0 0 3px rgba(168, 255, 62, .4)); }
.hud-btn > svg { display: block; }

/* ── Onlookers shouting at a wreck ── */
#bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.bubble { position: absolute; left: 0; top: 0; will-change: transform; }
.bubble span {
  position: relative; display: block; white-space: nowrap; transform-origin: 20% 100%;
  font-family: 'Teko', sans-serif; font-weight: 600; font-size: 18px; line-height: 1; letter-spacing: .5px; color: #0b1403;
  background: #f2ffe0; padding: 5px 10px 2px; border-radius: 12px; border: 2px solid #0b1403;
  box-shadow: 0 0 0 2px rgba(168, 255, 62, .9), 0 0 14px rgba(168, 255, 62, .45);
  animation: bubblePop .28s cubic-bezier(.3, 1.7, .5, 1) both;
}
.bubble span::after {                                     /* the tail, pointing down at whoever said it */
  content: ''; position: absolute; left: 14px; top: 100%; border: 7px solid transparent; border-top-color: #0b1403; border-bottom: 0; margin-top: 1px;
}
@keyframes bubblePop { from { transform: scale(.2) rotate(-8deg); opacity: 0; } }
@media (max-width: 700px) { .bubble span { font-size: 15px; padding: 4px 8px 1px; } }

/* ── In-game windows (gamewin.js): location pages + the House of Cards game, over the running map ── */
#gamewin { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; }
#gamewin[hidden] { display: none; }
.gw-backdrop { position: absolute; inset: 0; background: rgba(4, 1, 10, .62); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s; }
#gamewin.open .gw-backdrop { opacity: 1; }
.gw-panel {
  position: relative; width: min(640px, calc(100vw - 32px)); max-height: min(78vh, 720px); display: flex; flex-direction: column;
  background: radial-gradient(130% 70% at 15% 0%, rgba(80, 30, 118, .55), transparent 62%), #13081f;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65); color: var(--text);
  transform: translateY(16px) scale(.98); opacity: 0; transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .18s;
}
#gamewin.open .gw-panel { transform: none; opacity: 1; }
.gw-panel.is-game { width: min(1500px, calc(100vw - 32px)); height: calc(100vh - 168px); max-height: none; }   /* (84px top + bottom: wallet, music) */
.gw-head { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 14px; padding: 16px 52px 10px 20px; border-bottom: 1px solid rgba(168, 255, 62, .18); }
.gw-titles { flex: 1; min-width: 0; }
.gw-kicker { font-family: 'Share Tech Mono', monospace; font-size: 12px; letter-spacing: 1px; color: var(--text); opacity: .7; text-transform: uppercase; }
.gw-title { margin: 3px 0 0; font-family: 'Teko', sans-serif; font-weight: 600; font-size: 44px; line-height: .95; color: var(--neon); text-transform: uppercase;
  text-shadow: 0 0 6px rgba(168, 255, 62, .85), 0 0 20px rgba(168, 255, 62, .45); overflow-wrap: anywhere; }
.gw-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--neon); font-size: 34px; line-height: 1; padding: 2px 8px; cursor: pointer; }
.gw-close:hover, .gw-close:focus-visible { text-shadow: 0 0 10px var(--neon); outline: none; }
.gw-body {
  position: relative; z-index: 1; flex: 1; min-height: 120px; overflow: auto; padding: 14px 20px 18px;
  scrollbar-width: thin; scrollbar-color: var(--neon-faint) transparent;
}
.gw-body::-webkit-scrollbar { width: 6px; }
.gw-body::-webkit-scrollbar-thumb { background: var(--neon-faint); }
.gw-body::-webkit-scrollbar-track { background: transparent; }
.is-game .gw-body { padding: 0; overflow: hidden; display: flex; }
.gw-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid rgba(168, 255, 62, .18); }
.gw-foot .btn { flex: 0 1 auto; }
.gw-loading { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Teko', sans-serif; font-size: 26px; letter-spacing: 3px; color: var(--neon); animation: blink 1.4s ease-in-out infinite; pointer-events: none; }
.gw-note { font-family: 'Share Tech Mono', monospace; font-size: 13px; }
/* a location page, restyled for the HUD */
.gw-page { font-family: 'Share Tech Mono', monospace; font-size: 13px; line-height: 1.5; }
.gw-page .card { margin: 0 0 14px; padding: 12px 14px; border: 1px solid rgba(168, 255, 62, .25); border-left: 4px solid var(--neon); background: rgba(168, 255, 62, .05); }
.gw-page .card h2 { margin: 0 0 6px; font-family: 'Teko', sans-serif; font-weight: 500; font-size: 26px; line-height: 1; color: var(--neon); letter-spacing: 1px; text-transform: uppercase; }
.gw-page p { margin: 6px 0; }
.gw-page .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.gw-page .grid a, .gw-page .grid button {
  display: block; width: 100%; padding: 10px 12px 7px; text-align: left; cursor: pointer; text-decoration: none; color: var(--neon);
  border: 1px solid rgba(168, 255, 62, .35); background: rgba(168, 255, 62, .06); font-family: 'Teko', sans-serif; font-size: 22px; line-height: 1; text-transform: uppercase;
}
.gw-page .grid a:hover, .gw-page .grid button:hover { background: rgba(168, 255, 62, .16); border-color: var(--neon); }
.gw-page .grid small { display: block; margin-top: 3px; font-family: 'Share Tech Mono', monospace; font-size: 11px; color: var(--text); opacity: .7; }
/* Location pages (pages/*.html) have their own <link> stripped when loaded into this
   window (see gamewin.js openPage — the window supplies its own styling), so every
   class a location page uses must have a .gw-page-scoped rule here too, not just in
   css/page.css's standalone-view copy. */
.gw-page .cap-row { display: flex; justify-content: space-between; align-items: baseline; font-family: 'Teko', sans-serif; font-size: 20px; letter-spacing: .5px; }
.gw-page .cap-row b { color: var(--neon); font-size: 24px; }
.gw-page .cap-bar { margin-top: 8px; height: 10px; border: 1px solid rgba(168, 255, 62, .4); background: rgba(168, 255, 62, .06); overflow: hidden; }
.gw-page .cap-fill { height: 100%; background: linear-gradient(90deg, rgba(168, 255, 62, .5), var(--neon)); box-shadow: 0 0 8px rgba(168, 255, 62, .6); }
.gw-page .cap-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; opacity: .85; }
.gw-page .cap-meta b { color: var(--text); opacity: 1; }
.gw-page .rewards { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.gw-page .rewards li { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid rgba(168, 255, 62, .25); background: rgba(168, 255, 62, .04); }
.gw-page .rewards .asset { display: flex; align-items: center; gap: 8px; font-family: 'Teko', sans-serif; font-size: 20px; letter-spacing: .5px; }
.gw-page .rewards .asset .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--neon); box-shadow: 0 0 6px currentColor; }
.gw-page .rewards .amount { font-family: 'Share Tech Mono', monospace; font-size: 15px; color: var(--neon); }
.gw-page .tag { margin-top: 10px; display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .65; }
.gw-page .apes-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gw-page .ape-count { font-family: 'Share Tech Mono', monospace; font-size: 13px; opacity: .8; }
.gw-page .ape-count b { color: var(--neon); }
.gw-page .h-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 76px)); gap: 8px; margin-top: 12px; }
.gw-page .h-name { font-size: 10px; }
.gw-page .h-sub { font-size: 8px; }
.gw-page .ape-empty { margin-top: 14px; padding: 14px; border: 1px dashed rgba(168, 255, 62, .35); text-align: center; opacity: .75; font-size: 13px; }
/* Same card used by the Holdings panel (css/map.css .h-grid/.h-card above) — the ape
   picker deliberately looks identical, just with pick/lock states layered on top. */
.h-card { position: relative; }
.h-card.is-picked { border-color: var(--neon); background: rgba(168, 255, 62, .16); box-shadow: 0 0 10px rgba(168, 255, 62, .3); }
.h-card.is-picked .h-name { color: var(--neon); }
.h-card.is-picked::after { content: '✓'; position: absolute; top: 3px; right: 5px; color: var(--neon); font-weight: bold; text-shadow: 0 0 6px var(--neon); }
.h-card.is-locked { opacity: .4; pointer-events: none; }
.h-card.is-locked .h-sub { color: var(--amber); opacity: 1; }
/* A just-committed ape — distinct from both pickable (.is-ape) and never-
   activated (.is-locked): confirmed in THIS round, can't be picked again. */
.h-card.is-committed { opacity: .85; pointer-events: none; border-color: var(--neon); background: rgba(168, 255, 62, .1); }
.h-card.is-committed .h-sub { color: var(--neon); opacity: 1; }
.h-card.is-committed::after { content: '✓'; position: absolute; top: 3px; right: 5px; color: var(--neon); font-weight: bold; text-shadow: 0 0 6px var(--neon); }

.ape-in-banner {
  margin-bottom: 10px; padding: 10px 14px; text-align: center; font-family: 'Teko', sans-serif; font-size: 20px; letter-spacing: .5px;
  color: #07030f; background: var(--neon); box-shadow: 0 0 16px rgba(168, 255, 62, .6);
  animation: apeInPulse 1.6s ease-in-out 2;
}
@keyframes apeInPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
/* the game */
.gw-game { position: relative; flex: 1; }
.gw-game iframe { display: block; width: 100%; height: 100%; border: 0; background: #07030f; }
.gw-gate { margin: auto; max-width: 460px; padding: 34px 22px; text-align: center; font-family: 'Share Tech Mono', monospace; font-size: 13px; line-height: 1.55; }
.gw-gate-icon { font-size: 30px; letter-spacing: 10px; color: var(--pink); text-shadow: 0 0 12px rgba(255, 79, 216, .6); }
.gw-gate h3 { margin: 10px 0 6px; font-family: 'Teko', sans-serif; font-weight: 600; font-size: 34px; line-height: 1; color: var(--neon); text-transform: uppercase; }
.gw-gate .btn { display: inline-block; min-width: 220px; margin-top: 12px; }
body.gw-open #wallet, body.gw-open #music { z-index: 45; }   /* wallet + music stay usable over the window */
body.gw-open #musicBackdrop { z-index: 44; }              /* (a click off the music menu closes the menu, not the window) */
@media (min-width: 701px) { .gw-panel { max-height: min(calc(100vh - 168px), 980px); width: min(760px, calc(100vw - 32px)); } }
@media (max-width: 700px) {
  .gw-panel, .gw-panel.is-game { width: 100vw; height: calc(100dvh - 64px - 70px); max-height: none; margin: 64px 0 70px; }   /* between the wallet and the music buttons */
  body.gw-open #wallet { top: 12px; bottom: auto; right: 12px; }      /* (up top while a window is open, clear of it) */
  .gw-title { font-size: 34px; }
  .gw-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ── Blue beacon pin (config pin: 'blue'): an off-the-main-drag spot worth the trip — the House of Cards ── */
.pin.pin-blue .pin-bubble {
  border-color: #4fb8ff; color: #8fd6ff;
  background: radial-gradient(circle, rgba(8, 32, 64, .92), rgba(3, 10, 26, .95));
  box-shadow: 0 0 18px rgba(79, 184, 255, .85), inset 0 0 12px rgba(79, 184, 255, .4);
}
.pin.pin-blue .pin-bubble > svg { filter: drop-shadow(0 0 4px rgba(79, 184, 255, .95)); }
/* pinApe: a blue beacon that keeps the ape tile (the Safehouse) */
.pin.pin-blue.pin-ape:not(.pin-locked) .pin-ape-tile { display: block; background: #8fd6ff; filter: drop-shadow(0 0 4px rgba(79, 184, 255, .95)); }
.pin.pin-blue.pin-ape:not(.pin-locked) .pin-bubble:has(.pin-ape-tile) > svg { display: none; }
.pin.pin-blue .pin-bubble::after {                         /* a ring pulsing out from it */
  content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(79, 184, 255, .85);
  animation: beacon 2.2s ease-out infinite; pointer-events: none;
}
.pin.pin-blue .pin-tail { border-top-color: #4fb8ff; filter: drop-shadow(0 0 5px #4fb8ff); }
.pin.pin-blue .pin-label { border-color: rgba(79, 184, 255, .6); }
.pin.pin-blue .pin-name { color: #8fd6ff; text-shadow: 0 0 6px rgba(79, 184, 255, .85), 0 0 20px rgba(79, 184, 255, .45); }
.pin.pin-blue.hot .pin-bubble { box-shadow: 0 0 28px rgba(79, 184, 255, 1), inset 0 0 16px rgba(79, 184, 255, .6); }
@keyframes beacon { from { transform: scale(1); opacity: .9; } to { transform: scale(1.95); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pin.pin-blue .pin-bubble::after { animation: none; opacity: .5; } }
