:root {
  --wood: #5b3a1e; --wood2: #7a4f2a; --rust: #b5531c; --swamp: #2f5d3a; --moss: #7aa14a; --cream: #f4e7c3;
  --red: #d23b2f; --green: #5bd16a; --blue: #4f8fd6; --yellow: #f2c33f;
  --font-head: 'Bangers', Impact, 'Arial Black', 'Haettenschweiler', sans-serif;
  --font-body: 'Segoe UI', Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none; background: #0b1a12; font-family: var(--font-body); color: var(--cream); }
#app { position: fixed; inset: 0; }
canvas#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
kbd { background: #2a1a0c; border: 1px solid #8a6a3a; border-radius: 4px; padding: 0 5px; font-size: 0.85em; color: var(--yellow); font-family: var(--font-body); }
button { font-family: var(--font-head); letter-spacing: 1px; cursor: pointer; border: 0; border-radius: 8px; background: var(--rust); color: #fff; padding: 10px 18px; font-size: 18px; text-shadow: 0 2px 0 rgba(0,0,0,.4); box-shadow: 0 4px 0 #6d2f0e, 0 6px 12px rgba(0,0,0,.4); transition: transform .05s; }
button:hover { filter: brightness(1.1); }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 #6d2f0e; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.big { font-size: 24px; padding: 14px 28px; }
button.alt { background: var(--swamp); box-shadow: 0 4px 0 #1a3a22, 0 6px 12px rgba(0,0,0,.4); }
button.danger { background: #8a2020; box-shadow: 0 4px 0 #4a1010; }
button.small { font-size: 12px; padding: 4px 10px; font-family: var(--font-body); letter-spacing: 0; vertical-align: middle; }
select { background: #1b120a; border: 2px solid #8a6a3a; color: var(--cream); padding: 6px 10px; border-radius: 6px; font-size: 14px; }
input[type=text], input:not([type]) { background: #1b120a; border: 2px solid #8a6a3a; color: var(--cream); padding: 10px 12px; font-size: 18px; border-radius: 6px; width: 100%; font-family: var(--font-body); }
input:focus { outline: 2px solid var(--yellow); }
label { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: #d8c49a; }
label.check { text-transform: none; letter-spacing: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.muted { color: #b9a67e; font-size: 13px; }
.small-text { font-size: 12px; }

/* overlays */
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; }
#lobby { background: radial-gradient(ellipse at 50% 120%, rgba(31,63,42,.55) 0%, rgba(11,26,18,.75) 70%); }
.swamp-haze { position: absolute; inset: 0; background: radial-gradient(circle at 20% 30%, rgba(120,180,90,.12), transparent 40%), radial-gradient(circle at 80% 70%, rgba(200,120,50,.10), transparent 40%), radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%); pointer-events: none; }
.panel { position: relative; max-width: 960px; width: min(96vw, 960px); max-height: 94vh; overflow: auto; padding: 28px 32px; border-radius: 14px; }
.panel.narrow { width: min(96vw, 520px); }
.wood { background: linear-gradient(180deg, #6b4423, #4e2f16); border: 4px solid #2a1709; box-shadow: inset 0 0 0 2px #8a5a30, 0 20px 60px rgba(0,0,0,.6); }
.wood::before { content: ''; position: absolute; inset: 0; border-radius: 10px; background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.05), transparent 60%), radial-gradient(ellipse at 50% 100%, rgba(0,0,0,.25), transparent 60%); pointer-events: none; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: 2px; margin: 0 0 10px; text-transform: uppercase; }
h2 { font-size: 30px; color: var(--yellow); letter-spacing: 2px; }
h3 { font-size: 18px; color: #e9d7a8; margin-top: 16px; }
.logo { font-size: clamp(56px, 10vw, 110px); line-height: .9; text-align: center; margin: 0; display: flex; flex-direction: column; align-items: center; }
.logo span { color: var(--moss); text-shadow: 4px 4px 0 #1d2d12, 8px 8px 0 rgba(0,0,0,.4); transform: rotate(-2deg); }
.logo .snatch { color: var(--yellow); text-shadow: 4px 4px 0 #6d2f0e, 8px 8px 0 rgba(0,0,0,.4); transform: rotate(2deg) translateY(-6px); }
.tag { text-align: center; font-size: 18px; color: #e9d7a8; margin: 8px 0 20px; font-style: italic; }
.row { display: flex; gap: 14px; margin-bottom: 8px; }
.row label { flex: 1; }
#title-screen .big { width: 100%; margin-top: 10px; }
.howto { margin-top: 18px; font-size: 13px; line-height: 1.9; color: #d8c49a; border-top: 1px solid #8a5a30; padding-top: 12px; }

.lobby-head { display: flex; justify-content: space-between; align-items: center; }
#room-code { color: #fff; background: #2a1709; padding: 2px 12px; border-radius: 6px; letter-spacing: 4px; }
.pill { background: #2a1709; border-radius: 999px; padding: 4px 12px; font-size: 12px; }
.pill.on { background: #2f7d3a; color: #fff; }
.lobby-body { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
@media (max-width: 760px) { .lobby-body { grid-template-columns: 1fr; } }
#player-list { list-style: none; padding: 0; margin: 0; }
#player-list li { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.25); margin: 4px 0; padding: 6px 10px; border-radius: 6px; font-size: 15px; }
#player-list li .cls { margin-left: auto; color: var(--yellow); font-size: 12px; text-transform: uppercase; }
#player-list li .rdy { width: 10px; height: 10px; border-radius: 50%; background: #666; }
#player-list li .rdy.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
#player-list li .host { font-size: 11px; background: var(--rust); padding: 1px 6px; border-radius: 4px; }
.modes { display: flex; flex-direction: column; gap: 6px; }
.mode { background: rgba(0,0,0,.25); padding: 8px 10px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.mode.sel { border-color: var(--yellow); background: rgba(242,195,63,.12); }
.mode b { display: block; font-family: var(--font-head); letter-spacing: 1px; font-size: 16px; }
.mode span { font-size: 12px; color: #d8c49a; }
.mode.locked { opacity: .6; cursor: default; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.class-card { background: rgba(0,0,0,.3); border: 2px solid #3a2410; border-radius: 10px; padding: 10px; cursor: pointer; position: relative; min-height: 120px; transition: transform .08s; }
.class-card:hover { transform: translateY(-2px); border-color: #8a5a30; }
.class-card.sel { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(242,195,63,.4); }
.class-card.disabled { opacity: .35; pointer-events: none; }
.class-card .swatch { width: 100%; height: 44px; border-radius: 6px; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.class-card > b { font-family: var(--font-head); font-size: 18px; letter-spacing: 1px; display: block; }
.class-card .role { font-size: 11px; text-transform: uppercase; color: var(--yellow); letter-spacing: 1px; }
.class-card .blurb { font-size: 12px; color: #d8c49a; margin-top: 4px; line-height: 1.3; }
.class-card .abs { font-size: 11px; color: #c9b58a; margin-top: 6px; }
.class-card .team { position: absolute; top: 6px; right: 8px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; padding: 1px 6px; border-radius: 4px; }
.team.reptile { background: #2f5d3a; } .team.human { background: #6d3f1f; }
.lobby-foot { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
#ready.on { background: #2f7d3a; }

/* HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; font-family: var(--font-body); }
#crosshair { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); }
#crosshair .dot { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; background: #fff; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 2px #000; }
#crosshair .hitmark { position: absolute; inset: 0; border: 2px solid var(--yellow); transform: rotate(45deg) scale(0); opacity: 0; }
#crosshair .hitmark.pop { animation: hitpop .25s ease-out; }
@keyframes hitpop { 0% { transform: rotate(45deg) scale(.4); opacity: 1; } 100% { transform: rotate(45deg) scale(1.3); opacity: 0; } }
#objective { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); text-align: center; }
#obj-main { font-family: var(--font-head); font-size: 34px; letter-spacing: 3px; color: #fff; text-shadow: 2px 2px 0 #000, 0 0 12px rgba(0,0,0,.6); }
#obj-sub { font-size: 14px; color: #ffe9b0; text-shadow: 1px 1px 0 #000; }
#eggs { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
#eggs .egg { width: 16px; height: 20px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #fff7e0; box-shadow: inset -3px -3px 0 #d9c7a0, 0 0 4px #000; }
#eggs .egg.carried { background: var(--yellow); animation: pulse 1s infinite; }
#eggs .egg.lost { background: #3a2a1a; box-shadow: none; opacity: .5; }
@keyframes pulse { 50% { transform: scale(1.15); } }
#brawl-score { width: 320px; margin: 6px auto 0; }
#brawl-score .bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #222; border: 2px solid #000; }
#brawl-score .r { background: var(--moss); } #brawl-score .c { background: #6a2a9a; margin: 0 auto; } #brawl-score .h { background: var(--rust); margin-left: auto; }
#score-text { font-family: var(--font-head); font-size: 18px; letter-spacing: 2px; text-shadow: 1px 1px 0 #000; }
#announce { position: absolute; top: 24%; left: 50%; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity .3s; }
#announce.show { opacity: 1; }
#announce-main { font-family: var(--font-head); font-size: 76px; letter-spacing: 5px; color: var(--yellow); text-shadow: 4px 4px 0 #000, 0 0 30px rgba(0,0,0,.8); }
#announce-sub { font-size: 20px; color: #fff; text-shadow: 2px 2px 0 #000; }
#killfeed { position: absolute; right: 16px; top: 250px; width: 320px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
#killfeed .kf { background: rgba(0,0,0,.55); padding: 4px 10px; border-radius: 6px; font-size: 13px; animation: fadein .2s; }
#killfeed .kf b.r { color: var(--moss); } #killfeed .kf b.h { color: #ff9a5a; } #killfeed .kf .how { color: #ccc; font-style: italic; }
@keyframes fadein { from { opacity: 0; transform: translateX(20px); } }
#minimap-wrap { position: absolute; right: 16px; top: 16px; width: 220px; height: 220px; border-radius: 50%; overflow: hidden; border: 3px solid #2a1709; box-shadow: 0 4px 20px rgba(0,0,0,.6); background: #0b1a12; }
#minimap { display: block; }
#compass { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-family: var(--font-head); color: var(--yellow); font-size: 14px; text-shadow: 1px 1px 0 #000; }
#status { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); width: 480px; text-align: center; }
#class-name { font-family: var(--font-head); letter-spacing: 2px; font-size: 16px; color: var(--yellow); text-shadow: 1px 1px 0 #000; }
#hpbar { position: relative; height: 22px; background: #1b120a; border: 2px solid #000; border-radius: 6px; overflow: hidden; margin: 4px 0; box-shadow: 0 2px 8px rgba(0,0,0,.6); }
#hpfill { height: 100%; width: 100%; background: linear-gradient(180deg, #6fe07a, #2f9a3c); transition: width .15s; }
#hpfill.low { background: linear-gradient(180deg, #ff6b5b, #b31f1f); }
#hptext { position: absolute; inset: 0; font-family: var(--font-head); font-size: 15px; letter-spacing: 1px; line-height: 20px; text-shadow: 1px 1px 0 #000; }
#effects { display: flex; gap: 6px; justify-content: center; min-height: 18px; }
#effects .ef { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: rgba(0,0,0,.6); text-transform: uppercase; letter-spacing: 1px; }
#abilities { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.ab { position: relative; width: 92px; height: 60px; background: rgba(20,12,6,.85); border: 2px solid #8a5a30; border-radius: 8px; overflow: hidden; }
.ab .cd { position: absolute; inset: 0; background: rgba(0,0,0,.7); transform-origin: bottom; transform: scaleY(0); }
.ab .key { position: absolute; top: 3px; left: 6px; font-size: 11px; color: var(--yellow); font-weight: bold; }
.ab .abname { position: absolute; bottom: 5px; left: 0; right: 0; font-family: var(--font-head); font-size: 13px; letter-spacing: 1px; text-align: center; }
.ab.ready { border-color: var(--yellow); }
.ab.flash { animation: abflash .2s; }
@keyframes abflash { 50% { background: #f2c33f; } }
#prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); background: rgba(0,0,0,.6); padding: 6px 14px; border-radius: 6px; font-size: 14px; opacity: 0; transition: opacity .15s; }
#prompt.show { opacity: 1; }
#chat { position: absolute; left: 16px; bottom: 16px; width: 380px; pointer-events: auto; }
#chat-log { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow: hidden; justify-content: flex-end; }
#chat-log .msg { background: rgba(0,0,0,.45); padding: 3px 8px; border-radius: 4px; font-size: 13px; transition: opacity 1s; }
#chat-log .msg.sys { color: #c9b58a; font-style: italic; }
#chat-log .msg b { color: var(--yellow); } #chat-log .msg.r b { color: var(--moss); } #chat-log .msg.h b { color: #ff9a5a; }
#chat-log .msg.taunt { color: #ffd98a; }
#chat-input { margin-top: 4px; font-size: 14px; padding: 6px 10px; }
#voice-ind { position: absolute; left: 16px; bottom: 240px; display: flex; flex-direction: column; gap: 3px; }
#voice-ind .v { font-size: 12px; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 4px; } #voice-ind .v.me { color: var(--green); }
#respawn { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(80,0,0,.2), rgba(0,0,0,.6)); }
#respawn-main { font-family: var(--font-head); font-size: 54px; letter-spacing: 4px; color: var(--red); text-shadow: 3px 3px 0 #000; }
#respawn-sub { font-size: 22px; text-shadow: 2px 2px 0 #000; margin-top: 8px; }
#taunts { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); display: flex; gap: 6px; }
#taunts .tn { background: rgba(0,0,0,.7); border: 1px solid #8a5a30; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
#taunts .tn kbd { margin-right: 4px; }
#vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px rgba(200,0,0,0); transition: box-shadow .12s; }
#vignette.hit { box-shadow: inset 0 0 180px rgba(220,20,20,.75); }
#vignette.poison { box-shadow: inset 0 0 160px rgba(60,200,40,.5); }
#vignette.fear { box-shadow: inset 0 0 200px rgba(120,0,160,.6); }
#underwater { position: absolute; inset: 0; background: rgba(20,60,40,.35); opacity: 0; transition: opacity .2s; }
#underwater.on { opacity: 1; }
#toasts { position: absolute; left: 50%; top: 70%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 4px; align-items: center; }
#toasts .toast { background: rgba(0,0,0,.7); padding: 6px 14px; border-radius: 6px; font-size: 14px; animation: fadein .2s; }
#ping-ind { position: absolute; right: 16px; bottom: 16px; font-size: 11px; color: #b9a67e; text-shadow: 1px 1px 0 #000; }

/* scoreboard / gameover */
#scoreboard { background: rgba(0,0,0,.45); z-index: 8; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-family: var(--font-head); letter-spacing: 1px; color: var(--yellow); border-bottom: 2px solid #8a5a30; padding: 6px 8px; font-weight: normal; }
td { padding: 6px 8px; border-bottom: 1px solid rgba(0,0,0,.3); }
tr.me td { background: rgba(242,195,63,.12); }
tr.r td:first-child { border-left: 4px solid var(--moss); } tr.h td:first-child { border-left: 4px solid var(--rust); }
#gameover { background: rgba(0,0,0,.6); z-index: 12; }
#go-title { font-size: 64px; text-align: center; color: var(--yellow); text-shadow: 4px 4px 0 #000; }
#go-reason { text-align: center; font-size: 18px; margin-bottom: 16px; }
#go-lobby { display: block; margin: 20px auto 0; }
#bigmap { background: rgba(0,0,0,.6); z-index: 7; }
#bigmap-canvas { border: 4px solid #2a1709; border-radius: 10px; max-width: 90vmin; max-height: 90vmin; width: 90vmin; height: 90vmin; }
#menu { background: rgba(0,0,0,.5); z-index: 9; }
#menu .big { width: 100%; margin: 6px 0; }
.settings { margin: 14px 0; display: flex; flex-direction: column; gap: 6px; }
.settings label { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
.settings input[type=range] { width: 200px; }
#disconnected { background: rgba(0,0,0,.7); z-index: 20; }

/* ================= TOUCH CONTROLS ================= */
#touch { position: absolute; inset: 0; z-index: 6; pointer-events: none; touch-action: none; }
#touch-area { position: absolute; inset: 0; pointer-events: auto; touch-action: none; }
#stick-hint, #look-hint { position: absolute; bottom: max(28px, env(safe-area-inset-bottom)); width: 110px; height: 110px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.28); display: flex; align-items: center; justify-content: center; pointer-events: none; transition: opacity .3s; }
#stick-hint { left: max(40px, env(safe-area-inset-left)); } #look-hint { right: 280px; width: 130px; height: 70px; border-radius: 20px; bottom: 50px; }
#stick-hint span, #look-hint span { font-family: var(--font-head); font-size: 14px; letter-spacing: 2px; color: rgba(255,255,255,.45); text-align: center; }
#touch.active #stick-hint, #touch.active #look-hint { opacity: 0; }
#stick { position: absolute; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; border: 3px solid rgba(255,255,255,.45); background: rgba(0,0,0,.3); display: none; pointer-events: none; }
#stick.on { display: block; }
#stick-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe08a, #d9a51a); box-shadow: 0 3px 10px rgba(0,0,0,.6); }
.tbtn { pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; position: relative; width: 66px; height: 66px; border-radius: 50%; background: rgba(14,10,6,.78); border: 3px solid #8a5a30; color: #fff; font-family: var(--font-head); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 0; box-shadow: 0 4px 0 #1a0f06, 0 6px 14px rgba(0,0,0,.6); overflow: hidden; }
.tbtn i { font-style: normal; font-size: 22px; line-height: 1; }
.tbtn b { font-weight: normal; font-size: 10px; letter-spacing: 1px; line-height: 1.1; margin-top: 2px; text-align: center; max-width: 60px; text-shadow: 1px 1px 0 #000; }
.tbtn em { position: absolute; top: 5px; left: 9px; font-style: normal; font-size: 11px; color: var(--yellow); font-weight: bold; }
.tbtn:active, .tbtn.down { transform: translateY(3px); box-shadow: 0 1px 0 #1a0f06; filter: brightness(1.3); }
.tbtn .ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(0,0,0,.72) 0turn, transparent 0turn); pointer-events: none; }
.tbtn.cd { border-color: #4a3a2a; } .tbtn.cd b, .tbtn.cd i { opacity: .55; }
.tb-fire { width: 104px; height: 104px; border-color: #e0552f; background: radial-gradient(circle at 40% 35%, rgba(180,60,40,.85), rgba(60,15,10,.9)); }
.tb-fire i { font-size: 30px; } .tb-fire b { font-size: 13px; max-width: 92px; }
.tb-ab { width: 74px; height: 74px; border-color: var(--yellow); background: radial-gradient(circle at 40% 35%, rgba(120,90,20,.85), rgba(35,25,8,.9)); }
.tb-move { width: 62px; height: 62px; border-color: #4f8fd6; background: radial-gradient(circle at 40% 35%, rgba(40,80,140,.85), rgba(10,25,50,.9)); }
.tb-sys { width: 54px; height: 54px; border-radius: 14px; border-width: 2px; } .tb-sys i { font-size: 18px; } .tb-sys b { font-size: 9px; }
.tb-sys.mic.on { background: #2f7d3a; border-color: #7fff7f; }
.tb-interact { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); width: 120px; height: 62px; border-radius: 16px; border-color: var(--yellow); animation: pulse 1s infinite; background: rgba(60,45,10,.9); }
.tb-interact b { font-size: 11px; max-width: 110px; }
#touch-top { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
#touch-right { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 270px; height: 230px; }
#touch-right .tbtn { position: absolute; }
#touch-right [data-act="fire"] { right: 0; bottom: 0; }
#touch-right [data-act="ab1"] { right: 112px; bottom: 6px; }
#touch-right [data-act="ab2"] { right: 150px; bottom: 92px; }
#touch-right [data-act="jump"] { right: 52px; bottom: 120px; }
#touch-right [data-act="dive"] { right: 0; bottom: 150px; width: 54px; height: 54px; }
#touch-right [data-act="dive"] i { font-size: 18px; }

/* letterbox + vignette for the cinematic bits */
#bars { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
#bars .bar-top, #bars .bar-bot { position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height .6s ease; }
#bars .bar-top { top: 0; } #bars .bar-bot { bottom: 0; }
body.cine #bars .bar-top, body.cine #bars .bar-bot { height: 9vh; }
#vignette { box-shadow: inset 0 0 120px rgba(0,0,0,.45); }

/* help card */
#help { background: rgba(0,0,0,.6); z-index: 11; }
.help-card { max-width: 720px; width: min(96vw, 720px); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 8px 0 10px; }
.help-grid div { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; background: rgba(0,0,0,.25); padding: 5px 8px; border-radius: 8px; }
.help-grid i { grid-row: 1 / 3; font-style: normal; font-size: 24px; }
.help-grid b { font-family: var(--font-head); letter-spacing: 1px; font-size: 15px; color: var(--yellow); }
.help-grid span { font-size: 12px; color: #e9d7a8; line-height: 1.3; }
#help-ok { width: 100%; }
@media (max-height: 480px) { .help-card { padding: 8px 12px; } .help-grid { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 5px; margin: 4px 0 6px; } .help-grid span { font-size: 10px; line-height: 1.2; } .help-grid b { font-size: 12px; } .help-grid i { font-size: 18px; } .help-card h2 { font-size: 20px; margin: 0 0 2px; } #help-ok { font-size: 16px; padding: 7px 12px; } }

/* desktop ability icons */
.ab { width: 104px; height: 68px; }
.ab .abicon { position: absolute; top: 4px; left: 0; right: 0; text-align: center; font-size: 22px; }
.ab .abname { font-size: 12px; }
.ab .cd { background: conic-gradient(rgba(0,0,0,.75) 0turn, transparent 0turn); transform: none; }

/* ================= PHONE HUD LAYOUT ================= */
body.touch #hud { pointer-events: none; }
body.touch #crosshair { opacity: .5; }
body.touch #abilities { display: none; }
body.touch #objective { top: max(8px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); transform: none; text-align: left; background: rgba(0,0,0,.45); padding: 6px 10px; border-radius: 10px; min-width: 150px; }
body.touch #obj-main { font-size: 20px; letter-spacing: 2px; } body.touch #obj-sub { font-size: 11px; }
body.touch #eggs { justify-content: flex-start; margin-top: 3px; } body.touch #eggs .egg { width: 11px; height: 14px; }
body.touch #brawl-score { width: 180px; margin: 4px 0 0; } body.touch #score-text { font-size: 14px; }
body.touch #status { left: max(10px, env(safe-area-inset-left)); top: 96px; bottom: auto; transform: none; width: 190px; text-align: left; }
body.touch #class-name { font-size: 12px; letter-spacing: 1px; }
body.touch #hpbar { height: 16px; } body.touch #hptext { font-size: 12px; line-height: 13px; }
body.touch #effects { justify-content: flex-start; } body.touch #effects .ef { font-size: 9px; }
body.touch #minimap-wrap { width: 140px; height: 140px; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); border-width: 3px; }
body.touch #minimap { width: 140px; height: 140px; }
body.touch #killfeed { top: 156px; right: max(8px, env(safe-area-inset-right)); width: 190px; } body.touch #killfeed .kf { font-size: 10px; padding: 2px 6px; }
body.touch #announce { top: 20%; } body.touch #announce-main { font-size: 40px; letter-spacing: 3px; } body.touch #announce-sub { font-size: 14px; }
body.touch #respawn-main { font-size: 36px; } body.touch #respawn-sub { font-size: 16px; }
body.touch #prompt { display: none; }
body.touch #ping-ind { display: none; }
body.touch #chat { left: max(10px, env(safe-area-inset-left)); top: 150px; bottom: auto; width: 230px; }
body.touch #chat-log { max-height: 84px; } body.touch #chat-log .msg { font-size: 11px; padding: 2px 6px; }
body.touch #chat-input { font-size: 16px; }
body.touch #voice-ind { bottom: auto; top: 240px; left: max(10px, env(safe-area-inset-left)); } body.touch #voice-ind .v { font-size: 11px; }
body.touch #taunts { bottom: auto; top: 60px; left: 50%; transform: translateX(-50%); flex-direction: column; gap: 4px; }
body.touch #taunts .tn { pointer-events: auto; font-size: 13px; padding: 10px 14px; background: rgba(0,0,0,.85); }
body.touch #toasts { top: 62%; }
body.touch #menu .panel, body.touch #scoreboard .panel, body.touch #gameover .panel { pointer-events: auto; }
body.touch #scoreboard, body.touch #bigmap, body.touch #menu, body.touch #gameover, body.touch #help { pointer-events: auto; }

@media (max-width: 900px) {
  .panel { padding: 14px 14px; border-radius: 10px; }
  .logo { font-size: clamp(40px, 12vw, 72px); }
  .tag { font-size: 14px; margin: 4px 0 10px; }
  .howto { display: none; }
  .row { flex-direction: row; gap: 8px; }
  input:not([type]) { font-size: 16px; padding: 8px 10px; }
  button.big { font-size: 18px; padding: 10px 16px; }
  .lobby-body { grid-template-columns: 1fr; gap: 10px; }
  .class-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
  .class-card { min-height: 0; padding: 8px; } .class-card .swatch { height: 30px; font-size: 22px; } .class-card .blurb { display: none; } .class-card .abs { font-size: 10px; }
  .lobby-head h2 { font-size: 20px; }
  h3 { font-size: 15px; margin-top: 8px; }
  .lobby-foot { flex-wrap: wrap; gap: 8px; }
  #sb-table, #go-table { font-size: 12px; } th, td { padding: 4px 5px; }
  #go-title { font-size: 36px; }
  #bigmap-canvas { width: 92vmin; height: 92vmin; }
}
@media (max-height: 500px) {
  .panel { max-height: 96vh; padding: 10px 14px; }
  .logo { font-size: 44px; } .tag { display: none; }
  #title-screen .big { margin-top: 4px; }
}

/* ================= OPENING ================= */
@keyframes beat { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.18); } 45% { transform: scale(1); } 60% { transform: scale(1.12); } }
.credit { text-align: center; font-size: 13px; color: #ffd5e1; margin: -10px 0 14px; letter-spacing: 1px; }
.credit b { color: var(--yellow); }
.credit .small { margin-left: 8px; }
@media (max-width: 900px) { .credit { font-size: 11px; margin: -4px 0 8px; } }


#quick { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); display: flex; gap: 8px; z-index: 12; }
.qbtn { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; padding: 0; background: rgba(20,12,6,.8); border: 2px solid #8a5a30; box-shadow: 0 3px 0 #2a1709; }
.qbtn.off { opacity: .6; }
#settings { background: rgba(0,0,0,.55); z-index: 13; pointer-events: auto; }
#settings .panel { pointer-events: auto; }
#settings-close { width: 100%; margin-top: 8px; }

/* ================= PHONE PORTRAIT ================= */
@media (orientation: portrait) {
  body.touch #touch-top { top: max(6px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); gap: 4px; width: calc(100vw - 12px); justify-content: center; }
  body.touch .tb-sys { width: 44px; height: 44px; border-radius: 10px; } body.touch .tb-sys i { font-size: 16px; } body.touch .tb-sys b { font-size: 7px; }
  body.touch #minimap-wrap { top: 62px; right: 8px; width: 110px; height: 110px; } body.touch #minimap { width: 110px; height: 110px; }
  body.touch #objective { top: 62px; left: 8px; max-width: calc(100vw - 134px); min-width: 0; padding: 5px 9px; }
  body.touch #obj-main { font-size: 18px; } body.touch #obj-sub { font-size: 10px; }
  body.touch #status { top: 136px; left: 8px; width: calc(100vw - 134px); }
  body.touch #chat { top: 190px; left: 8px; width: calc(100vw - 134px); } body.touch #chat-log { max-height: 70px; }
  body.touch #killfeed { top: 180px; right: 8px; width: 110px; } body.touch #killfeed .kf { font-size: 9px; }
  body.touch #voice-ind { top: 270px; }
  body.touch #announce { top: 30%; } body.touch #announce-main { font-size: 34px; }
  body.touch #look-hint { right: 16px; left: auto; bottom: 300px; width: 120px; height: 60px; }
  body.touch #stick-hint { left: 24px; bottom: 40px; width: 100px; height: 100px; }
  body.touch #touch-right { width: 250px; height: 250px; right: 10px; bottom: 16px; }
  body.touch #touch-right [data-act="ab2"] { right: 140px; bottom: 100px; }
  body.touch #touch-right [data-act="ab1"] { right: 110px; bottom: 6px; }
  body.touch #touch-right [data-act="jump"] { right: 50px; bottom: 130px; }
  body.touch #touch-right [data-act="dive"] { right: 0; bottom: 160px; }
  body.touch .tb-interact { bottom: 270px; left: 16px; transform: none; width: 110px; height: 56px; }
  body.touch #toasts { top: 56%; width: 90vw; } body.touch #toasts .toast { font-size: 12px; text-align: center; }
  body.touch #respawn-main { font-size: 30px; }
}

/* ================= touch buttons v3: bigger, readable ================= */
.tbtn { width: 70px; height: 70px; }
.tbtn i { font-size: 24px; }
.tbtn b { font-size: 11px; max-width: 66px; letter-spacing: .5px; line-height: 1.05; text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.tbtn em { top: 6px; left: 10px; font-size: 12px; }
.tb-fire { width: 112px; height: 112px; }
.tb-fire i { font-size: 34px; } .tb-fire b { font-size: 13px; max-width: 100px; }
.tb-ab { width: 84px; height: 84px; }
.tb-ab b { font-size: 11px; max-width: 76px; }
.tb-move { width: 66px; height: 66px; }
.tb-sys { width: 56px; height: 56px; } .tb-sys b { font-size: 9px; letter-spacing: .3px; }
#touch-right { width: 290px; height: 250px; }
#touch-right [data-act="fire"] { right: 0; bottom: 0; }
#touch-right [data-act="ab1"] { right: 122px; bottom: 4px; }
#touch-right [data-act="ab2"] { right: 166px; bottom: 96px; }
#touch-right [data-act="jump"] { right: 66px; bottom: 128px; }
#touch-right [data-act="dive"] { right: 2px; bottom: 160px; width: 58px; height: 58px; }
@media (orientation: portrait) {
  body.touch .tb-sys { width: 47px; height: 47px; } body.touch .tb-sys b { font-size: 8px; } body.touch .tb-sys i { font-size: 17px; }
  body.touch #touch-right { width: 270px; height: 260px; right: 8px; bottom: 14px; }
  body.touch #touch-right [data-act="ab2"] { right: 150px; bottom: 104px; }
  body.touch #touch-right [data-act="ab1"] { right: 118px; bottom: 4px; }
  body.touch #touch-right [data-act="jump"] { right: 56px; bottom: 136px; }
  body.touch #touch-right [data-act="dive"] { right: 0; bottom: 170px; }
}
body.touch #toasts .toast { font-size: 14px; background: rgba(0,0,0,.8); border: 1px solid #8a5a30; }

/* ================= DRAWER ================= */
body.touch #touch-top { left: auto; right: max(8px, env(safe-area-inset-right)); top: 156px; transform: none; flex-direction: column; gap: 8px; width: auto; }
body.touch #killfeed { right: 72px; top: 156px; width: 190px; }
#drawer-scrim { position: absolute; inset: 0; z-index: 14; background: rgba(0,0,0,.25); }
#drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(92vw, 400px); z-index: 15; background: linear-gradient(180deg, rgba(74,47,22,.86), rgba(40,24,10,.9)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-left: 3px solid #8a5a30; box-shadow: -10px 0 40px rgba(0,0,0,.6); padding: max(10px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); overflow-y: auto; transform: translateX(0); animation: slidein .22s ease-out; pointer-events: auto; display: flex; flex-direction: column; gap: 10px; }
@keyframes slidein { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-head); font-size: 20px; letter-spacing: 2px; color: var(--yellow); }
.dbtn-x { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; padding: 0; background: rgba(0,0,0,.4); box-shadow: none; }
#drawer-map { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; border: 2px solid #2a1709; background: #0b1a12; }
#drawer-status { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
#drawer-status span { background: rgba(0,0,0,.4); padding: 4px 9px; border-radius: 999px; }
#drawer-status span b { color: var(--yellow); }
.drawer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dbtn { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.35); border: 2px solid #6b4a2b; box-shadow: none; font-family: var(--font-head); letter-spacing: 1px; font-size: 15px; color: #fff; }
.dbtn i { grid-row: 1 / 3; font-style: normal; font-size: 24px; }
.dbtn b { font-weight: normal; }
.dbtn small { font-family: var(--font-body); font-size: 10px; letter-spacing: 0; color: #d8c49a; text-transform: none; }
.dbtn.danger { border-color: #8a2020; }
.dbtn:active { background: rgba(242,195,63,.3); }
#drawer-players { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
#drawer-players div { display: flex; justify-content: space-between; background: rgba(0,0,0,.3); padding: 4px 8px; border-radius: 6px; }
@media (orientation: portrait) {
  body.touch #touch-top { top: 180px; right: 8px; }
  body.touch #killfeed { top: 180px; right: 68px; width: 150px; }
  #drawer { width: 100vw; border-left: 0; }
}
@media (orientation: landscape) and (max-height: 480px) {
  #drawer { width: min(92vw, 560px); }
  #drawer-map { width: 46%; float: left; margin-right: 10px; }
  .drawer-grid { grid-template-columns: 1fr 1fr 1fr; }
}

.drawer-row { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.3); padding: 6px 10px; border-radius: 10px; font-family: var(--font-head); letter-spacing: 1px; font-size: 14px; }
.drawer-row b { min-width: 60px; text-align: center; color: var(--yellow); font-weight: normal; font-size: 16px; }
.dbtn-sm { width: 44px; height: 40px; border-radius: 10px; padding: 0; font-size: 22px; background: rgba(0,0,0,.45); border: 2px solid #8a5a30; box-shadow: none; }
.dbtn-sm.wide { width: auto; padding: 0 12px; font-size: 12px; font-family: var(--font-body); margin-left: auto; }

#go-awards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 14px; }
#go-awards .award { background: rgba(0,0,0,.3); border: 2px solid var(--yellow); border-radius: 10px; padding: 8px 14px; text-align: center; min-width: 140px; }
#go-awards .award b { display: block; font-family: var(--font-head); letter-spacing: 1px; color: var(--yellow); font-size: 16px; }
#go-awards .award span { display: block; font-size: 15px; }
#go-awards .award small { color: #d8c49a; font-size: 11px; }

#taunts .tn.qc { border-color: var(--yellow); color: #fff; }

/* ================= CHARACTER SHOWCASE ================= */
.lobby-body { grid-template-columns: 260px 1fr 1fr; }
#showcase { --sc-accent: #f2c33f; background: linear-gradient(180deg, color-mix(in srgb, var(--sc-accent) 10%, rgba(0,0,0,.3)), rgba(0,0,0,.3)); border: 2px solid color-mix(in srgb, var(--sc-accent) 35%, #3a2410); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: background .5s, border-color .5s, box-shadow .5s; box-shadow: 0 0 24px -8px color-mix(in srgb, var(--sc-accent) 55%, transparent); }
.sc-head { display: grid; grid-template-columns: auto 40px 1fr 40px; align-items: center; gap: 8px; }
.sc-team { font-size: 10px; letter-spacing: 1px; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; }
.sc-team.reptile { background: #2f5d3a; } .sc-team.human { background: #6d3f1f; } .sc-team.city { background: #4a2a7a; }
.sc-arrow { width: 40px; height: 40px; border-radius: 10px; padding: 0; font-size: 16px; background: rgba(0,0,0,.45); border: 2px solid #8a5a30; box-shadow: none; }
.sc-title { text-align: center; } .sc-title b { display: block; font-family: var(--font-head); font-size: 26px; letter-spacing: 2px; color: var(--yellow); } .sc-title span { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #e9d7a8; }
#sc-canvas { width: 100%; aspect-ratio: 1; border-radius: 12px; background: radial-gradient(ellipse at 50% 70%, color-mix(in srgb, var(--sc-accent) 30%, rgba(95,138,60,.35)), rgba(11,26,18,.2) 70%); display: block; touch-action: pan-y; transition: background .5s; }
#sc-blurb { margin: 0; font-size: 13px; color: #e9d7a8; text-align: center; min-height: 34px; }
.sc-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.sc-stats div span { font-size: 10px; letter-spacing: 1px; color: #d8c49a; }
.sc-stats i { display: block; height: 8px; background: rgba(0,0,0,.5); border-radius: 4px; overflow: hidden; margin-top: 2px; }
.sc-stats b { display: block; height: 100%; background: linear-gradient(90deg, #7aa14a, var(--sc-accent)); border-radius: 4px; transition: width .4s; }
#sc-abilities { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.sc-ab { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 1px; padding: 8px 4px; border-radius: 10px; background: rgba(0,0,0,.4); border: 2px solid #8a5a30; box-shadow: none; color: #fff; font-family: var(--font-head); letter-spacing: 1px; font-size: 12px; position: relative; }
.sc-ab .k { position: absolute; top: 3px; left: 6px; font-size: 9px; color: var(--yellow); font-family: var(--font-body); font-weight: bold; }
.sc-ab i { font-style: normal; font-size: 24px; } .sc-ab b { font-weight: normal; text-align: center; line-height: 1.05; } .sc-ab small { font-family: var(--font-body); font-size: 9px; color: #d8c49a; letter-spacing: 0; }
.sc-ab:active { background: rgba(242,195,63,.35); }
#sc-desc { margin: 0; font-size: 12px; color: #fff; background: rgba(0,0,0,.35); padding: 6px 10px; border-radius: 8px; min-height: 30px; text-align: center; }
#sc-pick { width: 100%; }
#sc-pick.picked { background: #2f7d3a; box-shadow: 0 4px 0 #1a3a22; }
@media (max-width: 1100px) { .lobby-body { grid-template-columns: 240px 1fr; } .lobby-col.classes { grid-column: 1 / -1; } }
@media (max-width: 900px) { .lobby-body { grid-template-columns: 1fr; } .lobby-col.players { order: 2; } .lobby-col.showcase { order: 1; } .lobby-col.classes { order: 3; } #showcase { padding: 8px; } .sc-title b { font-size: 22px; } #sc-canvas { max-height: 46vh; } }

/* gesture mode hides the action buttons, keeps Talk + More */
body.touch.gestures #touch-right { display: none; }
body.touch.gestures #look-hint { width: 230px; height: 56px; border-radius: 14px; right: 24px; bottom: 90px; }
body.touch.gestures #look-hint span { font-size: 10px; letter-spacing: 1px; line-height: 1.4; }
body.touch.gestures .tb-interact { bottom: 160px; }
@media (orientation: portrait) { body.touch.gestures #look-hint { right: 16px; bottom: 120px; width: 200px; } }

/* ================= LOBBY v2: fixed viewport, pages ================= */
.lobby-fixed { height: min(96vh, 980px); width: min(96vw, 1240px); max-height: none; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 16px 22px; }
.lobby-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.lobby-room { font-family: var(--font-head); font-size: 20px; letter-spacing: 2px; color: var(--yellow); }
.lobby-room #room-code { font-size: 20px; }
#lobby-right { text-align: right; }
.lobby-tabs { display: flex; gap: 6px; background: rgba(0,0,0,.35); padding: 4px; border-radius: 14px; border: 2px solid #3a2410; }
.lobby-tabs .tab { display: flex; align-items: center; gap: 6px; background: transparent; box-shadow: none; border-radius: 10px; padding: 8px 18px; font-size: 16px; color: #d8c49a; }
.lobby-tabs .tab i { font-style: normal; font-size: 16px; }
.lobby-tabs .tab.on { background: linear-gradient(180deg, #d9a51a, #b5531c); color: #fff; box-shadow: 0 2px 0 #6d2f0e; }
.lobby-tabs .tab.done i::after { content: ' ✓'; font-size: 11px; color: #9fe07a; }
.lpage { display: none; flex: 1; min-height: 0; overflow: hidden; }
.lpage.on { display: flex; flex-direction: column; gap: 8px; }
.lobby-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 0; padding-top: 8px; border-top: 1px solid rgba(138,90,48,.6); }
.lobby-foot #ready { margin-right: auto; }
/* mode cards */
.lpage[data-page="mode"] .modes { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 10px; flex: 1; min-height: 0; }
.mode { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(180deg, rgba(20,34,18,.55), rgba(0,0,0,.5)); border: 2px solid #3a2410; position: relative; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.mode::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, transparent, rgba(122,161,74,.6), transparent); opacity: .5; }
.mode .mh { display: flex; align-items: center; gap: 12px; }
.mode .mi { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 30px; background: radial-gradient(circle at 35% 30%, #4e7a3c, #1e3a22 70%); border: 2px solid #7aa14a; box-shadow: 0 4px 10px rgba(0,0,0,.5), inset 0 0 12px rgba(0,0,0,.4); }
.mode b { font-size: 24px; line-height: 1; padding: 0; color: #fff3cf; text-shadow: 0 2px 0 rgba(0,0,0,.5); overflow-wrap: anywhere; }
.mode span { font-size: 15px; line-height: 1.4; padding: 0; color: #f1e3bd; overflow-wrap: break-word; hyphens: auto; }
.mode .players { margin-top: auto; font-size: 12px; color: var(--yellow); letter-spacing: 1.5px; text-transform: uppercase; font-family: var(--font-head); }
.mode.sel { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(242,195,63,.35), 0 0 30px rgba(242,195,63,.18), inset 0 0 40px rgba(242,195,63,.08); background: linear-gradient(180deg, rgba(242,195,63,.16), rgba(20,34,18,.55) 40%, rgba(0,0,0,.5)); }
.mode.sel .mi { border-color: var(--yellow); box-shadow: 0 0 16px rgba(242,195,63,.45), inset 0 0 12px rgba(0,0,0,.4); }
.mode:not(.locked):hover { transform: translateY(-2px); border-color: #8a5a30; }
.mode.locked { cursor: default; }
/* page headings as hanging wood signs */
.lpage h3.sign { display: flex; align-items: baseline; gap: 12px; margin: 0; font-size: 24px; color: var(--yellow); letter-spacing: 3px; text-shadow: 0 2px 0 #2a1709, 0 4px 10px rgba(0,0,0,.5); }
.lpage h3.sign small { font-family: var(--font-body); font-size: 13px; letter-spacing: 0; text-transform: none; color: #d8c49a; font-weight: normal; }
.lpage h3.sign::after { content: ''; flex: 1; height: 2px; background: linear-gradient(90deg, rgba(122,161,74,.7), transparent); margin-left: 6px; align-self: center; }
/* critter page */
.critter-layout { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 14px; flex: 1; min-height: 0; }
#showcase { min-height: 0; overflow: hidden; }
#sc-canvas { flex: 1; min-height: 0; max-height: none; aspect-ratio: auto; width: 100%; height: 100%; }
.roster { display: flex; flex-direction: column; min-height: 0; }
.roster-head { display: flex; align-items: center; gap: 8px; } .roster-head h3 { margin: 0; flex: 1; }
.roster .class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; overflow: auto; padding-right: 4px; align-content: start; }
.roster .class-card { min-height: 0; padding: 10px; display: grid; grid-template-columns: 50px 1fr; column-gap: 10px; align-items: center; }
.roster .class-card .swatch { width: 50px; height: 50px; margin: 0; font-size: 28px; grid-row: 1 / 4; border-radius: 12px; }
.roster .class-card > b { font-size: 14px; } .roster .class-card .role { font-size: 9px; } .roster .class-card .blurb, .roster .class-card .abs { display: none; } .roster .class-card .team { display: none; }
/* squad page */
#player-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-content: start; overflow: auto; }
#player-list li { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: linear-gradient(180deg, rgba(0,0,0,.25), rgba(0,0,0,.45)); border: 2px solid #3a2410; font-size: 16px; }
#player-list li .ava { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; background: rgba(0,0,0,.4); }
#player-list li .cls { margin: 0; display: block; font-size: 11px; }
#player-list li .rdy { width: 12px; height: 12px; }
#player-list li .who { display: flex; flex-direction: column; }
#player-list li .host { margin-left: 6px; }
/* nicer buttons */
button.big { background: linear-gradient(180deg, #d1622a, #a8451a); border: 2px solid #f0a060; box-shadow: 0 4px 0 #6d2f0e, 0 8px 18px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.25); }
button.big.alt { background: linear-gradient(180deg, #3f7a4c, #25542f); border-color: #7ab07a; box-shadow: 0 4px 0 #1a3a22, 0 8px 18px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.2); }
#ready.on { background: linear-gradient(180deg, #5bd16a, #2f7d3a); }
.wood { box-shadow: inset 0 0 0 2px #8a5a30, inset 0 0 60px rgba(0,0,0,.35), 0 20px 60px rgba(0,0,0,.6); }
@media (max-width: 900px) {
  .lobby-fixed { height: 100vh; height: 100dvh; width: 100vw; border-radius: 0; border-width: 0; padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)); gap: 6px; }
  .lobby-top { grid-template-columns: 1fr; gap: 6px; } .lobby-room { font-size: 16px; } #lobby-right { text-align: center; }
  .lobby-tabs { justify-content: space-between; } .lobby-tabs .tab { flex: 1; justify-content: center; padding: 9px 6px; font-size: 16px; letter-spacing: 1.5px; }
  .lpage[data-page="mode"] .modes { grid-template-columns: 1fr 1fr; grid-auto-rows: minmax(0, 1fr); gap: 6px; }
  .mode { padding: 10px 11px; gap: 6px; border-radius: 14px; } .mode .mh { gap: 8px; } .mode .mi { width: 38px; height: 38px; font-size: 21px; border-radius: 12px; } .mode b { font-size: 17px; } .mode span { font-size: 12.5px; line-height: 1.3; } .mode .players { display: none; }
  .lpage h3.sign { font-size: 18px; letter-spacing: 2px; } .lpage h3.sign small { font-size: 11px; }
  .critter-layout { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .roster { display: none; } .roster.show { display: flex; position: absolute; inset: 60px 10px 70px; background: rgba(20,12,6,.96); border-radius: 12px; padding: 10px; z-index: 5; }
  #showcase { padding: 6px; gap: 5px; } .sc-title b { font-size: 24px; } .sc-title span { font-size: 11px; } #sc-blurb { font-size: 12.5px; line-height: 1.35; min-height: 0; } .sc-ab { padding: 6px 2px; } .sc-ab i { font-size: 20px; } .sc-ab b { font-size: 11.5px; } .sc-ab small { font-size: 10px; } #sc-desc { font-size: 12px; line-height: 1.35; min-height: 0; padding: 5px 8px; } #sc-pick { font-size: 20px; padding: 11px; }
  .lobby-foot { gap: 6px; } .lobby-foot button.big { font-size: 15px; padding: 9px 12px; }
  #player-list { grid-template-columns: 1fr; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .lobby-tabs .tab { padding: 4px 10px; font-size: 12px; } .lobby-fixed { gap: 4px; padding: 6px 10px; }
  .critter-layout { grid-template-columns: minmax(240px, 46%) 1fr; } .roster { display: flex; }
  #showcase .sc-stats, #sc-blurb { display: none; }
}

.roster .class-card.viewing { border-color: #8a5a30; background: rgba(138,90,48,.25); }
.roster .class-card.sel { border-color: var(--yellow); }

/* ================= swamp theme pass ================= */
.lobby-fixed { background: radial-gradient(ellipse at 50% 0%, rgba(122,161,74,.18), transparent 55%), radial-gradient(ellipse at 50% 110%, rgba(31,63,42,.55), transparent 60%), linear-gradient(180deg, #6b4423, #4e2f16); }
.lobby-fixed::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0) 70%, rgba(0,0,0,.25)); }
.lobby-fixed > * { position: relative; z-index: 1; }
.lobby-tabs { background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.3)); border-color: #5a3a1a; box-shadow: inset 0 2px 6px rgba(0,0,0,.5); }
.lobby-tabs .tab { font-size: 18px; letter-spacing: 2px; }
.lobby-tabs .tab i { font-size: 18px; }
.lobby-tabs .tab.on { background: linear-gradient(180deg, #e2b32a, #b5531c); box-shadow: 0 2px 0 #6d2f0e, 0 0 18px rgba(242,195,63,.35); }
.lobby-room { font-size: 22px; }
.lobby-room #room-code { font-size: 22px; background: #1b1008; border: 2px solid #8a5a30; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.pill { background: #1b1008; border: 1px solid #5a3a1a; font-size: 13px; }
.lobby-foot { border-top: 2px solid rgba(122,161,74,.35); }
#player-list li { font-size: 18px; background: linear-gradient(180deg, rgba(20,34,18,.55), rgba(0,0,0,.5)); }
#player-list li .cls { font-size: 13px; letter-spacing: 1px; }
#player-list li .ava { background: radial-gradient(circle at 35% 30%, #4e7a3c, #1e3a22 70%); border: 2px solid #7aa14a; }
#lobby-hint { font-size: 14px; }
.roster .class-card > b { font-size: 17px; line-height: 1.05; overflow-wrap: anywhere; } .roster .class-card .role { font-size: 11px; line-height: 1.25; letter-spacing: .5px; margin-top: 3px; overflow-wrap: anywhere; }
#sc-blurb { font-size: 14px; line-height: 1.4; } #sc-desc { font-size: 13px; line-height: 1.4; }
.sc-ab b { font-size: 13px; } .sc-ab small { font-size: 10px; }
.sc-team { font-family: var(--font-head); font-size: 12px; letter-spacing: 2px; border: 1px solid rgba(255,255,255,.15); }
/* fireflies drifting over the swamp behind the panels */
.fireflies { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fireflies i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #d9ff8a; box-shadow: 0 0 10px 3px rgba(190,255,120,.65); opacity: 0; animation: ff 9s ease-in-out infinite; }
.fireflies i:nth-child(1) { left: 8%; top: 70%; animation-delay: 0s; } .fireflies i:nth-child(2) { left: 18%; top: 30%; animation-delay: 1.3s; animation-duration: 11s; }
.fireflies i:nth-child(3) { left: 30%; top: 85%; animation-delay: 2.6s; } .fireflies i:nth-child(4) { left: 55%; top: 15%; animation-delay: 0.7s; animation-duration: 12s; }
.fireflies i:nth-child(5) { left: 70%; top: 75%; animation-delay: 3.4s; } .fireflies i:nth-child(6) { left: 84%; top: 40%; animation-delay: 1.9s; animation-duration: 10s; }
.fireflies i:nth-child(7) { left: 92%; top: 88%; animation-delay: 4.5s; } .fireflies i:nth-child(8) { left: 42%; top: 55%; animation-delay: 5.2s; animation-duration: 13s; }
@keyframes ff { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: .9; } 50% { opacity: .2; transform: translate(26px, -34px); } 70% { opacity: .8; } 100% { opacity: 0; transform: translate(-18px, -70px); } }
@media (prefers-reduced-motion: reduce) { .fireflies i { animation: none; opacity: .4; } }
@media (max-width: 900px) { .lobby-tabs .tab { font-size: 16px; } .lobby-room { font-size: 18px; } .lobby-room #room-code { font-size: 18px; } #player-list li { font-size: 17px; } }

/* studio splash: client/w7-splash.js brings its own styles */
/* loading overlay: steady, nothing shifts while it is up */
#loading { position: absolute; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; background: rgba(5,8,6,.82); backdrop-filter: blur(4px); transition: opacity .35s; }
#loading.out { opacity: 0; pointer-events: none; }
.ld-box { width: min(86vw, 360px); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 24px; border-radius: 16px; background: linear-gradient(180deg, #4e2f16, #2a1709); border: 3px solid #2a1709; box-shadow: inset 0 0 0 2px #8a5a30, 0 20px 60px rgba(0,0,0,.6); }
.ld-logo { display: block; width: 110px; height: auto; }
.ld-bar { width: 100%; height: 10px; border-radius: 6px; background: rgba(0,0,0,.5); overflow: hidden; border: 1px solid #5a3a1a; }
.ld-bar i { display: block; height: 100%; width: 40%; border-radius: 6px; background: linear-gradient(90deg, #7aa14a, #f2c33f); animation: ldslide 1.1s ease-in-out infinite; }
.ld-bar.done i { width: 100%; animation: none; }
@keyframes ldslide { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
#ld-text { font-family: var(--font-head); font-size: 20px; letter-spacing: 2px; color: #f4e7c3; min-height: 24px; text-align: center; }
#ld-sub { font-size: 12px; color: #b9a67e; min-height: 16px; text-align: center; }
/* panels fade in instead of popping; title waits for fonts so nothing reflows */
#title-screen, #lobby-screen { animation: panelin .45s ease-out both; }
@keyframes panelin { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
body:not(.ui-ready) #title-screen { visibility: hidden; }
#join-status { min-height: 20px; }

/* kit swap row in the showcase */
#sc-kit { display: flex; flex-direction: column; gap: 4px; }
#sc-kit .kit { display: flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: 12px; letter-spacing: 0; padding: 5px 10px; background: rgba(0,0,0,.4); border: 1px dashed #8a5a30; box-shadow: none; color: #f4e7c3; border-radius: 8px; text-align: left; }
#sc-kit .kit em { font-style: normal; font-weight: bold; color: var(--yellow); font-size: 11px; }
#sc-kit .kit i { font-style: normal; color: var(--moss); font-size: 14px; margin-left: auto; }
#sc-kit .kit small { color: #b9a67e; font-size: 11px; }
#sc-kit .kit:active { background: rgba(242,195,63,.25); }
/* in-match upgrade chooser */
#upgrade { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(94vw, 620px); z-index: 9; pointer-events: auto; background: linear-gradient(180deg, rgba(78,47,22,.96), rgba(42,23,9,.96)); border: 3px solid #2a1709; box-shadow: inset 0 0 0 2px #8a5a30, 0 20px 60px rgba(0,0,0,.6); border-radius: 16px; padding: 14px 16px; animation: panelin .3s ease-out both; }
#up-title { font-family: var(--font-head); font-size: 24px; letter-spacing: 2px; color: var(--yellow); text-align: center; text-shadow: 0 2px 0 #2a1709; margin-bottom: 10px; }
#up-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
#up-opts .up { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 12px; background: linear-gradient(180deg, rgba(20,34,18,.6), rgba(0,0,0,.5)); border: 2px solid #3a2410; box-shadow: none; position: relative; font-family: var(--font-body); letter-spacing: 0; }
#up-opts .up:hover, #up-opts .up:active { border-color: var(--yellow); background: linear-gradient(180deg, rgba(242,195,63,.2), rgba(0,0,0,.5)); transform: none; }
#up-opts .up em { position: absolute; top: 6px; left: 8px; font-style: normal; font-size: 11px; color: var(--yellow); font-weight: bold; }
#up-opts .up i { font-style: normal; font-size: 34px; }
#up-opts .up b { font-family: var(--font-head); font-size: 17px; letter-spacing: 1px; color: #fff3cf; }
#up-opts .up span { font-size: 12px; color: #e9d7a8; text-align: center; line-height: 1.3; }
#up-opts .up u { text-decoration: none; font-size: 10px; color: var(--moss); }
.up-hint { text-align: center; font-size: 11px; color: #b9a67e; margin-top: 8px; }
@media (max-width: 600px) { #up-opts { gap: 6px; } #up-opts .up { padding: 8px 4px; } #up-opts .up i { font-size: 26px; } #up-opts .up b { font-size: 13px; } #up-opts .up span { font-size: 10.5px; } #up-title { font-size: 18px; } }

/* title screen polish */
#title-screen { width: min(96vw, 760px); padding: 30px 36px 26px; }
#title-screen .logo { filter: drop-shadow(0 10px 18px rgba(0,0,0,.45)); }
#title-screen .tag { font-size: 20px; margin: 10px 0 8px; color: #f1e3bd; }
#title-screen .credit { margin: 0 0 18px; }
#title-screen label { font-family: var(--font-head); font-size: 14px; letter-spacing: 2px; color: var(--yellow); }
#title-screen input[type=text], #title-screen input:not([type]) { margin-top: 4px; background: linear-gradient(180deg, #140c06, #1f140a); border: 2px solid #8a5a30; box-shadow: inset 0 2px 8px rgba(0,0,0,.6); font-size: 20px; }
#title-screen label.check { font-family: var(--font-body); color: #e9d7a8; letter-spacing: 0; font-size: 15px; }
#title-screen .big { font-size: 28px; padding: 16px 28px; letter-spacing: 2px; }
#title-screen .howto { font-size: 13.5px; background: rgba(0,0,0,.22); border: 1px solid rgba(138,90,48,.5); border-radius: 10px; padding: 10px 14px; margin-top: 16px; }
#title-screen .howto b { color: var(--yellow); font-family: var(--font-head); letter-spacing: 1px; font-weight: normal; font-size: 15px; }
@media (max-width: 600px) { #title-screen { padding: 18px 16px; } #title-screen .big { font-size: 22px; padding: 13px 18px; } #title-screen .howto { display: none; } }

/* quick buttons live inside the lobby header once you're in a room (no more overlapping the tabs or mic pill) */
#lobby-right { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
#lobby-right #quick { position: static; top: auto; right: auto; }
#lobby-right .qbtn { width: 38px; height: 38px; font-size: 17px; border-radius: 10px; }
@media (max-width: 900px) { #lobby-right { justify-content: center; } }
#player-list li .who > span:first-child { overflow-wrap: anywhere; line-height: 1.15; }
.mode .mh b { flex: 1; min-width: 0; }

/* perk strip under the health bar */
#perks { display: flex; gap: 4px; justify-content: center; min-height: 18px; margin-top: 2px; }
#perks .pk { font-size: 14px; background: rgba(0,0,0,.55); border: 1px solid rgba(242,195,63,.45); border-radius: 6px; padding: 0 5px; position: relative; }
#perks .pk i { font-style: normal; font-size: 9px; color: var(--yellow); margin-left: 2px; font-weight: bold; }

/* squad page layout + header that wraps instead of squeezing */
.squad-layout { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 16px; flex: 1; min-height: 0; }
.squad-left { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.squad-left #player-list { flex: 1; min-height: 0; }
.squad-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow: auto; }
.mcard { background: linear-gradient(180deg, rgba(20,34,18,.55), rgba(0,0,0,.5)); border: 2px solid #3a2410; border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.mcard .mh { display: flex; align-items: center; gap: 12px; }
.mcard .mi { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 28px; background: radial-gradient(circle at 35% 30%, #4e7a3c, #1e3a22 70%); border: 2px solid #7aa14a; }
.mcard h4 { margin: 0; font-family: var(--font-head); font-size: 22px; letter-spacing: 1.5px; color: #fff3cf; text-transform: uppercase; line-height: 1; overflow-wrap: anywhere; }
.mcard .players { font-size: 11px; color: var(--yellow); letter-spacing: 1.5px; text-transform: uppercase; font-family: var(--font-head); }
.mcard p { margin: 0; font-size: 14px; line-height: 1.4; color: #f1e3bd; overflow-wrap: break-word; }
.mcard small { font-size: 12px; color: #b9a67e; line-height: 1.35; }
.mcard .mstats { display: flex; flex-wrap: wrap; gap: 6px; }
.mcard .mstats span { font-size: 12px; background: rgba(0,0,0,.4); border-radius: 999px; padding: 3px 10px; color: #e9d7a8; white-space: nowrap; }
.invite-card .invite-row { display: flex; gap: 8px; align-items: center; }
.invite-card code { flex: 1; min-width: 0; font-size: 13px; background: #1b1008; border: 1px solid #5a3a1a; border-radius: 8px; padding: 6px 10px; color: var(--yellow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lobby-room { flex: 1 1 auto; white-space: nowrap; }
.lobby-tabs { order: 0; margin: 0 auto; }
#lobby-right { flex: 1 1 auto; }
.pill { white-space: nowrap; }
@media (max-width: 1100px) { .lobby-tabs { order: 3; flex-basis: 100%; justify-content: center; } }
@media (max-width: 900px) { .lobby-top { display: grid; } .lobby-tabs { order: 0; } .squad-layout { grid-template-columns: 1fr; grid-template-rows: auto auto; overflow: auto; } .squad-side { overflow: visible; } .mcard { padding: 10px 12px; gap: 6px; } .mcard h4 { font-size: 18px; } .mcard p { font-size: 12.5px; } .invite-card p { display: none; } }
button.small { white-space: nowrap; }
#lobby-hint { overflow-wrap: break-word; }

/* loadout in the pause menu, swamp cred, level badges */
#menu-kit { margin: 8px 0 12px; } #menu-kit h3 { margin: 0 0 6px; font-size: 16px; }
#menu-kit-rows { display: flex; flex-direction: column; gap: 6px; }
#menu-kit-rows .kit { display: flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: 14px; letter-spacing: 0; padding: 8px 12px; background: rgba(0,0,0,.4); border: 1px dashed #8a5a30; box-shadow: none; color: #f4e7c3; border-radius: 8px; text-align: left; width: 100%; }
#menu-kit-rows .kit em { font-style: normal; font-weight: bold; color: var(--yellow); } #menu-kit-rows .kit i { font-style: normal; color: var(--moss); margin-left: auto; } #menu-kit-rows .kit small { color: #b9a67e; }
.cred { text-align: center; font-size: 13px; color: #d8c49a; margin: -4px 0 6px; letter-spacing: 1px; } .cred b { font-family: var(--font-head); color: var(--yellow); letter-spacing: 2px; font-weight: normal; }
.go-cred { text-align: center; color: var(--yellow); font-family: var(--font-head); letter-spacing: 1.5px; font-size: 18px; margin: 4px 0; }
#player-list li .lv { font-size: 10px; background: #2f5d3a; color: #fff; padding: 1px 6px; border-radius: 4px; margin-left: 6px; letter-spacing: 1px; font-family: var(--font-head); }

/* ===== showcase: fixed slots so switching critters never shifts the layout ===== */
#showcase { display: flex; flex-direction: column; gap: 8px; }
.sc-head { min-height: 56px; }
.sc-title b { font-size: 30px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sc-title span { display: block; min-height: 14px; }
#sc-blurb { min-height: 3.0em; max-height: 3.0em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14.5px; line-height: 1.45; }
.sc-stats { min-height: 30px; }
#sc-abilities { gap: 8px; }
.sc-ab { min-height: 84px; padding: 8px 6px 6px; align-content: start; }
.sc-ab i { font-size: 26px; line-height: 1; }
.sc-ab b { font-size: 14px; line-height: 1.05; min-height: 2.1em; display: flex; align-items: center; justify-content: center; overflow-wrap: anywhere; letter-spacing: 1px; }
.sc-ab small { min-height: 12px; }
#sc-kit { min-height: 36px; }
#sc-kit .kit { min-height: 34px; font-size: 13px; }
#sc-kit .kit.none { opacity: .55; border-style: dotted; cursor: default; }
#sc-desc { min-height: 3.1em; max-height: 3.1em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 13.5px; line-height: 1.45; }
#sc-pick { min-height: 54px; }
/* face icons */
.swatch img, .ava img, #class-name img.face { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; image-rendering: auto; }
.roster .class-card { grid-template-columns: 60px 1fr; column-gap: 12px; padding: 10px 12px; min-height: 80px; }
.roster .class-card .swatch { width: 60px; height: 60px; font-size: 32px; border-radius: 14px; overflow: hidden; border: 2px solid rgba(255,255,255,.12); box-shadow: inset 0 0 14px rgba(0,0,0,.35); }
.roster .class-card > b { font-size: 18px; line-height: 1.05; }
.roster .class-card .role { font-size: 11.5px; }
.roster .class-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
#player-list li { grid-template-columns: 60px 1fr auto; }
#player-list li .ava { width: 60px; height: 60px; border-radius: 14px; overflow: hidden; font-size: 32px; }
#class-name { display: flex; align-items: center; justify-content: center; gap: 8px; }
#class-name img.face { width: 34px; height: 34px; border-radius: 10px; border: 2px solid rgba(242,195,63,.6); background: rgba(0,0,0,.4); }
@media (max-width: 900px) {
  .sc-title b { font-size: 24px; } #sc-blurb { font-size: 12.5px; min-height: 2.9em; max-height: 2.9em; line-height: 1.4; } .sc-ab { min-height: 70px; padding: 6px 3px 4px; } .sc-ab i { font-size: 21px; } .sc-ab b { font-size: 11.5px; min-height: 2.1em; } #sc-kit { min-height: 30px; } #sc-kit .kit { min-height: 28px; font-size: 11.5px; padding: 3px 8px; } #sc-desc { font-size: 12px; min-height: 2.9em; max-height: 2.9em; } #sc-pick { min-height: 46px; }
  .roster .class-card { grid-template-columns: 50px 1fr; min-height: 66px; padding: 8px 10px; } .roster .class-card .swatch { width: 50px; height: 50px; } .roster .class-card > b { font-size: 15px; }
  #player-list li { grid-template-columns: 52px 1fr auto; } #player-list li .ava { width: 52px; height: 52px; }
}

/* color picker + bigger preview */
#sc-colors { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; }
#sc-colors em { font-style: normal; font-family: var(--font-head); font-size: 12px; letter-spacing: 2px; color: var(--yellow); margin-right: 2px; }
#sc-colors .sw { width: 24px; height: 24px; border-radius: 50%; padding: 0; border: 2px solid rgba(255,255,255,.25); box-shadow: 0 2px 0 rgba(0,0,0,.5); }
#sc-colors .sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--yellow), 0 2px 0 rgba(0,0,0,.5); transform: scale(1.12); }
.critter-layout { grid-template-columns: minmax(340px, 500px) 1fr; }
@media (max-width: 900px) { #sc-colors { min-height: 26px; } #sc-colors .sw { width: 21px; height: 21px; } }

/* preview gets the room: tighter fixed slots, a floor for the canvas, and compact mode on short screens */
#sc-canvas { min-height: 150px; }
.sc-head { min-height: 50px; }
.sc-ab { min-height: 72px; padding: 6px 5px 5px; }
.sc-ab i { font-size: 24px; }
#sc-kit { min-height: 32px; } #sc-kit .kit { min-height: 30px; padding: 4px 10px; }
#sc-colors { min-height: 28px; }
#sc-desc { min-height: 2.9em; max-height: 2.9em; font-size: 13px; line-height: 1.4; }
#sc-pick { min-height: 48px; padding: 10px 20px; }
#showcase { gap: 6px; }
@media (max-height: 760px) and (min-width: 901px) { #sc-blurb { display: none; } .sc-stats { display: none; } .sc-ab { min-height: 62px; } .sc-ab i { font-size: 20px; } .sc-ab b { font-size: 12px; } #sc-desc { min-height: 2.8em; max-height: 2.8em; font-size: 12px; } }

/* title menu row + credits */
.menu-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.mbtn { font-family: var(--font-head); font-size: 15px; letter-spacing: 1.5px; padding: 8px 14px; background: linear-gradient(180deg, rgba(47,93,58,.9), rgba(31,63,42,.9)); border: 2px solid #7ab07a; box-shadow: 0 3px 0 #1a3a22; border-radius: 10px; }
.credits p { text-align: center; margin: 6px 0; }
.credits .cr-big { font-size: 20px; color: #f1e3bd; } .credits .cr-big b { color: var(--yellow); font-family: var(--font-head); letter-spacing: 2px; font-weight: normal; font-size: 24px; }
.credits .big { width: 100%; margin-top: 14px; }
@media (max-width: 600px) { .mbtn { font-size: 13px; padding: 7px 10px; } }

/* keybinds, tutorial, rematch */
.keybinds h3 { font-size: 15px; margin: 12px 0 6px; } .keybinds h3 small { font-family: var(--font-body); font-size: 11px; letter-spacing: 0; text-transform: none; color: #b9a67e; } .keybinds h3 a { color: var(--yellow); }
#keys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kb { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--font-body); letter-spacing: 0; font-size: 13px; padding: 6px 10px; background: rgba(0,0,0,.35); border: 1px solid #5a3a1a; box-shadow: none; color: #f4e7c3; border-radius: 8px; text-align: left; }
.kb kbd { font-size: 12px; min-width: 34px; text-align: center; } .kb.wait kbd { background: var(--yellow); color: #1b120a; }
.mbtn.school.glow { animation: schoolglow 1.6s ease-in-out infinite; border-color: var(--yellow); }
@keyframes schoolglow { 0%, 100% { box-shadow: 0 3px 0 #1a3a22, 0 0 0 rgba(242,195,63,0); } 50% { box-shadow: 0 3px 0 #1a3a22, 0 0 18px rgba(242,195,63,.6); } }
#tut { position: absolute; left: 50%; top: 86px; transform: translateX(-50%); width: min(92vw, 520px); pointer-events: none; z-index: 6; }
.tut-step { background: linear-gradient(180deg, rgba(78,47,22,.95), rgba(42,23,9,.95)); border: 2px solid #8a5a30; border-radius: 14px; padding: 10px 14px; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.tut-step em { font-style: normal; font-family: var(--font-head); font-size: 14px; color: var(--yellow); grid-row: 1 / 3; letter-spacing: 1px; border-right: 1px solid rgba(255,255,255,.15); padding-right: 12px; }
.tut-step b { font-family: var(--font-head); font-size: 20px; letter-spacing: 2px; color: #fff3cf; } .tut-step span { font-size: 14px; color: #f1e3bd; line-height: 1.3; }
.tut-bar { height: 6px; background: rgba(0,0,0,.5); border-radius: 3px; margin-top: 6px; overflow: hidden; } .tut-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7aa14a, #f2c33f); transition: width .4s; }
.go-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 600px) { #keys-grid { grid-template-columns: 1fr; } #tut { top: 70px; } .tut-step b { font-size: 16px; } .tut-step span { font-size: 12.5px; } }

/* ===== settings v2: tabs, profile, sliders ===== */
.settings-panel { width: min(96vw, 680px); padding: 20px 24px 22px; display: flex; flex-direction: column; gap: 12px; max-height: 94vh; }
.settings-head { display: flex; flex-direction: column; gap: 10px; } .settings-head h2 { margin: 0; }
.stabs { display: flex; gap: 6px; background: rgba(0,0,0,.4); padding: 4px; border-radius: 14px; border: 2px solid #3a2410; overflow-x: auto; scrollbar-width: none; }
.stabs::-webkit-scrollbar { display: none; }
.stab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; box-shadow: none; border-radius: 10px; padding: 8px 10px; font-size: 14px; color: #d8c49a; white-space: nowrap; }
.stab i { font-style: normal; font-size: 15px; }
.stab.on { background: linear-gradient(180deg, #e2b32a, #b5531c); color: #fff; box-shadow: 0 2px 0 #6d2f0e, 0 0 14px rgba(242,195,63,.3); }
.settings { overflow: auto; min-height: 0; flex: 1; padding-right: 4px; }
.spage { display: none; flex-direction: column; gap: 8px; } .spage.on { display: flex; }
.spage > label { display: grid; grid-template-columns: 1fr auto; row-gap: 4px; background: rgba(0,0,0,.25); border: 1px solid rgba(138,90,48,.5); border-radius: 10px; padding: 8px 12px; }
.spage > label .val { font-family: var(--font-head); color: var(--yellow); letter-spacing: 1px; font-size: 14px; }
.spage > label input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--yellow); height: 22px; }
.spage > label select { grid-column: 1 / -1; }
.spage > label.check { display: flex; margin: 0; }
.spage h3 { margin: 10px 0 4px; }
.profile-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; background: linear-gradient(180deg, rgba(20,34,18,.55), rgba(0,0,0,.5)); border: 2px solid #3a2410; border-radius: 16px; padding: 14px; }
.pf-face { width: 96px; height: 96px; border-radius: 18px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 48px; background: radial-gradient(circle at 35% 30%, #4e7a3c, #1e3a22 70%); border: 2px solid #7aa14a; }
.pf-face img { width: 100%; height: 100%; object-fit: cover; }
.pf-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-main input { font-size: 18px; padding: 8px 10px; }
.pf-level b { font-family: var(--font-head); color: var(--yellow); letter-spacing: 2px; font-size: 18px; font-weight: normal; } .pf-level span { color: #b9a67e; font-size: 12px; }
.pf-bar { height: 10px; background: rgba(0,0,0,.5); border-radius: 5px; overflow: hidden; border: 1px solid #5a3a1a; } .pf-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7aa14a, #f2c33f); transition: width .4s; }
.pf-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pf-stat { background: rgba(0,0,0,.3); border: 1px solid rgba(138,90,48,.5); border-radius: 10px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pf-stat i { font-style: normal; font-size: 18px; } .pf-stat b { font-family: var(--font-head); font-size: 17px; letter-spacing: 1px; color: #fff3cf; overflow-wrap: anywhere; text-align: center; } .pf-stat span { font-size: 10px; color: #b9a67e; text-transform: uppercase; letter-spacing: 1px; }
.pf-ach { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ach { background: rgba(0,0,0,.3); border: 1px solid rgba(138,90,48,.4); border-radius: 10px; padding: 7px 10px; opacity: .45; display: flex; flex-direction: column; gap: 2px; }
.ach.on { opacity: 1; border-color: var(--yellow); background: linear-gradient(180deg, rgba(242,195,63,.14), rgba(0,0,0,.35)); }
.ach b { font-family: var(--font-head); letter-spacing: 1px; font-size: 14px; color: #fff3cf; } .ach span { font-size: 11.5px; color: #d8c49a; }
.pf-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
@media (max-width: 600px) { .settings-panel { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border-width: 0; padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); } .stab { font-size: 12px; padding: 7px 8px; } .stab i { font-size: 14px; } .pf-stats { grid-template-columns: repeat(3, 1fr); } .pf-ach { grid-template-columns: 1fr; } .profile-card { grid-template-columns: 72px 1fr; } .pf-face { width: 72px; height: 72px; } }

/* faction tabs + sort above the critter picker */
.critter-layout { grid-template-rows: auto 1fr; }
#faction-bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ftabs { display: flex; gap: 6px; background: rgba(0,0,0,.4); padding: 4px; border-radius: 14px; border: 2px solid #3a2410; flex: 1; }
.ftab { flex: 1; background: transparent; box-shadow: none; border-radius: 10px; padding: 8px 10px; font-size: 15px; letter-spacing: 1.5px; color: #d8c49a; white-space: nowrap; }
.ftab.on { background: linear-gradient(180deg, #e2b32a, #b5531c); color: #fff; box-shadow: 0 2px 0 #6d2f0e, 0 0 14px rgba(242,195,63,.3); }
#faction-bar.single .ftabs { display: none; }
#faction-bar .sort { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 0; }
#faction-bar .sort select { padding: 5px 8px; font-size: 13px; }
.roster-head h3 small { font-family: var(--font-body); font-size: 12px; color: #b9a67e; letter-spacing: 0; text-transform: none; }
@media (max-width: 900px) { .critter-layout { grid-template-rows: auto 1fr auto; } .ftab { font-size: 13px; padding: 7px 6px; letter-spacing: 1px; } #faction-bar .sort { font-size: 11px; } #faction-bar .sort select { font-size: 12px; padding: 4px 6px; } }
/* phone: everything in the picker stays on one screen */
@media (max-width: 900px) {
  #faction-bar { flex-wrap: nowrap; gap: 6px; }
  #faction-bar .sort { flex: 0 0 auto; } #faction-bar .sort > span, #faction-bar .sort { font-size: 0; } #faction-bar .sort select { font-size: 12px; padding: 4px 4px; max-width: 96px; }
  #sc-colors { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-height: 24px; gap: 5px; } #sc-colors::-webkit-scrollbar { display: none; }
  #sc-colors .sw { width: 19px; height: 19px; flex: 0 0 auto; } #sc-colors em { font-size: 10px; flex: 0 0 auto; }
  #sc-canvas { min-height: 110px; }
  #sc-blurb { min-height: 2.6em; max-height: 2.6em; font-size: 12px; line-height: 1.3; }
  .sc-ab { min-height: 62px; } #sc-desc { min-height: 2.6em; max-height: 2.6em; font-size: 11.5px; line-height: 1.3; }
  #sc-kit { min-height: 28px; } #sc-kit .kit { min-height: 26px; font-size: 11px; }
  #sc-pick { min-height: 42px; font-size: 18px; padding: 9px; }
  #showcase { gap: 4px; }
}

/* button padding pass: every button has room to breathe and a consistent height */
button { padding: 11px 20px; line-height: 1.1; }
button.big { padding: 15px 30px; }
button.small { padding: 6px 12px; }
.mbtn { padding: 10px 18px; }
.lobby-tabs .tab { padding: 10px 20px; }
.ftab { padding: 9px 12px; }
.stab { padding: 9px 12px; }
.sc-arrow { width: 44px; height: 44px; padding: 0; }
.sc-ab { padding: 8px 6px 7px; }
#sc-kit .kit { padding: 7px 12px; }
#sc-colors .sw { padding: 0; }
.qbtn { padding: 0; }
.kb { padding: 8px 12px; }
#up-opts .up { padding: 14px 10px; }
#player-list li { padding: 12px 14px; }
.go-btns .big { min-width: 180px; }
#keys-reset { padding: 0; }
.dbtn { padding: 10px 8px; }
.tbtn { padding: 0; }
@media (max-width: 900px) { button { padding: 10px 16px; } button.big { padding: 12px 20px; } .lobby-tabs .tab { padding: 9px 8px; } .mbtn { padding: 9px 12px; } .sc-ab { padding: 6px 4px 5px; } #sc-kit .kit { padding: 5px 10px; } .lobby-foot button.big { padding: 10px 14px; } }

/* ===== settings v3: one fixed size, no scrolling, nothing shifts between tabs ===== */
#settings .settings-panel { width: min(96vw, 880px); height: min(92vh, 600px); max-height: none; overflow: hidden; padding: 18px 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.settings-head { display: flex; flex-direction: row; align-items: center; gap: 16px; flex: 0 0 auto; }
.settings-head h2 { margin: 0; font-size: 28px; flex: 0 0 auto; }
.stabs { flex: 1; overflow: hidden; }
.stab { min-width: 0; padding: 9px 8px; }
.stab:active, .stab:hover { transform: none; filter: none; }
.stab span { white-space: nowrap; }
#settings .settings { flex: 1 1 auto; min-height: 0; overflow: hidden; margin: 0; padding: 0; display: block; }
.spage { height: 100%; gap: 8px; align-content: start; }
.spage.on { display: flex; }
.spage.two.on { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.spage.grid2.on { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.spage .col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.spage label { font-size: 13px; }
.spage label .val { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.spage label.check { padding: 10px 12px; background: rgba(0,0,0,.25); border: 1px solid rgba(138,90,48,.5); border-radius: 10px; font-size: 14px; line-height: 1.3; }
.spage label.check input { flex: 0 0 auto; width: 18px; height: 18px; accent-color: var(--yellow); }
.spage .note { margin: 2px 0 0; font-size: 12px; line-height: 1.4; color: #b9a67e; }
.spage h3 { margin: 0 0 2px; font-size: 16px; }
#settings-close { flex: 0 0 auto; margin: 0; }
body:not(.touch) .touch-only, body.touch .desk-only { display: none !important; }
/* profile */
.profile-card { grid-template-columns: 84px 1fr; padding: 12px; gap: 12px; }
.pf-face { width: 84px; height: 84px; font-size: 42px; }
.pf-namel { display: flex; flex-direction: column; gap: 3px; font-size: 11px; background: none; border: 0; padding: 0; }
.pf-main input { font-size: 16px; padding: 6px 10px; }
.pf-next { font-size: 11px; color: #b9a67e; min-height: 14px; }
.pf-stats { grid-template-columns: repeat(3, 1fr); }
.pf-stat { padding: 7px 4px; min-height: 58px; justify-content: center; }
.pf-stat b { font-size: 16px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-actions { justify-content: flex-start; margin: 0; }
.pf-ach { grid-template-columns: 1fr 1fr; gap: 6px; }
.ach { display: grid; grid-template-columns: 20px 1fr; column-gap: 6px; align-items: center; padding: 6px 8px; min-height: 40px; }
.ach i { font-style: normal; font-size: 14px; grid-row: 1 / 3; text-align: center; }
.ach b { font-size: 12.5px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ach span { font-size: 10.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* keys */
.keybinds h3 { margin: 0 0 6px; }
#keys-grid { grid-template-columns: 1fr 1fr; gap: 5px; }
.kb { padding: 5px 10px; min-height: 30px; font-size: 12.5px; }
.kb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* narrow screens: full screen sheet, tabs as icon-over-label, columns stack */
@media (max-width: 700px) {
  #settings .settings-panel { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border-width: 0; padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); gap: 10px; }
  .settings-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .settings-head h2 { font-size: 22px; text-align: center; }
  .stab { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 10.5px; letter-spacing: 1px; }
  .stab i { font-size: 18px; }
  .spage.two.on, .spage.grid2.on { grid-template-columns: 1fr; gap: 10px; }
  .profile-card { grid-template-columns: 68px 1fr; } .pf-face { width: 68px; height: 68px; }
  .pf-stat { min-height: 50px; } .pf-stat i { font-size: 15px; } .pf-stat b { font-size: 14px; }
  .ach { min-height: 34px; padding: 5px 7px; } .ach b { font-size: 11.5px; } .ach span { font-size: 9.5px; }
}
/* short screens (phones sideways, small laptop windows): one row header, 3-wide achievements, no descriptions */
@media (max-height: 520px) {
  #settings .settings-panel { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; border-width: 0; padding: 8px 14px; gap: 8px; }
  .settings-head { flex-direction: row; align-items: center; } .settings-head h2 { font-size: 20px; }
  .stab { flex-direction: row; padding: 5px 6px; font-size: 11px; } .stab i { font-size: 14px; }
  .spage.two.on { grid-template-columns: 1fr 1fr; } .spage.grid2.on { grid-template-columns: 1fr 1fr; }
  .profile-card { grid-template-columns: 56px 1fr; padding: 8px; } .pf-face { width: 56px; height: 56px; font-size: 30px; }
  .pf-stat { min-height: 42px; padding: 4px; } .pf-stat span { font-size: 9px; }
  .pf-ach { grid-template-columns: 1fr 1fr 1fr; gap: 4px; } .ach { min-height: 28px; grid-template-columns: 16px 1fr; } .ach span { display: none; } .ach i { grid-row: auto; font-size: 12px; }
  .spage label { padding: 6px 10px; } .spage label.check { padding: 7px 10px; font-size: 12.5px; } .spage .note { display: none; }
  #settings-close { padding: 8px 14px; font-size: 18px; }
}
/* settings v3: override the legacy .settings label rules for labels nested in columns */
#settings .spage label { display: grid; grid-template-columns: 1fr auto; row-gap: 4px; align-items: center; justify-content: stretch; gap: 4px 10px; background: rgba(0,0,0,.25); border: 1px solid rgba(138,90,48,.5); border-radius: 10px; padding: 8px 12px; margin: 0; text-transform: uppercase; letter-spacing: 1px; color: #d8c49a; }
#settings .spage label input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--yellow); height: 22px; margin: 0; }
#settings .spage label select { grid-column: 1 / -1; width: 100%; }
#settings .spage label.check { display: flex; justify-content: flex-start; align-items: center; gap: 10px; text-transform: none; letter-spacing: 0; color: #f1e3bd; }
#settings .spage label.pf-namel { display: flex; flex-direction: column; gap: 3px; background: none; border: 0; padding: 0; font-size: 11px; }
#settings .spage label.pf-namel input { width: 100%; }
@media (max-width: 700px) {
  #settings .spage.two.on { gap: 8px; } #settings .spage .col { gap: 6px; }
  #settings .pf-ach { gap: 4px; } #settings .ach { min-height: 30px; padding: 4px 7px; }
  #settings .pf-stat { min-height: 44px; padding: 4px; } #settings .pf-stats { gap: 4px; }
  #settings .profile-card { padding: 8px 10px; }
  #settings .pf-actions .small { padding: 4px 10px; font-size: 11px; }
}
#settings .spage label.pf-namel { text-align: left; align-items: stretch; }
@media (max-height: 520px) {
  #settings .pf-stats { grid-template-columns: repeat(6, 1fr); gap: 4px; }
  #settings .pf-stat { min-height: 40px; padding: 3px 2px; } #settings .pf-stat i { font-size: 13px; } #settings .pf-stat b { font-size: 13px; } #settings .pf-stat span { font-size: 8px; letter-spacing: .5px; }
  #settings .pf-next { display: none; } #settings .pf-main { gap: 4px; } #settings .pf-main input { padding: 4px 8px; font-size: 14px; }
  #settings .spage .col { gap: 6px; }
}

/* Steam invite */
.steam-btn { width: 100%; margin-top: 8px; font-size: 15px; letter-spacing: 1.5px; background: linear-gradient(180deg, #2a475e, #171a21); border: 2px solid #66c0f4; box-shadow: 0 3px 0 #0e1116, 0 0 14px rgba(102,192,244,.25); color: #e6f4ff; }
.steam-btn:hover { filter: brightness(1.15); }

/* controller focus ring + hint bar */
.pad-focus { outline: 3px solid var(--yellow) !important; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(242,195,63,.25), 0 0 22px rgba(242,195,63,.45) !important; position: relative; z-index: 2; }
input.pad-focus, select.pad-focus { outline-offset: 1px; }
body.pad-ui { cursor: none; }
#pad-hint { position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; display: flex; gap: 14px; padding: 7px 14px; border-radius: 999px; background: rgba(10,8,4,.82); border: 1px solid rgba(242,195,63,.4); font-size: 12px; color: #f1e3bd; pointer-events: none; white-space: nowrap; }
#pad-hint b { display: inline-block; min-width: 20px; padding: 1px 6px; margin-right: 4px; border-radius: 6px; background: #2a1709; border: 1px solid #8a5a30; color: var(--yellow); font-family: var(--font-head); letter-spacing: 1px; text-align: center; font-weight: normal; }
#pad-hint b + b { margin-left: -2px; }
#upgrade .up.pad-focus { border-color: var(--yellow); }
body.hide-fps #ping-ind { display: none; }
@media (max-height: 520px) {
  #settings #keys-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  #settings .kb { min-height: 24px; padding: 2px 7px; font-size: 11px; } #settings .kb kbd { font-size: 10px; min-width: 26px; }
  #settings .keybinds h3 { margin-bottom: 3px; font-size: 13px; }
  #settings .spage.on { gap: 5px; } #settings .spage label.check { padding: 5px 10px; }
}

/* title screen: clean mic line, fields that never truncate, balanced wrapping, no joystick behind the menu */
body.touch:not(.in-game) #touch { display: none !important; }
#title-screen .tag, #title-screen .credit, #title-screen .cred { text-wrap: balance; }
#title-screen label.check.mic-line { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; padding: 10px 12px; background: rgba(0,0,0,.25); border: 1px solid rgba(138,90,48,.5); border-radius: 10px; cursor: pointer; }
#title-screen .mic-line input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--yellow); }
#title-screen .mic-line span { flex: 1; min-width: 0; line-height: 1.35; font-size: 15px; color: #f1e3bd; }
#title-screen .mic-line small { color: #b9a67e; font-size: 13px; white-space: nowrap; }
#title-screen .title-fields { gap: 12px; }
#title-screen .title-fields label { min-width: 0; }
#title-screen .title-fields label:first-child { flex: 1.6; }
#title-screen .title-fields input { text-overflow: ellipsis; }
input[type=checkbox] { accent-color: var(--yellow); }
@media (max-width: 520px) {
  #title-screen { padding: 18px 16px 16px; }
  #title-screen .tag { font-size: 16px; margin: 6px 0 4px; }
  #title-screen .title-fields { flex-direction: column; gap: 8px; margin-bottom: 4px; }
  #title-screen .title-fields input { font-size: 17px; padding: 9px 12px; }
  #title-screen .mic-line span { font-size: 14px; } #title-screen .mic-line small { font-size: 12px; }
  #title-screen .big { font-size: 22px; padding: 13px 18px; margin-top: 8px; }
  #title-screen .menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
  #title-screen .menu-row .mbtn { width: 100%; padding: 9px 6px; font-size: 13px; }
  #title-screen .credit { margin-bottom: 12px; font-size: 12px; }
}
/* the HOW TO PLAY button covers this; no scrolling on laptop-height screens */
@media (max-height: 860px) { #title-screen .howto { display: none; } #title-screen .logo { font-size: clamp(48px, 8vw, 88px); } #title-screen { padding-top: 22px; padding-bottom: 20px; } }
/* ===== lobby consistency pass ===== */
/* grid/flex children may shrink below their content: long invite links and names never widen the page */
.squad-layout > *, .squad-left, .squad-side, .critter-layout > *, #player-list li, #player-list li .who, .mcard { min-width: 0; }
.squad-layout { overflow-x: hidden; }
.invite-card code { display: block; }
/* one card style for squad, match and invite: same radius, padding and border */
#player-list li, .mcard { border-radius: 14px; padding: 12px 14px; border: 2px solid #3a2410; background: linear-gradient(180deg, rgba(20,34,18,.55), rgba(0,0,0,.5)); }
#player-list { gap: 8px; }
#player-list li { min-height: 72px; }
#player-list li .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
/* tab checkmarks: a small badge in the corner instead of text that wraps under the icon */
.lobby-tabs .tab { position: relative; }
.lobby-tabs .tab.done i::after { content: none; }
.lobby-tabs .tab.done::after { content: '✓'; position: absolute; top: 3px; right: 6px; font-size: 11px; line-height: 1; color: #9fe07a; font-family: var(--font-body); font-weight: bold; }
.lobby-tabs .tab i { white-space: nowrap; }
.sc-team { white-space: nowrap; }
@media (max-width: 900px) {
  /* phones: the roster list is hidden, so sorting does nothing; the faction tabs say the team, so the badge goes */
  #faction-bar .sort { display: none; }
  #faction-bar.single { display: none; }
  .sc-head { grid-template-columns: 44px 1fr 44px; }
  .sc-team { display: none; }
  /* squad page stacks: the list takes only the room it needs */
  .squad-left #player-list { flex: 0 0 auto; overflow: visible; }
  .squad-layout { gap: 10px; align-content: start; }
  #player-list li { min-height: 62px; padding: 9px 12px; }
  #player-list li .ava { width: 46px; height: 46px; }
  #player-list li { grid-template-columns: 46px 1fr auto; }
  .mcard { padding: 10px 12px; }
  .lobby-tabs .tab { flex-direction: row; gap: 6px; }
  .lobby-tabs .tab i { font-size: 16px; }
}
/* phones: room code + sound/settings/mic share one row, tabs below */
@media (max-width: 900px) {
  .lobby-top { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 8px; }
  .lobby-top .lobby-room { grid-column: 1; grid-row: 1; white-space: nowrap; }
  .lobby-top #lobby-right { grid-column: 2; grid-row: 1; justify-content: flex-end; gap: 6px; }
  .lobby-top .lobby-tabs { grid-column: 1 / -1; grid-row: 2; }
  #lobby-right .qbtn { width: 34px; height: 34px; font-size: 15px; }
  #lobby-right .pill { font-size: 11px; padding: 4px 9px; }
}
/* short phones: drop the blurb and stat bars before the preview gets squeezed */
@media (max-width: 900px) and (max-height: 740px) {
  #sc-blurb, #showcase .sc-stats { display: none; }
  #sc-canvas { min-height: 96px; }
  .sc-ab { min-height: 58px; } .sc-ab i { font-size: 19px; }
  #sc-desc { min-height: 2.6em; max-height: 2.6em; }
  .lobby-fixed { gap: 5px; }
}
/* laptop heights: same compaction as short phones so PICK never slides under the footer */
@media (min-width: 901px) and (max-height: 860px) {
  #sc-blurb { display: none; }
  #showcase .sc-stats { display: none; }
  #sc-canvas { min-height: 120px; }
  .sc-ab { min-height: 60px; padding: 5px 4px; } .sc-ab i { font-size: 20px; } .sc-ab b { font-size: 12px; min-height: 1.1em; }
  #sc-desc { min-height: 2.6em; max-height: 2.6em; font-size: 12px; }
  #sc-pick { min-height: 44px; padding: 8px 18px; font-size: 20px; }
  .lobby-fixed { gap: 8px; padding-top: 12px; padding-bottom: 12px; }
}
/* the swap row is a fixed height; tall emoji can't nudge the layout by a pixel */
#sc-kit { height: 34px; min-height: 0; overflow: hidden; }
#sc-kit .kit { height: 34px; min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; }
#sc-kit .kit i, #sc-kit .kit em { line-height: 1; }
@media (max-width: 900px) { #sc-kit, #sc-kit .kit { height: 28px; } }
@media (min-width: 901px) and (max-height: 860px) { #sc-kit, #sc-kit .kit { height: 30px; } }

/* picking a critter mid-match: only the picker, and a clear way back */
#back-to-game { display: none; }
body.mid-match #back-to-game { display: inline-block; margin-left: auto; }
body.mid-match #next-page, body.mid-match #ready, body.mid-match #start, body.mid-match #reroll { display: none !important; }
body.mid-match .lobby-tabs .tab[data-page="mode"], body.mid-match .lobby-tabs .tab[data-page="squad"] { display: none; }
