:root { --bg: #16120f; --ink: #f6efe6; --mut: #b9ab9a; --hot: #ff4b2b; --gold: #ffc23d; --blue: #3ec7ff; --panel: rgba(22, 18, 15, .82); --line: rgba(255, 255, 255, .12); --disp: 'Anton', Impact, 'Arial Narrow', sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 15px/1.4 Inter, system-ui, sans-serif; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
body.menu canvas#game { filter: saturate(.85) brightness(.75); }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; padding: max(18px, env(safe-area-inset-top)) 18px 18px; overflow-y: auto; background: radial-gradient(ellipse at 50% 30%, rgba(22, 18, 15, .25), rgba(22, 18, 15, .85) 75%); z-index: 10; }
.screen.on { display: flex; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#s-title { justify-content: center; cursor: pointer; }
h2 { font-family: var(--disp); font-weight: 400; letter-spacing: .04em; font-size: clamp(26px, 4vw, 40px); margin: 6px 0 2px; text-transform: uppercase; text-shadow: 0 3px 0 #000; }
h4 { margin: 14px 0 6px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.logo { font-family: var(--disp); line-height: .85; text-align: center; transform: rotate(-4deg); filter: drop-shadow(0 8px 0 #000); }
.logo span { display: block; font-size: clamp(90px, 18vw, 210px); color: var(--ink); -webkit-text-stroke: 4px #000; letter-spacing: .02em; }
.logo b { display: inline-block; font-weight: 400; font-size: clamp(34px, 6vw, 70px); background: var(--hot); color: #fff; padding: 2px 18px; transform: rotate(3deg) translateY(-8px); border: 4px solid #000; }
.logo.small span { font-size: clamp(52px, 9vw, 96px); } .logo.small b { font-size: clamp(20px, 3vw, 32px); }
.tag { color: var(--mut); margin: 0; font-size: 18px; }
.blink { font-family: var(--disp); font-size: 26px; letter-spacing: .1em; animation: blink 1.1s steps(2) infinite; margin: 24px 0 0; }
@keyframes blink { 50% { opacity: .15; } }
.ver { position: fixed; bottom: 10px; right: 14px; color: var(--mut); font-size: 12px; }

.menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; width: min(980px, 100%); }
.menu.row { display: flex; flex-wrap: wrap; justify-content: center; }
.btn { background: linear-gradient(180deg, #2a221c, #1d1814); border: 2px solid var(--line); border-radius: 10px; padding: 12px 16px; text-align: left; display: flex; flex-direction: column; gap: 2px; transition: transform .08s, border-color .1s, background .1s; box-shadow: 0 4px 0 #000; }
.btn b { font-family: var(--disp); font-weight: 400; font-size: 22px; letter-spacing: .03em; text-transform: uppercase; }
.btn small { color: var(--mut); font-size: 12.5px; }
.btn.sm { padding: 9px 16px; align-items: center; text-align: center; font-weight: 700; flex-direction: row; }
.btn.xs { padding: 3px 8px; font-size: 12px; box-shadow: none; display: inline-flex; margin-left: 8px; }
.btn.hot { background: linear-gradient(180deg, #ff5a36, #d8341a); border-color: #ff8a6b; }
.nav:focus { outline: none; }
.btn:hover, .btn:focus-visible, .btn:focus { border-color: var(--gold); transform: translateY(-2px); background: linear-gradient(180deg, #3a2e24, #241d17); }
.btn.hot:focus, .btn.hot:hover { background: linear-gradient(180deg, #ff7150, #e0401f); }
.link { background: none; border: 0; color: var(--mut); text-decoration: underline; padding: 2px; }
.link:focus { color: var(--gold); }
footer { color: var(--mut); font-size: 13px; margin-top: auto; padding-top: 10px; }
.badges { display: flex; gap: 10px; color: var(--gold); font-weight: 800; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; width: min(860px, 100%); backdrop-filter: blur(6px); }
.panel.scroll { max-height: calc(100vh - 190px); overflow-y: auto; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.field:last-child { border: 0; }
.field label { color: var(--mut); font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: rgba(0, 0, 0, .35); padding: 3px; border-radius: 9px; }
.seg button { background: transparent; border: 1.5px solid transparent; border-radius: 7px; padding: 6px 11px; font-weight: 600; color: var(--mut); }
.seg button.sel { background: var(--hot); color: #fff; }
.seg button:focus { border-color: var(--gold); color: var(--ink); }
input[type=text], #room-code, #art-name, .propose input { background: rgba(0, 0, 0, .4); border: 1.5px solid var(--line); color: var(--ink); border-radius: 8px; padding: 8px 10px; min-width: 120px; }
input:focus { border-color: var(--gold); outline: none; }
#room-code { width: 110px; text-transform: uppercase; letter-spacing: .2em; font-weight: 800; text-align: center; }
input[type=range] { width: min(260px, 50vw); accent-color: var(--hot); }
input[type=range]:focus { outline: 2px solid var(--gold); border-radius: 4px; }
.hint { color: var(--mut); font-size: 13px; }
.status { color: var(--gold); font-weight: 700; min-height: 1.4em; margin: 0; }

/* ---------- character select ---------- */
.select-wrap { display: flex; gap: 16px; width: min(1180px, 100%); align-items: flex-start; flex: 1; min-height: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; flex: 1.6; max-height: calc(100vh - 230px); overflow-y: auto; padding: 4px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.card { position: relative; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 30%, #1d1814), #120e0b); border: 2px solid var(--line); border-radius: 10px; padding: 6px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform .08s, border-color .1s; box-shadow: 0 3px 0 #000; }
.card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: radial-gradient(circle, rgba(255, 255, 255, .08), transparent 70%); border-radius: 8px; }
.card span { font-family: var(--disp); font-size: 15px; letter-spacing: .03em; text-transform: uppercase; }
.card:focus, .card:hover, .card.sel { border-color: var(--gold); transform: translateY(-3px) scale(1.03); z-index: 1; }
.card.locked img { filter: grayscale(1) brightness(.4); }
.card em { position: absolute; top: 34%; font-style: normal; font-weight: 800; font-size: 12px; background: rgba(0, 0, 0, .7); padding: 2px 6px; border-radius: 6px; }
.preview { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 260px; max-height: calc(100vh - 230px); overflow-y: auto; }
.preview img { width: 120px; height: 120px; object-fit: contain; float: right; }
.preview h3 { font-family: var(--disp); font-weight: 400; font-size: 34px; margin: 0; text-transform: uppercase; }
.preview .ttl { color: var(--mut); margin: 0 0 8px; }
.stat { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; color: var(--mut); margin: 3px 0; }
.stat span { width: 32px; } .stat i { flex: 1; max-width: 160px; height: 7px; background: rgba(255, 255, 255, .1); border-radius: 4px; overflow: hidden; position: relative; }
.stat i::after { content: ''; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: linear-gradient(90deg, var(--hot), var(--gold)); }
.mv { list-style: none; padding: 0; margin: 10px 0 0; clear: both; font-size: 13.5px; }
.mv li { padding: 4px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }
.mv li.su b { color: var(--gold); } .mv li.ab { color: var(--mut); font-size: 12.5px; }
kbd { background: #000; border: 1px solid #444; border-bottom-width: 3px; border-radius: 5px; padding: 1px 6px; font: 700 12px Inter, sans-serif; white-space: nowrap; }
.lock { color: var(--hot); font-weight: 700; }
.picks { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.pk { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line); }
.pk.cur { border-color: var(--gold); }
.pk img, .pk i { width: 44px; height: 44px; border-radius: 8px; background: rgba(255, 255, 255, .06); object-fit: contain; display: inline-block; }

/* ---------- bracket ---------- */
.bracket { display: flex; gap: 10px; width: min(1200px, 100%); overflow-x: auto; padding-bottom: 6px; }
.bracket .col { display: flex; flex-direction: column; justify-content: space-around; gap: 4px; min-width: 150px; flex: 1; }
.bracket .slot { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 2px 6px; font-size: 12.5px; font-weight: 600; }
.bracket .slot.a { margin-top: 4px; } .bracket .slot img { width: 24px; height: 24px; object-fit: contain; }
.bracket .slot.me { border-color: var(--gold); background: rgba(255, 194, 61, .15); }
.bracket .slot.boss { border-color: #7a1f1f; } .bracket .slot.beaten { opacity: .4; text-decoration: line-through; }
.bracket h4 { margin: 0 0 4px; font-size: 11px; }

/* ---------- options/controls/moves ---------- */
table { border-collapse: collapse; width: 100%; }
td, th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--gold); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.key { min-width: 86px; background: #000; border: 1.5px solid #444; border-bottom-width: 4px; border-radius: 7px; padding: 5px 8px; font-weight: 800; }
.key:focus, .key:hover { border-color: var(--gold); } .key.cap { border-color: var(--hot); animation: blink .6s steps(2) infinite; }
.moves td:last-child { text-align: right; }
.moves .su b { color: var(--gold); }
.mini-roster { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.mini-roster button { background: rgba(0, 0, 0, .3); border: 2px solid transparent; border-radius: 8px; padding: 2px; }
.mini-roster button.sel, .mini-roster button:focus { border-color: var(--gold); }
.mini-roster img { width: 42px; height: 42px; object-fit: contain; display: block; }

/* ---------- art ---------- */
.art-wrap { display: flex; gap: 14px; width: min(1180px, 100%); align-items: flex-start; }
.art-wrap .grid { max-height: calc(100vh - 170px); }
.art-panel { display: flex; gap: 14px; flex-wrap: wrap; width: auto; flex: 1.3; }
#art-preview { width: 260px; height: 292px; background: radial-gradient(circle at 50% 40%, #3a2e24, #120e0b); border-radius: 12px; border: 1px solid var(--line); }
.art-controls { flex: 1; min-width: 240px; }
.btn.file { position: relative; overflow: hidden; } .btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
input[type=color] { width: 44px; height: 32px; border: 0; background: none; padding: 0; }

/* ---------- results ---------- */
#res-title { font-size: clamp(44px, 8vw, 86px); margin-top: 4vh; }
#res-title.win { color: var(--gold); } #res-title.lose { color: var(--hot); }
#res-portrait { text-align: center; } #res-portrait img { width: 140px; height: 140px; object-fit: contain; } #res-portrait h3 { font-family: var(--disp); font-weight: 400; font-size: 28px; margin: 0; text-transform: uppercase; }
#res-stats td:not(:first-child), #res-stats th:not(:first-child) { text-align: center; }
.fame { color: var(--gold); font-weight: 800; font-size: 18px; text-align: center; } .fame.big { font-size: 24px; }
.missions-done p, .unlock { color: #7dff9b; font-weight: 700; margin: 4px 0; text-align: center; }

/* ---------- progress / assembly / lobby ---------- */
.mission { display: grid; grid-template-columns: 1fr 120px auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mission i, .pollopt i { height: 8px; background: rgba(255, 255, 255, .1); border-radius: 4px; position: relative; overflow: hidden; }
.mission i::after, .pollopt i::after { content: ''; position: absolute; inset: 0; width: calc(var(--v) * 100%); background: var(--gold); }
.mission.done span { text-decoration: line-through; color: var(--mut); }
.unls { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
.unl { text-align: center; background: rgba(0, 0, 0, .3); border-radius: 8px; padding: 6px; font-size: 12px; opacity: .65; } .unl.ok { opacity: 1; }
.unl img { width: 52px; height: 52px; object-fit: contain; display: block; margin: 0 auto; } .unl span { display: block; font-weight: 700; }
.lb { padding-left: 24px; } .lb li { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--line); } .lb li.me { color: var(--gold); }
.pollopt { display: grid; grid-template-columns: 1fr 160px 40px; gap: 10px; align-items: center; width: 100%; background: rgba(0, 0, 0, .3); border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 4px 0; text-align: left; }
.pollopt.sel, .pollopt:focus { border-color: var(--gold); }
.prop { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.vote { background: #000; border: 1.5px solid #444; border-radius: 8px; padding: 4px 8px; font-weight: 800; min-width: 56px; } .vote.sel, .vote:focus { border-color: var(--gold); color: var(--gold); }
.propose { display: flex; gap: 8px; margin: 6px 0; } .propose input { flex: 1; }
.lobby { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: min(980px, 100%); } .lobby.off { opacity: .35; pointer-events: none; }
#lobby-players { list-style: none; padding: 0; margin: 0; max-height: 240px; overflow-y: auto; } #lobby-players li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #7dff9b; margin-right: 6px; } .dot.playing { background: var(--hot); } .dot:not(.idle):not(.playing) { background: var(--gold); }
#lobby-chat { height: 240px; overflow-y: auto; background: rgba(0, 0, 0, .35); border-radius: 8px; padding: 8px; font-size: 13.5px; } #lobby-chat p { margin: 2px 0; user-select: text; }
#room-info { margin: 8px 0; color: var(--gold); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; font-family: var(--disp); }
#hud-bars { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 110px; }
.side { flex: 1; display: flex; gap: 8px; align-items: flex-start; max-width: 520px; transition: opacity .3s; }
.side.r { flex-direction: row-reverse; text-align: right; }
.side .por { width: 54px; height: 54px; object-fit: contain; background: rgba(0, 0, 0, .55); border: 2px solid #000; border-radius: 10px; }
.side .info { flex: 1; }
.side .nm { font-size: 20px; letter-spacing: .04em; text-transform: uppercase; text-shadow: 0 2px 0 #000; }
.side .nm small { font-family: Inter, sans-serif; font-size: 11px; color: var(--gold); font-weight: 800; }
.hp { position: relative; height: 20px; background: #200; border: 3px solid #000; border-radius: 6px; overflow: hidden; box-shadow: 0 3px 0 rgba(0, 0, 0, .5); }
.hp i { position: absolute; inset: 0; transform-origin: left; }
.side.r .hp i { transform-origin: right; }
.hp .g { background: #ff3b3b; } .hp .h { background: linear-gradient(180deg, #ffe066, #ffb703); }
.hp .h.low { background: linear-gradient(180deg, #ff8f6b, #ff4b2b); animation: blink .5s steps(2) infinite; }
.pips { display: flex; gap: 4px; margin-top: 4px; } .side.r .pips { justify-content: flex-end; }
.pip { width: 30px; height: 30px; border-radius: 6px; background: rgba(0, 0, 0, .5); border: 2px solid #000; position: relative; overflow: hidden; }
.pip img { width: 100%; height: 100%; object-fit: contain; } .pip i { position: absolute; left: 0; bottom: 0; height: 3px; background: #ffb703; }
.pip.cur { border-color: var(--gold); } .pip.dead img { filter: grayscale(1) brightness(.35); }
.wins { display: flex; gap: 5px; margin-top: 5px; } .side.r .wins { justify-content: flex-end; }
.wins b { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #000; background: rgba(0, 0, 0, .5); } .wins b.on { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.side.out { opacity: .45; }
#hud-timer { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); font-size: 48px; min-width: 86px; text-align: center; background: rgba(0, 0, 0, .55); border: 3px solid #000; border-radius: 12px; padding: 0 8px; text-shadow: 0 3px 0 #000; }
#hud-timer.warn { color: var(--hot); }
#hud-meters { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 40px; }
.meter { display: flex; flex-direction: column; gap: 4px; width: min(300px, 32vw); } .meter.r { align-items: flex-end; }
.meter .sp { display: flex; gap: 4px; align-items: center; } .meter.r .sp { flex-direction: row-reverse; }
.meter .sp span { width: 44px; height: 12px; background: rgba(0, 0, 0, .6); border: 2px solid #000; border-radius: 4px; position: relative; overflow: hidden; }
.meter .sp span::after { content: ''; position: absolute; inset: 0; width: calc(var(--v, 0) * 100%); background: var(--blue); }
.meter .sp span.full::after { background: linear-gradient(90deg, #3ec7ff, #c8f3ff); box-shadow: 0 0 10px var(--blue); }
.meter label { font-size: 13px; letter-spacing: .1em; text-shadow: 0 2px 0 #000; margin: 0 4px; }
.meter .su { position: relative; height: 16px; width: 100%; background: rgba(0, 0, 0, .6); border: 2px solid #000; border-radius: 5px; overflow: hidden; }
.meter .su i { position: absolute; inset: 0; background: linear-gradient(90deg, #a0f, #ff3cac); transform-origin: left; } .meter.r .su i { transform-origin: right; }
.meter .su label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.meter .su.full { box-shadow: 0 0 14px #ff3cac; animation: pulse .6s infinite alternate; }
@keyframes pulse { to { filter: brightness(1.4); } }
.flash { animation: mflash .35s; } .fail { animation: mfail .35s; }
@keyframes mflash { 50% { transform: scale(1.12); filter: brightness(2); } } @keyframes mfail { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
#hud.rumble #hud-bars { gap: 10px; } #hud.rumble .side { flex-direction: row !important; text-align: left !important; max-width: 25%; }
#hud.rumble .side .por { width: 38px; height: 38px; } #hud.rumble .side .nm { font-size: 15px; } #hud.rumble .hp { height: 14px; }
#hud.rumble #hud-timer { top: auto; bottom: 64px; font-size: 32px; }
#hud.rumble .side.r .hp i { transform-origin: left; }
#hud.rumble #hud-meters .meter:not(.r0) { display: none; }
.combo { position: absolute; top: 120px; left: 22px; font-size: 26px; color: var(--gold); text-shadow: 0 3px 0 #000, 0 0 12px rgba(255, 75, 43, .7); opacity: 0; }
.combo b { font-size: 50px; color: #fff; } .combo.right { left: auto; right: 22px; }
.combo.pop { animation: combo 1.2s ease-out; } @keyframes combo { 0% { opacity: 1; transform: scale(1.5); } 15% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; } }
#hud-btns { position: absolute; top: max(74px, calc(env(safe-area-inset-top) + 64px)); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: auto; }
#hud-btns button { background: rgba(0, 0, 0, .55); border: 2px solid #000; border-radius: 8px; width: 38px; height: 30px; font-size: 14px; } #hud-btns button.off { opacity: .4; }
#fps { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font: 700 11px Inter, sans-serif; color: #7dff9b; }
#announce { position: fixed; top: 34%; left: 0; right: 0; text-align: center; font-family: var(--disp); font-size: clamp(48px, 10vw, 120px); letter-spacing: .04em; color: #fff; -webkit-text-stroke: 3px #000; text-shadow: 0 6px 0 #000; pointer-events: none; z-index: 6; opacity: 0; }
#announce.show { animation: ann 1.1s ease-out forwards; }
#announce.big { color: var(--gold); } #announce.ko { color: var(--hot); font-size: clamp(80px, 16vw, 200px); } #announce.sm { font-size: clamp(36px, 7vw, 80px); }
#announce.super { top: 22%; font-size: clamp(30px, 6vw, 64px); color: #ff3cac; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .7), transparent); padding: 10px 0; }
#announce.super.fromL { animation-name: annL; } #announce.super.fromR { animation-name: annR; }
@keyframes ann { 0% { opacity: 0; transform: scale(2.2); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(.95); } }
@keyframes annL { 0% { opacity: 0; transform: translateX(-40%); } 18% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes annR { 0% { opacity: 0; transform: translateX(40%); } 18% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }
.float { position: fixed; transform: translate(-50%, -50%); font-family: var(--disp); pointer-events: none; z-index: 6; animation: flt .9s ease-out forwards; text-shadow: 0 2px 0 #000; }
.float.txt { color: var(--blue); font-size: 24px; } .float.dmg { color: #fff; font-size: 22px; }
@keyframes flt { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -60px; } }
#toast { position: fixed; bottom: 22%; left: 50%; transform: translate(-50%, 20px); background: rgba(0, 0, 0, .85); border: 1px solid var(--gold); padding: 10px 16px; border-radius: 10px; font-weight: 700; opacity: 0; transition: .25s; z-index: 30; pointer-events: none; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(10, 8, 6, .78); z-index: 20; }
#pause .panel { width: min(560px, 94vw); max-height: 92vh; overflow-y: auto; } #pause .menu { grid-template-columns: 1fr 1fr; }
#pause-moves { margin-top: 10px; } #pause-moves table { font-size: 13px; }
#loading { background: var(--bg); z-index: 50; }
#rotate { display: none; z-index: 60; text-align: center; font-family: var(--disp); font-size: 28px; }
#rotate .phone { font-size: 64px; animation: rot 1.6s infinite; }
@keyframes rot { 50% { transform: rotate(90deg); } }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }

/* ---------- touch controls ---------- */
#touch { position: fixed; inset: 0; z-index: 7; pointer-events: none; }
#touch button { pointer-events: auto; position: absolute; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .35); border-radius: 50%; font: 800 12px Inter, sans-serif; color: #fff; text-transform: uppercase; touch-action: none; backdrop-filter: blur(2px); }
#touch button.on { background: rgba(255, 194, 61, .5); border-color: var(--gold); }
#touch .pad { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: 30px; width: 210px; height: 200px; }
#touch .pad button { width: 72px; height: 72px; font-size: 24px; border-radius: 16px; }
#touch .pad [data-k=up] { left: 69px; top: 0; } #touch .pad [data-k=left] { left: 0; top: 64px; } #touch .pad [data-k=right] { left: 138px; top: 64px; } #touch .pad [data-k=down] { left: 69px; top: 128px; }
#touch .tbtns { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: 56px; width: 250px; height: 200px; }
#touch .tbtns button { width: 66px; height: 66px; }
.t-punch { right: 84px; bottom: 0; } .t-kick { right: 6px; bottom: 30px; } .t-jump { right: 160px; bottom: 20px; }
.t-block { right: 172px; bottom: 100px; } .t-spec { right: 94px; bottom: 80px; background: rgba(62, 199, 255, .2) !important; } .t-super { right: 16px; bottom: 112px; background: rgba(255, 60, 172, .25) !important; }
.t-tag { right: 100px; bottom: 156px; width: 52px !important; height: 52px !important; }

@media (max-width: 820px), (max-height: 520px) {
  .select-wrap, .art-wrap { flex-direction: column; } .preview { width: 100%; max-height: 32vh; } .grid { max-height: 40vh; width: 100%; }
  .lobby { grid-template-columns: 1fr; }
  .menu { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); } .btn b { font-size: 18px; } .btn small { display: none; }
  #hud-bars { gap: 76px; } .side .por { width: 40px; height: 40px; } .side .nm { font-size: 15px; } .hp { height: 15px; } #hud-timer { font-size: 32px; min-width: 60px; }
  .meter .sp span { width: 30px; } #hud-meters { bottom: 6px; }
  .screen { gap: 8px; padding-top: 10px; } h2 { font-size: 24px; }
}
@media (max-height: 520px) { .logo span { font-size: 80px; } .blink { margin-top: 8px; } }
body.touch #hud-meters { bottom: auto; top: 96px; } body.touch .combo { top: 150px; }
/* v1.1 review fixes */
.card span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(11px, 1.1vw, 15px); }
.grid.small .card span { font-size: 11px; }
@media (max-height: 520px) {
  .select-wrap { flex-direction: row; } .grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); max-height: calc(100vh - 150px); flex: 1.4; }
  .preview { max-height: calc(100vh - 150px); width: auto; padding: 8px; } .preview img { width: 60px; height: 60px; } .preview h3 { font-size: 22px; }
  .card { padding: 3px; } .card span { font-size: 10px; }
  .panel.scroll { max-height: calc(100vh - 120px); }
  .art-wrap { flex-direction: row; } #art-preview { width: 150px; height: 170px; }
}
.side.assist-ready .pip:not(.cur):not(.dead) { box-shadow: 0 0 0 2px #ffc23d, 0 0 12px #ffc23d; }

/* ---------- VS loading screen ---------- */
#vs { position: fixed; inset: 0; z-index: 40; display: flex; overflow: hidden; background: #0d0a08; font-family: var(--disp); }
#vs .vs-side { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 3vw 6vh; }
#vs .vs-side.l { background: linear-gradient(115deg, #ff4b2b 0%, #b5172c 60%, #3a0a12 100%); clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%); animation: vsL .5s cubic-bezier(.2, 1.4, .4, 1); }
#vs .vs-side.r { background: linear-gradient(245deg, #2b8cff 0%, #1640b5 60%, #0a1240 100%); clip-path: polygon(12% 0, 100% 0, 100% 100%, 0 100%); align-items: flex-end; animation: vsR .5s cubic-bezier(.2, 1.4, .4, 1); }
#vs .vs-side::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.06) 0 18px, transparent 18px 44px); }
#vs .vs-figs { position: absolute; inset: 4vh 2vw 14vh; display: flex; align-items: flex-end; justify-content: center; }
#vs .vs-figs img { height: 100%; max-width: 46%; object-fit: contain; filter: drop-shadow(8px 10px 0 rgba(0,0,0,.45)); margin: 0 -7%; animation: pop .5s backwards; }
#vs .vs-figs img:nth-child(1) { z-index: 3; height: 100%; } #vs .vs-figs img:nth-child(2) { z-index: 2; height: 84%; animation-delay: .12s; } #vs .vs-figs img:nth-child(3) { z-index: 1; height: 74%; animation-delay: .24s; }
#vs .vs-side.l .vs-figs { flex-direction: row-reverse; } #vs .vs-side.r .vs-figs img { transform: scaleX(-1); }
#vs .vs-names { position: relative; display: flex; gap: 2vw; font-size: clamp(20px, 3vw, 44px); color: #fff; text-shadow: 3px 3px 0 #000; -webkit-text-stroke: 1.5px #000; text-transform: uppercase; }
#vs .vs-names span:first-child { color: #ffd23f; font-size: 1.25em; }
#vs .vs-mid { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 5; }
#vs .vs-mid b { display: block; font-weight: 400; font-size: clamp(90px, 16vw, 220px); color: #fff; -webkit-text-stroke: 6px #000; text-shadow: 0 0 40px #ffd23f, 8px 8px 0 #000; animation: vsPop .6s .25s backwards cubic-bezier(.2, 1.8, .4, 1); font-style: italic; }
#vs .vs-mid small { display: block; font-size: clamp(16px, 2vw, 26px); color: #ffd23f; text-shadow: 2px 2px 0 #000; letter-spacing: .1em; }
@keyframes vsL { from { transform: translateX(-100%); } } @keyframes vsR { from { transform: translateX(100%); } }
@keyframes vsPop { from { transform: scale(4) rotate(-20deg); opacity: 0; } } @keyframes pop { from { transform: translateY(40px) scale(.8); opacity: 0; } }

/* ---------- Marf Brawl art pack v2 ---------- */
#s-title { background: linear-gradient(180deg, rgba(16,12,10,.15), rgba(16,12,10,.75)), url(../art/ui/title.jpg) center / cover; justify-content: flex-end; padding-bottom: 8vh; }
#s-title .brand { width: min(720px, 80vw); filter: drop-shadow(0 10px 20px rgba(0,0,0,.6)); margin-bottom: 1vh; }
#vs { background: url(../art/ui/versus.jpg) center / cover; }
#vs .vs-side.l { background: linear-gradient(115deg, rgba(255,75,43,.82), rgba(181,23,44,.7) 60%, rgba(58,10,18,.55)); }
#vs .vs-side.r { background: linear-gradient(245deg, rgba(43,140,255,.82), rgba(22,64,181,.7) 60%, rgba(10,18,64,.55)); }
#s-results { background: linear-gradient(180deg, rgba(16,12,10,.25), rgba(16,12,10,.82)), url(../art/ui/results.jpg) center / cover; }
#res-portrait img.full { width: auto; height: min(42vh, 380px); object-fit: contain; filter: drop-shadow(6px 8px 0 rgba(0,0,0,.4)); }
.preview img.full { width: auto; height: 210px; float: right; margin: -6px -4px 0 6px; object-fit: contain; filter: drop-shadow(4px 6px 0 rgba(0,0,0,.4)); }
@media (max-height: 520px) { .preview img.full { height: 110px; } #res-portrait img.full { height: 30vh; } }
#vs .vs-names { flex-direction: column; gap: 0; font-size: clamp(16px, 2.2vw, 30px); line-height: 1.05; } #vs .vs-side.r .vs-names { align-items: flex-end; }

/* ---------- comic bubbles, POW, chips, segmented super, controls strip ---------- */
.bubble { position: fixed; left: 0; top: 0; z-index: 6; pointer-events: none; will-change: transform; }
.bubble span { position: absolute; bottom: 14px; left: -20px; display: block; max-width: 230px; width: max-content; background: #fff; color: #111; font: 400 clamp(14px, 1.6vw, 21px)/1.05 var(--disp); text-transform: uppercase; letter-spacing: .02em; padding: 9px 13px; border: 3px solid #111; border-radius: 18px; box-shadow: 4px 4px 0 rgba(0,0,0,.35); animation: bub .25s cubic-bezier(.2,1.6,.4,1); transform-origin: 20px 100%; }
.bubble span::after { content: ''; position: absolute; left: 18px; bottom: -14px; border: 9px solid transparent; border-top: 12px solid #111; }
.bubble span::before { content: ''; position: absolute; left: 21px; bottom: -8px; border: 6px solid transparent; border-top: 9px solid #fff; z-index: 1; }
.bubble.r span { left: auto; right: -20px; transform-origin: calc(100% - 20px) 100%; } .bubble.r span::after { left: auto; right: 18px; } .bubble.r span::before { left: auto; right: 21px; }
@keyframes bub { from { transform: scale(0); } }
.pow { position: fixed; transform: translate(-50%, -50%) rotate(var(--rot)); z-index: 6; pointer-events: none; font: 400 clamp(26px, 3.4vw, 46px) var(--disp); color: #ffd23f; -webkit-text-stroke: 2.5px #111; text-shadow: 3px 3px 0 #e63946; animation: pow .7s ease-out forwards; }
@keyframes pow { 0% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(.2); } 20% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.25); } 100% { transform: translate(-50%, -80%) rotate(var(--rot)) scale(1); opacity: 0; } }
.chips { display: flex; gap: 6px; margin-top: 5px; font: 600 11px Inter, sans-serif; } .side.r .chips { justify-content: flex-end; }
.chips span { background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.18); border-radius: 6px; padding: 2px 6px 2px 3px; white-space: nowrap; text-shadow: none; }
.chips kbd { padding: 0 4px; font-size: 10px; margin-right: 1px; border-bottom-width: 2px; }
.meter .su { background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--segs, 2) - 2px), rgba(0,0,0,.85) calc(100% / var(--segs, 2) - 2px) calc(100% / var(--segs, 2))), rgba(0,0,0,.6); }
.meter .su i { mix-blend-mode: normal; }
#hud-hint { position: absolute; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); font: 600 11.5px Inter, sans-serif; color: #e9e0d5; background: rgba(0,0,0,.5); padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
#hud-hint kbd { font-size: 10.5px; margin: 0 2px 0 6px; }
@media (max-width: 820px) { .chips { display: none; } #hud-hint { display: none !important; } }
/* ---------- v1.4 menu / select / arena-select redesign ---------- */
#s-menu { background: linear-gradient(90deg, rgba(16,12,10,.92) 0%, rgba(16,12,10,.7) 45%, rgba(16,12,10,.35) 100%), url(../art/ui/title.jpg) right center / cover; align-items: stretch; padding: 14px 3vw; }
.menu-top { display: flex; align-items: center; gap: 14px; width: 100%; }
.brand-sm { height: 54px; } .ver-tag { color: #ffc23d; font: 400 13px var(--disp); letter-spacing: .08em; text-transform: uppercase; }
.top-badges { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pill { background: rgba(0,0,0,.55); border: 2px solid rgba(255,194,61,.55); color: #ffc23d; border-radius: 10px; padding: 7px 12px; font: 400 15px var(--disp); letter-spacing: .05em; }
.pill.icon { font-size: 18px; padding: 5px 11px; } .pill:focus, .pill:hover { border-color: #fff; }
.menu-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 3vw; width: 100%; flex: 1; align-items: start; }
.kicker { margin: 6px 0 0; font: 400 16px var(--disp); color: #ffc23d; letter-spacing: .08em; text-transform: uppercase; transform: skewX(-8deg); }
h2.pick { font-size: clamp(36px, 5.2vw, 66px); margin: 0 0 10px; font-style: italic; transform: skewX(-6deg); text-shadow: 4px 4px 0 #b5172c, 0 6px 18px rgba(0,0,0,.6); }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 700px; }
.card2 { position: relative; text-align: left; padding: 14px 44px 12px 20px; border: 0; color: #fff; background: linear-gradient(135deg, #3a2a20, #241a14); clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); box-shadow: inset 0 0 0 2px rgba(255,194,61,.3); transition: transform .08s, filter .1s; display: flex; flex-direction: column; }
.card2::after { content: '\203A'; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font: 400 34px var(--disp); opacity: .8; }
.card2 b { font: 400 clamp(20px, 2.1vw, 28px) var(--disp); letter-spacing: .03em; text-transform: uppercase; font-style: italic; } .card2 small { color: #e8d9c4; font-size: 12.5px; }
.card2.gold { background: linear-gradient(135deg, #ffd23f, #ff9f1c); color: #2a1606; } .card2.gold small { color: #4a2a0a; }
.card2:hover, .card2:focus { transform: translateY(-2px) scale(1.015); filter: brightness(1.15); box-shadow: inset 0 0 0 3px #fff; }
.diffrow { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font: 400 13px var(--disp); letter-spacing: .08em; color: #e8d9c4; text-transform: uppercase; }
.small-links { justify-content: flex-start; margin-top: 12px; max-width: 700px; }
.menu-right { display: flex; flex-direction: column; gap: 12px; margin-top: 56px; }
.dash { background: rgba(20,14,10,.82); border: 2px solid rgba(255,194,61,.6); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.dash h3 { margin: 0 0 8px; font: 400 24px var(--disp); color: #ffc23d; font-style: italic; text-transform: uppercase; }
.lbrow { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.08); align-items: center; } .lbrow b { font-family: var(--disp); color: #ffc23d; } .lbrow em { font-style: normal; color: #8fe3ff; font-weight: 700; } .lbrow.me span { color: #ffc23d; }
.dash .mission { grid-template-columns: 1fr 70px auto; font-size: 13px; } .dash .btn { margin-top: 8px; width: 100%; justify-content: center; }
#s-menu footer { margin-top: auto; text-align: center; }
/* select */
#s-select { background: linear-gradient(90deg, rgba(16,12,10,.4), rgba(16,12,10,.9) 40%), url(../art/ui/versus.jpg) center / cover; }
#select-big { position: fixed; left: 0; bottom: 0; height: 88vh; max-width: 38vw; object-fit: contain; object-position: left bottom; z-index: 0; filter: drop-shadow(10px 10px 0 rgba(0,0,0,.35)); pointer-events: none; }
#select-big.is3d { height: 70vh; } #select-big.in { animation: slideIn .3s ease-out; } @keyframes slideIn { from { transform: translateX(-30px); opacity: 0; } }
#s-select .select-wrap, #s-select .picks, #s-select .menu, #s-select h2, #s-select .kicker { position: relative; z-index: 1; }
#s-select .select-wrap { margin-left: 30vw; width: auto; flex-direction: column-reverse; max-width: 900px; }
#s-select .preview { max-height: none; } #s-select .grid { max-height: 40vh; width: 100%; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
#s-select .preview img.full { display: none; }
#team-toggle button { font: 400 15px var(--disp); letter-spacing: .05em; }
/* arena select */
#s-arena { background: linear-gradient(180deg, rgba(16,12,10,.55), rgba(16,12,10,.92)), url(../art/arenas/harbour.jpg) center / cover; }
.arena-wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; width: min(1200px, 100%); }
.arena-col { background: rgba(20,14,10,.8); border: 2px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px; } .arena-col.dyn { border-color: #ffc23d; box-shadow: 0 0 24px rgba(255,194,61,.25); }
.arena-col h3 { margin: 0; font: 400 26px var(--disp); font-style: italic; } .arena-col h3 em { font-style: normal; font-size: 12px; background: #ff3d7f; padding: 2px 7px; border-radius: 8px; vertical-align: middle; }
.arena-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; } .arena-cards.small { grid-template-columns: 1fr 1fr; }
.acard { height: 120px; border: 2px solid rgba(255,255,255,.2); border-radius: 10px; background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 8px 10px; text-align: left; clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.arena-cards.small .acard { height: 74px; } .acard b { font: 400 20px var(--disp); text-transform: uppercase; font-style: italic; text-shadow: 2px 2px 0 #000, 0 0 10px #000; }
.acard:hover, .acard:focus { border-color: #ffc23d; transform: scale(1.03); }
@media (max-width: 820px), (max-height: 520px) {
  .menu-grid { grid-template-columns: 1fr; } .menu-right { display: none; } .cards { grid-template-columns: 1fr 1fr 1fr; } .card2 { padding: 8px 30px 8px 12px; } .card2 small { display: none; } .card2 b { font-size: 16px; }
  h2.pick { font-size: 28px; margin: 0 0 4px; } .brand-sm { height: 36px; } .ver-tag { display: none; }
  #select-big { height: 80vh; max-width: 28vw; } #s-select .select-wrap { margin-left: 26vw; flex-direction: row; } #s-select .grid { max-height: 52vh; }
  .arena-wrap { grid-template-columns: 1fr 1fr; } .acard { height: 70px; } .arena-cards.small .acard { height: 52px; } .acard b { font-size: 14px; }
}
