:root {
  --bg: #07080d;
  --panel: #10131c;
  --line: #222838;
  --text: #e8ecf5;
  --muted: #8a93a8;
  --green: #39ff88;
  --pink: #ff3b6b;
  --gold: #ffd23b;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }

/* lobby */
#fundo { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
#lobby { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }
.sala { backdrop-filter: blur(10px); transition: transform .2s, box-shadow .2s; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.logo { font-family: 'Russo One', sans-serif; font-size: 30px; letter-spacing: 1px; text-shadow: 0 0 20px #ffffff22; }
.logo span { background: linear-gradient(90deg, #39ff88, #3bc8ff, #b46bff, #ff3b6b, #39ff88); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: brilho 6s linear infinite;
  filter: drop-shadow(0 0 12px #39ff8866); }
@keyframes brilho { to { background-position: 300% 0; } }
.hero h1 em { background: linear-gradient(90deg, #39ff88, #3bc8ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.topo-dir { display: flex; align-items: center; gap: 8px; }
.topo-dir button { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text); }
.btn-musica.off { opacity: .45; }
.saldo { text-align: right; color: var(--muted); font-size: 14px; margin-left: 8px; }
.saldo b { color: var(--text); font-size: 18px; margin-left: 6px; }
.saldo small { display: block; font-size: 11px; }
.hero { padding: 48px 0 32px; }
.hero h1 { font-family: 'Russo One', sans-serif; font-weight: 400; font-size: clamp(28px, 5vw, 52px); line-height: 1.1; margin: 0 0 12px; }
.hero h1 em { font-style: normal; color: var(--green); }
.hero p { color: var(--muted); margin: 0 0 24px; }
.nome { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.nome input { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 14px; font: inherit; width: 200px; }
.nome input:focus { outline: 2px solid var(--green); border-color: transparent; }
.salas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.sala { text-align: left; background: linear-gradient(160deg, #161b2ecc, #0b0e18cc); border: 1px solid #2a3150; border-radius: 16px; padding: 18px; color: var(--text); }
.sala.trancada:hover { transform: translateY(-2px); box-shadow: 0 12px 40px -20px #ffd23b; }
.sala .valor { font-family: 'Russo One', sans-serif; font-size: 26px; }
.sala .info { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.sala .info b { color: var(--gold); }
.sala .tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 999px; background: #1a1f2c; color: var(--muted); }
.sala.free { border-color: #39ff8888; box-shadow: 0 0 0 1px #39ff8833, 0 10px 50px -16px #39ff88; animation: respira 2.4s ease-in-out infinite; }
.sala.free .tag { background: linear-gradient(90deg, #39ff88, #3bffe9); color: #04130a; }
.sala.free:hover { transform: translateY(-3px) scale(1.02); }
@keyframes respira { 50% { box-shadow: 0 0 0 1px #39ff8866, 0 14px 60px -12px #39ff88; } }
.sala.free:focus-visible { outline: 2px solid var(--green); }
.sala.trancada { opacity: .6; }
#conta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#conta button { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--text); font-size: 13px; }
#conta .entrar { background: linear-gradient(90deg, #39ff88, #3bffe9); color: #04130a; font-weight: 800; border: 0; }
.sala.paga { cursor: pointer; }
.sala.paga:hover { transform: translateY(-2px); box-shadow: 0 12px 40px -20px #ffd23b; }
.sala.paga .tag { background: #ffd23b22; color: var(--gold); }
.sala.paga[aria-disabled="true"] { opacity: .6; }
.sala.paga[aria-disabled="true"] .tag { background: #1a1f2c; color: var(--muted); }
#historico { margin-top: 28px; max-width: 640px; background: linear-gradient(160deg, #161b2ecc, #0b0e18cc); border: 1px solid #2a3150; border-radius: 16px; padding: 16px 20px; }
#historico h2 { font-family: 'Russo One', sans-serif; font-weight: 400; font-size: 18px; margin: 0 0 8px; }
#historico ol { margin: 0; padding-left: 20px; font-size: 14px; }
#historico li { padding: 3px 0; }
#historico span { float: right; font-weight: 800; }
#historico .ganho { color: var(--green); }
#historico .perda { color: var(--muted); }
.modal { background: linear-gradient(160deg, #1a2040, #0a0d1a); color: var(--text); border: 1px solid #ffffff22; border-radius: 18px; padding: 24px; width: min(380px, calc(100vw - 32px)); }
.modal::backdrop { background: #000a; backdrop-filter: blur(4px); }
.modal form { display: grid; gap: 12px; position: relative; }
.modal h2 { font-family: 'Russo One', sans-serif; font-weight: 400; margin: 0; }
.modal label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.modal input, .modal select, .modal textarea { background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; }
.modal input:focus, .modal select:focus { outline: 2px solid var(--green); border-color: transparent; }
.modal .erro { color: var(--pink); margin: 0; min-height: 1em; font-size: 13px; }
.modal .acoes { display: flex; gap: 8px; }
.modal .acoes button { flex: 1; border-radius: 10px; padding: 11px; font-weight: 800; border: 1px solid var(--line); background: #151a26; color: var(--text); }
.modal .acoes .nova { background: var(--green); color: #04130a; border-color: transparent; }
.modal .fechar { position: absolute; top: -8px; right: -8px; background: none; border: 0; color: var(--muted); font-size: 18px; }
.modal .nota { margin: 0; font-size: 12px; color: var(--muted); }
.qr { display: grid; gap: 10px; justify-items: center; text-align: center; }
.qr img { width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 8px; }
.qr textarea { width: 100%; resize: none; font-size: 11px; word-break: break-all; }
.qr .espera { color: var(--gold); font-size: 13px; margin: 0; }
#conta .pix { background: var(--green); color: #04130a; font-weight: 800; border-color: transparent; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 10; background: linear-gradient(160deg, #1a2040, #0a0d1a);
  border: 1px solid var(--gold); color: var(--text); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 40px -10px #000; }
.regras { color: var(--muted); font-size: 13px; margin-top: 28px; max-width: 640px; }

/* jogo */
#jogo { position: fixed; inset: 0; overflow: hidden; }
#cv { display: block; width: 100vw; height: 100vh; touch-action: none; cursor: crosshair; }
#hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; gap: 12px; }
/* painéis de vidro com borda em degradê */
#stats, #lb, #feed div, #res, #botoes button, #skills div {
  background: linear-gradient(160deg, #1a2040b8, #0a0d1ab8); backdrop-filter: blur(8px);
  border: 1px solid #ffffff1f; box-shadow: 0 8px 30px -12px #000, inset 0 1px 0 #ffffff14;
}
#stats { border-radius: 12px; padding: 9px 14px; font-weight: 700; font-size: 14px; white-space: nowrap; }
#lb { margin: 0; padding: 10px 14px 10px 32px; border-radius: 12px; font-size: 13px; min-width: 170px; }
#lb:empty { display: none; }
#lb li { padding: 2px 0; font-weight: 600; }
#lb li:nth-child(1)::marker { content: '👑 '; }
#lb li:nth-child(1) { color: var(--gold); }
#lb li:nth-child(2) { color: #d7e1f5; }
#lb li:nth-child(3) { color: #ffb070; }
#lb li.eu { color: var(--green); font-weight: 800; }
#lb span { float: right; color: var(--muted); margin-left: 12px; font-variant-numeric: tabular-nums; }
#msg { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; text-shadow: 0 2px 12px #000; }
#msg b { display: block; font-family: 'Russo One', sans-serif; font-weight: 400; font-size: clamp(24px, 4vw, 40px); }
#msg small { color: var(--muted); font-size: 14px; }
#msg.alerta b { color: var(--pink); animation: pulsa .5s ease-in-out infinite alternate; }
#msg.alerta small { color: var(--text); }
#msg.airdrop b { color: var(--gold); animation: pulsa .4s ease-in-out infinite alternate; }
#msg.airdrop small { color: var(--text); }
#skills { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; pointer-events: none; }
#skills div { border-color: #ffd23b88; color: var(--gold); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: 0 0 20px -6px #ffd23b; }
#tiro { display: none; position: absolute; right: 120px; bottom: 120px; width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--gold); background: #ffd23b33; color: var(--text); font-weight: 800; touch-action: none; user-select: none; }
@media (pointer: coarse) { #tiro.tem { display: block; } #skills { bottom: 70px; } }
#msg.vai b { color: var(--green); font-size: clamp(48px, 9vw, 96px); animation: vai 1.1s ease-out forwards; }
@keyframes pulsa { to { transform: scale(1.08); } }
@keyframes vai { from { transform: scale(.4); opacity: 0; } 25% { transform: scale(1.1); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
#feed { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
#feed div { border-radius: 10px; padding: 5px 12px; font-size: 13px; white-space: nowrap; animation: entra .35s cubic-bezier(.2, 1.5, .4, 1); }
#feed div.eu { border-color: var(--gold); color: var(--gold); font-weight: 800; box-shadow: 0 0 24px -6px #ffd23b; }
@keyframes entra { from { transform: translateY(-10px) scale(.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #msg b, #feed div { animation: none !important; } .kfx { animation-duration: .01s !important; animation-delay: 1.8s !important; } }
#res { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); border-radius: 18px; padding: 22px;
  animation: sobe .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes sobe { from { transform: translate(-50%, -40%) scale(.9); opacity: 0; } }
#res h2 { font-family: 'Russo One', sans-serif; font-weight: 400; margin: 0 0 4px; font-size: 24px; }
#res h2 em { font-style: normal; color: var(--gold); }
#res ol { margin: 12px 0; padding-left: 26px; max-height: 40vh; overflow: auto; font-size: 14px; }
#res li { padding: 2px 0; }
#res li.eu { color: var(--green); font-weight: 800; }
#res li span { float: right; color: var(--muted); }
#res .pote { background: #151a26; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--muted); }
#res .pote b { color: var(--gold); }
#res .acoes { display: flex; gap: 8px; margin-top: 14px; }
#res .acoes button { flex: 1; border-radius: 10px; padding: 12px; font-weight: 800; border: 1px solid var(--line); background: #151a26; color: var(--text); }
#res .acoes .nova { background: var(--green); color: #04130a; border-color: transparent; box-shadow: 0 8px 30px -10px var(--green); }
#res .acoes button:focus-visible { outline: 2px solid var(--gold); }

/* letreiro de abate */
#killfx { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); pointer-events: none; text-align: center; }
.kfx { animation: kfx 1.9s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.kfx b { display: block; font-family: 'Russo One', sans-serif; font-weight: 400; font-size: clamp(34px, 6vw, 64px); letter-spacing: 1px;
  color: var(--gold); text-shadow: 0 0 24px #ffd23baa, 0 4px 0 #8a5a00; }
.kfx small { display: block; margin-top: 4px; font-weight: 800; font-size: clamp(16px, 2.4vw, 22px); text-shadow: 0 2px 10px #000; }
.kfx.combo b { color: #fff; background: linear-gradient(90deg, #ffd23b, #ff3b6b, #b46bff, #3bc8ff); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; text-shadow: none; filter: drop-shadow(0 0 18px #ff3b6baa); }
.kfx.morte b { color: var(--pink); text-shadow: 0 0 30px #ff3b6baa, 0 4px 0 #5a0018; }
@keyframes kfx {
  0% { transform: scale(2.6) rotate(-6deg); opacity: 0; }
  12% { transform: scale(.92) rotate(2deg); opacity: 1; }
  20% { transform: scale(1.06) rotate(-1deg); }
  28%, 80% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(1.15) translateY(-20px); opacity: 0; }
}
#feed span.nome { font-weight: 800; }
#botoes { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; }
#botoes button { color: var(--text); border-radius: 12px; padding: 8px 14px; }
#turbo { display: none; position: absolute; right: 24px; bottom: 180px; width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--pink); background: #ff3b6b33; color: var(--text); font-weight: 800; font-size: 13px; touch-action: none; user-select: none; }
#turbo.on { background: var(--pink); }
@media (pointer: coarse) { #turbo { display: block; } }
@media (max-width: 600px) {
  #hud { flex-direction: column; align-items: flex-start; }
  #feed { top: auto; bottom: 60px; }
  #lb { min-width: 0; font-size: 12px; }
}
