:root {
  --pink: #ff4fa3;
  --orange: #ff8a3d;
  --yellow: #ffd23f;
  --teal: #2ee6c9;
  --purple: #7b5cff;
  --ink: #1a1030;
  --money: #7dff6b;
  --pixel: 'Silkscreen', ui-monospace, Menlo, monospace;
  --chunky: 'Bungee', 'Arial Black', Impact, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a1440; color: #fff; font-family: system-ui, -apple-system, Segoe UI, sans-serif; user-select: none; -webkit-user-select: none; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; }
/* ---------- lobby ---------- */
#menu { align-items: flex-start; overflow-y: auto; background:
  radial-gradient(ellipse at 50% 115%, rgba(255,120,60,.32), transparent 55%),
  linear-gradient(90deg, rgba(18,6,36,.3) 0%, rgba(18,6,36,.62) 35%, rgba(18,6,36,.62) 65%, rgba(18,6,36,.3) 100%); }
.lobby { width: min(1060px, 94vw); margin: 0 auto; padding: 34px 16px 40px; display: flex; flex-direction: column; gap: 18px; }
.lobby-head { text-align: center; }
.logo { margin: 0; font-family: var(--chunky); font-size: clamp(48px, 8.5vw, 104px); line-height: .9; letter-spacing: 2px; display: inline-flex; gap: .06em; align-items: flex-end; position: relative; }
.logo span:nth-child(1) { color: var(--yellow); text-shadow: 0 4px 0 #d9581e, 0 8px 0 #a3271c, 0 12px 0 #5b1235, 0 18px 30px rgba(0,0,0,.45); }
.logo span:nth-child(2) { color: var(--teal); text-shadow: 0 4px 0 #1a9bb8, 0 8px 0 #2a5bb0, 0 12px 0 #2a1d6b, 0 18px 30px rgba(0,0,0,.45); }
.logo em { font-style: normal; font-size: .32em; color: #fff; background: var(--pink); padding: 4px 10px; border-radius: 8px; transform: rotate(-8deg) translateY(-1.6em); box-shadow: 0 4px 0 #a01a63; position: absolute; right: -0.9em; top: .2em; }
.tag { font-size: 16px; line-height: 1.5; margin: 20px auto 0; max-width: 640px; opacity: .92; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
#url-form { display: flex; align-items: center; gap: 10px; width: min(760px, 100%); margin: 4px auto 0; background: rgba(20,8,40,.82); padding: 10px; border-radius: 18px; box-shadow: 0 6px 0 rgba(0,0,0,.35), inset 0 0 0 3px rgba(255,255,255,.12), 0 0 40px rgba(255,79,163,.18); }
.url-ico { font-size: 22px; padding-left: 6px; }
#url-input { flex: 1; min-width: 0; font-size: 19px; padding: 14px 16px; border: 0; border-radius: 12px; background: #fff; color: var(--ink); outline: none; font-family: var(--pixel); }
#url-input:focus { box-shadow: 0 0 0 3px var(--yellow); }
#go-btn { font-family: var(--chunky); font-size: 22px; padding: 14px 26px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(180deg, #ff6aa8, #ff3d7f); box-shadow: 0 5px 0 #a3134d; transition: transform .08s; white-space: nowrap; }
#go-btn:hover { transform: translateY(-2px); }
#go-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #a3134d; }
#menu-err { min-height: 18px; text-align: center; color: #ffd0d0; font-family: var(--pixel); font-size: 13px; text-shadow: 0 1px 2px #000; margin-top: -8px; }
#menu-err:empty { display: none; }

.sec-h { display: flex; align-items: center; gap: 12px; font-family: var(--pixel); font-size: 13px; letter-spacing: 3px; color: var(--yellow); margin-bottom: 12px; }
.sec-h i { flex: 1; height: 2px; background: linear-gradient(90deg, rgba(255,210,63,.55), transparent); }
.sec-h em { font-style: normal; letter-spacing: 1px; color: rgba(255,255,255,.55); font-size: 11px; }

#site-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
#dev-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sec-h.dev-h { margin-top: 20px; color: var(--teal, #2ee6c9); }
.sec-h.dev-h i { background: linear-gradient(90deg, rgba(46,230,201,.55), transparent); }
.site-card.dev { background: #142a36; }
@media (max-width: 900px) {
  #site-grid, #dev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #site-grid .site-card:nth-child(n+5) { display: none; }
}
.site-card { position: relative; border: 0; padding: 0; border-radius: 14px; overflow: hidden; text-align: left; background: #1d1036; color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.4), inset 0 0 0 2px rgba(255,255,255,.1); transition: transform .12s, box-shadow .12s; }
.site-card:hover, .site-card:focus-visible { transform: translateY(-4px); box-shadow: 0 9px 0 rgba(0,0,0,.4), inset 0 0 0 3px var(--yellow), 0 0 26px rgba(255,210,63,.25); outline: none; }
.site-card .thumb { aspect-ratio: 16 / 9; background: var(--card-bg, linear-gradient(135deg, #ff4fa3, #7b5cff)) center top / cover no-repeat; position: relative; overflow: hidden; }
.site-card .thumb.has-banner .initial { display: none; }
.site-card .thumb.has-banner::after { background: linear-gradient(180deg, transparent 60%, rgba(20,8,40,.55)); }
.site-card .thumb.loading .initial { opacity: .35; }
.site-card .thumb.loading::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.22) 50%, transparent 70%) 0 0 / 250% 100%; animation: cardShimmer 1.2s linear infinite; }
@keyframes cardShimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }
.site-card .thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(20,8,40,.75)); }
.site-card .thumb .initial { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--chunky); font-size: 44px; color: rgba(255,255,255,.9); text-shadow: 0 4px 0 rgba(0,0,0,.3); }
.site-card .meta { display: flex; align-items: center; gap: 8px; padding: 9px 10px 10px; }
.site-card .fav { width: 22px; height: 22px; border-radius: 6px; background: #fff; object-fit: contain; flex: none; }
.site-card .fav.blank { display: inline-flex; align-items: center; justify-content: center; font: 700 12px var(--pixel); color: var(--ink); }
.site-card .txt { min-width: 0; }
.site-card .host { font-family: var(--pixel); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card .ttl { font-size: 11px; opacity: .6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-card .badge { position: absolute; top: 8px; right: 8px; z-index: 1; font: 10px var(--pixel); padding: 3px 7px; border-radius: 999px; background: var(--money); color: #0b3d12; box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.site-card .badge.live { background: rgba(20,8,40,.8); color: #fff; }
.alt-row { display: flex; gap: 12px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.ghost { font-family: var(--pixel); font-size: 14px; color: #fff; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.3); padding: 9px 14px; border-radius: 12px; cursor: pointer; }
.ghost:hover { background: rgba(255,255,255,.2); }
.ghost.file input { display: none; }

.lobby-info { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; }
.info-card { background: rgba(20,8,40,.78); border-radius: 18px; padding: 16px 18px; box-shadow: 0 6px 0 rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.1); }
.how ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.how li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; font-size: 13.5px; line-height: 1.35; }
.how li b { color: var(--yellow); }
.keys { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.keys em, .cp-body em { font-style: normal; font-family: var(--pixel); font-size: 10px; opacity: .7; margin-left: 2px; }
.mouse { display: inline-block; font: 10px var(--pixel); background: var(--yellow); color: var(--ink); padding: 3px 7px; border-radius: 6px; box-shadow: 0 2px 0 #c58a10; }
.rule { display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.06); font-size: 13px; line-height: 1.4; }
.rule b { color: #fff; }
.edge { flex: none; display: inline-block; width: 46px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, #fff8e0 0 26%, #2a1d45 26% 40%, #7b5cff 40%); box-shadow: 0 3px 0 #3a2a70; }
.ars-note { margin: 0 0 10px; font-size: 13.5px; line-height: 1.4; }
.ars-note b { color: var(--yellow); }
.ars-note.small { margin: 12px 0 0; font-size: 12px; opacity: .75; }
.ars-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 7px; border-radius: 12px; background: rgba(255,255,255,.05); box-shadow: inset 3px 0 0 var(--wc); font-family: var(--pixel); font-size: 11.5px; }
.ars-row b { opacity: .5; }
.ars-row .t0 { color: #fff; }
.ars-row .t1 { color: var(--wc); }
.ars-row .t2 { color: var(--wc); text-shadow: 0 0 10px var(--wc); }
kbd { display: inline-block; min-width: 22px; text-align: center; padding: 2px 6px; margin-right: 3px; border-radius: 6px; background: #fff; color: var(--ink); font-family: var(--pixel); font-size: 11px; box-shadow: 0 2px 0 #9a8fb8; }
@media (max-width: 820px) { .lobby-info { grid-template-columns: 1fr; } .how li { grid-template-columns: 120px 1fr; } }
@media (max-width: 520px) { #url-form { flex-wrap: wrap; } .url-ico { display: none; } #go-btn { width: 100%; } }


#loading { background: rgba(26,10,48,.72); backdrop-filter: blur(3px); }
.load-box { text-align: center; }
#load-title { font-family: var(--chunky); font-size: 30px; color: var(--yellow); text-shadow: 0 3px 0 #a3271c; margin-top: 24px; }
#load-msg { font-family: var(--pixel); margin-top: 10px; opacity: .9; min-height: 20px; }
.bar { width: 320px; height: 14px; border-radius: 8px; background: rgba(255,255,255,.15); margin: 18px auto 0; overflow: hidden; }
#load-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow)); transition: width .3s; }
.voxel-spin { width: 70px; height: 70px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; animation: vs 1.1s infinite steps(4); }
.voxel-spin i { border-radius: 4px; }
.voxel-spin i:nth-child(1) { background: var(--pink); } .voxel-spin i:nth-child(2) { background: var(--yellow); }
.voxel-spin i:nth-child(3) { background: var(--teal); } .voxel-spin i:nth-child(4) { background: var(--purple); }
@keyframes vs { to { transform: rotate(360deg); } }

.panel { background: rgba(26,12,52,.92); padding: 26px 30px; border-radius: 22px; min-width: 320px; text-align: center; box-shadow: 0 10px 0 rgba(0,0,0,.35), inset 0 0 0 3px rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 10px; }
.panel h2 { font-family: var(--chunky); margin: 0 0 6px; font-size: 40px; color: var(--teal); text-shadow: 0 4px 0 #2a5bb0; }
.panel button { font-family: var(--pixel); font-size: 16px; padding: 12px 16px; border-radius: 12px; border: 0; background: #fff; color: var(--ink); box-shadow: 0 4px 0 #9a8fb8; }
.panel button:hover { background: var(--yellow); }
.toggles { display: flex; gap: 8px; margin-top: 6px; }
.toggles .tg { flex: 1; font-size: 12px; padding: 9px 8px; }
@keyframes wob { 50% { transform: scale(1.05) rotate(-2deg); } }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: var(--pixel); cursor: none; }
#hud-tl { position: absolute; left: 18px; top: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
#site-pill { display: flex; align-items: center; gap: 8px; background: rgba(20,8,40,.7); padding: 6px 12px 6px 6px; border-radius: 999px; font-size: 13px; max-width: 340px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
#site-pill img { width: 22px; height: 22px; border-radius: 6px; background: #fff; object-fit: contain; }
#site-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#floor-box { display: flex; align-items: baseline; gap: 8px; font-family: var(--chunky); text-shadow: 0 3px 0 #000, 0 0 12px rgba(0,0,0,.5); }
#floor-box .lbl { font-size: 16px; color: var(--teal); }
#floor-num { font-size: 44px; color: #fff; line-height: 1; }
#floor-of { font-size: 16px; opacity: .8; }
#room-name { font-size: 13px; color: var(--yellow); text-shadow: 0 2px 0 #000; letter-spacing: 1px; }
#hud-tc { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); text-align: center; }
#clue { background: linear-gradient(180deg, rgba(255,210,63,.95), rgba(255,160,40,.95)); color: var(--ink); padding: 8px 16px; border-radius: 14px; font-size: 14px; box-shadow: 0 4px 0 #a35a10, 0 8px 20px rgba(0,0,0,.35); display: flex; gap: 8px; align-items: center; max-width: 560px; }
#clue b { font-family: var(--chunky); font-weight: 400; font-size: 16px; }
.clue-ico { font-size: 20px; }
#radar-hint { font-size: 11px; margin-top: 6px; opacity: .8; text-shadow: 0 1px 2px #000; }
#hud-tr { position: absolute; right: 120px; top: 14px; text-align: right; }
#stars { font-size: 34px; letter-spacing: 2px; line-height: 1; }
#stars .on { color: #fff; text-shadow: 0 0 0 #000, 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 0 0 14px #ffd23f; }
#stars .off { color: rgba(0,0,0,.45); text-shadow: 2px 2px 0 rgba(255,255,255,.15); }
#stars .on.blink { animation: starblink .5s steps(2) infinite; }
@keyframes starblink { 50% { color: #ffd23f; } }
#money { font-family: var(--chunky); font-size: 40px; color: var(--money); text-shadow: 3px 3px 0 #0b3d12, -2px -2px 0 #0b3d12, 2px -2px 0 #0b3d12, -2px 2px 0 #0b3d12, 0 0 18px rgba(125,255,107,.45); margin-top: 4px; transition: transform .1s; }
#money.bump { transform: scale(1.18); }
#hud-bl { position: absolute; left: 18px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
#hearts { font-size: 28px; letter-spacing: 3px; filter: drop-shadow(2px 2px 0 #000); }
#hearts .dead { opacity: .25; filter: grayscale(1); }
#hud-br { position: absolute; right: 120px; bottom: 16px; }
#wreck-meter { background: rgba(20,8,40,.75); padding: 6px 12px; border-radius: 12px; font-size: 12px; display: flex; gap: 10px; align-items: baseline; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); }
#wreck-meter b { font-family: var(--chunky); font-weight: 400; color: var(--pink); font-size: 22px; }
#minimap-wrap { position: absolute; right: 16px; top: 16px; bottom: 16px; width: 88px; display: flex; align-items: flex-start; justify-content: center; }
#minimap { border-radius: 8px; box-shadow: 0 0 0 3px rgba(20,8,40,.85), 0 6px 20px rgba(0,0,0,.4); image-rendering: pixelated; }
#radar-arrow { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); opacity: 0; transition: opacity .25s; text-align: center; }
#radar-arrow.on { opacity: 1; }
#radar-arrow .arr { font-size: 46px; color: var(--yellow); text-shadow: 0 0 10px #ff8a3d, 2px 2px 0 #000; }
#radar-arrow .txt { font-size: 13px; background: rgba(20,8,40,.8); padding: 3px 8px; border-radius: 8px; white-space: nowrap; }
#floaters { position: absolute; inset: 0; overflow: hidden; }
.floater { position: absolute; transform: translate(-50%, -50%); font-family: var(--chunky); white-space: nowrap; text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; animation: floatUp 1s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 0; margin-top: 0; transform: translate(-50%,-50%) scale(.4); } 15% { opacity: 1; transform: translate(-50%,-50%) scale(1.25); } 30% { transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; margin-top: -60px; } }
#crosshair { position: absolute; width: 34px; height: 34px; transform: translate(-50%, -50%); left: -100px; top: -100px; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 0 2px #000; }
#crosshair i:nth-child(1) { left: 15px; top: 0; width: 4px; height: 10px; }
#crosshair i:nth-child(2) { left: 15px; bottom: 0; width: 4px; height: 10px; }
#crosshair i:nth-child(3) { top: 15px; left: 0; width: 10px; height: 4px; }
#crosshair i:nth-child(4) { top: 15px; right: 0; width: 10px; height: 4px; }
#crosshair.fire i { background: var(--yellow); }
#hint { position: absolute; left: 50%; bottom: 166px; transform: translateX(-50%); width: max-content; max-width: min(92vw, 760px); font-size: 14px; background: rgba(20,8,40,.8); padding: 8px 14px; border-radius: 12px; opacity: 0; transition: opacity .3s; text-align: center; }
#hint.on { opacity: 1; }
#vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px rgba(255,0,60,0); transition: box-shadow .2s; }
#vignette.hurt { box-shadow: inset 0 0 160px rgba(255,0,60,.65); }
#flash { position: absolute; inset: 0; background: #fff; opacity: 0; }

/* ---------- wreck rating / combo / prompts ---------- */
.rating-lbl { font-size: 10px; letter-spacing: 2px; opacity: .85; text-shadow: 1px 1px 0 #000; }
#combo { min-height: 0; text-align: right; margin-top: 4px; opacity: 0; transform-origin: right center; transition: opacity .2s; }
#combo.on { opacity: 1; }
#combo .cmb-n { font-family: var(--chunky); font-size: 30px; color: var(--pink); text-shadow: 3px 3px 0 #000, -1px -1px 0 #000; line-height: 1; }
#combo .cmb-mult { font-family: var(--chunky); font-size: 22px; color: var(--yellow); text-shadow: 2px 2px 0 #000; }
#combo .cmb-bar { width: 150px; height: 8px; margin: 4px 0 0 auto; border-radius: 5px; background: rgba(0,0,0,.45); overflow: hidden; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
#combo .cmb-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--yellow), var(--pink)); transform-origin: left; }
#combo.pulse .cmb-n { animation: cmbPulse .18s ease-out; }
@keyframes cmbPulse { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
#combo.hot .cmb-n { color: #fff; text-shadow: 3px 3px 0 #000, 0 0 18px #ff4fa3, 0 0 30px #ffd23f; }
#prompt { position: absolute; transform: translate(-50%, -100%); font-family: var(--chunky); font-size: 16px; color: #fff; background: rgba(20,8,40,.82); padding: 5px 10px; border-radius: 10px; box-shadow: 0 3px 0 rgba(0,0,0,.4), inset 0 0 0 2px var(--teal); white-space: nowrap; opacity: 0; transition: opacity .15s; }
#prompt.on { opacity: 1; animation: promptBob .8s ease-in-out infinite; }
@keyframes promptBob { 50% { margin-top: -5px; } }
#prompt b { color: var(--yellow); }
#frenzy-tint { position: absolute; inset: 0; box-shadow: inset 0 0 140px rgba(255,140,40,0); transition: box-shadow .3s; }
#frenzy-tint.on { box-shadow: inset 0 0 160px rgba(255,140,40,.55), inset 0 0 40px rgba(255,79,163,.45); animation: frenzyPulse .35s ease-in-out infinite alternate; }
@keyframes frenzyPulse { to { box-shadow: inset 0 0 200px rgba(255,210,63,.6), inset 0 0 60px rgba(255,79,163,.55); } }
#loadstrip { margin-top: 8px; background: rgba(20,8,40,.85); border-radius: 12px; padding: 7px 12px; min-width: 320px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); pointer-events: none; }
#loadstrip .ls-txt { font-size: 13px; }
#loadstrip .ls-txt b { color: var(--yellow); }
#loadstrip .ls-bar { height: 8px; border-radius: 5px; background: rgba(255,255,255,.15); margin-top: 6px; overflow: hidden; }
#loadstrip .ls-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--orange), var(--yellow)); transition: width .4s; }
#loadstrip.ready { box-shadow: inset 0 0 0 3px var(--money), 0 0 24px rgba(125,255,107,.5); animation: wob 0.8s ease-in-out infinite; }

/* ---------- weapons, evolution, controls, banners ---------- */
#weapons { display: flex; gap: 8px; align-items: flex-end; }
.wslot { --wc: var(--yellow); position: relative; background: rgba(20,8,40,.8); border-radius: 12px; padding: 11px 10px 8px; min-width: 124px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); transform: scale(.92); transform-origin: 50% 100%; transition: transform .16s cubic-bezier(.3,.7,.4,1), box-shadow .2s, background-color .2s; }
/* inactive guns are dimmed, but their key stays bright so you can always read it */
.wslot > :not(.k) { transition: opacity .14s; }
.wslot:not(.active):not(.nudge) > :not(.k) { opacity: .5; }
/* the gun in your hand: full size, lifted, lit in its own colour */
.wslot.active { transform: translateY(-8px); background-color: color-mix(in srgb, var(--wc) 22%, rgba(20,8,40,.9)); box-shadow: inset 0 0 0 3px var(--wc), 0 4px 0 rgba(0,0,0,.4), 0 0 22px color-mix(in srgb, var(--wc) 50%, transparent); }
/* the moment you switch: the slot jumps and flashes, a ring bursts off it, the gun pops in */
.wslot.picked { animation: slotPick .46s cubic-bezier(.2,.8,.3,1); }
.wslot.picked::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at 50% 55%, #fff, color-mix(in srgb, var(--wc) 70%, transparent) 70%); mix-blend-mode: screen; pointer-events: none; animation: pickFlash .38s ease-out forwards; }
.wslot.picked::after { content: ''; position: absolute; inset: -3px; border-radius: 15px; border: 3px solid var(--wc); box-shadow: 0 0 16px var(--wc); pointer-events: none; animation: pickRing .5s ease-out forwards; }
.wslot.picked .gun { animation: gunPick .5s cubic-bezier(.2,.8,.3,1); }
.wslot.picked .n { animation: namePick .5s ease-out; }
@keyframes slotPick { 0% { transform: translateY(-2px) scale(.9); } 38% { transform: translateY(-20px) scale(1.14); } 100% { transform: translateY(-8px) scale(1); } }
@keyframes pickFlash { 0% { opacity: .95; } 100% { opacity: 0; } }
@keyframes pickRing { 0% { opacity: 1; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.32, 1.5); } }
@keyframes gunPick { 0% { transform: scale(.25) rotate(-30deg); filter: brightness(2.4) drop-shadow(0 0 12px var(--wc)); } 55% { transform: scale(1.35) rotate(6deg); } 100% { transform: scale(1.08) rotate(0); } }
@keyframes namePick { 0% { transform: scale(1.5); color: #fff; text-shadow: 0 0 14px var(--wc), 1px 1px 0 #000; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .wslot.picked, .wslot.picked::after, .wslot.picked .gun, .wslot.picked .n { animation: none; } }
.wslot .top { display: flex; align-items: center; gap: 6px; font-size: 11px; min-height: 11px; }
/* a real keyboard key sitting on the top edge of each slot */
.wslot .k, #prompt .kc { display: inline-grid; place-items: center; box-sizing: border-box; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 6px; font-family: var(--pixel); font-size: 14px; line-height: 1; color: var(--ink); background: linear-gradient(#fff, #e2dcf2); box-shadow: 0 4px 0 #8f86b3, 0 6px 7px rgba(0,0,0,.5), inset 0 -2px 0 rgba(0,0,0,.06); text-shadow: none; }
.wslot .k { position: absolute; left: 50%; top: -15px; transform: translateX(-50%); }
.wslot.active .k { background: linear-gradient(#fff, color-mix(in srgb, var(--wc) 30%, #fff)); }
/* click a gun to equip it */
#weapons .wslot[data-i] { pointer-events: auto; cursor: pointer; }
#weapons .wslot[data-i]:not(.active):not(.nudge):hover { transform: translateY(-3px) scale(.95); }
#weapons .wslot[data-i]:not(.active):hover > :not(.k) { opacity: .9; }
#hud:has(#weapons .wslot[data-i]:hover) #crosshair { visibility: hidden; }
/* the wordless "try this one" nudge: slot lifts and glows, its key taps itself */
.wslot.nudge { transform: translateY(-10px) scale(.97); animation: slotNudge 1.2s ease-in-out infinite; }
.wslot.nudge .k, #prompt .kc.tap { background: linear-gradient(#fff8cf, #ffd23f); animation: keyTap 1.2s ease-in-out infinite; }
@keyframes slotNudge {
  0%, 100% { box-shadow: inset 0 0 0 3px var(--wc), 0 4px 0 rgba(0,0,0,.4), 0 0 8px color-mix(in srgb, var(--wc) 35%, transparent); }
  50% { box-shadow: inset 0 0 0 3px var(--wc), 0 4px 0 rgba(0,0,0,.4), 0 0 28px color-mix(in srgb, var(--wc) 80%, transparent); }
}
@keyframes keyTap {
  0%, 28%, 56%, 100% { translate: 0 0; box-shadow: 0 4px 0 #b08a1c, 0 6px 7px rgba(0,0,0,.5); }
  14%, 42% { translate: 0 4px; box-shadow: 0 0 0 #b08a1c, 0 1px 2px rgba(0,0,0,.5); }
}
#prompt .kc { vertical-align: middle; margin-right: 4px; }
#prompt .pg { width: 60px; height: 30px; object-fit: contain; vertical-align: middle; filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)); }
@media (prefers-reduced-motion: reduce) { .wslot.nudge, .wslot.nudge .k, #prompt .kc.tap { animation: none; } }
.wslot .pips { display: flex; gap: 3px; }
.wslot .pips i { width: 9px; height: 9px; border-radius: 2px; background: rgba(255,255,255,.18); }
.wslot .pips i.on { background: var(--wc); box-shadow: 0 0 6px var(--wc); }
.wslot .a { margin-left: auto; }
.wslot .gun { display: block; width: 96px; height: 48px; margin: 2px auto -2px; object-fit: contain; background: radial-gradient(closest-side, color-mix(in srgb, var(--wc) 26%, transparent), transparent); filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)); transform-origin: 50% 60%; transition: transform .2s, filter .2s; }
.wslot.active .gun { transform: scale(1.08); filter: drop-shadow(0 2px 0 rgba(0,0,0,.45)) drop-shadow(0 0 8px color-mix(in srgb, var(--wc) 55%, transparent)); }
.wslot.evolved .gun { animation: gunEvolve 1.2s ease-out; }
@keyframes gunEvolve { 0% { transform: scale(1.6) rotate(-8deg); filter: brightness(2.2) drop-shadow(0 0 14px var(--wc)); } 60% { transform: scale(1.02) rotate(1deg); } }
.wslot .n { font-size: 12px; color: var(--wc); margin: 2px 0 5px; text-align: center; white-space: nowrap; text-shadow: 1px 1px 0 #000; }
.wslot.t2 .n { text-shadow: 0 0 10px var(--wc), 1px 1px 0 #000; }
.wslot .xp { position: relative; height: 10px; border-radius: 5px; background: rgba(0,0,0,.5); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.wslot .xp i { position: absolute; inset: 0; transform-origin: left; background: linear-gradient(90deg, color-mix(in srgb, var(--wc) 55%, #000), var(--wc)); transition: transform .15s; }
.wslot .xp span { position: absolute; inset: 0; font-size: 7px; letter-spacing: 1px; line-height: 10px; text-align: center; color: #fff; text-shadow: 1px 1px 0 #000; }
.wslot .xp.none { background: transparent; box-shadow: none; }
.wslot .xp.none span { font-size: 8px; opacity: .7; }
.wslot.soon .xp { animation: soonPulse .45s ease-in-out infinite alternate; }
@keyframes soonPulse { to { box-shadow: inset 0 0 0 1px #fff, 0 0 10px var(--wc); } }
.wslot.evolved { animation: slotEvolve 1.5s ease-out; }
@keyframes slotEvolve { 0% { transform: translateY(-8px) scale(1.35); box-shadow: inset 0 0 0 4px #fff, 0 0 40px var(--wc); } 100% { transform: translateY(-8px) scale(1); } }
.wslot.bomb { --wc: #7dff6b; min-width: 96px; }

/* weapon evolution card: pops up out of the weapon bar */
#evolve { --wc: var(--yellow); position: absolute; left: 18px; bottom: 166px; min-width: 330px; padding: 12px 18px 14px; border-radius: 16px; background: rgba(20,8,40,.92); box-shadow: inset 0 0 0 3px var(--wc), 0 0 40px color-mix(in srgb, var(--wc) 50%, transparent), 0 8px 0 rgba(0,0,0,.4); opacity: 0; transform: translateY(20px) scale(.8); transform-origin: left bottom; pointer-events: none; }
#evolve.on { animation: evolveIn 3.2s cubic-bezier(.2,1.5,.4,1) forwards; }
@keyframes evolveIn { 0% { opacity: 0; transform: translateY(30px) scale(.6); } 10% { opacity: 1; transform: translateY(0) scale(1.06); } 18% { transform: scale(1); } 86% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-10px) scale(.96); } }
#evolve .ev-tag { font-size: 11px; letter-spacing: 2px; color: var(--wc); }
#evolve .ev-names { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 4px; font-family: var(--chunky); }
#evolve .ev-names s { font-size: 15px; opacity: .55; }
#evolve .ev-names b { color: var(--wc); }
#evolve .ev-names span { font-size: 28px; color: #fff; text-shadow: 0 0 16px var(--wc), 2px 2px 0 #000; }
#evolve .ev-desc { font-size: 12px; color: #fff; opacity: .9; }

/* controls panel (H): open for the first seconds of a run, then a small chip */
#controls-panel { position: absolute; left: 18px; top: 150px; background: rgba(20,8,40,.78); border-radius: 12px; padding: 6px 10px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); font-size: 11px; max-width: 250px; }
#controls-panel .cp-head { font-size: 11px; letter-spacing: 1px; opacity: .85; }
#controls-panel .cp-body { display: none; flex-direction: column; gap: 5px; margin-top: 8px; }
#controls-panel.open .cp-body { display: flex; }
#controls-panel.open { padding: 9px 12px 11px; }
#controls-panel .cp-body b { color: var(--yellow); font-weight: 400; }
#controls-panel kbd { font-size: 9px; min-width: 18px; padding: 1px 4px; margin-right: 2px; }
#controls-panel .mouse { font-size: 9px; padding: 2px 5px; }
.cp-rule { display: flex; align-items: center; gap: 8px; margin-top: 3px; color: #fff8e0; }
.cp-rule .edge { width: 30px; height: 12px; }

/* banners sit up top and stay compact so they never cover the player */
#banner { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); text-align: center; font-family: var(--chunky); pointer-events: none; }
#banner .big { font-size: clamp(26px, 4.2vw, 50px); color: var(--yellow); text-shadow: 0 3px 0 #d9581e, 0 6px 0 #a3271c, 0 10px 18px rgba(0,0,0,.4); animation: bannerIn .45s cubic-bezier(.2,1.6,.4,1); }
#banner .small { font-family: var(--pixel); font-size: 14px; margin-top: 8px; text-shadow: 2px 2px 0 #000; }
#banner.combo { left: auto; right: 120px; top: 150px; transform: none; text-align: right; }
#banner.combo .big { font-size: clamp(22px, 2.8vw, 34px); }
#banner.combo .small { font-size: 12px; }
@keyframes bannerIn { from { transform: scale(.3) rotate(-6deg); opacity: 0; } }

/* The holding room while the destination builds: neon drop bay with tips. */
#load-room { position: absolute; inset: 0; z-index: 20; pointer-events: none; color: #fff; text-align: center; }
.room-heading { position: absolute; top: 6%; left: 5%; right: 5%; }
.room-eyebrow { font-family: var(--pixel); font-size: 12px; letter-spacing: 4px; color: var(--teal); }
.room-heading h2 { margin: 10px 0 6px; font-family: var(--chunky); font-size: clamp(26px, 4.4vw, 48px); color: var(--yellow); text-shadow: 0 3px 0 #d9581e, 0 6px 0 #a3271c, 0 12px 24px rgba(0,0,0,.45); }
#room-site { display: inline-block; margin: 0; font-family: var(--pixel); font-size: 14px; padding: 5px 12px; border-radius: 999px; background: rgba(20,8,40,.75); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
.room-footer { position: absolute; bottom: 5%; left: 5%; right: 5%; display: flex; align-items: center; flex-direction: column; gap: 12px; }
#room-message { margin: 0; max-width: 560px; font-family: var(--pixel); font-size: 14px; background: rgba(20,8,40,.8); padding: 8px 14px; border-radius: 10px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12); }
#room-tip { display: flex; gap: 10px; align-items: center; max-width: 620px; font-size: 14px; background: rgba(20,8,40,.72); padding: 8px 14px; border-radius: 12px; box-shadow: inset 0 0 0 2px rgba(46,230,201,.35); }
#room-tip .tip-lbl { font: 10px var(--pixel); letter-spacing: 2px; color: var(--ink); background: var(--teal); border-radius: 6px; padding: 3px 6px; }
#room-tip-txt { text-align: left; line-height: 1.35; }
#room-tip-txt b { color: var(--yellow); }
#room-blip { width: 12px; height: 12px; background: var(--teal); border-radius: 50%; animation: roomBlip 1.6s ease-out infinite; }
#room-blip.ready { background: var(--money); animation-duration: 2.6s; }
@keyframes roomBlip { 0% { box-shadow: 0 0 0 0 rgba(46,230,201,.6); } 100% { box-shadow: 0 0 0 22px rgba(46,230,201,0); } }
#load-room button { pointer-events: auto; cursor: pointer; border: 0; border-radius: 12px; padding: 12px 22px; font-family: var(--pixel); background: #fff; color: var(--ink); }
#room-enter { font-family: var(--chunky) !important; font-size: 22px; color: #fff !important; background: linear-gradient(180deg, #ff6aa8, #ff3d7f) !important; box-shadow: 0 5px 0 #a3134d; animation: wob .9s ease-in-out infinite; }
#room-enter kbd { margin-right: 8px; vertical-align: 3px; }
.room-controls { font-size: 12px; font-family: var(--pixel); background: rgba(20,8,40,.75); border-radius: 10px; padding: 0 0 0 12px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.1); }
.room-controls kbd { font-size: 9px; }
#load-room #room-back { background: transparent; color: #fff; text-decoration: underline; padding: 10px 12px; font-family: inherit; }
#load-room button:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }

/* ---------- treasure celebration (in-game overlay) ---------- */
#treasure-fx { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s; overflow: hidden; }
#treasure-fx.on { opacity: 1; }
#treasure-fx::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 120px rgba(255,190,40,.35); animation: tfGlow .5s ease-in-out infinite alternate; }
@keyframes tfGlow { to { box-shadow: inset 0 0 160px rgba(255,210,63,.45), inset 0 0 40px rgba(255,79,163,.25); } }
/* during the celebration only the celebration is on screen */
#hud.cine > :not(#treasure-fx):not(#flash) { opacity: 0 !important; }
.tf-rays { position: absolute; left: var(--tx, 50%); top: var(--ty, 50%); width: 170vmax; height: 170vmax; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(rgba(255,214,90,.13) 0 6deg, transparent 6deg 16deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0,0,0,.8) 10%, transparent 48%); mask-image: radial-gradient(circle, #000 0, rgba(0,0,0,.8) 10%, transparent 48%);
  animation: tfSpin 10s linear infinite; mix-blend-mode: screen; }
@keyframes tfSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.tf-title { position: absolute; left: 0; right: 0; top: 11%; text-align: center; font-family: var(--chunky); font-size: clamp(42px, 8vw, 112px); line-height: 1; white-space: nowrap; }
.tf-title span { display: inline-block; color: var(--yellow); text-shadow: 0 5px 0 #d9581e, 0 10px 0 #a3271c, 0 18px 30px rgba(0,0,0,.5), 0 0 40px rgba(255,210,63,.7);
  animation: tfLetter .55s cubic-bezier(.2,1.8,.4,1) both, tfBob 1.1s ease-in-out infinite;
  animation-delay: calc(var(--i) * 45ms + .12s), calc(var(--i) * 70ms + .9s); }
@keyframes tfLetter { from { transform: translateY(-140px) scale(2.4) rotate(-24deg); opacity: 0; } }
@keyframes tfBob { 50% { transform: translateY(-9px) rotate(-2deg); } }
.tf-bonus { position: absolute; left: 0; right: 0; top: calc(11% + clamp(56px, 10vw, 140px)); text-align: center; opacity: 0; }
.tf-bonus.on { opacity: 1; animation: tfBonus .5s cubic-bezier(.2,1.8,.4,1); }
.tf-bonus b { display: block; font-family: var(--chunky); font-weight: 400; font-size: clamp(30px, 4.6vw, 58px); color: var(--money);
  text-shadow: 3px 3px 0 #0b3d12, -2px -2px 0 #0b3d12, 2px -2px 0 #0b3d12, -2px 2px 0 #0b3d12, 0 0 24px rgba(125,255,107,.6); }
.tf-bonus span { font: 14px var(--pixel); letter-spacing: 4px; text-shadow: 2px 2px 0 #000; }
@keyframes tfBonus { from { transform: scale(.2); opacity: 0; } }
.tf-confetti i { position: absolute; left: var(--x); bottom: -14px; width: var(--w); height: calc(var(--w) * 1.6); background: var(--c); border-radius: 2px; opacity: 0;
  animation: tfCannon var(--d) cubic-bezier(.12,.75,.35,1) var(--dl) forwards; }
@keyframes tfCannon {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  45% { opacity: 1; transform: translate(calc(var(--dx) * .8), var(--up)) rotate(calc(var(--r) * .5)); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--up) + 70vh)) rotate(var(--r)); }
}

/* ---------- results ---------- */
#pause { background: rgba(20,6,40,.45); }
#win { background: radial-gradient(ellipse at 50% 35%, rgba(40,14,70,.2), rgba(14,4,28,.85) 72%); overflow-y: auto; overflow-x: hidden; }
.win-rays { position: fixed; left: 50%; top: 22%; width: 190vmax; height: 190vmax; transform: translate(-50%, -50%); pointer-events: none;
  background: repeating-conic-gradient(rgba(255,210,63,.09) 0 7deg, transparent 7deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000, transparent 42%); mask-image: radial-gradient(circle, #000, transparent 42%);
  animation: tfSpin 45s linear infinite; }
.win-card { position: relative; width: min(880px, calc(100vw - 32px)); margin: auto; padding: 22px 24px 20px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(40,17,76,.97), rgba(22,8,44,.97));
  box-shadow: 0 0 0 3px rgba(255,210,63,.6), 0 0 70px rgba(255,180,40,.25), 0 14px 0 rgba(0,0,0,.4); }
#win.show .win-card { animation: winIn .6s cubic-bezier(.2,1.35,.4,1) both; }
#win.stamped .win-card { animation: winThump .35s ease-out; }
@keyframes winIn { from { transform: translateY(90px) scale(.86); opacity: 0; } }
@keyframes winThump { 30% { transform: scale(1.015) rotate(-.3deg); } }

.win-top { display: flex; align-items: center; gap: 22px; }
.win-grade { --gc: linear-gradient(135deg, #8a7aa8, #4a3c66); flex: none; width: 112px; height: 112px; border-radius: 24px; display: grid; place-items: center; position: relative;
  background: var(--gc); box-shadow: inset 0 0 0 4px rgba(255,255,255,.35), 0 6px 0 rgba(0,0,0,.4); opacity: 0; }
.win-grade[data-g="S"] { --gc: linear-gradient(135deg, #ffd23f, #ff4fa3); box-shadow: inset 0 0 0 4px rgba(255,255,255,.5), 0 6px 0 rgba(0,0,0,.4), 0 0 40px rgba(255,210,63,.6); }
.win-grade[data-g="A"] { --gc: linear-gradient(135deg, #2ee6c9, #7b5cff); }
.win-grade[data-g="B"] { --gc: linear-gradient(135deg, #7dff6b, #1fa98f); }
.win-grade[data-g="C"] { --gc: linear-gradient(135deg, #ff8a3d, #c4456b); }
.win-grade span { font-family: var(--chunky); font-size: 78px; line-height: 1; color: #fff; text-shadow: 0 5px 0 rgba(0,0,0,.3); }
.win-grade em { position: absolute; bottom: -10px; font: 11px var(--pixel); font-style: normal; background: var(--ink); padding: 3px 9px; border-radius: 7px; letter-spacing: 3px; box-shadow: 0 0 0 2px rgba(255,255,255,.2); }
.win-grade.stamp { animation: stamp .5s cubic-bezier(.3,1.6,.5,1) forwards; }
@keyframes stamp { 0% { opacity: 0; transform: scale(3.2) rotate(-28deg); } 55% { opacity: 1; transform: scale(.9) rotate(3deg); } 100% { opacity: 1; transform: scale(1) rotate(-6deg); } }
.win-head { min-width: 0; }
.win-kicker { font-family: var(--chunky); font-size: clamp(26px, 4.4vw, 46px); line-height: 1; color: var(--yellow); text-shadow: 0 4px 0 #d9581e, 0 8px 0 #a3271c, 0 12px 20px rgba(0,0,0,.4); }
.win-site { display: flex; align-items: center; gap: 9px; margin: 14px 0 4px; font: 400 16px var(--pixel); min-width: 0; }
.win-site span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-site img { width: 24px; height: 24px; border-radius: 6px; background: #fff; object-fit: contain; flex: none; }
.win-where { font-size: 13px; opacity: .72; }

.win-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0 12px; }
.hero { position: relative; background: rgba(255,255,255,.06); border-radius: 16px; padding: 12px 14px 13px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.08), inset 0 -3px 0 var(--hc); }
.hero .lbl { font: 11px var(--pixel); letter-spacing: 2px; opacity: .72; }
.hero b { display: block; margin-top: 4px; font-family: var(--chunky); font-weight: 400; font-size: clamp(26px, 4vw, 40px); line-height: 1.05; color: var(--hc); text-shadow: 0 3px 0 rgba(0,0,0,.45); font-variant-numeric: tabular-nums; }
.hero .best { position: absolute; right: 10px; top: 10px; font: 10px var(--pixel); font-style: normal; opacity: .65; }
.hero .best.new { opacity: 1; color: #fff; background: var(--pink); padding: 3px 7px; border-radius: 6px; box-shadow: 0 2px 0 #a01a63; animation: wob .8s ease-in-out infinite; }
.hero .best.plain { position: static; display: block; margin-top: 6px; text-align: right; }
.hero .meter { height: 8px; border-radius: 4px; background: rgba(0,0,0,.45); margin-top: 7px; overflow: hidden; }
.hero .meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--yellow)); }

.win-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ws { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.04); border-radius: 12px; padding: 8px 12px; font-size: 13px; opacity: 0; animation: wsIn .35s ease-out forwards; animation-delay: calc(.55s + var(--i) * 70ms); }
.ws .ic { font-size: 18px; }
.ws b { margin-left: auto; font: 15px var(--pixel); color: var(--money); }
@keyframes wsIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.win-row { display: grid; grid-template-columns: 1fr 1.45fr; gap: 12px; margin-top: 12px; }
.win-box { background: rgba(255,255,255,.04); border-radius: 14px; padding: 10px 12px 12px; }
.win-box h4 { margin: 0 0 8px; font: 400 11px var(--pixel); letter-spacing: 3px; color: var(--yellow); }
.wa { display: flex; align-items: center; gap: 8px; font: 12px var(--pixel); margin: 6px 0; }
.wa kbd { font-size: 9px; min-width: 18px; }
.wa .nm { color: var(--wc); text-shadow: 0 0 10px color-mix(in srgb, var(--wc) 50%, transparent); }
.wa .pips { margin-left: auto; display: flex; gap: 3px; }
.wa .pips i { width: 10px; height: 10px; border-radius: 2px; background: rgba(255,255,255,.15); }
.wa .pips i.on { background: var(--wc); box-shadow: 0 0 6px var(--wc); }
.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.bdg { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 10px; background: rgba(0,0,0,.25); opacity: .38; filter: grayscale(1); }
.bdg .ic { font-size: 20px; }
.bdg b { display: block; font: 400 11px var(--pixel); letter-spacing: 1px; }
.bdg em { display: block; font-style: normal; font-size: 10.5px; opacity: .7; }
.bdg.on { opacity: 1; filter: none; background: linear-gradient(135deg, rgba(255,210,63,.22), rgba(255,79,163,.22)); box-shadow: inset 0 0 0 2px rgba(255,210,63,.65); animation: bdgPop .5s cubic-bezier(.2,1.8,.4,1); }
.bdg.on b { color: var(--yellow); }
@keyframes bdgPop { 0% { transform: scale(1.5); } }

.win-btns2 { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.win-btns2 button { flex: 1; min-width: 150px; font-family: var(--pixel); font-size: 14px; padding: 13px 14px; border-radius: 14px; border: 0; background: #fff; color: var(--ink); box-shadow: 0 4px 0 #9a8fb8; transition: transform .08s; }
.win-btns2 button.primary { flex: 1.5; font-family: var(--chunky); font-size: 24px; color: #fff; background: linear-gradient(180deg, #ff6aa8, #ff3d7f); box-shadow: 0 5px 0 #a3134d, 0 0 26px rgba(255,79,163,.35); }
.win-btns2 button.primary kbd { vertical-align: 4px; margin-left: 6px; }
.win-btns2 button.ghost-btn { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); }
.win-btns2 button:hover { transform: translateY(-2px); }
.win-btns2 button:active { transform: translateY(2px); }
.win-btns2 button:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
@media (max-width: 760px) {
  .win-top { flex-direction: column; text-align: center; gap: 14px; }
  .win-site { justify-content: center; }
  .win-hero, .win-grid { grid-template-columns: 1fr 1fr; }
  .win-row { grid-template-columns: 1fr; }
}

/* The objective stays visible while loading and when ready; tips can rotate below it. */
#room-objective { margin: 14px auto 0; padding: 12px 18px; max-width: 540px; border-radius: 12px; background: rgba(20,8,40,.86); box-shadow: inset 0 0 0 1px rgba(255,210,63,.35); }
#room-objective .mission-label { font: 9px var(--pixel); letter-spacing: 2px; color: var(--teal); }
#room-objective h3 { margin: 5px 0 6px; font: 18px var(--chunky); color: var(--yellow); }
#room-objective p { margin: 0; font-size: 14px; line-height: 1.45; color: #fff; }
@media (max-height: 650px) {
  .room-heading { top: 3%; }
  .room-heading h2 { font-size: 28px; margin: 5px 0; }
  #room-objective { margin-top: 8px; padding: 8px 12px; }
  #room-objective h3 { font-size: 15px; }
  #room-objective p { font-size: 12px; }
}

/* Equipped gun progress: a thin arc floating over the player's head. Quiet by default; XP gains, a near
   evolution and the evolution itself light it up. */
#player-evolution { position: absolute; width: 66px; height: 22px; transform: translateX(-50%); pointer-events: none; opacity: .6; transition: opacity .25s; }
#player-evolution .pe-arc { position: absolute; inset: 0; width: 66px; height: 22px; overflow: visible; }
#player-evolution path { fill: none; stroke-linecap: round; }
#player-evolution .pe-under { stroke: rgba(12, 6, 24, .55); stroke-width: 6; }
#player-evolution .pe-track { stroke: rgba(255, 255, 255, .2); stroke-width: 2.5; }
#player-evolution .pe-fill { stroke: var(--wc); stroke-width: 2.5; stroke-dasharray: 100 100; stroke-dashoffset: 100; filter: drop-shadow(0 0 2px var(--wc)); transition: stroke-dashoffset .18s ease-out; }
#player-evolution .pe-shine { stroke: #fff; stroke-width: 1.5; stroke-dasharray: 9 91; stroke-dashoffset: 100; opacity: 0; }
#player-evolution .pe-head { position: absolute; left: 0; top: 0; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 5px 1px var(--wc); offset-path: path('M4 19 Q33 6 62 19'); offset-rotate: 0deg; offset-anchor: 50% 50%; offset-distance: 0%; transition: offset-distance .18s ease-out, width .2s, height .2s, box-shadow .2s; }
#player-evolution .pe-pips { position: absolute; left: 50%; top: 1px; display: flex; gap: 4px; transform: translateX(-50%); }
#player-evolution .pe-pips i { width: 4px; height: 4px; transform: rotate(45deg); background: rgba(255, 255, 255, .22); box-shadow: 0 0 0 1px rgba(12, 6, 24, .55); transition: background .2s, box-shadow .2s; }
#player-evolution .pe-pips i.on { background: var(--wc); box-shadow: 0 0 0 1px rgba(12, 6, 24, .55), 0 0 5px var(--wc); }
#pe-gain { position: absolute; left: calc(100% + 1px); top: 12px; font: 8px var(--pixel); color: var(--wc); white-space: nowrap; text-shadow: 0 1px 0 #0c0618, 0 0 4px rgba(12, 6, 24, .8); opacity: 0; transform: translateY(3px); transition: opacity .15s, transform .25s; }
#player-evolution.empty .pe-fill, #player-evolution.empty .pe-head, #player-evolution.maxed .pe-head { opacity: 0; }
#player-evolution.gaining, #player-evolution.evolved { opacity: 1; }
#player-evolution.gaining .pe-head { width: 7px; height: 7px; box-shadow: 0 0 8px 2px var(--wc); }
#player-evolution.gaining #pe-gain, #player-evolution.evolved #pe-gain { opacity: 1; transform: none; }
#player-evolution.evolved #pe-gain { color: #fff; }
#player-evolution.soon { opacity: .9; }
#player-evolution.soon .pe-fill { animation: peSoon 1.1s ease-in-out infinite; }
#player-evolution.maxed:not(.gaining):not(.evolved) { opacity: .45; }
#player-evolution.maxed .pe-shine { opacity: .75; animation: peShine 2.6s linear infinite; }
#player-evolution.evolved .pe-fill { animation: peFlash .55s ease-out 2; }
#player-evolution.evolved .pe-pips i.on:not(:has(+ i.on)) { animation: pePip .5s ease-out; }
#player-evolution.evolved::after { content: ''; position: absolute; left: 0; right: 0; top: 6px; height: 15px; border-radius: 50%; border: 2px solid var(--wc); animation: peBurst .7s ease-out forwards; }
@keyframes peSoon { 50% { filter: drop-shadow(0 0 5px var(--wc)); stroke-width: 3.2; } }
@keyframes peShine { from { stroke-dashoffset: 100; } to { stroke-dashoffset: -9; } }
@keyframes peFlash { 0% { stroke: #fff; stroke-width: 4.5; filter: drop-shadow(0 0 8px var(--wc)); } 100% { stroke-width: 2.5; } }
@keyframes pePip { 0% { scale: 2.4; } 100% { scale: 1; } }
@keyframes peBurst { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.7, 2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #player-evolution, #player-evolution * { transition: none !important; animation: none !important; }
  #player-evolution.evolved::after { display: none; }
}

/* The actual treasure is the hero of the pre-drop briefing. */
#load-room .room-heading { top: 4%; }
#load-room .room-heading h2 { font-size: clamp(26px, 3.4vw, 46px); }
.room-destination { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
#room-status { font: 11px var(--pixel); color: var(--teal); padding: 5px 0; }
#load-room #room-site { font-size: 11px; }
#room-objective { display: flex; align-items: center; gap: 22px; max-width: 680px; padding: 14px 24px 14px 10px; border-radius: 18px; background: linear-gradient(120deg, rgba(39,20,54,.96), rgba(20,8,40,.93)); box-shadow: inset 0 0 0 1px rgba(255,210,63,.55), 0 8px 28px rgba(0,0,0,.25); }
.treasure-target { margin: 0; width: 240px; flex: 0 0 240px; position: relative; background: radial-gradient(ellipse at center, rgba(255,196,70,.14), transparent 70%); }
#room-treasure-preview { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; }
.treasure-target figcaption { margin-top: -5px; font: 8px var(--pixel); letter-spacing: 1px; color: #e8cb88; }
.mission-copy { flex: 1; text-align: left; }
#room-objective h3 { font-size: clamp(19px, 2vw, 27px); line-height: 1.15; margin: 7px 0 10px; }
#room-objective p { font-size: 14px; line-height: 1.45; }
@media (max-width: 640px), (max-height: 650px) {
  #load-room .room-heading { top: 2%; }
  #load-room .room-heading h2 { font-size: 25px; margin: 6px 0; }
  #room-objective { gap: 12px; padding: 8px 12px 10px 4px; margin-top: 8px; max-width: 560px; }
  .treasure-target { width: 160px; flex-basis: 160px; }
  #room-objective h3 { font-size: 19px; margin: 4px 0 6px; }
  #room-objective p { font-size: 12px; }
  .treasure-target figcaption { font-size: 6px; }
}
@media (max-width: 420px) {
  .treasure-target { width: 120px; flex-basis: 120px; }
  #room-objective h3 { font-size: 16px; }
}

/* Briefly draw attention to the revealed clue, then let the player read it calmly. */
#room-objective.clue-ready { animation: clueReveal .5s ease-out, clueFocus 2.6s ease-in-out .5s 3; }
#room-objective #room-objective-clue { margin: 6px 0 9px; padding: 8px 10px; border-left: 3px solid var(--yellow); border-radius: 0 7px 7px 0; background: rgba(255,210,63,.12); }
.clue-label { display: block; margin-bottom: 5px; font: 8px var(--pixel); letter-spacing: 1px; color: #e4c98b; }
#room-clue-target { display: block; color: #ffe990; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
#room-objective #room-mission-how { color: #ded6e6; font-size: 13px; }
.target-brackets { position: absolute; inset: 10% 15% 17%; pointer-events: none; }
.target-brackets i { position: absolute; width: 15px; height: 15px; border: solid rgba(255,220,127,.7); border-width: 0; }
.target-brackets i:nth-child(1) { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.target-brackets i:nth-child(2) { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.target-brackets i:nth-child(3) { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.target-brackets i:nth-child(4) { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }
.clue-ready .target-brackets { animation: targetFocus 2.6s ease-in-out 3; }
@keyframes clueReveal { from { opacity: .6; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes clueFocus { 50% { box-shadow: inset 0 0 0 2px rgba(255,210,63,.7), 0 0 20px rgba(255,196,70,.16); } }
@keyframes targetFocus { 50% { transform: scale(1.04); opacity: .55; } }
@media (max-height: 650px), (max-width: 640px) {
  #room-objective #room-objective-clue { padding: 5px 8px; margin: 5px 0; }
  #room-clue-target { font-size: 15px; }
  #room-objective #room-mission-how { font-size: 11px; }
  .clue-label { font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #room-objective.clue-ready, .clue-ready .target-brackets { animation: none; }
}

/* The same gold-dollar identity carries from world pickups to the treasure payout. */
.coin-emblem, #money::before {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 27px; height: 27px; border: 0; border-radius: 0;
  clip-path: polygon(33.33% 0,66.67% 0,66.67% 8.33%,83.33% 8.33%,83.33% 16.67%,91.67% 16.67%,91.67% 33.33%,100% 33.33%,100% 66.67%,91.67% 66.67%,91.67% 83.33%,83.33% 83.33%,83.33% 91.67%,66.67% 91.67%,66.67% 100%,33.33% 100%,33.33% 91.67%,16.67% 91.67%,16.67% 83.33%,8.33% 83.33%,8.33% 66.67%,0 66.67%,0 33.33%,8.33% 33.33%,8.33% 16.67%,16.67% 16.67%,16.67% 8.33%,33.33% 8.33%);
  background: linear-gradient(135deg,#ffe991 0 23%,#ffce43 23% 42%,#ffe58a 42% 49%,#f5b829 49% 76%,#be7813 76%);
  box-shadow: inset 0 3px #fff1b3, inset -3px -3px #af6a0d;
  color: #925004; font: 17px var(--pixel); font-style: normal; letter-spacing: 0; text-shadow: 1px 1px #ffe58a;
}
#money::before { content: '$'; width: 28px; height: 28px; margin-right: 8px; vertical-align: 4px; }
.tf-reward { display: flex; justify-content: center; align-items: center; gap: 12px; }
.tf-reward .coin-emblem { width: 48px; height: 48px; font-size: 29px; }
.tf-bonus .tf-reward b { color: #ffdf75; text-shadow: 0 3px 0 #8e4e0d, 0 0 20px rgba(255,192,61,.3); }
.tf-coin-total { display: block; margin-top: 10px; font: 12px var(--pixel); color: #ffe69b; text-shadow: 0 2px 2px #2e193c; }
.hero .lbl .coin-emblem { width: 19px; height: 19px; font-size: 11px; vertical-align: -3px; margin-right: 3px; }

/* Sharing stays beside the destination and in the results' top-right corner. */
#site-row { display: flex; align-items: center; gap: 7px; max-width: min(390px, calc(100vw - 36px)); }
#site-row #site-pill { min-width: 0; }
.hunt-share { display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; pointer-events: auto; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; padding: 8px 10px; background: #29173f; color: #fff1b3; font: 10px var(--pixel); box-shadow: 0 3px 0 #10091d; position: relative; }
.hunt-share svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; flex: none; }
.hunt-share:hover, .hunt-share:focus-visible { color: #211432; background: var(--yellow); outline: 2px solid #fff1b3; outline-offset: 3px; }
.hunt-share:disabled { opacity: .4; cursor: not-allowed; }
#hud-share { padding: 6px; flex: none; }
#hud-share[data-feedback]::after { content: attr(data-feedback); position: absolute; left: calc(100% + 8px); top: 0; padding: 9px; border-radius: 6px; background: #29173f; color: #fff1b3; white-space: nowrap; }
#win-share { position: absolute; right: 18px; top: 13px; }
.win-card:has(#win-share) .win-top { padding-top: 28px; }
.share-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#floor-num { display: inline-block; transform-origin: center bottom; }
#stars > span { display: inline-block; position: relative; transform-origin: center; }
#stars .earned::after { content: ''; position: absolute; width: 4px; height: 4px; left: 50%; top: 50%; background: #fff1b3; box-shadow: -19px -15px #ffd23f, 18px -19px #fff1b3, 22px 9px #ffd23f, -19px 15px #fff1b3; pointer-events: none; animation: ratingPixels .85s ease-out both; }
@keyframes ratingPixels { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 35% { opacity: 1; } 100% { transform: scale(1.7) rotate(15deg); opacity: 0; } }
@media (max-width: 640px) { #win-share { font-size: 8px; right: 12px; top: 10px; padding: 5px 7px; } }
@media (prefers-reduced-motion: reduce) { #stars .earned::after { animation: none; display: none; } }
#hud:has(.hunt-share:hover) #crosshair { visibility: hidden; }
