:root { color-scheme: dark; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #10132a; color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif; user-select: none; }
#tela { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.oculto { display: none !important; }

button { font: inherit; font-weight: 800; color: #fff; border: 0; border-radius: 12px; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .08s, filter .15s; }
button:hover { filter: brightness(1.1); }
button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
button:disabled { opacity: .5; cursor: default; }
.grande { font-size: 21px; padding: 11px 22px; background: linear-gradient(#ffb92e, #ff7a1a); letter-spacing: .5px; }
.grande small { display: block; font-size: 11px; font-weight: 600; opacity: .9; }
.medio { font-size: 15px; padding: 10px 16px; }
.azul { background: linear-gradient(#4aa8ff, #2467e0); }
.verde { background: linear-gradient(#4bd27a, #1f9a52); }
.roxo { background: linear-gradient(#a77bff, #6a3fd1); }
.criar button { flex: 1; font-size: 13px; padding: 8px 4px; line-height: 1.25; }
.criar small { display: block; font-size: 10px; font-weight: 600; opacity: .9; }
#abertas { position: fixed; right: 14px; top: 14px; width: 290px; max-height: calc(100% - 28px); overflow-y: auto; background: #12153ae8; border: 2px solid #6fd0ff; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
#abertas h3 { font-size: 16px; }
#lista-abertas { list-style: none; display: flex; flex-direction: column; gap: 6px; }
#lista-abertas li { display: flex; align-items: center; gap: 8px; background: #232856; border-radius: 10px; padding: 8px 10px; }
#lista-abertas li div { flex: 1; min-width: 0; font-size: 13px; }
#lista-abertas li b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lista-abertas li small { display: block; font-size: 11px; color: #aab0e0; }
#lista-abertas button { font-size: 12px; padding: 7px 10px; }
#lista-abertas li.vazio { background: none; padding: 0; font-size: 12px; color: #b9bfee; line-height: 1.5; }
@media (max-width: 900px) { #abertas { width: 240px; top: auto; bottom: 10px; right: 10px; max-height: 45%; } }
.cinza { background: linear-gradient(#6b7096, #454a70); }
input, select { font: inherit; color: #fff; background: #0d1024cc; border: 2px solid #4a5085; border-radius: 10px; padding: 7px 11px; outline: none; }
input:focus, select:focus { border-color: #ffb92e; }
input[type=range] { padding: 0; border: 0; background: none; width: 100px; vertical-align: middle; }

.painel-lateral { position: fixed; left: 0; top: 0; bottom: 0; width: 400px; max-width: 100%; padding: 18px 24px;
  display: flex; flex-direction: column; gap: 9px; overflow-y: auto;
  background: linear-gradient(100deg, #12153af2 70%, #12153ac0); border-right: 3px solid #ff6fb1; }
.painel-lateral > * { flex-shrink: 0; }
h1 { font-size: 33px; line-height: 1; font-weight: 900; font-style: italic; text-shadow: 0 4px 0 #0008; }
h1 span { color: #ffb92e; }
h1 small { display: block; font-size: 15px; letter-spacing: 7px; color: #6fd0ff; margin-top: 5px; }
.rotulo { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: #aab0e0; margin-bottom: 4px; }
#seletor { display: flex; flex-direction: column; gap: 3px; }
#personagens { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 5px; }
#personagens button { background: #232856; padding: 6px 2px; font-size: 11px; border: 2px solid transparent; }
#personagens button i { display: block; width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 3px; font-style: normal; font-size: 19px; line-height: 34px; }
#personagens button.ativo, #skins button.ativo, #mapas button.ativo { border-color: #ffb92e; background: #3a3f7a; opacity: 1; }
#skins button, #mapas button { flex: 1; background: #232856; padding: 6px 3px; font-size: 12px; border: 2px solid transparent; }
#mapas button { font-size: 11px; line-height: 1.25; }
#mapas button:disabled { opacity: .55; }
.fileira { display: flex; gap: 8px; align-items: center; }
.fileira.centro { justify-content: center; flex-wrap: wrap; }
.entrar input { width: 115px; text-transform: uppercase; text-align: center; font-weight: 900; letter-spacing: 3px; }
.entrar button { flex: 1; }
.rodape { justify-content: space-between; font-size: 13px; color: #c5c9f0; }
details { font-size: 13px; color: #c5c9f0; line-height: 1.7; }
summary { cursor: pointer; font-weight: 700; }
.dica { font-size: 13px; color: #b9bfee; line-height: 1.5; }

h2 { font-size: 22px; }
#codigo-sala { font-size: 52px; font-weight: 900; letter-spacing: 14px; text-align: center; background: #0d1024; border: 2px dashed #ffb92e; border-radius: 14px; cursor: pointer; padding-left: 14px; user-select: text; }
#lista { list-style: none; display: flex; flex-direction: column; gap: 6px; }
#lista li { display: flex; justify-content: space-between; align-items: center; background: #232856; border-radius: 10px; padding: 8px 12px; border-left: 6px solid var(--cor, #555); font-size: 14px; }
#lista li.vazio { opacity: .45; border-left-color: #555; }
#lista li small { color: #aab0e0; }
.marcar { font-size: 14px; cursor: pointer; }
#linha-bots select { padding: 3px 6px; font-size: 13px; }
#contagem-sala { font-size: 13px; color: #aab0e0; font-weight: 600; }
#lista.duas { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
#lista.duas li { padding: 4px 8px; font-size: 12px; border-left-width: 4px; min-width: 0; gap: 4px; }
#lista.duas li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tabela-final { max-height: 42vh; overflow-y: auto; pointer-events: auto; }
#tabela-final th, #tabela-final td, #tabela-placar th, #tabela-placar td { padding: 3px 12px; }
#tabela-final thead th { position: sticky; top: 0; background: #12153a; }

#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 2px 3px #000b; }
#topo { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; white-space: nowrap; }
.chip { background: #0d1024b8; border-radius: 20px; padding: 6px 14px; font-size: 14px; }
.chip b { font-size: 17px; margin-left: 4px; }
#chip-zona.perigo { background: #8b1e57d0; animation: pisca 1s infinite alternate; }
@keyframes pisca { to { filter: brightness(1.5); } }
#mapa-canto { position: absolute; top: 12px; right: 12px; width: 200px; }
#minimapa { width: 200px; height: 200px; border-radius: 14px; border: 3px solid #ffffffaa; background: #234; display: block; }
#local { text-align: center; font-size: 13px; font-weight: 700; margin-top: 3px; }
#feed { position: absolute; top: 246px; right: 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: 13px; }
#feed div { background: #0d1024b8; border-radius: 8px; padding: 4px 10px; }
#aviso { position: absolute; top: 62px; width: 100%; text-align: center; font-size: 21px; font-weight: 800; color: #ffd65c; transition: opacity .4s; opacity: 0; }
#contagem { position: absolute; top: 24%; width: 100%; text-align: center; font-size: 92px; font-weight: 900; color: #ffb92e; }
#prompt { position: absolute; top: 63%; left: 50%; transform: translateX(-50%); font-size: 15px; font-weight: 700; background: #0d1024c8; padding: 7px 16px; border-radius: 10px; white-space: nowrap; }
#prompt:empty { display: none; }
#status { position: absolute; left: 18px; bottom: 18px; width: min(300px, 26vw); display: flex; flex-direction: column; gap: 6px; }
.barra { position: relative; height: 24px; background: #0d1024c0; border-radius: 7px; overflow: hidden; border: 2px solid #ffffff44; }
.barra i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transition: width .15s; }
.barra span { position: absolute; left: 8px; top: 0; font-size: 13px; line-height: 20px; }
.barra.vida i { background: linear-gradient(#5ee06f, #279c48); }
.barra.vida.baixa i { background: linear-gradient(#ff7a6a, #c22c35); }
.barra.escudo i { background: linear-gradient(#62c8ff, #2373d6); }
#inventario { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 6px; }
.vaga { width: 82px; height: 56px; background: #0d1024b8; border-radius: 9px; border: 2px solid #ffffff33; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; font-size: 12px; font-weight: 700; }
.vaga kbd { position: absolute; top: 1px; left: 5px; font-size: 10px; opacity: .7; font-family: inherit; }
.vaga.ativa { border-color: #ffb92e; background: #3a3f7ad0; transform: translateY(-5px); }
.vaga.vazia { opacity: .45; }
.vaga em { font-style: normal; font-size: 11px; opacity: .8; }
.vaga u { text-decoration: none; display: block; width: 42px; height: 4px; border-radius: 3px; margin-bottom: 3px; }
#municao { position: absolute; right: 20px; bottom: 16px; text-align: right; }
#municao b { font-size: 46px; line-height: 1.05; }
#municao b.vazio { color: #ff6a6a; }
#municao span { font-size: 20px; opacity: .85; }
#nome-arma { font-weight: 800; font-size: 15px; }
#tipo-municao { font-size: 11px; opacity: .75; }
#progresso { position: absolute; top: 69%; left: 50%; transform: translateX(-50%); width: 220px; text-align: center; font-size: 13px; font-weight: 700; }
#progresso div { height: 8px; background: #0008; border-radius: 6px; overflow: hidden; margin-top: 3px; }
#progresso i { display: block; height: 100%; background: #ffb92e; width: 0; }
#mira { position: absolute; left: 50%; top: 50%; --abre: 8px; }
#mira i { position: absolute; background: #fff; box-shadow: 0 0 3px #000; }
#mira i:nth-child(1), #mira i:nth-child(2) { width: 2px; height: 9px; left: -1px; }
#mira i:nth-child(3), #mira i:nth-child(4) { height: 2px; width: 9px; top: -1px; }
#mira i:nth-child(1) { bottom: var(--abre); }
#mira i:nth-child(2) { top: var(--abre); }
#mira i:nth-child(3) { right: var(--abre); }
#mira i:nth-child(4) { left: var(--abre); }
#mira b { position: absolute; width: 3px; height: 3px; left: -1.5px; top: -1.5px; background: #ffb92e; border-radius: 2px; }
#marcador { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 30px; opacity: 0; color: #fff; }
#numeros span { position: absolute; font-weight: 900; font-size: 20px; transform: translate(-50%, -50%); animation: sobe .8s forwards; }
#numeros span.cabeca { color: #ffd23f; font-size: 27px; }
@keyframes sobe { to { margin-top: -48px; opacity: 0; } }
#vinheta { position: absolute; inset: 0; box-shadow: inset 0 0 120px 40px #e0182d; opacity: 0; transition: opacity .35s; }
#fora-zona { position: absolute; inset: 0; background: radial-gradient(transparent 45%, #a531c9aa); opacity: 0; transition: opacity .4s; }
#luneta { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 32vh, #000000b8 52vh); opacity: 0; }
#direcao-dano { position: absolute; left: 50%; top: 50%; width: 230px; height: 230px; margin: -115px; opacity: 0; transition: opacity .3s; }
#direcao-dano::after { content: ""; position: absolute; left: 80px; top: -4px; width: 70px; height: 16px; background: #ff2d45; border-radius: 50% 50% 0 0; }
#eliminado { position: absolute; bottom: 100px; width: 100%; text-align: center; }
#eliminado h3 { font-size: 28px; color: #ff7080; }

.caixa-central { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #12153aee; border: 3px solid #6fd0ff; border-radius: 18px; padding: 22px 28px; text-align: center; display: flex; flex-direction: column; gap: 12px; min-width: 340px; max-width: 94vw; z-index: 5; }
#placar { z-index: 6; pointer-events: none; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 6px 12px; text-align: center; }
th { font-size: 11px; text-transform: uppercase; color: #aab0e0; }
td:nth-child(2), th:nth-child(2) { text-align: left; }
tbody tr { background: #232856cc; border-bottom: 3px solid #12153a; }
tr.eu { background: #4a4f95; }
#mapa-grande { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(88vh, 94vw); height: min(88vh, 94vw); border: 3px solid #fff; border-radius: 16px; z-index: 4; pointer-events: none; }
#final { position: fixed; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; padding: 4vh 16px; text-align: center;
  background: linear-gradient(#0d102400 25%, #0d1024e8 72%); }
#titulo-final { font-size: clamp(44px, 9vh, 86px); font-weight: 900; font-style: italic; color: #ffc928; text-shadow: 0 5px 0 #0009; line-height: 1; }
#final.derrota #titulo-final { color: #ff6a80; }
#tabela-final { width: min(620px, 94vw); }
#toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: #c22c55; padding: 10px 20px; border-radius: 12px; font-weight: 700; z-index: 20; box-shadow: 0 6px 20px #0007; max-width: 94vw; }
#carregando { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; background: #10132a; z-index: 30; padding: 30px; text-align: center; }

@media (max-width: 920px) {
  #inventario { bottom: 90px; }
  .vaga { width: 68px; height: 50px; }
  #status { width: 220px; }
}
@media (max-height: 720px) {
  .painel-lateral { padding: 12px 20px; gap: 6px; }
  h1 { font-size: 27px; }
  h1 small { font-size: 12px; }
  .grande { font-size: 18px; padding: 8px 18px; }
  #codigo-sala { font-size: 38px; }
  #minimapa, #mapa-canto { width: 160px; }
  #minimapa { height: 160px; }
  #feed { top: 204px; }
}
