* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #8fc8ff;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#app, #app canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }

#crosshair { --gap: 5px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair span {
  position: absolute;
  background: var(--cross-color, #fff);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
  transition: opacity 0.1s;
}
#crosshair span:nth-child(1) { width: 2px; height: 7px; left: -1px; top: calc(-7px - var(--gap)); }
#crosshair span:nth-child(2) { width: 2px; height: 7px; left: -1px; top: var(--gap); }
#crosshair span:nth-child(3) { width: 7px; height: 2px; left: calc(-7px - var(--gap)); top: -1px; }
#crosshair span:nth-child(4) { width: 7px; height: 2px; left: var(--gap); top: -1px; }
#crosshair.melee span, #crosshair.ads span { opacity: 0; }

/* Hitmarker: aspa que aparece al acertar */
#hitmarker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
/* Marca de impacto: más grande y gruesa (blanca, amarilla en la cabeza, roja al eliminar) */
#hitmarker span {
  position: absolute; width: 3px; height: 11px; left: -1.5px; top: -5.5px; border-radius: 2px;
  background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 6px rgba(0, 0, 0, 0.5);
}
#hitmarker span:nth-child(1) { transform: rotate(45deg) translateY(-13px); }
#hitmarker span:nth-child(2) { transform: rotate(135deg) translateY(-13px); }
#hitmarker span:nth-child(3) { transform: rotate(225deg) translateY(-13px); }
#hitmarker span:nth-child(4) { transform: rotate(315deg) translateY(-13px); }
#hitmarker.head span { background: #ffd23c; height: 14px; top: -7px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 10px rgba(255, 200, 40, 0.9); }
#hitmarker.kill span { background: #ff4040; width: 4px; height: 16px; top: -8px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 60, 60, 0.9); }
/* Escudo de racha activo: borde azul en la pantalla */
body.shielded #hud { box-shadow: inset 0 0 90px rgba(74, 134, 255, 0.55); }

#kill-banner {
  position: absolute; left: 50%; top: 60%;
  transform: translateX(-50%);
  font-weight: 900; font-size: 20px; letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  opacity: 0; transition: opacity 0.2s;
  white-space: nowrap;
}
#kill-banner.show { opacity: 1; }
#kill-banner b { color: #ff5a4f; }
#kill-banner i { color: #ffc93c; font-style: normal; }

#damage-numbers .dmg {
  position: absolute;
  font-weight: 900; font-size: 18px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7);
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
#damage-numbers .dmg.head { color: #ffc93c; font-size: 22px; }

#health {
  position: absolute; left: 20px; bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.hp-text { font-weight: 900; font-size: 30px; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); min-width: 56px; }
.hp-bar {
  width: 200px; height: 12px; border-radius: 6px; overflow: hidden;
  background: rgba(20, 30, 60, 0.5); border: 2px solid rgba(255, 255, 255, 0.5);
}
.hp-fill { width: 100%; height: 100%; background: #4fcf86; transition: width 0.15s; }

#weapon-panel {
  position: absolute; right: 20px; bottom: 20px;
  text-align: right;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
#slots { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
#slots div {
  padding: 4px 8px; border-radius: 6px;
  background: rgba(20, 30, 60, 0.45); border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: inherit; font-weight: 700; font-size: 11px; line-height: 1.2; opacity: 0.7;
}
#slots div.active { background: rgba(255, 201, 60, 0.85); color: #1b2a55; opacity: 1; text-shadow: none; }
#weapon-name { font-weight: 700; font-size: 14px; opacity: 0.9; }
#ammo b { font-size: 40px; font-weight: 900; }
#ammo span { font-size: 18px; font-weight: 700; opacity: 0.8; margin-left: 4px; }
#ammo.low b { color: #ff5a4f; }
#reload-bar {
  width: 140px; height: 5px; margin-left: auto; margin-top: 4px;
  border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.2);
  visibility: hidden;
}
#reload-bar.show { visibility: visible; }
#reload-bar div { height: 100%; width: 0; background: #ffc93c; }

body.is-touch #health { left: 12px; bottom: auto; top: 12px; }
body.is-touch #debug { top: 44px; }
body.is-touch .hp-bar { width: 120px; }
body.is-touch .hp-text { font-size: 20px; min-width: 0; }
body.is-touch #weapon-panel { top: 12px; bottom: auto; right: 80px; }
body.is-touch #ammo b { font-size: 26px; }
body.is-touch #slots, body.is-touch #weapon-name { display: none; }
#crosshair i {
  position: absolute; width: 3px; height: 3px; left: -1.5px; top: -1.5px;
  background: var(--cross-color, #fff); border-radius: 50%; box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

#debug {
  position: absolute; left: 12px; top: 10px;
  font: 600 13px/1.4 Consolas, monospace;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  opacity: 0.9;
}

/* ---------- Menú ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20, 30, 60, 0.35), rgba(10, 15, 35, 0.75));
  backdrop-filter: blur(4px);
  padding: 16px;
}
.menu-card { text-align: center; max-width: 420px; width: 100%; }
.menu-card h1 {
  font-size: clamp(44px, 10vw, 72px);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  text-shadow: 0 4px 0 #1b2a55, 0 8px 24px rgba(0, 0, 0, 0.4);
}
.menu-card h1 span { color: #ffc93c; }
.subtitle { margin: 10px 0 26px; opacity: 0.85; font-weight: 600; }

.big-btn {
  display: block; width: 100%; margin: 0 auto 12px;
  font-family: inherit;
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 2px;
  color: #1b2a55;
  background: linear-gradient(#ffd75e, #ffb627);
  border: none;
  border-radius: 14px;
  padding: 16px 24px;
  cursor: pointer;
  box-shadow: 0 6px 0 #b9790c, 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s;
}
.big-btn:hover { transform: translateY(-2px); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #b9790c; }

#menu-msg { min-height: 20px; margin-top: 14px; font-weight: 600; color: #ffd75e; }

.controls {
  margin-top: 18px;
  display: grid; gap: 6px;
  font-size: 14px; opacity: 0.9;
}
kbd {
  display: inline-block; min-width: 26px;
  padding: 2px 7px; margin-right: 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font: 700 12px/1.4 Consolas, monospace;
}
body.is-touch .desktop-only { display: none; }
body:not(.is-touch) .touch-only { display: none; }

/* ---------- Controles táctiles ---------- */
#touch-ui { position: fixed; inset: 0; display: none; }
#touch-ui.active { display: block; }

.tc-zone { position: absolute; top: 0; bottom: 0; }
.tc-move { left: 0; width: 45%; }
.tc-look { right: 0; width: 55%; }

.tc-joy {
  position: absolute; width: 130px; height: 130px;
  margin: -65px 0 0 -65px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.tc-joy.visible { opacity: 1; }
.tc-knob {
  position: absolute; left: 50%; top: 50%;
  width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.tc-joy.sprint .tc-knob { background: rgba(255, 201, 60, 0.85); }

.tc-btn {
  position: absolute;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: rgba(14, 22, 44, 0.38);
  color: #fff;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.tc-btn svg { width: 46%; height: 46%; }
.tc-btn.pressed { background: rgba(255, 201, 60, 0.55); border-color: #ffc93c; }
/* Disparar: grande, donde cae el pulgar derecho; Agacharse justo debajo; Saltar abajo a la derecha; Arma encima */
.tc-fire { width: 104px; height: 104px; right: 104px; bottom: 92px; background: rgba(255, 90, 79, 0.32); border-color: rgba(255, 140, 130, 0.7); }
.tc-fire svg { width: 50%; height: 50%; }
.tc-fire.pressed { background: rgba(255, 90, 79, 0.65); border-color: #ff8a80; }
.tc-crouch { width: 60px; height: 60px; right: 126px; bottom: 22px; }
.tc-jump { width: 74px; height: 74px; right: 20px; bottom: 28px; }
.tc-switch { width: 64px; height: 64px; right: 26px; bottom: 124px; border-radius: 18px; }
.tc-switch img { width: 82%; height: auto; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.tc-pause { width: 44px; height: 44px; right: 14px; top: 12px; border-radius: 12px; }
/* Balas encima del botón ARMA: tocarlas recarga (en móvil no hay más contador) */
.tc-ammo {
  position: absolute; right: 18px; bottom: 196px; min-width: 80px; padding: 5px 10px;
  border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.35); background: rgba(14, 22, 44, 0.5);
  color: #fff; font-family: inherit; text-align: center; line-height: 1; -webkit-tap-highlight-color: transparent;
}
.tc-ammo b { font-size: 22px; font-weight: 900; }
.tc-ammo small { font-size: 12px; font-weight: 700; opacity: 0.75; margin-left: 2px; }
.tc-ammo.low b { color: #ff5a4f; }
.tc-ammo.reloading { opacity: 0.55; }
.tc-ammo.pressed { border-color: #ffc93c; }
.tc-ammo.hidden { display: none; }
body.is-touch #weapon-panel { display: none; }

.big-btn.secondary {
  font-size: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.big-btn.secondary:active { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.menu-view { max-width: 320px; margin: 0 auto; }

/* ---------- Duelo ---------- */
#scoreboard {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  display: flex; align-items: stretch; gap: 4px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
}
.sb-side {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px; border-radius: 10px;
  font-weight: 900;
}
.sb-side b { font-size: 30px; line-height: 1; }
.sb-name { font-size: 13px; letter-spacing: 1px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-a { background: rgba(74, 134, 255, 0.75); }
.sb-b { background: rgba(255, 122, 47, 0.75); }
.sb-mid {
  min-width: 92px; padding: 4px 10px; border-radius: 10px;
  background: rgba(20, 30, 60, 0.6); text-align: center;
}
#sb-time { font-size: 22px; font-weight: 900; line-height: 1.1; }
#sb-time.urgent { color: #ff5a4f; }
#sb-round { font-size: 11px; font-weight: 700; opacity: 0.85; }

#killfeed {
  position: absolute; right: 16px; top: 76px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
#killfeed div {
  padding: 4px 10px; border-radius: 6px;
  background: rgba(20, 30, 60, 0.55);
  font-weight: 700; font-size: 13px;
  transition: opacity 0.4s;
}
#killfeed .a { color: #8fb4ff; }
#killfeed .b { color: #ffb98a; }
#killfeed .w { opacity: 0.8; margin: 0 6px; font-size: 11px; }
#killfeed .hs { color: #ffc93c; margin-left: 6px; }

#round-banner {
  position: absolute; left: 0; right: 0; top: 24%;
  text-align: center; pointer-events: none;
  text-shadow: 0 4px 0 rgba(20, 30, 60, 0.6), 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0; transform: scale(0.92); transition: opacity 0.25s, transform 0.25s;
}
#round-banner.show { opacity: 1; transform: scale(1); }
#round-banner h2 { font-size: clamp(32px, 7vw, 60px); font-weight: 900; letter-spacing: 2px; }
#round-banner p { font-size: 16px; font-weight: 700; opacity: 0.9; margin-top: 4px; }
#round-banner.win h2 { color: #6fe0a0; }
#round-banner.lose h2 { color: #ff6b5f; }

#countdown {
  position: absolute; left: 50%; top: 38%;
  transform: translate(-50%, -50%);
  font-size: 96px; font-weight: 900; color: #ffc93c;
  text-shadow: 0 6px 0 #b9790c, 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
}
#countdown.pop { animation: pop 0.9s ease-out forwards; }
@keyframes pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
}

#hurt-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 30, 30, 0.75) 100%);
  opacity: 0;
}
#damage-dirs { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#damage-dirs .dir {
  position: absolute; left: -45px; top: -130px;
  width: 90px; height: 22px;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  border-top: 6px solid rgba(255, 60, 50, 0.9);
  transform-origin: 45px 130px;
}

#match-end h1 { font-size: clamp(48px, 11vw, 80px); }
#match-end.win h1 { color: #6fe0a0; }
#match-end.lose h1 { color: #ff6b5f; }
#me-score { font-size: 38px; font-weight: 900; margin: 6px 0 16px; }
#me-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-width: 380px; margin: 0 auto 22px;
}
#me-stats div {
  padding: 8px 4px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px; font-weight: 600; opacity: 0.95;
}
#me-stats b { display: block; font-size: 22px; font-weight: 900; }

body.is-touch #scoreboard { top: 8px; transform: translateX(-50%) scale(0.85); transform-origin: top center; }
body.is-touch #killfeed { top: 80px; left: 12px; right: auto; align-items: flex-start; }
body.is-touch #weapon-panel { top: 60px; right: 16px; }

/* Mira telescópica, utilidad y cegadora */
#scope { position: absolute; inset: 0; display: none; pointer-events: none; }
#scope.show { display: block; }
#scope .scope-ring {
  position: absolute; left: 50%; top: 50%;
  width: 92vmin; height: 92vmin; transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 200vmax #05070c, inset 0 0 40px 10px rgba(0, 0, 0, 0.6);
}
#scope span { position: absolute; background: rgba(0, 0, 0, 0.85); }
#scope .h { left: 4vmin; right: 4vmin; top: 50%; height: 2px; margin-top: -1px; }
#scope .v { top: 4vmin; bottom: 4vmin; left: 50%; width: 2px; margin-left: -1px; }
#utility { font-size: 13px; font-weight: 700; margin-top: 4px; color: #ffc93c; }
#utility.empty { opacity: 0.4; color: #fff; }
#blind { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 5; }

/* Modos por equipos */
.mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-btn.team {
  font-size: 15px; white-space: nowrap; padding-left: 8px; padding-right: 8px;
  color: #fff;
  background: linear-gradient(#5b93ff, #3d6fe0);
  box-shadow: 0 6px 0 #2a4fa8, 0 10px 24px rgba(0, 0, 0, 0.3);
}
.big-btn.team:active { box-shadow: 0 3px 0 #2a4fa8; }

.sb-side { position: relative; }
.sb-pips { position: absolute; left: 0; right: 0; bottom: -9px; display: flex; justify-content: center; gap: 4px; }
.sb-pips i {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(20, 30, 60, 0.6); border: 1px solid rgba(255, 255, 255, 0.6);
}
.sb-pips i.on { background: #fff; }

#name-tags .name-tag {
  position: absolute; left: 0; top: 0;
  text-align: center; white-space: nowrap;
  font-weight: 800; font-size: 13px; color: #9cc0ff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.nt-bar { width: 46px; height: 4px; margin: 2px auto 0; border-radius: 2px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.nt-bar div { height: 100%; background: #6fe0a0; }

#spectate {
  position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%);
  padding: 8px 18px; border-radius: 10px;
  background: rgba(20, 30, 60, 0.6);
  font-weight: 700; font-size: 14px; letter-spacing: 1px;
  display: none;
}
#spectate.show { display: block; }
#spectate b { color: #9cc0ff; margin-left: 6px; }

/* Todos contra todos */
.big-btn.ffa {
  font-size: 17px; color: #fff;
  background: linear-gradient(#b45cff, #8a3ad9);
  box-shadow: 0 6px 0 #5f2399, 0 10px 24px rgba(0, 0, 0, 0.3);
}
.big-btn.ffa:active { box-shadow: 0 3px 0 #5f2399; }
.seg.seg-5 { grid-template-columns: repeat(5, 1fr); }

/* Arsenal */
#arsenal .menu-card { max-width: 860px; }
#arsenal h2 { font-size: 32px; font-weight: 900; margin-bottom: 14px; letter-spacing: 1px; }
.ars-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; text-align: left; }
.ars-col h3 { font-size: 13px; letter-spacing: 1px; opacity: 0.8; margin-bottom: 6px; text-transform: uppercase; }
.ars-item {
  display: block; width: 100%; margin-bottom: 6px; padding: 8px 10px;
  border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer;
  font-family: inherit; text-align: left;
}
.ars-item.active { border-color: #ffc93c; background: rgba(255, 201, 60, 0.18); }
.ars-item b { display: block; font-size: 14px; margin-bottom: 5px; }
.ars-stat { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 6px; font-size: 10px; opacity: 0.85; }
.ars-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.ars-bar i { display: block; height: 100%; background: #ffc93c; }
@media (max-width: 720px) { .ars-cols { grid-template-columns: repeat(2, 1fr); } }

/* Perfil: nivel, XP y monedas */
#profile-bar {
  display: flex; align-items: center; gap: 10px;
  max-width: 360px; margin: 0 auto 14px;
  padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.1);
}
.lvl-badge {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(#ffd75e, #ffb627); color: #1b2a55;
  font-weight: 900; font-size: 17px; box-shadow: 0 3px 0 #b9790c;
}
.pb-xp { flex: 1; text-align: left; }
.pb-xp-text { font-size: 11px; font-weight: 700; opacity: 0.85; margin-bottom: 4px; }
.xp-bar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.xp-bar div { height: 100%; width: 0; background: linear-gradient(90deg, #6fe0a0, #4fcf86); transition: width 0.6s ease-out; }
.coins { display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 18px; color: #ffd75e; }
.coins i, i.coin {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff2b0, #ffc93c 55%, #c98a10);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15); vertical-align: -2px;
}
#daily-btn {
  display: block; margin: -4px auto 12px; padding: 8px 14px; border: none; border-radius: 10px;
  font-family: inherit; font-weight: 800; font-size: 13px; cursor: pointer;
  color: #1b2a55; background: #6fe0a0; box-shadow: 0 3px 0 #2f9a5e;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.04); } }
.mode-row.three { grid-template-columns: 1fr 1fr 1fr; }
.mode-row.three .big-btn { font-size: 14px; padding-left: 4px; padding-right: 4px; }

/* Recompensas al final de la partida */
#me-rewards { max-width: 380px; margin: -8px auto 18px; text-align: left; }
.rw-lines div { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; opacity: 0.9; padding: 2px 0; }
.rw-lines span:last-child { color: #ffd75e; }
.rw-total { display: flex; justify-content: space-between; align-items: center; margin: 8px 0; font-weight: 900; font-size: 18px; }
.rw-total .xp { color: #6fe0a0; }
.rw-level { display: flex; align-items: center; gap: 10px; }
.rw-level .xp-bar { flex: 1; height: 10px; }
.rw-up { margin-top: 8px; text-align: center; font-weight: 900; color: #ffd75e; font-size: 18px; animation: pulse 1s ease-in-out 3; }

/* Colección */
.coll-card { max-width: 900px; }
.coll-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.coll-head h2 { font-size: 30px; font-weight: 900; letter-spacing: 1px; }
.coll-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.coll-tab {
  flex: 1; padding: 9px; border: none; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-weight: 800; color: #fff; background: rgba(255, 255, 255, 0.1);
}
.coll-tab.active { background: #ffc93c; color: #1b2a55; }
.coll-body { margin-bottom: 14px; }
.coll-skins { display: grid; grid-template-columns: 190px 1fr; gap: 12px; text-align: left; }
.coll-weapons { display: flex; flex-direction: column; gap: 4px; max-height: 380px; overflow-y: auto; }
.coll-weapon {
  padding: 6px 10px; border: 2px solid transparent; border-radius: 8px; cursor: pointer;
  font-family: inherit; color: #fff; background: rgba(255, 255, 255, 0.08); text-align: left;
}
.coll-weapon b { display: block; font-size: 13px; }
.coll-weapon span { font-size: 11px; opacity: 0.7; }
.coll-weapon.active { border-color: #ffc93c; }
.coll-preview { display: block; width: 100%; border-radius: 12px; background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.15)); }
.coll-progress { font-size: 12px; opacity: 0.8; margin: 6px 0; }
.wrap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; max-height: 200px; overflow-y: auto; }
.wrap-card {
  padding: 5px; border-radius: 10px; cursor: pointer; text-align: left;
  border: 2px solid var(--rarity); background: rgba(255, 255, 255, 0.06);
  font-family: inherit; color: #fff;
}
.wrap-card b { display: block; font-size: 12px; margin-top: 4px; }
.wrap-card span { font-size: 10px; color: var(--rarity); font-weight: 700; }
.wrap-card.locked { opacity: 0.45; filter: grayscale(0.7); cursor: default; }
.wrap-card.active { box-shadow: 0 0 0 3px #fff inset; }
.wrap-swatch { height: 34px; border-radius: 6px; }
.wrap-swatch.big { width: 90px; height: 60px; flex: none; }

.case-area { display: flex; gap: 20px; align-items: center; text-align: left; }
.case-art { width: 150px; flex: none; }
.case-lid { height: 26px; border-radius: 10px 10px 4px 4px; background: linear-gradient(#ffd75e, #e8a51a); }
.case-body {
  height: 90px; margin-top: 4px; border-radius: 4px 4px 12px 12px;
  background: linear-gradient(#5b8fd9, #3d63b8); display: grid; place-items: center;
  font-size: 40px; color: #ffd75e;
}
.case-info h3 { font-size: 20px; margin-bottom: 6px; }
.case-info p { font-size: 13px; opacity: 0.85; margin-bottom: 8px; }
.case-odds { display: flex; gap: 12px; font-size: 12px; font-weight: 700; margin-bottom: 12px; flex-wrap: wrap; }
.case-info .big-btn { width: auto; display: inline-block; padding: 12px 26px; font-size: 18px; }
.big-btn:disabled { filter: grayscale(1); opacity: 0.5; cursor: default; }
.case-hint { font-size: 12px !important; color: #ffd75e; }
.reel-wrap { position: relative; overflow: hidden; margin-top: 16px; padding: 8px 0; border-radius: 12px; background: rgba(0, 0, 0, 0.3); }
.reel { display: flex; gap: 8px; will-change: transform; }
.reel-item {
  flex: none; width: 110px; padding: 6px; border-radius: 8px;
  border-bottom: 4px solid var(--rarity); background: rgba(255, 255, 255, 0.08); text-align: left;
}
.reel-item b { display: block; font-size: 11px; margin-top: 4px; }
.reel-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: #ffc93c; z-index: 2; box-shadow: 0 0 10px #ffc93c; }
.case-prize {
  display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 12px;
  border-radius: 12px; border: 2px solid var(--rarity); background: rgba(255, 255, 255, 0.08); text-align: left;
  animation: pulse 0.8s ease-in-out 2;
}
.case-prize b { display: block; font-size: 22px; }
.case-prize span { font-size: 13px; opacity: 0.9; }
.prize-rarity { color: var(--rarity); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats-grid div { padding: 10px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); font-size: 12px; font-weight: 600; }
.stats-grid b { display: block; font-size: 20px; font-weight: 900; }
@media (max-width: 720px) {
  .coll-skins { grid-template-columns: 1fr; }
  .coll-weapons { flex-direction: row; overflow-x: auto; max-height: none; }
  .coll-weapon { flex: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .case-area { flex-direction: column; text-align: center; }
}

/* Selector de dificultad */
.seg-label { font-size: 12px; font-weight: 700; opacity: 0.8; margin-bottom: 6px; letter-spacing: 0.5px; }
.seg {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 4px; margin-bottom: 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}
.seg button {
  font-family: inherit; font-weight: 700; font-size: 12px;
  padding: 8px 2px; border: none; border-radius: 8px; cursor: pointer;
  color: #fff; background: transparent;
}
.seg button.active { background: #ffc93c; color: #1b2a55; }

/* Pantallas bajas (móvil en horizontal) */
@media (max-height: 500px) {
  .overlay { align-items: flex-start; overflow-y: auto; padding-top: 12px; }
  .menu-card h1 { font-size: 40px; }
  .subtitle { margin: 4px 0 12px; font-size: 13px; }
  .big-btn { padding: 11px 20px; font-size: 20px; margin-bottom: 8px; }
  .big-btn.secondary { font-size: 15px; }
  .controls { display: none; }
  #profile-bar { margin-bottom: 6px; padding: 4px 10px; }
  .lvl-badge { width: 30px; height: 30px; font-size: 14px; }
  .wrap-grid { max-height: 120px; }
  .coll-head h2 { font-size: 20px; }
  .big-btn.team, .big-btn.ffa { font-size: 14px; }
  .seg.seg-5 button { font-size: 10px; }
  #arsenal h2 { font-size: 22px; margin-bottom: 6px; }
  .ars-item { padding: 5px 8px; }
  .ars-stat { display: none; }
  .seg { margin-bottom: 8px; }
  .seg button { padding: 6px 2px; }
  #me-score { font-size: 26px; margin: 0 0 8px; }
  #me-stats { margin-bottom: 10px; gap: 6px; }
  #me-stats div { padding: 4px; }
  #me-stats b { font-size: 16px; }
  #round-banner { top: 16%; }
  #countdown { top: 60%; font-size: 64px; }
}

/* Pantallas que se abren encima del menú: fondo más opaco */
#collection, #arsenal { background: rgba(10, 15, 35, 0.94); z-index: 20; }

/* ---------- Fase 8: pulido ---------- */
#loading { z-index: 50; flex-direction: column; gap: 14px; background: #1b2a55; font-weight: 800; letter-spacing: 1px; }
.loader {
  width: 48px; height: 48px; border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.2); border-top-color: #ffc93c;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay:not(.hidden) .menu-card { animation: cardIn 0.25s ease-out; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

.icon-btn {
  position: absolute; right: 16px; top: 16px; z-index: 2;
  width: 46px; height: 46px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 24px; color: #fff; background: rgba(255, 255, 255, 0.14);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.25); }

#settings, #tutorial { background: rgba(10, 15, 35, 0.94); z-index: 20; }
.set-card { max-width: 760px; }
.set-card h2, .tut-card h2 { font-size: 30px; font-weight: 900; letter-spacing: 1px; margin-bottom: 14px; }
.set-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; text-align: left; }
.set-cols section { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.set-cols h3 { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; opacity: 0.75; margin-bottom: 8px; }
.set-row { display: grid; grid-template-columns: 1fr 120px 52px; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.set-row input[type=range] { width: 100%; accent-color: #ffc93c; }
.set-row output { text-align: right; font-weight: 800; color: #ffd75e; }
.set-toggle {
  grid-column: 2 / 4; justify-self: end; width: 70px; padding: 6px; border: none; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-weight: 800; color: #fff; background: rgba(255, 255, 255, 0.15);
}
.set-toggle.on { background: #6fe0a0; color: #1b2a55; }
.set-seg { grid-column: 2 / 4; margin: 0; }
.cross-colors { grid-column: 2 / 4; display: flex; gap: 6px; justify-content: flex-end; }
.cross-swatch { width: 26px; height: 26px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.cross-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px #1b2a55 inset; }

.tut-card { max-width: 560px; }
.tut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; text-align: left; margin-bottom: 14px; }
.tut-grid div { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tut-grid kbd { min-width: 70px; text-align: center; }
.tut-tips { text-align: left; font-size: 13px; opacity: 0.9; margin: 0 0 18px 18px; line-height: 1.5; }

#rotate {
  position: fixed; inset: 0; z-index: 100; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: #1b2a55; font-weight: 800; font-size: 18px;
}
.rotate-icon { font-size: 54px; animation: tilt 1.6s ease-in-out infinite; }
@keyframes tilt { 50% { transform: rotate(-90deg); } }
/* El juego se puede jugar en vertical: ya no se pide girar el móvil */

@media (max-width: 720px) {
  .set-cols { grid-template-columns: 1fr; }
  .tut-grid { grid-template-columns: 1fr; }
}
@media (max-height: 500px) {
  .set-card h2, .tut-card h2 { font-size: 20px; margin-bottom: 6px; }
  .set-cols { gap: 8px; margin-bottom: 8px; }
  .set-row { margin-bottom: 4px; }
  .tut-tips { display: none; }
}

/* Anuncio recompensado */
#double-btn {
  display: block; margin: -8px auto 16px; padding: 9px 16px; border: none; border-radius: 10px;
  font-family: inherit; font-weight: 800; font-size: 14px; cursor: pointer;
  color: #1b2a55; background: #ffd75e; box-shadow: 0 3px 0 #b9790c;
}
#double-btn:disabled { opacity: 0.6; cursor: default; }

/* Iconos de armas (renderizados en Blender) */
#slots div { display: flex; align-items: center; gap: 4px; padding: 3px 8px; }
#slots div span { font-weight: 900; font-size: 11px; opacity: 0.8; }
#slots img { height: 26px; width: 52px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
#slots div.active img { filter: none; }
.ars-icon { display: block; width: 100%; height: 44px; object-fit: contain; margin-bottom: 4px; }
.coll-weapon { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.coll-weapon img { grid-row: 1 / 3; width: 52px; height: 26px; object-fit: contain; }
@media (max-height: 500px) { .ars-icon { height: 26px; } }

/* Personajes */
.pb-avatar {
  width: 44px; height: 44px; flex: none; padding: 0; border: 2px solid #ffc93c; border-radius: 12px; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #5b7fd6, #2a3f7a); overflow: hidden;
}
.pb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.coll-chars { display: grid; grid-template-columns: 230px 1fr; gap: 12px; text-align: left; }
.char-side { display: flex; flex-direction: column; align-items: stretch; }
.char-preview {
  display: block; width: 100%; border-radius: 12px;
  background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.16), rgba(0, 0, 0, 0.18));
}
.char-info { margin: 8px 0; text-align: center; }
.char-info b { display: block; font-size: 22px; font-weight: 900; }
.char-info span { color: var(--rarity); font-weight: 800; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.char-side .big-btn { width: 100%; font-size: 18px; padding: 10px; margin-bottom: 0; }
.char-side .big-btn i.coin { vertical-align: -1px; }
.char-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px;
  max-height: 390px; overflow-y: auto; padding-right: 4px;
}
.char-card {
  position: relative; padding: 4px 4px 5px; border-radius: 10px; cursor: pointer; text-align: center;
  border: 2px solid var(--rarity); background: rgba(255, 255, 255, 0.06); font-family: inherit; color: #fff;
}
.char-card img {
  width: 100%; aspect-ratio: 1; display: block; border-radius: 7px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.12));
}
.char-card b { display: block; font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-card span { display: block; font-size: 10px; color: var(--rarity); font-weight: 800; }
.char-card.locked img { filter: grayscale(0.85) brightness(0.7); }
.char-card.locked span { color: #ffd75e; }
.char-card.active { box-shadow: 0 0 0 3px #fff inset; background: rgba(255, 255, 255, 0.16); }
.char-card.equipped::after {
  content: '✓'; position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #4fcf86; color: #fff; font-size: 12px; font-weight: 900; line-height: 18px;
}
@media (max-width: 720px) {
  .coll-chars { grid-template-columns: 1fr; }
  .char-side { display: grid; grid-template-columns: 120px 1fr; column-gap: 10px; align-items: center; }
  .char-side .char-preview { grid-row: 1 / 4; }
  .char-grid { max-height: 220px; }
}
@media (max-height: 500px) {
  .coll-chars { grid-template-columns: 150px 1fr; }
  .char-grid { max-height: 170px; }
  .pb-avatar { width: 32px; height: 32px; }
}

/* ================= Interfaz de partida estilo Rivals ================= */
/* Marcador: tarjeta azul (tú) y amarilla (rival) con retrato, y el tiempo en medio */
#scoreboard { top: 10px; gap: 22px; align-items: center; }
.sb-side {
  min-width: 104px; height: 62px; padding: 4px 14px 4px 6px; gap: 8px;
  border-radius: 8px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.sb-a { background: linear-gradient(135deg, #5b5ef0, #3a3fc2); }
.sb-b { background: linear-gradient(135deg, #ffd84a, #f5b81f); flex-direction: row-reverse; padding: 4px 6px 4px 14px; }
.sb-b b, .sb-b .sb-name { color: #fff; text-shadow: 0 2px 3px rgba(120, 70, 0, 0.6); }
.sb-side b { font-size: 40px; }
.sb-face { width: 54px; height: 54px; object-fit: cover; border-radius: 6px; background: rgba(0, 0, 0, 0.18); }
.sb-name { position: absolute; left: 0; right: 0; bottom: -17px; text-align: center; font-size: 11px; max-width: none; }
.sb-mid { min-width: 110px; padding: 8px 14px; border-radius: 8px; background: rgba(40, 18, 60, 0.82); }
#sb-time-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; }
#sb-time-wrap .hourglass { font-style: normal; font-size: 18px; filter: grayscale(1) brightness(2); }
#sb-time { font-size: 28px; }
#sb-round { margin-top: 2px; }
.sb-pips { bottom: -30px; }

/* Vida: barra larga verde con el número dentro */
#health { left: 12px; bottom: 14px; display: block; }
#health .hp-bar {
  position: relative; width: 290px; height: 26px; border-radius: 13px;
  background: rgba(15, 20, 40, 0.65); border: 3px solid rgba(0, 0, 0, 0.35);
}
#health .hp-fill { border-radius: 10px; background: #5ef04a; }
#health .hp-text {
  position: absolute; left: 212px; width: 80px; text-align: right; top: 50%; transform: translateY(-50%); z-index: 1;
  font-size: 15px; min-width: 0; color: rgba(255, 255, 255, 0.95); padding-right: 14px;
}
#health .hp-text::after { content: ' \2665'; font-size: 13px; }
#health.low .hp-bar { animation: hpLow 0.8s ease-in-out infinite alternate; }
@keyframes hpLow { to { border-color: rgba(255, 60, 60, 0.85); } }

/* Armas: nombre grande y casillas cuadradas con la munición en la activa */
#weapon-panel { right: 12px; bottom: 40px; }
#weapon-name { font-size: 28px; font-weight: 900; opacity: 1; margin-bottom: 6px; }
#ammo, #reload-bar { display: none; }
#slots { gap: 6px; margin-bottom: 0; align-items: flex-end; }
#slots div {
  position: relative; width: 64px; height: 64px; padding: 0; justify-content: center;
  border-radius: 8px; background: rgba(15, 20, 40, 0.45); border: 2px solid rgba(255, 255, 255, 0.12); opacity: 0.85;
}
#slots div span { position: absolute; left: 5px; top: 3px; font-size: 10px; }
#slots img { width: 54px; height: 40px; }
#slots div.active {
  width: 84px; height: 84px; background: rgba(15, 20, 40, 0.7);
  border-color: rgba(255, 255, 255, 0.85); color: #fff; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7);
}
#slots div.active img { width: 72px; height: 50px; margin-top: -14px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.slot-ammo {
  position: absolute; left: 0; right: 0; bottom: 4px; text-align: center;
  font-style: normal; font-weight: 900; font-size: 20px; line-height: 1;
}
.slot-ammo small { font-size: 11px; opacity: 0.8; margin-left: 3px; }
.slot-ammo.low { color: #ff5a4f; }
#utility { position: absolute; right: 0; top: -22px; font-size: 11px; }

/* Barra de atajos (abajo a la derecha) */
#hint-bar {
  position: absolute; right: 12px; bottom: 10px; display: flex; gap: 14px;
  padding: 4px 12px; border-radius: 12px; background: rgba(15, 20, 40, 0.55);
  font-size: 11px; font-weight: 700; opacity: 0.85;
}
#hint-bar kbd {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.85); color: #1b1f2e; font-weight: 800; font-size: 10px; line-height: 16px;
}
body.is-touch #hint-bar { display: none; }

/* Números de daño: grandes, rojos y con borde oscuro; estallido detrás */
#damage-numbers .dmg {
  font-size: 40px; color: #ff3d3d; letter-spacing: 1px;
  -webkit-text-stroke: 3px #4a0d12; paint-order: stroke fill;
  text-shadow: 0 4px 0 rgba(60, 5, 10, 0.55);
}
#damage-numbers .dmg.head { color: #ffb02e; font-size: 48px; -webkit-text-stroke-color: #5a2a00; }
#damage-numbers .dmg.pop { animation: dmgPop 0.25s ease-out; }
@keyframes dmgPop { 0% { transform: translate(-50%, -50%) scale(1.55); } 100% { transform: translate(-50%, -50%) scale(1); } }
.hitfx {
  position: absolute; left: 50%; top: 50%; width: 130px; height: 130px; z-index: -1;
  margin: -65px 0 0 -65px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 8deg, rgba(255, 235, 240, 0.95) 0 6deg, transparent 6deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 70%);
  mask: radial-gradient(circle, transparent 18%, #000 30%, transparent 70%);
  animation: hitfx 0.3s ease-out forwards;
}
.dmg.head .hitfx { background: repeating-conic-gradient(from 8deg, rgba(255, 220, 140, 0.95) 0 6deg, transparent 6deg 30deg); }
@keyframes hitfx { 0% { transform: scale(0.3) rotate(0deg); opacity: 1; } 100% { transform: scale(1.25) rotate(20deg); opacity: 0; } }

/* Killfeed en cápsulas de color con el icono del arma */
#killfeed { top: 12px; right: 12px; }
#killfeed div {
  display: flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
#killfeed div.kf-a { background: rgba(74, 110, 255, 0.92); }
#killfeed div.kf-b { background: rgba(235, 52, 58, 0.92); }
#killfeed img.w { height: 18px; width: 40px; object-fit: contain; filter: brightness(0) invert(1); margin: 0; opacity: 1; }
#killfeed .hs { color: #ffd84a; margin-left: 0; }
body.is-touch #killfeed { top: 92px; }

/* Cartel de ronda: caja de color arriba en el centro */
#round-banner { top: 96px; text-shadow: none; }
#round-banner h2 {
  display: inline-block; padding: 6px 26px 8px; border-radius: 6px;
  font-size: clamp(26px, 4.4vw, 42px); color: #fff; letter-spacing: 1px;
  background: linear-gradient(#3b3f58, #23263a); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}
#round-banner.win h2 { color: #fff; background: linear-gradient(#3fd06e, #23a24f); }
#round-banner.lose h2 { color: #fff; background: linear-gradient(#ff4a4f, #c8232c); }
#round-banner p { text-shadow: 0 2px 3px rgba(0, 0, 0, 0.6); }

/* Tarjeta "te eliminó" abajo a la derecha */
#killed-by {
  position: absolute; right: 20px; bottom: 160px; display: flex; align-items: center; gap: 12px;
  padding: 8px 18px 8px 8px; border-radius: 8px; min-width: 330px;
  background: linear-gradient(100deg, #ffd84a, #f2b21c 70%, rgba(242, 178, 28, 0));
  color: #fff; text-shadow: 0 2px 3px rgba(110, 60, 0, 0.6);
  opacity: 0; transform: translateX(30px); transition: opacity 0.25s, transform 0.25s;
}
#killed-by.show { opacity: 1; transform: none; }
#killed-by .kb-face { width: 70px; height: 70px; border-radius: 6px; object-fit: cover; background: rgba(0, 0, 0, 0.15); }
#killed-by b { display: block; font-size: 24px; font-weight: 900; }
#killed-by span { font-size: 14px; font-weight: 700; }
#killed-by .kb-weapon { width: 120px; height: 70px; object-fit: contain; margin-left: auto; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }

/* Aviso de baja (al matar tú) como cápsula */
#kill-banner {
  top: 64%; font-size: 17px; padding: 6px 16px; border-radius: 8px;
  background: rgba(15, 20, 40, 0.6); text-shadow: none;
}

@media (max-height: 500px) {
  .sb-side { height: 46px; min-width: 80px; }
  .sb-face { width: 40px; height: 40px; }
  .sb-side b { font-size: 28px; }
  #sb-time { font-size: 20px; }
  #health .hp-bar { width: 180px; height: 20px; }
  #health .hp-text { left: 102px; }
  #killed-by { bottom: 110px; min-width: 260px; }
  #killed-by .kb-face { width: 50px; height: 50px; }
  #killed-by .kb-weapon { width: 80px; height: 50px; }
}
body.is-touch #health { top: auto; bottom: 14px; left: 50%; transform: translateX(-50%); }
body.is-touch #health .hp-bar { width: 200px; }
body.is-touch #health .hp-text { left: 122px; }

/* ================= Arsenal estilo Rivals ================= */
.ars-card { max-width: 820px; }
.ars-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.ars-slot {
  position: relative; padding: 26px 8px 10px; border-radius: 12px; cursor: pointer;
  border: 3px solid rgba(255, 255, 255, 0.15); background: linear-gradient(#2c3560, #1c2240);
  color: #fff; font-family: inherit; transition: transform 0.1s, border-color 0.1s;
}
.ars-slot:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.45); }
.ars-slot.active { border-color: #ffc93c; background: linear-gradient(#3b4680, #252d55); }
.ars-slot-title {
  position: absolute; left: 0; right: 0; top: 6px; font-size: 11px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase; opacity: 0.75;
}
.ars-slot img { display: block; width: 100%; height: 70px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.ars-slot b { display: block; margin-top: 4px; font-size: 15px; }
.ars-hint { opacity: 0.7; font-size: 13px; margin: 4px 0 16px; }
.ars-picker { margin-bottom: 16px; text-align: left; }
.ars-picker h3 { font-size: 13px; letter-spacing: 1px; opacity: 0.8; margin-bottom: 6px; text-transform: uppercase; }
.ars-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
@media (max-width: 720px) { .ars-slots { grid-template-columns: repeat(2, 1fr); } }
@media (max-height: 500px) {
  .ars-slot { padding: 20px 6px 6px; }
  .ars-slot img { height: 40px; }
  .ars-slot b { font-size: 12px; }
}

/* Al apuntar sin mira: punto central algo mayor */
#crosshair.ads i { width: 5px; height: 5px; left: -2.5px; top: -2.5px; }

/* ================= Locutor: mensajes grandes en mitad de la pantalla ================= */
#announce {
  position: absolute; left: 0; right: 0; top: 24%; text-align: center; pointer-events: none;
  opacity: 0; font-style: italic;
}
#announce b {
  display: inline-block; font-size: clamp(42px, 7.5vw, 86px); font-weight: 900; letter-spacing: 2px; line-height: 1;
  color: #ffe066; -webkit-text-stroke: 4px #4a2400; paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(60, 20, 0, 0.6), 0 0 30px rgba(255, 180, 40, 0.65);
}
#announce span {
  display: block; margin-top: 4px; font-size: clamp(16px, 2.2vw, 26px); font-weight: 900; letter-spacing: 3px;
  color: #fff; -webkit-text-stroke: 2px #5a0a0a; paint-order: stroke fill;
}
#announce.orange b { color: #ffad33; -webkit-text-stroke-color: #4a1800; text-shadow: 0 6px 0 rgba(70, 20, 0, 0.6), 0 0 34px rgba(255, 120, 20, 0.75); }
#announce.red b { color: #ff4d4d; -webkit-text-stroke-color: #3d0006; text-shadow: 0 6px 0 rgba(60, 0, 8, 0.6), 0 0 36px rgba(255, 40, 40, 0.75); }
#announce.purple b { color: #d77bff; -webkit-text-stroke-color: #25003a; text-shadow: 0 6px 0 rgba(30, 0, 50, 0.6), 0 0 40px rgba(190, 80, 255, 0.85); }
#announce.show { animation: announceIn 1.5s ease-out forwards; }
#announce.show b { animation: announceShake 0.45s ease-out; }
@keyframes announceIn {
  0% { opacity: 0; transform: scale(2.2); }
  10% { opacity: 1; transform: scale(0.94); }
  16% { transform: scale(1.04); }
  22% { transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08) translateY(-12px); }
}
@keyframes announceShake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  15% { transform: translate(-6px, 2px) rotate(-2deg); }
  30% { transform: translate(5px, -3px) rotate(2deg); }
  45% { transform: translate(-4px, 2px) rotate(-1deg); }
  60% { transform: translate(3px, -1px) rotate(1deg); }
  75% { transform: translate(-1px, 1px); }
}

/* ================= Racha con fuego ================= */
#streak {
  position: absolute; left: 22px; bottom: 58px; display: none; align-items: center; gap: 6px;
  padding: 4px 14px 4px 8px; border-radius: 12px; pointer-events: none;
  background: linear-gradient(90deg, rgba(120, 20, 0, 0.75), rgba(40, 10, 10, 0.2));
  font-weight: 900; font-style: italic; color: #fff;
}
#streak.show { display: flex; }
#streak b { font-size: 34px; line-height: 1; color: #ffd84a; -webkit-text-stroke: 2px #5a1a00; paint-order: stroke fill; }
#streak span { font-size: 12px; letter-spacing: 2px; opacity: 0.9; }
#streak .flame {
  position: relative; width: 26px; height: 34px; display: block;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 80%, #fff6b0 0 18%, #ffd23c 30%, #ff7a1a 58%, #e2260f 78%, transparent 80%);
  filter: drop-shadow(0 0 8px rgba(255, 110, 20, 0.9));
  transform-origin: 50% 90%; animation: flame 0.18s ease-in-out infinite alternate;
}
@keyframes flame { from { transform: scale(0.92, 1.05) rotate(-4deg); } to { transform: scale(1.08, 0.94) rotate(4deg); } }
/* Cuanto más alta la racha, más grande el fuego y más tiembla */
#streak.lv2 .flame { width: 30px; height: 40px; }
#streak.lv3 .flame { width: 34px; height: 46px; }
#streak.lv4 .flame { width: 38px; height: 52px; filter: drop-shadow(0 0 14px rgba(255, 80, 20, 1)); }
#streak.lv2 { animation: streakShake 0.5s linear infinite; }
#streak.lv3 { animation: streakShake 0.3s linear infinite; }
#streak.lv4 { animation: streakShake 0.18s linear infinite; }
#streak.bump b { animation: streakBump 0.35s ease-out; }
@keyframes streakShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1.5px, 1px) rotate(-0.6deg); }
  50% { transform: translate(1.5px, -1px) rotate(0.6deg); }
  75% { transform: translate(-1px, -1px); }
}
@keyframes streakBump { 0% { transform: scale(1.8); } 100% { transform: scale(1); } }
body.is-touch #streak { left: 12px; bottom: auto; top: 120px; }

/* ================= Mira del francotirador ================= */
/* Fuera de la lente: negro translúcido (se intuye el escenario); la cruz se inclina al girar */
#scope { --tilt: 0deg; --sx: 0px; --sy: 0px; }
#scope .scope-ring {
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.72), inset 0 0 50px 14px rgba(0, 0, 0, 0.55);
  transform: translate(calc(-50% - var(--sx) * 0.4), calc(-50% - var(--sy) * 0.4));
}
#scope .h, #scope .v { transform: translate(var(--sx), var(--sy)) rotate(var(--tilt)); background: rgba(0, 0, 0, 0.9); }
#scope .h { height: 3px; margin-top: -1.5px; }
#scope .v { width: 3px; margin-left: -1.5px; }
#scope::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 6px rgba(255, 60, 60, 0.9);
  transform: translate(var(--sx), var(--sy));
}

/* Selector de mapa con 8 opciones: dos filas de 4 */
.seg.seg-8 { grid-template-columns: repeat(4, 1fr); }
@media (max-height: 500px) { .seg.seg-8 button { font-size: 10px; padding: 5px 2px; } }

/* Mira telescópica limpia: las líneas no salen del círculo; todo se mueve junto y muy poco */
#scope .scope-ring {
  overflow: hidden;
  transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) rotate(var(--tilt));
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.72), inset 0 0 60px 18px rgba(0, 0, 0, 0.5);
}
#scope .scope-ring .h, #scope .scope-ring .v { position: absolute; transform: none; background: rgba(0, 0, 0, 0.85); }
#scope .scope-ring .h { left: 6%; right: 6%; top: 50%; height: 2px; margin-top: -1px; }
#scope .scope-ring .v { top: 6%; bottom: 6%; left: 50%; width: 2px; margin-left: -1px; }
#scope .scope-ring .dot {
  position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%;
  background: #ff3b3b; box-shadow: 0 0 5px rgba(255, 60, 60, 0.8);
}
#scope::after { display: none; }

/* Cámara del baile al ganar una ronda: sin mira ni arma */
body.dance-cam #crosshair, body.dance-cam #hitmarker, body.dance-cam #scope { display: none !important; }
