:root {
  --ink: #0b0a10;
  --ink2: #15131d;
  --paper: #f3efe6;
  --dim: #9c96a8;
  --neon: #ff3b6b;
  --gold: #ffd24a;
  --up: #4cff7a;
  --down: #ff5a5a;
  --line: rgba(243, 239, 230, 0.14);
}
#hud * { box-sizing: border-box; }
#hud .layer { position: absolute; inset: 0; pointer-events: none; }
#hud .on { pointer-events: auto; }
.px { image-rendering: pixelated; }
.btn {
  pointer-events: auto; cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  font: 16px 'Departure Mono', monospace; letter-spacing: 0.02em; color: var(--paper);
  background: var(--ink2); border: 0; padding: 12px 18px;
  box-shadow: 0 0 0 2px var(--line) inset, 4px 4px 0 rgba(0,0,0,0.45);
  transition: transform .08s, background .12s;
}
.btn:hover { background: #221f2c; transform: translate(-1px, -1px); box-shadow: 0 0 0 2px rgba(243,239,230,.3) inset, 5px 5px 0 rgba(0,0,0,0.45); }
.btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 2px var(--line) inset, 2px 2px 0 rgba(0,0,0,0.45); }
.btn.primary { background: var(--neon); color: #12060a; box-shadow: 0 0 0 2px rgba(255,255,255,.25) inset, 4px 4px 0 rgba(0,0,0,0.5), 0 0 28px rgba(255,59,107,.45); }
.btn.primary:hover { background: #ff5a83; }
.btn.gold { background: var(--gold); color: #1a1406; }
.btn small { font-size: 12px; opacity: .7; }
.key { display: inline-block; min-width: 22px; padding: 2px 6px; text-align: center; font: 13px 'Departure Mono', monospace; color: var(--ink); background: var(--paper); box-shadow: 0 2px 0 #8a8478; }

/* title */
#title { background: linear-gradient(180deg, rgba(11,10,16,.15) 0%, rgba(11,10,16,0) 35%, rgba(11,10,16,.2) 60%, rgba(11,10,16,.88) 100%); transition: opacity .6s; }
#title.hide { opacity: 0; }
#title .top { position: absolute; left: 40px; top: 32px; right: 40px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--paper); }
#title .live { display: flex; gap: 18px; align-items: center; background: rgba(11,10,16,.72); padding: 8px 14px; box-shadow: 0 0 0 2px var(--line) inset; }
#title .dot { width: 8px; height: 8px; background: var(--up); box-shadow: 0 0 10px var(--up); animation: blink 1.4s steps(2) infinite; }
#title .live b { color: var(--gold); font-weight: normal; }
@keyframes blink { 50% { opacity: .25; } }
#title .main { position: absolute; left: 40px; bottom: 44px; max-width: 760px; }
#title h1 { margin: 0; font: 400 clamp(72px, 11vw, 168px)/0.8 'Jersey 25', 'Jersey 10', monospace; color: var(--paper); letter-spacing: 0.01em; text-shadow: 0 0 40px rgba(255,59,107,.35), 6px 6px 0 rgba(0,0,0,.55); }
#title h1 em { font-style: normal; color: var(--neon); }
#title p { margin: 18px 0 26px; font-size: 16px; line-height: 1.55; color: #ddd7e6; max-width: 620px; }
#title .row { display: flex; gap: 14px; flex-wrap: wrap; }
#title p { margin-bottom: 16px; }
#title .apps { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; font-size: 13px; color: var(--paper); }
#title .apps .lab { color: var(--dim); margin-right: 2px; }
#title .apps img { width: 22px; height: 22px; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
#title .apps img.m { border-radius: 0; box-shadow: none; }
#title .apps b { font-weight: normal; margin-right: 8px; }
#title .apps i { width: 1px; height: 18px; background: var(--line); margin: 0 8px 0 2px; }
#title .live .pf { width: 16px; height: 16px; margin: 0 -8px 0 -6px; }
#title .legend { position: absolute; right: 40px; bottom: 48px; text-align: right; font-size: 13px; color: var(--dim); line-height: 2.1; }
#title .legend .key { margin-left: 6px; }
#title .foot { position: absolute; right: 40px; bottom: 16px; font-size: 11px; color: #6c6678; }

/* crosshair + prompt */
#cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; background: rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(0,0,0,.6); transition: all .1s; }
#cross.hot { width: 18px; height: 18px; margin: -9px 0 0 -9px; background: transparent; box-shadow: 0 0 0 2px rgba(255,255,255,.95), 0 0 0 3px rgba(0,0,0,.5); }
#cross.off { opacity: 0; }
#prompt { position: absolute; left: 50%; top: calc(50% + 38px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
#prompt .p { display: flex; gap: 10px; align-items: center; font-size: 14px; background: rgba(11,10,16,.78); padding: 6px 12px 6px 6px; box-shadow: 0 0 0 2px var(--line) inset; white-space: nowrap; }
#prompt .p.alt { opacity: .75; font-size: 12px; }

/* round chip */
#chip { position: absolute; right: 18px; top: 18px; min-width: 250px; background: rgba(11,10,16,.8); box-shadow: 0 0 0 2px var(--line) inset, 4px 4px 0 rgba(0,0,0,.4); padding: 10px 14px 11px; font-size: 13px; line-height: 1.6; }
#chip .r { display: flex; justify-content: space-between; gap: 18px; }
#chip .t { font: 22px/1 'Jersey 25', monospace; color: var(--paper); letter-spacing: .02em; }
#chip .pot { color: var(--gold); }
#chip .up { color: var(--up); } #chip .down { color: var(--down); }
#chip .mute { color: var(--dim); }
#chip .bar { height: 3px; background: rgba(255,255,255,.08); margin: 7px 0 6px; }
#chip .bar i { display: block; height: 100%; background: var(--neon); }
#chip.hide { opacity: 0; }

/* toasts */
#toasts { position: absolute; left: 18px; bottom: 18px; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { background: rgba(11,10,16,.88); box-shadow: 0 0 0 2px var(--line) inset, 4px 4px 0 rgba(0,0,0,.4); padding: 10px 14px; font-size: 13px; max-width: 420px; animation: tin .25s steps(4); }
.toast b { font-weight: normal; color: var(--gold); }
.toast.buy { box-shadow: 0 0 0 2px rgba(76,255,122,.4) inset, 4px 4px 0 rgba(0,0,0,.4); }
.toast.sell { box-shadow: 0 0 0 2px rgba(255,90,90,.4) inset, 4px 4px 0 rgba(0,0,0,.4); }
.toast.win { box-shadow: 0 0 0 2px rgba(255,210,74,.6) inset, 4px 4px 0 rgba(0,0,0,.4), 0 0 30px rgba(255,210,74,.3); }
.toast.out { animation: tout .3s steps(4) forwards; }
@keyframes tin { from { transform: translateX(-30px); opacity: 0; } }
@keyframes tout { to { transform: translateX(-30px); opacity: 0; } }

/* modal panels */
.scrim { position: absolute; inset: 0; background: rgba(6,5,10,.72); display: flex; align-items: center; justify-content: center; pointer-events: auto; animation: fin .2s; }
@keyframes fin { from { opacity: 0; } }
.panel { background: var(--ink); box-shadow: 0 0 0 2px var(--line) inset, 8px 8px 0 rgba(0,0,0,.5); padding: 28px 30px; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.panel h2 { margin: 0 0 6px; font: 400 44px/0.9 'Jersey 25', monospace; color: var(--paper); }
.panel h3 { margin: 22px 0 8px; font: 400 13px 'Departure Mono', monospace; color: var(--dim); letter-spacing: .08em; text-transform: uppercase; }
.panel p, .panel li { font-size: 14px; line-height: 1.6; color: #d9d3e2; }
.panel ol { padding-left: 20px; margin: 8px 0; }
.panel .stack { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.panel .stack .btn { justify-content: space-between; }
.panel .set { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 14px; margin: 12px 0; }
.panel input[type=range] { width: 200px; accent-color: var(--neon); }
.panel .seg { display: flex; gap: 6px; }
.panel .seg button { font: 13px 'Departure Mono', monospace; background: var(--ink2); color: var(--paper); border: 0; padding: 6px 10px; cursor: pointer; box-shadow: 0 0 0 2px var(--line) inset; }
.panel .seg button.sel { background: var(--paper); color: var(--ink); }
.panel .walletbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink2); padding: 12px 14px; box-shadow: 0 0 0 2px var(--line) inset; font-size: 14px; }
.panel .walletbox .ok { color: var(--up); }
.panel .note { font-size: 12px; color: var(--dim); margin-top: 10px; }
.wlist { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.wlist button { display: flex; align-items: center; gap: 12px; font: 15px 'Departure Mono', monospace; color: var(--paper); background: var(--ink2); border: 0; padding: 10px 12px; cursor: pointer; box-shadow: 0 0 0 2px var(--line) inset; }
.wlist button:hover { background: #221f2c; }
.wlist img { width: 28px; height: 28px; image-rendering: auto; }

/* room picker */
#picker .wrap { width: min(1180px, calc(100vw - 40px)); }
#picker .head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
#picker h2 { margin: 0; font: 400 64px/0.85 'Jersey 25', monospace; color: var(--paper); }
#picker .head p { margin: 0; font-size: 13px; color: var(--dim); text-align: right; line-height: 1.7; }
#picker .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
#picker .card { cursor: pointer; background: var(--ink); box-shadow: 0 0 0 2px var(--line) inset, 6px 6px 0 rgba(0,0,0,.5); padding: 8px 8px 14px; transition: transform .1s; position: relative; }
#picker .card:hover, #picker .card.sel { transform: translate(-3px, -3px); box-shadow: 0 0 0 2px var(--accent, var(--neon)) inset, 9px 9px 0 rgba(0,0,0,.5), 0 0 30px color-mix(in srgb, var(--accent, var(--neon)) 35%, transparent); }
#picker .thumb { width: 100%; aspect-ratio: 16 / 9; background: #000; display: block; image-rendering: pixelated; }
#picker .card .n { position: absolute; left: 16px; top: 16px; }
#picker .card h4 { margin: 12px 6px 4px; font: 400 32px/1 'Jersey 25', monospace; color: var(--paper); }
#picker .card span { display: block; margin: 0 6px; font-size: 12px; color: var(--dim); line-height: 1.5; }
@media (max-width: 860px) { #picker .grid { grid-template-columns: repeat(2, 1fr); } #picker h2 { font-size: 44px; } }

#pchint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 12px; color: var(--dim); background: rgba(11,10,16,.7); padding: 4px 10px; }
#pchint.hide { display: none; }
#loading { position: absolute; inset: 0; background: var(--ink); display: flex; align-items: center; justify-content: center; font: 400 40px 'Jersey 25', monospace; color: var(--paper); transition: opacity .5s; }
#loading.hide { opacity: 0; pointer-events: none; }
#loading i { display: inline-block; width: 14px; height: 14px; background: var(--neon); margin-left: 12px; animation: blink .8s steps(2) infinite; }
#touch { position: absolute; inset: 0; pointer-events: none; }
#touch .act { position: absolute; right: 22px; bottom: 26px; width: 74px; height: 74px; border-radius: 0; pointer-events: auto; font: 20px 'Jersey 25'; }
#touch .menu { position: absolute; right: 22px; top: 22px; pointer-events: auto; }
#touch .stick { position: absolute; left: 28px; bottom: 28px; width: 110px; height: 110px; box-shadow: 0 0 0 2px var(--line) inset; background: rgba(11,10,16,.3); }
