:root {
  --bg: #07080c;
  --panel: rgba(16, 19, 28, 0.88);
  --panel-2: rgba(28, 33, 46, 0.9);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e9edf5;
  --muted: #8b93a7;
  --fire: #ff5a1f;
  --fire-2: #ffb020;
  --cyan: #3de0ff;
  --ok: #5be37d;
  --bad: #ff4d5e;
  --font: "Segoe UI", "Bahnschrift", system-ui, sans-serif;
  --display: "Bahnschrift", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text); font-family: var(--font);
  user-select: none;
}
input, select, button { font: inherit; color: inherit; }
.hidden { display: none !important; }

#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100%; height: 100%; }

/* ───────── UI general ───────── */
#ui { position: fixed; inset: 0; overflow: auto; }
#ui.over-game { background: rgba(5, 6, 10, 0.72); backdrop-filter: blur(3px); }
.screen {
  min-height: 100%; padding: 28px 40px 40px;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 90, 31, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(61, 224, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #0b0d14, #07080c);
}
.screen.transparent { background: transparent; }

.logo {
  font-family: var(--display); font-weight: 800; letter-spacing: 0.18em;
  font-size: 54px; line-height: 1; margin: 0;
  background: linear-gradient(90deg, #fff 0%, #ffd2a8 40%, var(--fire) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(255, 90, 31, 0.25);
}
.logo small { display: block; font-size: 13px; letter-spacing: 0.5em; color: var(--muted); -webkit-text-fill-color: var(--muted); margin-top: 8px; }

.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.topbar .logo { font-size: 30px; }
.topbar .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted); white-space: nowrap;
}
.chip b { color: var(--text); }
.chip.points b { color: var(--fire-2); }

h2 { font-family: var(--display); letter-spacing: 0.08em; text-transform: uppercase; font-size: 22px; margin: 0 0 16px; }
h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.grid { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }

button, .btn {
  cursor: pointer; border: 1px solid var(--line); background: var(--panel-2);
  padding: 10px 18px; border-radius: 10px; font-weight: 600; letter-spacing: 0.03em;
  transition: transform 0.08s, background 0.15s, border-color 0.15s;
}
button:hover { border-color: rgba(255, 255, 255, 0.25); background: #2a3142; }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary {
  background: linear-gradient(135deg, var(--fire), #d63a10); border-color: transparent; color: #fff;
  box-shadow: 0 6px 24px rgba(255, 90, 31, 0.3);
}
button.primary:hover { background: linear-gradient(135deg, #ff6d36, #e44415); }
button.ghost { background: transparent; }
button.danger { border-color: rgba(255, 77, 94, 0.4); color: #ffb3bb; }
button.big { padding: 16px 24px; font-size: 18px; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], select {
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; outline: none; color: var(--text); min-width: 0;
}
input:focus, select:focus { border-color: var(--fire); }
input[type=range] { accent-color: var(--fire); }
.error { color: #ff9aa5; font-size: 13px; min-height: 18px; }

/* ───────── Login ───────── */
.login-wrap { display: grid; grid-template-columns: 1.2fr 1fr; min-height: 100vh; }
.login-hero { padding: 60px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.login-hero .tag { color: var(--muted); max-width: 460px; }
.login-card { align-self: center; justify-self: center; width: min(420px, 90%); }
.login-card .tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.login-card .tabs button { flex: 1; }
.login-card .tabs button.active { border-color: var(--fire); color: #fff; }
.resume { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; background: rgba(255, 90, 31, 0.08); border: 1px solid rgba(255, 90, 31, 0.3); }
.avatar { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 20px; background: linear-gradient(135deg, var(--fire), var(--fire-2)); color: #1a0d05; flex: none; }

/* ───────── Menú ───────── */
.menu-wrap { display: grid; grid-template-columns: 340px 1fr; gap: 28px; }
.menu-buttons { display: flex; flex-direction: column; gap: 10px; }
.menu-buttons button { text-align: left; padding: 15px 18px; font-size: 16px; }
.menu-buttons button .sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.menu-buttons button.primary .sub { color: rgba(255, 255, 255, 0.8); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--panel-2); border-radius: 12px; padding: 14px; border: 1px solid var(--line); }
.stat .v { font-size: 26px; font-weight: 800; font-family: var(--display); }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

.preview-box { position: relative; height: 360px; border-radius: 14px; overflow: hidden; background: radial-gradient(circle at 50% 70%, #1c2232, #0b0d14); border: 1px solid var(--line); }
.preview-box canvas { width: 100% !important; height: 100% !important; }
.preview-box .caption { position: absolute; left: 18px; bottom: 14px; right: 18px; }
.preview-box .caption .name { font-family: var(--display); font-size: 28px; font-weight: 800; letter-spacing: 0.06em; }

/* ───────── Tarjetas (tienda, personajes, mapas) ───────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  position: relative; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px; cursor: default;
}
.card.selectable { cursor: pointer; }
.card.selectable:hover { border-color: rgba(255, 255, 255, 0.25); }
.card.selected { border-color: var(--fire); box-shadow: 0 0 0 1px var(--fire) inset, 0 8px 30px rgba(255, 90, 31, 0.15); }
.card .title { font-weight: 800; font-size: 17px; }
.card .kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.card .price { font-family: var(--display); font-weight: 700; color: var(--fire-2); }
.card .bar { height: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; }
.card .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--fire)); }
.card .meters { display: grid; grid-template-columns: 70px 1fr; gap: 5px 8px; align-items: center; font-size: 11px; color: var(--muted); }
.card .swatch { height: 70px; border-radius: 8px; }
.badge { position: absolute; top: 12px; right: 12px; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: rgba(91, 227, 125, 0.15); color: var(--ok); }
.badge.lock { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.badge.eq { background: rgba(255, 90, 31, 0.18); color: var(--fire-2); }

.tabs-row { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs-row button.active { border-color: var(--fire); color: #fff; }

/* ───────── Partidas / Sala ───────── */
.games { display: flex; flex-direction: column; gap: 10px; }
.game-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 16px; align-items: center; padding: 14px 16px; background: var(--panel-2); border-radius: 12px; border: 1px solid var(--line); }
.lobby { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }
.player-list { display: flex; flex-direction: column; gap: 6px; }
.player-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--panel-2); border-radius: 10px; border: 1px solid var(--line); }
.player-item .dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.player-item .nm { flex: 1; font-weight: 600; }
.pill { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.pill.host { background: rgba(255, 176, 32, 0.18); color: var(--fire-2); }
.pill.me { background: rgba(61, 224, 255, 0.15); color: var(--cyan); }
.mini-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini { padding: 9px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; font-size: 13px; text-align: center; }
.mini.selected { border-color: var(--fire); color: #fff; background: rgba(255, 90, 31, 0.12); }
.mini.disabled { opacity: 0.35; cursor: not-allowed; }
.mini .s { display: block; font-size: 10px; color: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.me td { background: rgba(61, 224, 255, 0.08); }
.pos { color: var(--ok); } .neg { color: var(--bad); }

#toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
#toast div { background: #1d2230; border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); animation: toastIn 0.2s; }
#toast div.err { border-color: rgba(255, 77, 94, 0.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ───────── HUD ───────── */
#hud { position: fixed; inset: 0; pointer-events: none; font-family: var(--display); z-index: 5; }
.hud-top { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; }
.hud-timer { font-size: 30px; font-weight: 800; padding: 4px 18px; background: rgba(0,0,0,0.45); border-radius: 10px; letter-spacing: 0.06em; }
.hud-timer.low { color: var(--bad); }
.hud-score { font-size: 14px; padding: 8px 12px; background: rgba(0,0,0,0.45); border-radius: 10px; color: var(--muted); }
.hud-score b { color: #fff; font-size: 18px; }
.killfeed { position: absolute; top: 14px; right: 16px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.killfeed div { background: rgba(0,0,0,0.5); padding: 5px 10px; border-radius: 6px; font-size: 14px; font-family: var(--font); animation: toastIn 0.2s; }
.killfeed .me { color: var(--fire-2); }
.killfeed .w { color: var(--muted); font-size: 12px; margin: 0 6px; }
.hud-bl { position: absolute; left: 22px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.hp { display: flex; align-items: center; gap: 12px; }
.hp .n { font-size: 38px; font-weight: 800; min-width: 70px; }
.hp .bar { width: 240px; height: 10px; background: rgba(255,255,255,0.12); border-radius: 5px; overflow: hidden; }
.hp .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #b6f36b); transition: width 0.15s; }
.hp.low .bar i { background: linear-gradient(90deg, var(--bad), #ff8a5b); }
.abilities { display: flex; gap: 8px; }
.ab { position: relative; width: 64px; height: 64px; border-radius: 12px; background: rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.15); overflow: hidden; display: grid; place-items: center; text-align: center; }
.ab .key { position: absolute; top: 3px; left: 6px; font-size: 12px; color: var(--muted); }
.ab .nm { font-size: 9px; padding: 0 3px; line-height: 1.1; font-family: var(--font); font-weight: 600; }
.ab .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.65); }
.ab .t { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.ab.active { border-color: var(--cyan); box-shadow: 0 0 16px var(--cyan); }
.hud-br { position: absolute; right: 22px; bottom: 20px; text-align: right; }
.ammo { font-size: 46px; font-weight: 800; line-height: 1; }
.ammo small { font-size: 20px; color: var(--muted); }
.wname { font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.wslots { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.wslots span { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,0.45); color: var(--muted); font-family: var(--font); }
.wslots span.on { color: #fff; border: 1px solid var(--fire); }
.reload { color: var(--fire-2); font-size: 14px; letter-spacing: 0.2em; height: 18px; }

.crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.crosshair i { position: absolute; background: #fff; box-shadow: 0 0 2px #000; }
.crosshair .dot { width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; }
.hitmarker { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px; opacity: 0; transition: opacity 0.15s; }
.hitmarker.on { opacity: 1; transition: none; }
.hitmarker i { position: absolute; width: 9px; height: 2px; background: #fff; top: 12px; }
.hitmarker.head i { background: var(--bad); }
.hitmarker i:nth-child(1) { left: -1px; transform: rotate(45deg) translate(-3px, -6px); }
.hitmarker i:nth-child(2) { right: -1px; transform: rotate(-45deg) translate(3px, -6px); }
.hitmarker i:nth-child(3) { left: -1px; transform: rotate(-45deg) translate(-3px, 6px); }
.hitmarker i:nth-child(4) { right: -1px; transform: rotate(45deg) translate(3px, 6px); }
.dmg-dir { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px; transition: opacity 0.6s; opacity: 0; }
.dmg-dir::before { content: ""; position: absolute; left: 50%; top: 0; width: 70px; height: 16px; margin-left: -35px; border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 100%, rgba(255,60,60,0.9), transparent 70%); }
.vignette { position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s; }
.vignette.damage { background: radial-gradient(ellipse at center, transparent 50%, rgba(200, 0, 0, 0.55)); }
.vignette.sombra { background: radial-gradient(ellipse at center, transparent 45%, rgba(90, 40, 160, 0.55)); }
.vignette.titan { background: radial-gradient(ellipse at center, transparent 55%, rgba(40, 170, 255, 0.45)); }
.vignette.sobrecarga { background: radial-gradient(ellipse at center, transparent 60%, rgba(255, 230, 60, 0.35)); }
.vignette.vision { background: radial-gradient(ellipse at center, transparent 55%, rgba(255, 40, 40, 0.3)); }
/* Mira del francotirador: lente grande, postes gruesos que llevan la vista al centro, líneas finas
   con un halo claro (se ven sobre fondos oscuros y claros) y punto rojo en el centro exacto */
.scope { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(circle at center, transparent 0, transparent 42.5vh, rgba(0,0,0,0.55) 43.6vh, #000 44vh); }
.scope.on { opacity: 1; }
.scope svg { position: absolute; left: 50%; top: 50%; width: 88vh; height: 88vh; transform: translate(-50%, -50%); overflow: visible; }
.scope path, .scope circle { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: butt; }
.scope .halo path { stroke: rgba(255,255,255,0.45); stroke-width: 3px; }
.scope .thin path { stroke: #000; stroke-width: 1.5px; }
.scope .post-halo path { stroke: rgba(255,255,255,0.4); stroke-width: 11px; }
.scope .post path { stroke: #000; stroke-width: 7px; }
.scope .center { fill: #ff2a2a; stroke: rgba(0,0,0,0.8); stroke-width: 1px; }
.center-msg { position: absolute; left: 50%; top: 32%; transform: translateX(-50%); text-align: center; text-shadow: 0 2px 10px #000; }
.center-msg .big { font-size: 40px; font-weight: 800; letter-spacing: 0.08em; }
.center-msg .sm { font-size: 16px; color: #ccd; font-family: var(--font); }
.toast-kill { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); font-size: 20px; color: var(--fire-2); font-weight: 700; text-shadow: 0 2px 8px #000; }
.scoreboard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, 90vw); background: rgba(10, 12, 18, 0.92); border: 1px solid var(--line); border-radius: 14px; padding: 18px; font-family: var(--font); }
.fps { position: absolute; left: 8px; top: 6px; font-size: 12px; color: #9f9; font-family: monospace; }
.click-to-play { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); padding: 10px 18px; background: rgba(0,0,0,0.6); border-radius: 10px; font-family: var(--font); }
.vision-tag { position: absolute; width: 0; height: 0; }
.vision-tag i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border: 2px solid var(--bad); transform: rotate(45deg); box-shadow: 0 0 10px var(--bad); }
.vision-tag span { position: absolute; left: 12px; top: -8px; font-size: 11px; color: #ffb3b3; white-space: nowrap; font-family: var(--font); }
.nametag { position: absolute; transform: translate(-50%, -100%); font-size: 12px; font-family: var(--font); font-weight: 600; color: #fff; text-shadow: 0 1px 3px #000; white-space: nowrap; }
.nametag .hpb { height: 3px; margin-top: 2px; background: rgba(255,255,255,0.2); border-radius: 2px; overflow: hidden; }
.nametag .hpb i { display: block; height: 100%; background: var(--bad); }

@media (max-width: 1100px) {
  .menu-wrap, .lobby, .login-wrap { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Legibilidad del HUD sobre fondos claros (nieve, desierto) */
#hud { text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.55); }
.hud-bl, .hud-br { background: rgba(0,0,0,0.38); padding: 10px 14px; border-radius: 14px; }
.ab .key { text-shadow: none; }
.gren { margin-top: 6px; font-size: 13px; font-family: var(--font); color: #cfe8b0; }
.gren.empty { color: var(--muted); text-decoration: line-through; }
.protect { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); padding: 6px 16px; border-radius: 999px;
  background: rgba(255, 213, 79, 0.18); border: 1px solid rgba(255, 213, 79, 0.6); color: #ffe082; font-size: 15px;
  letter-spacing: 0.08em; opacity: 0; transition: opacity 0.2s; box-shadow: 0 0 24px rgba(255, 213, 79, 0.35); }

/* Versión web (celulares) */
body:not(.web) .web-only { display: none !important; }
.web .pc-only { display: none !important; }
@media (max-width: 900px) {
  .screen { padding: 14px 14px 28px; }
  .topbar { flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
  .topbar .logo { font-size: 22px; }
  .login-hero { padding: 24px 16px 0; }
  .logo { font-size: 34px; }
  .preview-box { height: 240px !important; }
  .game-row { grid-template-columns: 1fr auto; }
  .mini-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ───────── Controles táctiles ───────── */
.touch-layer { position: absolute; inset: 0; pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.t-look { position: absolute; left: 42%; right: 0; top: 0; bottom: 0; }
.t-joy { position: absolute; left: 4vw; bottom: 8vh; width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 2px solid rgba(255,255,255,0.22); opacity: 0.55; transition: opacity 0.15s; }
/* Palanca flotante: en reposo se ve tenue en su sitio; al tocar aparece bajo el pulgar */
.t-joy.active { opacity: 1; }
.t-joy.sprinting { border-color: var(--fire-2); }
.t-sprint { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); font: 700 11px var(--font); letter-spacing: 0.1em;
  color: var(--fire-2); opacity: 0; transition: opacity 0.15s; pointer-events: none; }
.t-joy.sprinting .t-sprint { opacity: 1; }
.t-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px; border-radius: 50%;
  background: rgba(255,255,255,0.35); pointer-events: none; }
.t-btn { position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); background: rgba(10,12,18,0.45);
  color: #fff; font: 700 12px var(--font); padding: 0; touch-action: none; }
.t-btn.on { background: rgba(255,90,31,0.6); border-color: var(--fire); }
.t-fire { right: 5vw; bottom: 16vh; width: 96px; height: 96px; font-size: 14px; background: rgba(255,90,31,0.35); }
.t-aim { right: calc(5vw + 108px); bottom: 22vh; width: 62px; height: 62px; }
.t-jump { right: 5vw; bottom: calc(16vh + 108px); width: 62px; height: 62px; }
.t-crouch { right: calc(5vw + 100px); bottom: calc(16vh + 128px); width: 62px; height: 62px; font-size: 10px; }
.t-reload { right: calc(5vw + 108px); bottom: calc(22vh - 72px); width: 50px; height: 50px; }
.t-gren { right: calc(5vw + 170px); bottom: calc(22vh - 30px); width: 50px; height: 50px; }
.t-swap { right: calc(5vw + 16px); bottom: calc(16vh - 62px); width: 54px; height: 44px; border-radius: 14px; }
.t-q { left: calc(4vw + 190px); bottom: 30vh; width: 50px; height: 50px; }
.t-e { left: calc(4vw + 190px); bottom: calc(30vh + 60px); width: 50px; height: 50px; }
/* Segundo disparo, encima de la palanca: dispara con el pulgar izquierdo mientras el derecho apunta */
.t-fire2 { left: calc(4vw + 110px); bottom: 44vh; width: 68px; height: 68px; font-size: 11px; background: rgba(255,90,31,0.3); }
.t-pause { left: 12px; top: 12px; width: 42px; height: 42px; }
.t-rotate { display: none; position: absolute; inset: 0; background: rgba(0,0,0,0.85); color: #fff; font: 600 18px var(--font);
  align-items: center; justify-content: center; text-align: center; padding: 20px; }
@media (orientation: portrait) { .touch .t-rotate { display: flex; } }
/* HUD compacto en celular para no chocar con los controles */
#hud.touch .hud-bl { left: 64px; bottom: auto; top: 10px; padding: 6px 10px; transform: scale(0.75); transform-origin: top left; }
#hud.touch .hud-bl .abilities { display: none; }
#hud.touch .hud-br { right: 10px; bottom: auto; top: 56px; padding: 6px 10px; transform: scale(0.7); transform-origin: top right; }
#hud.touch .killfeed { top: 10px; transform: scale(0.8); transform-origin: top right; }
#hud.touch .hud-top { top: 6px; transform: translateX(-50%) scale(0.8); transform-origin: top center; }
.pause-wrap { z-index: 10; }
.touch-layer { z-index: 5; }

/* Celular en horizontal: pantallas compactas sin tener que desplazarse */
@media (max-height: 520px) and (orientation: landscape) {
  .login-wrap { grid-template-columns: 1fr 1.25fr; min-height: 100vh; align-items: center; }
  .login-hero { padding: 12px 16px; gap: 8px; }
  .login-hero .tag { display: none; }
  .logo { font-size: 30px; }
  .login-card { padding: 14px; width: 100%; }
  .login-card .tabs { margin-bottom: 8px; }
  .login-card .col { gap: 6px; }
  input[type=text], input[type=password] { padding: 8px 10px; }
  button.big { padding: 10px 16px; font-size: 16px; }
  .menu-wrap { grid-template-columns: 1fr 1fr; gap: 14px; }
  .menu-buttons button { padding: 10px 14px; font-size: 14px; }
  .menu-buttons button .sub { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .lobby { grid-template-columns: 1fr 1fr; }
  .preview-box { height: 170px !important; }
}

/* ── Modos de juego ── */
.mode-pick { gap: 6px; flex-wrap: wrap; }
.mode-pick button { flex: 1; min-width: 110px; }
.team-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.ctf-banner { text-align: center; font-size: 34px; font-weight: 800; }
.ctf-banner .muted { font-size: 15px; font-weight: 500; }
.nametag.mate { color: #9fe3a0; }
.nametag.mate .hpb i { background: #66bb6a; }
.reload.flag { color: #ffd54f; animation: flagBlink 0.8s infinite alternate; }
@keyframes flagBlink { from { opacity: 1; } to { opacity: 0.45; } }
.flag-note { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); font-family: var(--font); font-size: 20px; font-weight: 700;
  text-shadow: 0 2px 8px #000; background: rgba(0,0,0,0.35); padding: 6px 16px; border-radius: 8px; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.flag-marks { position: absolute; inset: 0; pointer-events: none; }
.flag-mark { position: absolute; width: 0; height: 0; }
.flag-mark i { position: absolute; left: -9px; top: -22px; width: 18px; height: 14px; background: var(--c); clip-path: polygon(0 0, 100% 25%, 0 55%); box-shadow: 0 0 8px var(--c); }
.flag-mark i::before { content: ''; position: absolute; left: 0; top: 0; width: 2px; height: 22px; background: #ddd; }
.flag-mark span { position: absolute; left: 50%; top: 2px; transform: translateX(-50%); font-size: 11px; color: #fff; white-space: nowrap; font-family: var(--font); text-shadow: 0 1px 3px #000; }
.flag-mark.alert span { color: #ffd54f; }

/* ── Misión (cooperativo) ── */
.nametag.elite { color: #ffd54f; font-size: 13px; }
.nametag.elite .hpb { height: 4px; }
.nametag.elite .hpb i { background: #ffb300; }
.nametag.down { color: #ffb74d; }
.lives { color: #ffd54f; letter-spacing: 0.1em; font-size: 18px; }
.scoreboard td.lives { color: #ffd54f; letter-spacing: 0.1em; }
.down-marks { position: absolute; inset: 0; pointer-events: none; }
.down-mark { position: absolute; width: 0; height: 0; }
.down-mark i { position: absolute; left: -9px; top: -22px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #ffb74d; box-shadow: 0 0 10px #ff9800; animation: flagBlink 0.6s infinite alternate; }
.down-mark i::after { content: '+'; position: absolute; left: 0; right: 0; top: -4px; text-align: center; color: #ffb74d; font-weight: 800; font-size: 16px; line-height: 18px; }
.down-mark span { position: absolute; left: 50%; top: 2px; transform: translateX(-50%); font-size: 11px; color: #ffe0b2; white-space: nowrap; font-family: var(--font); text-shadow: 0 1px 3px #000; }
.revive-bar { position: absolute; left: 50%; top: 56%; transform: translateX(-50%); width: 260px; text-align: center; font-family: var(--font); font-size: 14px; display: none; }
.revive-bar .bar { height: 8px; margin-top: 6px; background: rgba(255,255,255,0.15); border-radius: 4px; overflow: hidden; }
.revive-bar .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb74d, #ffe082); transition: width 0.1s linear; }
.spec-msg { position: absolute; left: 50%; bottom: 14%; transform: translateX(-50%); padding: 8px 18px; border-radius: 999px; background: rgba(0,0,0,0.5); font-family: var(--font); font-size: 15px; display: none; white-space: nowrap; }
#hud.coop .hud-timer { font-size: 22px; }
.pill.medal { background: rgba(255, 213, 79, 0.18); color: #ffe082; border-color: rgba(255, 213, 79, 0.5); margin-left: 4px; }
#hud.spectating .hud-bl, #hud.spectating .hud-br, #hud.spectating .protect { display: none; }
.mission-banner { text-align: center; }
.mission-banner .big { font-size: 40px; font-weight: 800; letter-spacing: 0.08em; }
.mission-banner .big.win { color: var(--ok); }
.mission-banner .big.lose { color: var(--bad); }
.mission-banner .muted { font-size: 15px; font-weight: 500; }
.diff-pick { gap: 6px; flex-wrap: wrap; }
.diff-pick button { flex: 1; min-width: 100px; }
.t-rev { right: calc(5vw + 90px); bottom: calc(16vh + 70px); width: 90px; height: 44px; border-radius: 14px; font-size: 12px; background: rgba(255, 152, 0, 0.45); }
.t-spec { left: 50%; bottom: 22%; transform: translateX(-50%); width: 110px; height: 44px; border-radius: 14px; font-size: 12px; }
.t-btn.hidden { display: none; }

/* ── Minimapa ── */
.minimap { position: absolute; left: 12px; top: 26px; border-radius: 50%; box-shadow: 0 2px 12px rgba(0,0,0,0.5); pointer-events: none; }
.minimap.big { left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: 0.95; }
#hud.touch .minimap { left: 64px; top: 78px; }
#hud.touch .minimap.big { left: 50%; top: 50%; }

/* Celular: minimapa más pequeño bajo el botón de pausa (deja libre el disparo izquierdo) y sin la
   lista de armas (para cambiar está el botón ARMA), que tapaba AGACHAR y SALTO */
#hud.touch .minimap:not(.big) { left: 12px; top: 64px; width: 96px !important; height: 96px !important; }
#hud.touch .hud-br .wslots { display: none; }
