:root {
  --navy: #142458;
  --navy2: #1c3178;
  --panel: rgba(20, 36, 92, .92);
  --panel-edge: #3c63c9;
  --gold: #ffc531;
  --gold2: #f08f12;
  --text: #eef3ff;
  --muted: #a9b8e6;
  --ok: #5fe06a;
  --red: #ff5a4a;
  font-family: 'Baloo 2', system-ui, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a56b8; }
button, input, select { font: inherit; }
#backdrop { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
body[data-screen="game"] #backdrop { display: none; }

.screen { position: fixed; inset: 0; z-index: 1; display: none; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.screen.active { display: flex; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

/* ---------- logo ---------- */
.logo { display: inline-flex; flex-direction: column; align-items: center; line-height: .85; user-select: none; }
.logo-main {
  font-family: 'Lilita One', 'Baloo 2', sans-serif; font-size: 40px; letter-spacing: 1px;
  background: linear-gradient(#fff6b0, #ffc531 45%, #f08f12);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 2px #4a1d05;
  filter: drop-shadow(0 4px 0 #2a0e02) drop-shadow(0 6px 10px rgba(0,0,0,.35));
}
.logo-gg {
  font-family: 'Lilita One', sans-serif; font-size: 15px; letter-spacing: 6px; padding: 1px 10px 0 16px;
  margin-top: 6px; border-radius: 99px; color: #fff; background: linear-gradient(#3e7cf0, #1c3fa8);
  border: 2px solid #0f1d4f; box-shadow: 0 2px 0 #0f1d4f;
}
.logo.big .logo-main { font-size: clamp(48px, 9vw, 104px); -webkit-text-stroke-width: 3px; }
.logo.big .logo-gg { font-size: clamp(16px, 2.2vw, 24px); letter-spacing: 8px; }

/* ---------- botões ---------- */
.btn {
  --c1: #4f8cf7; --c2: #2556c9; --edge: #13307a;
  border: 2px solid var(--edge); border-radius: 12px; padding: 8px 18px; cursor: pointer;
  color: #fff; font-weight: 800; text-shadow: 0 2px 0 rgba(0,0,0,.35);
  background: linear-gradient(var(--c1), var(--c2)); box-shadow: 0 4px 0 var(--edge), inset 0 2px 0 rgba(255,255,255,.35);
  transition: transform .08s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn:disabled { filter: grayscale(.7) brightness(.8); cursor: default; }
.btn.gold { --c1: #ffe066; --c2: #f5a314; --edge: #8a4b06; color: #3a1d02; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.btn.green { --c1: #7ee35a; --c2: #2fa52a; --edge: #155c13; }
.btn.red { --c1: #ff7b6b; --c2: #d9342a; --edge: #7a1610; }
.btn.purple { --c1: #a77bff; --c2: #6b3fd6; --edge: #36197a; }
.btn.sm { padding: 4px 12px; font-size: 14px; border-radius: 10px; }
.btn.lg { padding: 10px 26px; font-size: 20px; }
.btn.xl { padding: 12px 30px; font-size: 26px; }
.btn.wide { width: 100%; }
.icon-btn { position: relative; background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.2); color: #fff; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 20px; }
.icon-btn:hover { background: rgba(255,255,255,.22); }
.badge { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-style: normal; font-size: 12px; border-radius: 99px; min-width: 18px; padding: 0 4px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; margin-top: 10px; }

/* ---------- painéis ---------- */
.panel {
  background: var(--panel); border: 3px solid var(--panel-edge); border-radius: 18px; padding: 18px;
  box-shadow: 0 10px 30px rgba(5,10,40,.5), inset 0 0 0 2px rgba(255,255,255,.06); backdrop-filter: blur(4px);
}
.panel-title, .panel-head h2 { margin: 0 0 12px; font-size: 22px; text-shadow: 0 2px 0 rgba(0,0,0,.4); letter-spacing: .5px; }
/* cabeçalho em "aba" dourada, como no mock */
.panel-title {
  display: table; margin: -32px auto 14px; padding: 2px 26px; border-radius: 12px;
  background: linear-gradient(#20367f, #0f1d4f); border: 3px solid var(--gold);
  box-shadow: 0 4px 0 #8a4b06, 0 0 16px rgba(255,197,49,.35);
}
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head h2 {
  margin: 0; padding: 2px 18px; border-radius: 12px; border: 3px solid var(--gold);
  background: linear-gradient(#20367f, #0f1d4f); box-shadow: 0 3px 0 #8a4b06;
}
.panel-head h2 + * { margin-left: auto; }
dialog .panel-title { margin-top: 0; }
.form-panel, .room-panel, .big-panel, .login-panel { margin-top: 22px; }
.big-panel .panel-head h2, .room-panel .panel-head h2, .rooms-panel .panel-head h2 { flex: 0 1 auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.hint { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 24px; }
.pill { background: rgba(0,0,0,.3); border-radius: 99px; padding: 2px 12px; font-weight: 700; font-size: 14px; white-space: nowrap; }
input, select {
  background: #0d1840; color: #fff; border: 2px solid #3554b0; border-radius: 10px; padding: 7px 12px; outline: none;
}
input:focus, select:focus { border-color: var(--gold); }
input:disabled { opacity: .5; }
label { display: block; font-weight: 700; margin-bottom: 10px; }
label > input, label > select { display: block; width: 100%; margin-top: 4px; }
label.check { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
label.check input, .srow input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gold); }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 2px solid #3554b0; }
.tab { background: #20367f; color: var(--muted); border: 0; padding: 6px 16px; border-radius: 10px 10px 0 0; cursor: pointer; font-weight: 700; }
.tab.active { background: linear-gradient(#4f8cf7, #2556c9); color: #fff; }
.tab:disabled { opacity: .5; cursor: default; }
.tabs.small .tab { padding: 2px 12px; font-size: 13px; }

.coin::before { content: '🪙 '; }
.gem::before { content: '💎 '; }
.coin, .gem { font-weight: 800; }
.currency { display: flex; gap: 12px; align-items: center; }
.currency .coin, .currency .gem { background: rgba(0,0,0,.35); padding: 4px 14px; border-radius: 99px; }

/* ---------- título ---------- */
.title-wrap { display: grid; justify-items: center; gap: 10px; text-align: center; }
.title-hero { display: flex; align-items: flex-end; gap: 10px; min-height: 160px; }
.hero-av { animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.hero-tanks { display: flex; gap: 20px; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.menu { display: grid; gap: 12px; width: 260px; }

/* ---------- login ---------- */
.login-panel { width: min(380px, 100%); text-align: center; }
.login-panel .logo { margin-bottom: 16px; }
.login-panel form { text-align: left; }

/* ---------- lobby ---------- */
#scr-lobby { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 14px; }
.topbar { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border: 3px solid var(--panel-edge); border-radius: 16px; padding: 8px 14px; }
.who { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.who b { font-size: 20px; display: block; line-height: 1; }
.who small { color: var(--muted); }
.av { display: inline-flex; }
.lobby-grid { display: grid; grid-template-columns: 240px 1fr 340px; gap: 14px; flex: 1; min-height: 0; }
.side-menu { display: grid; gap: 10px; align-content: start; }
.side-menu .btn { text-align: left; }
.rooms-panel { display: flex; flex-direction: column; min-height: 0; }
.room-list { flex: 1; overflow: auto; display: grid; gap: 8px; align-content: start; }
.room-item {
  display: grid; grid-template-columns: 1fr auto auto; grid-template-rows: auto auto; gap: 0 10px; text-align: left;
  background: linear-gradient(#23408f, #1a2f70); border: 2px solid #3c63c9; border-radius: 12px; padding: 8px 12px; color: #fff; cursor: pointer;
}
.room-item:hover:not(:disabled) { border-color: var(--gold); }
.room-item:disabled { opacity: .6; cursor: default; }
.room-item > span:nth-child(2) { grid-row: 2; color: var(--muted); font-size: 14px; }
.room-item .pill { grid-row: 1 / 3; grid-column: 2; align-self: center; }
.room-item .status { grid-row: 1 / 3; grid-column: 3; align-self: center; color: var(--ok); font-weight: 700; }
.room-item .status.playing { color: var(--gold); }
.online { color: var(--muted); margin-top: 8px; }
form.inline { display: flex; gap: 6px; }
form.inline input { width: 110px; text-transform: uppercase; }
.lobby-right { display: grid; grid-template-rows: auto 1fr; gap: 14px; min-height: 0; }
.event-card {
  cursor: pointer; border-radius: 16px; padding: 14px; border: 3px solid #ffb02e;
  background: linear-gradient(135deg, #6b2fd6, #c2338a); display: grid; gap: 4px; justify-items: start;
}
.event-card b { font-family: 'Lilita One'; font-size: 26px; color: #ffe066; text-shadow: 0 2px 0 #5a1300; }
.chat-panel { display: flex; flex-direction: column; min-height: 0; padding: 10px; }
.chat-log { flex: 1; overflow: auto; font-size: 14px; background: rgba(0,0,0,.25); border-radius: 10px; padding: 8px; min-height: 100px; }
.chat-log b { color: var(--gold); }
.chat-log .sys { color: var(--muted); font-style: italic; }
.chat-form input { width: 100%; margin-top: 8px; }

/* ---------- criar sala ---------- */
.form-panel { width: min(460px, 100%); }
.picker { display: flex; align-items: center; justify-content: space-between; background: #0d1840; border: 2px solid #3554b0; border-radius: 10px; margin-top: 4px; }
.picker button { background: none; border: 0; color: var(--gold); font-size: 26px; padding: 0 14px; cursor: pointer; }
.picker span { font-weight: 700; }
.map-preview { width: 100%; border-radius: 10px; border: 2px solid #3554b0; margin-top: 6px; display: block; }
.form-panel .row input[name=password] { flex: 1; }

/* ---------- sala de espera ---------- */
.room-panel { width: min(900px, 100%); }
.room-grid { display: grid; grid-template-columns: 1fr 270px; gap: 14px; }
.room-players { display: grid; gap: 6px; }
.rp { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.25); border-radius: 12px; padding: 4px 10px; min-height: 46px; border: 2px solid transparent; }
.rp.me { border-color: var(--gold); }
.rp b { flex: 1; }
.rp.empty { color: var(--muted); justify-content: center; border: 2px dashed #3554b0; }
.rp .ok { color: var(--ok); font-weight: 800; }
.rp .wait { color: var(--muted); }
.rp .x { background: none; border: 0; color: var(--red); font-size: 18px; cursor: pointer; }
.team { border: 0; border-radius: 8px; padding: 2px 10px; font-weight: 800; color: #fff; cursor: pointer; }
.team:disabled { cursor: default; }
.team-A { background: #d9443a; } .team-B { background: #2f6fe2; }
small.team-A, small.team-B { padding: 0 6px; border-radius: 6px; color: #fff; }
.room-info p { font-size: 15px; }
.room-bottom { display: grid; grid-template-columns: 1fr auto; gap: 14px; margin-top: 14px; }
.chat-panel.slim { height: 170px; }
.room-actions { display: grid; gap: 10px; align-content: end; }

/* ---------- jogo ---------- */
/* overflow: hidden evita que animações (banner com scale) criem barra de rolagem e façam a tela "pular" */
.screen.game { padding: 0; background: #2a56b8; overflow: hidden; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.g-top { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.g-players { display: grid; gap: 4px; }
.g-pl { display: grid; grid-template-columns: 30px 130px; grid-template-rows: auto 8px; column-gap: 6px; align-items: center; background: rgba(15,28,75,.8); border: 2px solid #3554b0; border-radius: 10px; padding: 2px 8px 4px 4px; }
.g-pl .av { grid-row: 1 / 3; }
.g-pl .nm { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-pl .hp { background: rgba(0,0,0,.5); border-radius: 4px; overflow: hidden; height: 7px; }
.g-pl .hp i { display: block; height: 100%; background: linear-gradient(90deg, #f0483a, #4cdb54); }
.g-pl.turn { border-color: var(--gold); box-shadow: 0 0 12px rgba(255,197,49,.6); }
.g-pl.dead { opacity: .45; filter: grayscale(1); }
.g-pl.team-A { border-left: 6px solid #d9443a; } .g-pl.team-B { border-left: 6px solid #2f6fe2; }
.g-timer { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; background: rgba(15,28,75,.85); border: 3px solid #3554b0; border-radius: 14px; padding: 2px 22px 6px; min-width: 150px; }
.g-timer small { display: block; font-weight: 800; color: var(--muted); font-size: 12px; }
.g-timer b { font-family: 'Lilita One'; font-size: 40px; line-height: 1; color: #fff; }
.g-timer.low b { color: var(--red); animation: pulse .5s infinite alternate; }
.g-turnname { display: block; font-size: 13px; color: var(--gold); font-weight: 700; }
@keyframes pulse { to { transform: scale(1.15); } }
.g-banner { position: absolute; top: 34%; left: 10%; right: 10%; text-align: center; will-change: transform, opacity; font-family: 'Lilita One'; font-size: clamp(30px, 5vw, 56px); color: #ffe066; -webkit-text-stroke: 2px #4a1d05; text-shadow: 0 4px 0 #2a0e02; opacity: 0; pointer-events: none; }
.g-banner.show { animation: banner 1.8s ease forwards; }
@keyframes banner { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.05); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.g-bottom { position: absolute; bottom: 10px; left: 10px; right: 10px; display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; align-items: end; }
.g-box, .g-mid { background: rgba(15,28,75,.88); border: 3px solid #3554b0; border-radius: 14px; padding: 6px 10px; }
.g-box small, .g-power small, .g-fuel small { font-weight: 800; color: var(--muted); font-size: 12px; }
.g-box b { display: block; font-family: 'Lilita One'; font-size: 32px; line-height: 1.1; }
.g-wind span { display: flex; align-items: center; gap: 6px; }
.g-wind i { font-style: normal; color: var(--gold); font-size: 24px; display: inline-block; transition: transform .3s; }
.g-wind b { display: inline; }
.g-mid { display: grid; gap: 6px; }
.g-power { display: grid; grid-template-columns: auto 1fr 40px; align-items: center; gap: 8px; }
.bar { position: relative; height: 18px; background: rgba(0,0,0,.5); border-radius: 9px; overflow: hidden; border: 2px solid #0d1840; }
.g-power .fill { height: 100%; width: 0; background: linear-gradient(90deg, #ffe066, #f5a314 50%, #ff4b2b); }
.g-power .last { position: absolute; top: -2px; bottom: -2px; width: 3px; background: #fff; box-shadow: 0 0 4px #000; }
.g-power .val { font-weight: 800; text-align: right; }
.g-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.g-fuel { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.g-fuel .bar { height: 10px; }
.g-fuel .fill { height: 100%; background: linear-gradient(90deg, #7ee35a, #2fa52a); }
.g-weapons { display: flex; gap: 6px; }
.g-weapon { background: #20367f; border: 2px solid #3554b0; border-radius: 10px; color: #fff; padding: 2px 8px; cursor: pointer; display: grid; justify-items: center; font-size: 18px; line-height: 1.1; }
.g-weapon small { font-size: 11px; color: var(--muted); }
.g-weapon.active { border-color: var(--gold); background: #33509f; }
.g-weapon.cooldown { opacity: .5; cursor: not-allowed; }
.screen.game:not(.my-turn) .g-mid { opacity: .75; }
.g-help { position: absolute; bottom: 118px; left: 50%; transform: translateX(-50%); font-size: 13px; color: #fff; background: rgba(0,0,0,.35); padding: 2px 12px; border-radius: 99px; white-space: nowrap; }
.g-quit { position: absolute; top: 10px; right: 10px; }
.g-touch { display: none; position: absolute; right: 10px; bottom: 130px; gap: 6px; }
.g-touch button { width: 54px; height: 54px; border-radius: 50%; border: 2px solid #fff; background: rgba(15,28,75,.7); color: #fff; font-size: 20px; touch-action: none; user-select: none; }
.g-touch .fire { width: 74px; height: 74px; background: rgba(217,52,42,.85); font-weight: 800; font-size: 16px; }
@media (pointer: coarse) { .g-touch { display: flex; } .g-help { display: none; } }

/* ---------- resultado ---------- */
.result-wrap { display: grid; justify-items: center; gap: 12px; width: min(820px, 100%); }
.result-banner {
  font-family: 'Lilita One'; font-size: clamp(56px, 10vw, 110px); line-height: 1;
  background: linear-gradient(#fff6b0, #ffc531 45%, #f08f12); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 3px #4a1d05; filter: drop-shadow(0 6px 0 #2a0e02); animation: win 0.6s ease;
}
.result-banner.lose { background: linear-gradient(#d6e2ff, #7f9ad8 50%, #4a5f9a); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke-color: #101a3c; }
@keyframes win { from { transform: scale(.3) rotate(-6deg); opacity: 0; } }
.result-body { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; width: 100%; }
.result-list { display: grid; gap: 6px; }
.rr { display: grid; grid-template-columns: 30px 1fr 70px 70px; gap: 8px; align-items: center; background: rgba(0,0,0,.3); padding: 6px 12px; border-radius: 10px; font-size: 18px; }
.rr.head { background: none; color: var(--muted); font-size: 13px; font-weight: 800; }
.rr.me { border: 2px solid var(--gold); }
.rr b { color: var(--gold); font-size: 22px; }
.rewards { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: 22px; font-weight: 800; }
.rewards .xp { color: #8fe3ff; }

/* ---------- loja / garagem ---------- */
.big-panel { width: min(900px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.shop-card { background: linear-gradient(#2a4aa0, #1a2f70); border: 2px solid #3c63c9; border-radius: 14px; padding: 10px; display: grid; justify-items: center; gap: 4px; text-align: center; }
.shop-card .art { height: 92px; display: grid; place-items: center; }
.shop-card.owned { opacity: .75; }
.big-icon { font-size: 52px; line-height: 1; }
.big-icon.huge { font-size: 120px; }
.garage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.garage-preview { background: rgba(0,0,0,.25); border-radius: 14px; padding: 12px; display: grid; justify-items: center; gap: 6px; }
.stats { width: 100%; display: grid; gap: 6px; }
.stats div { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; }
.stats i { height: 10px; background: rgba(0,0,0,.5); border-radius: 5px; overflow: hidden; }
.stats b { display: block; height: 100%; background: linear-gradient(90deg, #7ee35a, #ffe066); }
.garage-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-content: start; }
.g-slot { position: relative; background: #20367f; border: 3px solid #3554b0; border-radius: 12px; padding: 4px; cursor: pointer; display: grid; place-items: center; min-height: 70px; }
.g-slot.sel { border-color: var(--gold); }
.g-slot.using::after { content: '✓'; position: absolute; top: 2px; left: 6px; color: var(--ok); font-weight: 900; }
.g-slot.locked { filter: grayscale(.8) brightness(.7); }
.g-slot i { position: absolute; top: 4px; right: 6px; font-style: normal; }
.g-slot { color: #fff; gap: 0; padding-bottom: 6px; }
.slot-name { font-size: 12px; font-weight: 700; line-height: 1.1; }
.slot-price { font-size: 11px; color: var(--gold); }
.g-slot.locked .slot-price { filter: none; }
.g-slot.emb .big-icon { font-size: 36px; }

/* ---------- perfil ---------- */
.profile-grid { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.profile h3 { margin: 6px 0; font-size: 26px; }
.xpbar { position: relative; height: 22px; background: rgba(0,0,0,.45); border-radius: 11px; overflow: hidden; margin: 6px 0 10px; border: 2px solid #0d1840; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffe066, #f5a314); }
.xpbar span { position: absolute; inset: 0; text-align: center; font-size: 13px; font-weight: 800; line-height: 18px; }
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table td { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.stats-table td:last-child { text-align: right; font-weight: 800; }
.ach { display: flex; gap: 12px; flex-wrap: wrap; }
.medal { display: grid; justify-items: center; width: 110px; text-align: center; opacity: .4; filter: grayscale(1); }
.medal span { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #fff; background: radial-gradient(#ffe066, #c97a07); border: 3px solid #6b3a04; }
.medal.got { opacity: 1; filter: none; }
.medal small { font-size: 12px; }

/* ---------- configurações ---------- */
.settings-grid { display: grid; grid-template-columns: 170px 1fr; gap: 14px; min-height: 240px; }
.vtabs { display: grid; gap: 4px; align-content: start; }
.vtabs button { background: #20367f; border: 0; color: #fff; text-align: left; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.vtabs button.active { background: linear-gradient(90deg, #4f8cf7, #2556c9); }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.srow > input:not([type=checkbox]), .srow > select { width: 220px; margin: 0; }
.keys td { padding: 6px 10px 6px 0; }
kbd { background: #0d1840; border: 2px solid #3554b0; border-radius: 6px; padding: 0 8px; font-weight: 800; }

/* ---------- eventos ---------- */
.event-hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; border-radius: 16px; padding: 18px; border: 3px solid #ffb02e; background: linear-gradient(135deg, #5a2fd6, #c2338a); }
.event-hero h3 { font-family: 'Lilita One'; font-size: 40px; margin: 4px 0; color: #ffe066; text-shadow: 0 3px 0 #5a1300; }
.tag { background: #fff; color: #6b2fd6; font-weight: 800; padding: 2px 12px; border-radius: 8px; transform: rotate(-3deg); display: inline-block; }
.news li { margin: 6px 0; }

/* ---------- diálogos ---------- */
dialog.panel { color: var(--text); width: min(420px, 92vw); }
dialog::backdrop { background: rgba(5,10,40,.6); }
#dlg-alert p { white-space: pre-wrap; word-break: break-word; }
#pw-input { width: 100%; }
.msg-list { display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.msg { display: flex; gap: 10px; align-items: center; background: rgba(0,0,0,.25); border-radius: 10px; padding: 6px 12px; }
.msg span { font-size: 26px; }
.msg p { margin: 0; }
.msg.unread { border-left: 4px solid var(--gold); }

#toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translate(-50%, 120px); background: #0d1840; border: 2px solid var(--gold); border-radius: 12px; padding: 8px 20px; font-weight: 700; transition: transform .25s; }
#toast.show { transform: translate(-50%, 0); }
.credit { position: fixed; right: 10px; bottom: 4px; z-index: 2; font-size: 12px; color: rgba(255,255,255,.6); }
body[data-screen="game"] .credit { display: none; }

@media (max-width: 1050px) {
  .lobby-grid { grid-template-columns: 1fr; }
  #scr-lobby { overflow: auto; }
  .side-menu { grid-template-columns: repeat(2, 1fr); }
  .room-grid, .garage-grid, .result-body, .room-bottom, .event-hero { grid-template-columns: 1fr; }
  .result-hero { display: none; }
}

/* ---------- refinamentos v0.2 ---------- */
.empty-state { text-align: center; padding: 20px 10px; display: grid; justify-items: center; }
.empty-state h3 { margin: 6px 0 0; font-size: 24px; }
.empty-state p { color: var(--muted); max-width: 380px; margin: 4px 0 0; }
.es-art { display: flex; gap: 30px; animation: bob 3s ease-in-out infinite; }

.room-status { margin: 0; text-align: center; color: var(--gold); font-weight: 700; font-size: 14px; max-width: 220px; }
.tip { color: var(--muted); font-size: 13px; font-style: italic; min-height: 3em; }
#room-start:disabled { animation: none; }
#room-start:not(:disabled) { animation: glow 1.2s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 4px 0 var(--edge), 0 0 18px rgba(126,227,90,.8); } }

#net-status {
  position: fixed; z-index: 60; top: 10px; left: 50%; transform: translate(-50%, -80px);
  background: #7a1610; border: 2px solid #ff7b6b; border-radius: 99px; padding: 4px 18px; font-weight: 800;
  transition: transform .25s;
}
#net-status.show { transform: translate(-50%, 0); animation: pulse-o 1s infinite alternate; }
@keyframes pulse-o { to { opacity: .7; } }

.g-feed { position: absolute; top: 60px; right: 10px; display: grid; gap: 4px; justify-items: end; pointer-events: none; }
.g-feed div { background: rgba(15,28,75,.85); border: 2px solid #3554b0; border-radius: 10px; padding: 2px 12px; font-size: 14px; animation: feedin .3s ease; transition: opacity .6s; }
.g-feed div.out { opacity: 0; }
.g-feed b { color: var(--gold); }
@keyframes feedin { from { transform: translateX(30px); opacity: 0; } }
.g-rotate { display: none; }

dialog.panel[open] { animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
#confirm-text { font-size: 18px; text-align: center; }
.tut-body { text-align: center; min-height: 170px; }
.tut-icon { font-size: 64px; line-height: 1.2; }
.tut-body h3 { margin: 0; font-size: 26px; color: var(--gold); }
.tut-body p { font-size: 17px; }
.tut-dots { display: flex; gap: 6px; justify-content: center; }
.tut-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3554b0; }
.tut-dots i.on { background: var(--gold); }

/* foco visível para teclado */
.btn:focus-visible, .tab:focus-visible, .g-slot:focus-visible, .room-item:focus-visible, .icon-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- telas pequenas / celular ---------- */
@media (max-width: 700px) {
  .screen { padding: 10px; align-items: flex-start; }
  .logo-main { font-size: 32px; }
  .title-wrap { margin-top: 20px; }
  .title-hero { min-height: 0; }
  .hero-av svg { width: 100px; height: 100px; }
  .hero-tanks canvas { width: 120px !important; height: 72px !important; }
  .menu { width: 100%; max-width: 300px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .who b { font-size: 16px; }
  .currency { gap: 6px; }
  .currency .coin, .currency .gem { padding: 2px 10px; font-size: 14px; }
  .side-menu { grid-template-columns: 1fr 1fr; }
  .side-menu .btn.xl { grid-column: 1 / -1; font-size: 22px; }
  .side-menu .btn { font-size: 14px; padding: 8px 10px; }
  .lobby-right { grid-template-rows: auto 260px; }
  .rooms-panel { min-height: 300px; }
  .panel { padding: 14px; border-radius: 14px; }
  .room-actions { grid-template-columns: 1fr 1fr; }
  .room-status { grid-column: 1 / -1; max-width: none; }
  .garage-list { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .vtabs { grid-auto-flow: column; overflow-x: auto; }
  .srow > input:not([type=checkbox]), .srow > select { width: 60%; }
  .profile-grid { grid-template-columns: 1fr; justify-items: center; }
  .rr { grid-template-columns: 24px 1fr 50px 50px; font-size: 15px; }
  .result-wrap .row .btn.lg { font-size: 16px; padding: 8px 14px; }
  .event-hero h3 { font-size: 30px; }
  #event-art { display: none; }
  .credit { display: none; }
}

/* HUD da partida em telas baixas (celular na horizontal) */
@media (max-height: 520px), (max-width: 700px) {
  .g-bottom { grid-template-columns: 70px 1fr 70px; gap: 6px; bottom: 6px; left: 6px; right: 6px; }
  .g-box, .g-mid { padding: 3px 6px; border-width: 2px; border-radius: 10px; }
  .g-box b { font-size: 22px; }
  .g-wind i { font-size: 16px; }
  .g-weapon { padding: 0 6px; font-size: 14px; }
  .g-weapon small { font-size: 9px; }
  .bar { height: 14px; }
  .g-timer { padding: 0 14px 2px; min-width: 110px; }
  .g-timer b { font-size: 28px; }
  .g-pl { grid-template-columns: 24px 90px; }
  .g-pl .av svg { width: 24px; height: 24px; }
  .g-pl .nm { font-size: 11px; }
  .g-help { display: none; }
  .g-feed { top: 48px; }
  .g-feed div { font-size: 12px; }
}
@media (pointer: coarse) {
  .g-touch { display: grid; grid-template-columns: repeat(2, 52px); left: 8px; right: auto; bottom: auto; top: 40%; }
  .g-touch button { width: 52px; height: 52px; }
  .g-touch .fire { position: fixed; right: 14px; top: 42%; width: 82px; height: 82px; }
}
@media (pointer: coarse) and (orientation: portrait) {
  .g-rotate { display: grid; place-items: center; text-align: center; position: absolute; inset: 0; z-index: 5; background: rgba(13,24,64,.92); font-size: 22px; font-weight: 800; padding: 30px; }
}
.side-menu .btn { white-space: nowrap; }
.side-menu .btn.xl { font-size: 22px; padding: 10px 16px; }
@media (max-width: 1050px) {
  .lobby-grid { grid-template-columns: minmax(0, 1fr); }
  .side-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-menu .btn { overflow: hidden; text-overflow: ellipsis; }
  .rooms-panel { min-height: 0; }
  .room-list { overflow: visible; }
  .panel-head { flex-wrap: wrap; }
  .panel-head h2 { white-space: nowrap; }
  #scr-lobby > * { min-width: 0; }
}
@media (max-width: 700px) {
  .panel-head h2 { font-size: 18px; padding: 2px 12px; }
  form.inline { flex: 1; }
  form.inline input { flex: 1; min-width: 0; width: auto; }
  .es-art canvas { width: 110px !important; height: 69px !important; }
}
@media (max-width: 1050px) {
  .lobby-grid { flex: none; }
  .room-list { flex: none; }
}

/* ---------- v0.3: modelos, modo fácil, vento ---------- */
.easy-toggle { --c1: #5d6b8f; --c2: #39436a; --edge: #1d2340; }
.easy-toggle.on { --c1: #ffd86b; --c2: #e88a12; --edge: #7a3d04; color: #3a1d02; text-shadow: none; }
.easy-toggle.on .easy-label::before { content: '🎯 '; }
.easy-tag { background: var(--gold); color: #3a1d02; border-radius: 6px; padding: 0 6px; font-size: 11px; font-weight: 900; }
.model-tag { color: var(--muted); font-weight: 600; font-size: 12px; }
.g-wind { min-width: 110px; }
.wbars { display: flex; gap: 3px; margin-top: 2px; }
.wbars i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); }
.wbars i.on { background: linear-gradient(90deg, #8fe3ff, #ffe066); }
.wbars i.on:nth-child(n+4) { background: #ff7b4a; }
.g-weapon.special { border-color: #b27bff; }
.g-weapon.special.active { border-color: var(--gold); }
.stats .wpn { grid-template-columns: 1fr; gap: 0; background: rgba(0,0,0,.2); border-radius: 8px; padding: 4px 8px; }
.stats .wpn span { font-weight: 800; }
.stats .wpn small { color: var(--muted); }
#garage-name small { font-size: 13px; margin-left: 6px; }
#garage-rotation { margin: -4px 0 10px; }

/* garagem dentro da sala */
dialog.roomgarage { width: min(760px, 94vw); }
.rg-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.rg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 52vh; overflow: auto; }
.rg-detail { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rg-detail h3 { margin: 0; }
.rg-detail .stats { width: 100%; }
.rg-detail h3 small { font-size: 13px; margin-left: 6px; }
.rg-actions { justify-content: flex-end; margin-top: 12px; }
#room-garage:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 640px) { .rg-body { grid-template-columns: 1fr; } }
