/* Bomberman — fliperama à noite: roxo profundo, neon quente, bonecos coloridos.
   Fontes servidas pelo próprio site (sem CDN), nenhum estilo inline (CSP). */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/barlow-condensed-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/inter-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url(../fonts/inter-latin-800-normal.woff2) format("woff2"); }

:root {
  --bg: #0d0a1c;
  --bg2: #151030;
  --surface: rgba(220, 210, 255, .06);
  --surface2: rgba(220, 210, 255, .11);
  --line: rgba(190, 170, 255, .16);
  --line2: rgba(190, 170, 255, .3);
  --text: #f4f1ff;
  --muted: #b2a9d6;
  --gold: #ffc93c;
  --gold2: #ffe08a;
  --brass: linear-gradient(180deg, #ffe57a 0%, #ffb52e 50%, #ff7a1a 100%);
  --danger: #ff8a7a;
  --good: #6ee7a0;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(0, 0, 0, .5);
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --p0: #ff5a5a; --p1: #3d8bff; --p2: #2fd07a; --p3: #ffb52e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font); color: var(--text); line-height: 1.45; font-size: 15px;
  background:
    radial-gradient(900px 520px at 15% -120px, rgba(255, 90, 160, .20) 0%, transparent 65%),
    radial-gradient(900px 600px at 90% 10%, rgba(80, 120, 255, .18) 0%, transparent 60%),
    radial-gradient(1400px 900px at 50% 120%, #2a1460 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  display: flex; flex-direction: column;
}
a { color: var(--gold); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- topo ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid var(--line); background: rgba(13, 10, 28, .82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .5px; text-transform: uppercase; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%; flex: none; position: relative; margin-top: 4px;
  background: radial-gradient(circle at 34% 30%, #7a7fa0 0%, #23263c 50%, #07080f 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .6);
}
.brand-mark::before { content: ""; position: absolute; right: 1px; top: -5px; width: 9px; height: 7px; border-radius: 2px; background: #3a3e5a; transform: rotate(35deg); }
.brand-mark::after { content: ""; position: absolute; right: -4px; top: -9px; width: 7px; height: 7px; border-radius: 50%; background: #fff3a0; box-shadow: 0 0 8px 3px #ffb020; }
.topbar-right { display: inline-flex; align-items: center; gap: 10px; }
.toplink { color: var(--text); text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.toplink:hover { background: var(--surface2); }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; }
.iconbtn:hover { background: var(--surface2); }
.i-sound { width: 20px; height: 20px; display: block; background: currentColor; color: var(--text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm12.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm12.5 3a4.5 4.5 0 0 0-2.5-4v8a4.5 4.5 0 0 0 2.5-4zM14 3.2v2.1a7 7 0 0 1 0 13.4v2.1a9 9 0 0 0 0-17.6z'/%3E%3C/svg%3E") center/contain no-repeat; }
.iconbtn.muted .i-sound {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm12.6 3 2.7-2.7-1.4-1.4-2.7 2.7-2.7-2.7-1.4 1.4 2.7 2.7-2.7 2.7 1.4 1.4 2.7-2.7 2.7 2.7 1.4-1.4z'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9H4zm12.6 3 2.7-2.7-1.4-1.4-2.7 2.7-2.7-2.7-1.4 1.4 2.7 2.7-2.7 2.7 1.4 1.4 2.7-2.7 2.7 2.7 1.4-1.4z'/%3E%3C/svg%3E");
  opacity: .6;
}

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--surface2); color: var(--text); font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  border: 0; color: #2a1200; background: var(--brass);
  box-shadow: 0 8px 22px rgba(255, 140, 40, .35), inset 0 1px 0 rgba(255, 255, 255, .55);
  font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: .6px; text-transform: uppercase;
}
.btn-felt {
  border: 1px solid rgba(160, 140, 255, .45); color: #f3f0ff;
  background: linear-gradient(180deg, #6b4dff, #4a2fd0);
  box-shadow: 0 8px 20px rgba(80, 50, 220, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-gold { border: 1px solid rgba(233, 196, 106, .55); background: rgba(233, 196, 106, .14); color: var(--gold2); }
.btn-ghost { background: transparent; }
.btn-round { width: 48px; height: 48px; padding: 0; border-radius: 50%; font-size: 26px; line-height: 1; user-select: none; -webkit-user-select: none; touch-action: none; }
.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; padding: 2px 6px; text-decoration: underline; text-underline-offset: 2px; }
.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2);
  background: rgba(0, 0, 0, .35); color: var(--text); font-size: 16px;
}
.input[readonly] { color: var(--gold2); font-weight: 700; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.hint { margin: 6px 2px 0; font-size: 13px; color: var(--muted); }
.hint.warn { color: var(--danger); }

/* ---------- avisos ---------- */
.messages { position: absolute; left: 50%; top: 12%; transform: translateX(-50%); z-index: 15; width: min(520px, calc(100% - 24px)); pointer-events: none; }
.alert {
  padding: 12px 16px; border-radius: 14px; background: rgba(18, 12, 38, .94); border: 1px solid var(--line2);
  box-shadow: var(--shadow); font-weight: 600; text-align: center; animation: drop .25s ease;
}
.alert.good { border-color: rgba(110, 231, 160, .5); color: #d8ffe7; }
.alert.bad { border-color: rgba(255, 138, 122, .55); color: #ffe0da; }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.notice { max-width: 760px; margin: 0 auto 14px; padding: 12px 16px; border-radius: 12px; background: rgba(255, 138, 122, .12); border: 1px solid rgba(255, 138, 122, .4); }

/* =================== PARTIDA =================== */
.game { width: 100%; max-width: 1100px; margin: 0 auto; padding: 12px max(14px, env(safe-area-inset-left)) 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.players { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.players.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.players.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pcard {
  --pc: var(--p0);
  position: relative; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 8px 12px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, rgba(220, 210, 255, .08), rgba(220, 210, 255, .03));
  border: 1px solid var(--line); border-left: 4px solid var(--pc); transition: opacity .2s, filter .2s;
}
.pcard.c1 { --pc: var(--p1); } .pcard.c2 { --pc: var(--p2); } .pcard.c3 { --pc: var(--p3); }
.pcard.me { background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 22%, transparent), rgba(220, 210, 255, .03)); }
.pcard.dead { filter: grayscale(.85); opacity: .55; }
.pcard.out, .pcard.offline { opacity: .45; }
.pcard.winner { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(255, 201, 60, .35); }
.avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden; display: grid; place-items: center;
  background: var(--pc); border: 2px solid rgba(255, 255, 255, .5); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar .initial { font-family: var(--display); font-size: 19px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.pinfo { display: grid; min-width: 0; flex: 1; gap: 2px; }
.pname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 14.5px; }
.pstats { display: flex; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.st { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--text); }
.st::before { content: ""; width: 12px; height: 12px; display: inline-block; border-radius: 3px; background: currentColor; }
.st-b::before { background: radial-gradient(circle at 40% 40%, #8a8fb0, #1a1c2c 70%); border-radius: 50%; }
.st-f::before { background: linear-gradient(180deg, #ffd23a, #ff5a1a); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.st-s::before { background: linear-gradient(180deg, #6ef0a6, #17a85a); clip-path: polygon(55% 0, 15% 55%, 45% 55%, 35% 100%, 85% 40%, 55% 40%); border-radius: 0; }
.pwins { display: flex; gap: 4px; align-items: center; }
.pwins i { width: 14px; height: 14px; display: block; background: rgba(255, 255, 255, .15); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.pwins i.on { background: var(--gold); filter: drop-shadow(0 0 4px rgba(255, 201, 60, .8)); }
.pwins b { font: 800 13px var(--display); color: var(--gold2); }

.inforow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 26px; }
.status { margin: 0; font-weight: 600; color: var(--muted); font-size: 14px; }
.clock { margin: 0; font: 800 22px/1 var(--display); letter-spacing: 1px; font-variant-numeric: tabular-nums; color: var(--text); padding: 4px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.clock:empty { display: none; }
.clock.warn { color: var(--gold2); }
.clock.closing { color: #fff; background: #d6283c; border-color: #ff6b6b; animation: blink 1s steps(1) infinite; font-size: 18px; }
@keyframes blink { 50% { background: #8a1424; } }

.stage { position: relative; width: 100%; }
.stage canvas { display: block; width: 100%; aspect-ratio: 15 / 13.4; max-height: calc(100dvh - 230px); border-radius: 14px; touch-action: none; user-select: none; -webkit-user-select: none; }
.banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; pointer-events: none; text-align: center; width: 92%; }
.banner b { font: 800 clamp(56px, 13vw, 120px)/0.95 var(--display); color: #fff; text-shadow: 0 6px 0 rgba(0, 0, 0, .35), 0 0 30px rgba(255, 150, 60, .6); }
.banner span { font: 700 clamp(16px, 2.6vw, 22px) var(--display); letter-spacing: 1px; text-transform: uppercase; color: #fff; background: rgba(10, 6, 24, .65); padding: 4px 12px; border-radius: 999px; }
.banner span:empty { display: none; }
.banner.count b { animation: pulse .5s ease; }
.banner.go b { color: var(--gold2); font-size: clamp(64px, 15vw, 140px); }
.banner.round b { font-size: clamp(30px, 6vw, 56px); background: rgba(10, 6, 24, .8); padding: 10px 22px; border-radius: 18px; text-shadow: none; }
.banner.round.mine b { color: var(--gold2); }
@keyframes pulse { from { transform: scale(1.4); opacity: .4; } }
.messages { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); z-index: 15; width: min(460px, calc(100% - 24px)); pointer-events: none; }
.alert { padding: 9px 14px; font-size: 14px; }

/* controles do celular */
.pad { display: none; position: relative; grid-template-columns: 1fr auto; align-items: center; gap: 14px; min-height: 190px; padding: 4px 4px 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.stick { position: relative; height: 190px; border-radius: 22px; touch-action: none; background: radial-gradient(circle at 50% 50%, rgba(220, 210, 255, .07), transparent 70%); border: 1px dashed rgba(190, 170, 255, .18); }
.stick small { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; color: var(--muted); font-size: 11.5px; pointer-events: none; }
.stick.active small { opacity: 0; }
.stick-base { position: absolute; left: 50%; top: 50%; width: 128px; height: 128px; margin: -64px 0 0 -64px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .06) 0 55%, rgba(255, 255, 255, .12) 56% 58%, rgba(255, 255, 255, .04) 59%); border: 2px solid rgba(190, 170, 255, .3); }
.stick-base::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from -45deg, rgba(255, 255, 255, .0) 0 25%, rgba(255, 255, 255, .0) 25% 50%, rgba(255, 255, 255, 0) 50% 75%, rgba(255, 255, 255, 0) 75%); }
.stick-base[data-dir="1"]::before { background: conic-gradient(from -45deg, rgba(255, 201, 60, .35) 0 25%, transparent 25%); }
.stick-base[data-dir="2"]::before { background: conic-gradient(from 45deg, rgba(255, 201, 60, .35) 0 25%, transparent 25%); }
.stick-base[data-dir="3"]::before { background: conic-gradient(from 135deg, rgba(255, 201, 60, .35) 0 25%, transparent 25%); }
.stick-base[data-dir="4"]::before { background: conic-gradient(from 225deg, rgba(255, 201, 60, .35) 0 25%, transparent 25%); }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff 0%, #d9d2ff 40%, #8a7fd0 100%); box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
.bomb-btn { width: 132px; height: 132px; border-radius: 50%; border: 0; cursor: pointer; touch-action: none; position: relative; margin-right: 6px;
  background: radial-gradient(circle at 38% 30%, #ff9a5a 0%, #ff4a2a 45%, #b3160c 100%);
  box-shadow: 0 10px 0 #6e0c06, 0 16px 30px rgba(0, 0, 0, .5), inset 0 3px 0 rgba(255, 255, 255, .35); transition: transform .06s, box-shadow .06s; }
.bomb-btn.press { transform: translateY(8px); box-shadow: 0 2px 0 #6e0c06, 0 6px 14px rgba(0, 0, 0, .5), inset 0 3px 0 rgba(255, 255, 255, .35); }
.bomb-ico { position: absolute; left: 50%; top: 52%; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #6a6f8c, #14152a 70%); }
.bomb-ico::before { content: ""; position: absolute; right: 2px; top: -6px; width: 14px; height: 10px; border-radius: 3px; background: #3a3e5a; transform: rotate(35deg); }
.bomb-ico::after { content: ""; position: absolute; right: -6px; top: -12px; width: 10px; height: 10px; border-radius: 50%; background: #fff3a0; box-shadow: 0 0 10px 4px #ffd020; }
.keys-help { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; margin: 0 2px; border-radius: 6px; border: 1px solid var(--line2); border-bottom-width: 3px; background: var(--surface2); font: 700 12px var(--font); color: var(--text); }
.game-actions { text-align: center; }
@media (pointer: coarse) {
  .pad { display: grid; }
  .keys-help { display: none; }
}

/* convite */
.invite { text-align: center; padding: 16px; border-radius: 16px; border: 1px dashed var(--line2); background: var(--surface); }
.invite p { margin: 0 0 8px; color: var(--muted); }
.code-row { display: inline-flex; align-items: center; gap: 10px; }
.code-row code { font: 800 26px/1 var(--display); letter-spacing: 3px; color: var(--gold2); padding: 8px 14px; border-radius: 10px; background: rgba(0, 0, 0, .35); }
.copy-ghost { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* regras */
.rules { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 16px; }
.rules summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
.rules summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line2); color: var(--gold); font-weight: 800; }
.rules[open] summary::before { content: "–"; }
.rules summary::-webkit-details-marker { display: none; }
.rules ul { margin: 0 0 16px; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }
.rules li b { color: var(--text); }

/* diálogos */
.overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(5, 3, 14, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.dialog {
  width: min(440px, 100%); padding: 26px 24px 22px; border-radius: 22px; text-align: center;
  background: linear-gradient(180deg, #1f1840, #120d26); border: 1px solid var(--line2); box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
  animation: pop .3s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.dialog-icon { font-size: 48px; line-height: 1; margin-bottom: 8px; }
.dialog-title { margin: 0 0 6px; font-family: var(--display); font-weight: 800; font-size: 36px; letter-spacing: .5px; text-transform: uppercase; }
.dialog-title.win { background: var(--brass); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dialog-title.lose { color: var(--muted); }
.dialog-text { margin: 0 0 14px; color: var(--muted); }
.over-scores { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 6px; text-align: left; }
.over-scores li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.over-scores li.win { border-color: rgba(233, 196, 106, .6); background: rgba(233, 196, 106, .1); }
.over-scores li b { font-family: var(--display); font-size: 20px; font-weight: 800; }
.dialog-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.dialog-actions .btn { flex: 1 1 140px; }

.site-footer { text-align: center; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.site-footer p { margin: 2px 0; }

@media (max-width: 700px) {
  body { font-size: 14px; }
  .game-page .topbar { position: static; padding-top: 6px; padding-bottom: 6px; }
  .brand { font-size: 22px; }
  .game { padding: 6px 6px 12px; gap: 6px; }
  .players { gap: 5px; }
  .pcard { padding: 5px 7px; gap: 6px; border-left-width: 3px; border-radius: 10px; }
  .avatar { width: 26px; height: 26px; border-width: 1.5px; }
  .avatar .initial { font-size: 14px; }
  .pname { font-size: 12.5px; }
  .pstats { gap: 5px; font-size: 11px; }
  .st::before { width: 9px; height: 9px; }
  .pwins i { width: 11px; height: 11px; }
  .players.n3 .pcard, .players.n4 .pcard { display: grid; grid-template-columns: auto 1fr; gap: 1px 5px; }
  .players.n3 .avatar, .players.n4 .avatar { grid-row: 1; }
  .players.n3 .pwins, .players.n4 .pwins { grid-row: 1; grid-column: 2; justify-self: end; }
  .players.n3 .pinfo, .players.n4 .pinfo { grid-column: 1 / -1; }
  .players.n4 .pstats { gap: 4px; font-size: 10.5px; }
  .inforow { min-height: 0; }
  .status { font-size: 12px; }
  .clock { font-size: 17px; padding: 3px 8px; }
  .stage canvas { max-height: none; border-radius: 10px; }
  .pad { min-height: 0; }
  .stick { height: min(28svh, 210px); }
  .bomb-btn { width: 108px; height: 108px; }
}

/* =================== CAPA / LOBBY =================== */
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-left)) 28px; flex: 1; }
.hero { margin: 6px 0 20px; }
.hero:not(.hero-split) h1 { font-size: clamp(40px, 6vw, 64px); }
.hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 28px; align-items: center; margin: 8px 0 22px; }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(46px, 7vw, 82px); line-height: .92; letter-spacing: .5px; text-transform: uppercase; }
.hero h1 .o { display: block; background: var(--brass); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 14px 0 0; color: var(--muted); font-size: 17px; max-width: 46ch; }
.hero .tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text); }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.demo { position: relative; border-radius: 18px; }
.demo canvas { display: block; width: 100%; aspect-ratio: 15 / 13.4; border-radius: 16px; }
.demo-glow { position: absolute; inset: 10% 6% -6%; z-index: -1; background: radial-gradient(closest-side, rgba(255, 120, 60, .35), transparent); filter: blur(30px); }

.nickbox { max-width: 520px; margin: 0 0 18px; }
.card { padding: 20px; border-radius: 18px; background: linear-gradient(180deg, rgba(255, 244, 222, .07), rgba(255, 244, 222, .025)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card h2 { margin: 0 0 4px; font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: .4px; text-transform: uppercase; }
.card .sub { margin: 0 0 14px; color: var(--muted); }
.play-card { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; position: relative; overflow: hidden;
  background: linear-gradient(110deg, rgba(255, 90, 60, .28), rgba(120, 60, 255, .22) 55%, rgba(255, 201, 60, .08)); border-color: rgba(255, 150, 90, .3); }
.play-card .txt { flex: 1; min-width: 0; }
.play-card .btn-primary { min-width: 200px; min-height: 56px; font-size: 24px; }
.mini-balls { display: flex; flex: none; }
.mini-balls i { width: 44px; height: 44px; border-radius: 50%; margin-left: -10px; display: block; background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .55), transparent 34%), var(--c); box-shadow: inset -4px -6px 8px rgba(0, 0, 0, .35), 0 6px 10px rgba(0, 0, 0, .5); border: 2px solid rgba(255,255,255,.6); }
.mini-balls i:nth-child(1) { --c: var(--p0); } .mini-balls i:nth-child(2) { --c: var(--p1); } .mini-balls i:nth-child(3) { --c: var(--p2); } .mini-balls i:nth-child(4) { --c: var(--p3); }
.mini-balls i:first-child { margin-left: 0; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pl-row { display: flex; gap: 8px; margin: 0 0 12px; }
.pl-opt { flex: 1; cursor: pointer; }
.pl-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pl-opt span { display: grid; place-items: center; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .25); font: 800 30px/1 var(--display); }
.pl-opt small { font: 600 11px/1.3 var(--font); color: var(--muted); margin-top: 4px; }
.pl-opt input:checked + span { border-color: var(--gold); background: rgba(233, 196, 106, .14); color: var(--gold2); box-shadow: 0 0 0 1px rgba(233, 196, 106, .4); }
.pl-opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { margin-top: 3px; accent-color: #ffb52e; width: 18px; height: 18px; }
#f-join .btn { margin-top: 14px; }
.page .rules { margin-top: 18px; }
.links { text-align: center; margin-top: 18px; }

/* ranking */
.tabs { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.tabs .btn[aria-pressed="true"] { border-color: var(--gold); background: rgba(233, 196, 106, .16); color: var(--gold2); }
.table-wrap { border-radius: 16px; border: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.rank { width: 100%; border-collapse: collapse; }
.rank th, .rank td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.rank th { font-family: var(--display); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-size: 14px; }
.rank tr:last-child td { border-bottom: 0; }
.rank .num { text-align: right; font-variant-numeric: tabular-nums; }
.rank .pts { font-weight: 800; color: var(--gold2); }
.rank .placar { font-family: var(--display); font-weight: 700; font-size: 17px; white-space: nowrap; }
.medal { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; color: #2b1a02; background: var(--brass); }
.medal.m2 { background: linear-gradient(180deg, #f4f4f4, #a9adb3); }
.medal.m3 { background: linear-gradient(180deg, #f0b58a, #9a5a2e); }
.who { font-weight: 700; }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* compartilhar */
.share { position: relative; display: inline-block; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; flex: none; width: max-content; white-space: nowrap; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; min-height: 40px; }
.share-btn:hover { background: var(--surface2); }
.share-menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 250px; margin: 0; padding: 8px; list-style: none; background: #1a1436; border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); }
.share-title { display: none; font-weight: 800; padding: 6px 10px 10px; }
.share-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; background: transparent; color: var(--text); text-decoration: none; border-radius: 10px; cursor: pointer; text-align: left; font-weight: 600; }
.share-item:hover { background: var(--surface2); }
.share-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; }
.share-backdrop { display: none; }

@media (max-width: 820px) {
  .hero-split { grid-template-columns: 1fr; gap: 16px; }
  .hero p { font-size: 15px; }
  .cards { grid-template-columns: 1fr; }
  .play-card { flex-wrap: wrap; }
  .play-card .btn-primary { width: 100%; }
  .mini-balls { display: none; }
}
@media (max-width: 700px) {
  /* o desfoque do topo prenderia o menu de compartilhar dentro dele: no celular o topo fica sólido */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .share-menu { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; border-radius: 20px 20px 0 0; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); z-index: 70; }
  .share-title { display: block; }
  .share-backdrop { display: block; position: fixed; inset: 0; background: rgba(5, 3, 14, .6); z-index: 65; }
  .share-backdrop[hidden] { display: none; }
  .share-btn-txt { display: none; }
  .share-btn { padding: 8px 10px; }
  .hide-sm { display: none; }
  .rank th, .rank td { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
