/* THE UNDEADZ — MASSIVE ARENA. Void black, charcoal panels, toxic-green glow. */
@font-face { font-family: 'Lilita One'; src: url('fonts/lilita-one.woff2') format('woff2'); font-display: swap; }
:root {
  --void: #060907; --coal: #0e1310; --slab: #151b17; --slab-2: #1d251f; --line: #28332b;
  --toxic: #39ff14; --toxic-dim: #1f8f0c; --bone: #e6efe2; --mute: #8a9a8c; --blood: #ff3b6b; --amber: #ffb703;
  --display: 'Lilita One', 'Trebuchet MS', system-ui, sans-serif; --ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --glow: 0 0 18px rgba(57, 255, 20, .35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--void); color: var(--bone); font: 15px/1.45 var(--ui); overflow: hidden; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--toxic); outline-offset: 2px; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: .01em; }

.screen { position: fixed; inset: 0; overflow-y: auto; padding: 28px 20px 40px; background: radial-gradient(ellipse at 50% -10%, #11301a 0%, var(--void) 55%); }
.wrap { max-width: 1040px; margin: 0 auto; }
.brand { font-family: var(--display); font-size: clamp(38px, 9vw, 84px); line-height: .95; color: var(--bone); text-shadow: 0 0 28px rgba(57, 255, 20, .35); }
.brand b { display: block; font-weight: 400; color: var(--toxic); font-size: .56em; letter-spacing: .06em; text-shadow: var(--glow); }
.tag { color: var(--mute); max-width: 46ch; margin: 14px 0 0; }

.btn { border: 1px solid var(--line); background: var(--slab); border-radius: 10px; padding: 11px 18px; font-weight: 600; transition: border-color .15s, background .15s, transform .08s; }
.btn:hover:not(:disabled) { border-color: var(--toxic-dim); background: var(--slab-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-go { background: var(--toxic); color: #031200; border-color: var(--toxic); box-shadow: var(--glow); font-family: var(--display); font-weight: 400; font-size: 18px; padding: 13px 26px; }
.btn-go:hover:not(:disabled) { background: #6bff4d; border-color: #6bff4d; }
.btn-quiet { background: transparent; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.note { color: var(--mute); font-size: 13px; }
.err { color: var(--blood); background: rgba(255, 59, 107, .08); border: 1px solid rgba(255, 59, 107, .35); border-radius: 10px; padding: 10px 14px; margin-top: 14px; max-width: 60ch; }
.ok { color: var(--toxic); }

/* login */
#s-login .wrap { min-height: calc(100vh - 80px); display: flex; flex-direction: column; justify-content: center; }
.wallets { display: grid; gap: 10px; margin-top: 26px; max-width: 360px; }
.wallets .btn { display: flex; align-items: center; gap: 12px; text-align: left; }
.wallets img { width: 26px; height: 26px; border-radius: 6px; }
.steps { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--mute); font-size: 13px; }
.steps span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line); margin-right: 8px; }
.steps span.on::before { background: var(--toxic); box-shadow: var(--glow); } .steps span.on { color: var(--bone); }

/* character select */
.bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.bar h2 { font-size: 30px; }
.nick { display: flex; flex-direction: column; gap: 4px; } .nick input { background: var(--coal); border: 1px solid var(--line); color: var(--bone); border-radius: 10px; padding: 10px 12px; font: inherit; width: 220px; }
.nick input:focus { border-color: var(--toxic); outline: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card { position: relative; background: var(--slab); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: left; padding: 0; transition: border-color .15s, box-shadow .15s; }
.card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--coal); }
.card .cap { padding: 9px 11px 11px; display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; }
.card .cap em { font-style: normal; font-size: 12px; color: var(--mute); }
.card[aria-pressed="true"] { border-color: var(--toxic); box-shadow: var(--glow); }
.card[aria-pressed="true"] .cap em { color: var(--toxic); }
.sticky { position: sticky; bottom: -20px; margin: 22px -20px -20px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--void) 30%); display: flex; gap: 12px; justify-content: flex-end; align-items: center; }

/* lobby */
.lobby { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; }
.arenas { display: grid; gap: 12px; align-content: start; }
.arena { background: var(--slab); border: 1px solid var(--line); border-left: 4px solid var(--c, var(--toxic)); border-radius: 12px; padding: 14px 16px; }
.arena header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.arena .btn-go { background: var(--c, var(--toxic)); border-color: var(--c, var(--toxic)); box-shadow: 0 0 16px color-mix(in srgb, var(--c, var(--toxic)) 40%, transparent); font-size: 16px; padding: 9px 22px; }
.arena h3 { font-size: 22px; color: var(--c, var(--toxic)); }
.arena p { margin: 4px 0 10px; color: var(--mute); font-size: 13px; }
.live { font-size: 13px; color: var(--bone); } .live::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--toxic)); margin-right: 6px; box-shadow: 0 0 8px var(--c, var(--toxic)); }
.rooms { display: grid; gap: 6px; margin-top: 8px; }
.room { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--coal); border-radius: 8px; padding: 6px 6px 6px 12px; font-size: 13px; }
.room .btn { padding: 6px 12px; font-size: 13px; }
.panel { background: var(--slab); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; align-self: start; }
.tabs { display: flex; gap: 4px; margin: 10px 0 8px; flex-wrap: wrap; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 6px 10px; color: var(--mute); }
.tabs button[aria-selected="true"] { color: var(--toxic); border-color: var(--toxic); }
.board { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-height: 52vh; overflow-y: auto; }
.board li { display: grid; grid-template-columns: 28px 34px 1fr auto; gap: 10px; align-items: center; background: var(--coal); border-radius: 8px; padding: 5px 10px 5px 8px; font-size: 14px; }
.board img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--void); }
.board .pos { font-family: var(--display); color: var(--mute); text-align: center; } .board li:nth-child(-n+3) .pos { color: var(--amber); }
.board .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .board .who small { display: block; color: var(--mute); font-size: 11px; }
.board li .note { grid-column: 1 / -1; text-align: center; }
.board .val { font-family: var(--display); color: var(--toxic); font-size: 17px; }
select { background: var(--coal); border: 1px solid var(--line); color: var(--bone); border-radius: 8px; padding: 6px 8px; font: inherit; }

/* game */
#s-game { padding: 0; overflow: hidden; background: var(--void); touch-action: none; }
#cv, #gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; pointer-events: none; }
.hud > * { pointer-events: auto; }
.stats { top: 12px; left: 12px; display: grid; gap: 6px; }
.chip { background: rgba(6, 9, 7, .72); border: 1px solid var(--line); backdrop-filter: blur(6px); border-radius: 10px; padding: 6px 12px; display: flex; gap: 14px; align-items: baseline; }
.chip b { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--toxic); text-shadow: var(--glow); } .chip span { color: var(--mute); font-size: 12px; }
.chip i { font-style: normal; font-size: 13px; }
.lb { top: 12px; right: 12px; width: 210px; background: rgba(6, 9, 7, .72); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; backdrop-filter: blur(6px); }
.lb h4 { margin: 0 0 4px; font: 400 15px var(--display); color: var(--mute); }
.lb ol { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.lb li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; } .lb li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb li.me { color: var(--toxic); }
.mini { right: 12px; bottom: 12px; width: 150px; height: 150px; border: 1px solid var(--line); border-radius: 10px; background: rgba(6, 9, 7, .72); }
.mini canvas { width: 100%; height: 100%; display: block; border-radius: 10px; }
.exit { bottom: 12px; left: 12px; display: flex; gap: 8px; }
.exit .btn { padding: 7px 12px; font-size: 13px; background: rgba(6, 9, 7, .72); }
.keys { bottom: 18px; left: 50%; transform: translateX(-50%); color: var(--mute); font-size: 12px; background: rgba(6, 9, 7, .6); padding: 4px 12px; border-radius: 99px; white-space: nowrap; }
kbd { background: var(--slab-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; color: var(--bone); font: 12px var(--ui); }
.banner { top: 17%; left: 50%; transform: translateX(-50%); text-align: center; font-family: var(--display); font-size: 26px; text-shadow: 0 0 20px rgba(0, 0, 0, .9); pointer-events: none !important; }
.banner.gold { color: #ffd23f; font-size: 34px; text-shadow: 0 0 22px rgba(255, 190, 0, .9), 0 0 4px #000; animation: pop .35s ease-out; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.vignette { inset: 0; pointer-events: none !important; box-shadow: inset 0 0 120px 20px rgba(255, 59, 107, 0); transition: box-shadow .25s; } .vignette.on { box-shadow: inset 0 0 120px 20px rgba(255, 59, 107, .38); }
.conn { top: 56px; left: 50%; transform: translateX(-50%); background: var(--amber); color: #1a1200; border-radius: 99px; padding: 5px 16px; font-weight: 700; }
.touch { inset: auto 0 0 0; height: 0; display: none; }
.joy { position: absolute; left: 22px; bottom: 26px; width: 130px; height: 130px; border-radius: 50%; border: 2px solid rgba(57, 255, 20, .3); background: rgba(6, 9, 7, .35); }
.joy i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(57, 255, 20, .35); border: 2px solid var(--toxic); }
.tb { position: absolute; width: 74px; height: 74px; border-radius: 50%; border: 2px solid var(--toxic); background: rgba(6, 9, 7, .5); font-family: var(--display); font-size: 15px; color: var(--toxic); }
.tb.split { right: 22px; bottom: 28px; } .tb.eject { right: 106px; bottom: 80px; width: 58px; height: 58px; font-size: 13px; } .tb:active { background: rgba(57, 255, 20, .3); }
body.touch-on .touch { display: block; } body.touch-on .keys { display: none; } body.touch-on .exit { bottom: auto; top: 118px; left: 12px; } body.touch-on .mini { bottom: auto; top: 188px; width: 96px; height: 96px; } body.touch-on .lb { width: 150px; font-size: 12px; }

/* death */
.over { position: fixed; inset: 0; background: rgba(4, 6, 4, .78); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 5; padding: 20px; }
.over .box { background: var(--slab); border: 1px solid var(--line); border-top: 3px solid var(--blood); border-radius: 16px; padding: 26px 28px; max-width: 460px; width: 100%; }
.over h2 { font-size: 40px; color: var(--blood); } .over .by { color: var(--mute); margin: 4px 0 18px; }
.res { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.res div { background: var(--coal); border-radius: 10px; padding: 10px 12px; } .res b { display: block; font: 400 28px var(--display); color: var(--toxic); } .res span { font-size: 12px; color: var(--mute); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--slab-2); border: 1px solid var(--line); padding: 9px 16px; border-radius: 10px; z-index: 9; max-width: 90vw; }

@media (max-width: 800px) { .lobby { grid-template-columns: 1fr; } .lb { width: 170px; } .stats .chip b { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
