* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; user-select: none; -webkit-user-select: none; }
body { font-family: 'VT323', 'Courier New', monospace; color: #fff; font-size: 22px; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.hidden { display: none !important; }
.red { color: #ff5555; } .blue { color: #55aaff; } .green { color: #55ff55; } .yellow { color: #ffff55; } .gray { color: #aaaaaa; } .gold { color: #ffaa00; }
.txt-shadow, #hud, .screen { text-shadow: 2px 2px 0 #3f3f3f; }

/* ---------- Pantallas ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 20; background: radial-gradient(ellipse at center, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%); }
.screen.dim { background: rgba(0, 0, 0, 0.55); }
.logo { font-family: 'Press Start 2P', monospace; font-size: clamp(34px, 7vw, 76px); color: #fff; letter-spacing: 4px;
  text-shadow: 5px 5px 0 #2a2a2a; -webkit-text-stroke: 2px #222; paint-order: stroke fill; text-align: center; }
.logo.small { font-size: clamp(22px, 4vw, 40px); }
.logo.win { color: #ffd84a; } .logo.lose { color: #ff5555; }
.splash { font-family: 'Press Start 2P', monospace; font-size: 14px; color: #ffff55; transform: rotate(-4deg); animation: pulse 0.9s ease-in-out infinite alternate; margin-bottom: 6px; }
@keyframes pulse { from { transform: rotate(-4deg) scale(1); } to { transform: rotate(-4deg) scale(1.08); } }
.panel { background: rgba(0, 0, 0, 0.55); border: 2px solid #000; box-shadow: inset 0 0 0 2px #555; padding: 18px 22px; width: min(440px, 92vw); display: flex; flex-direction: column; gap: 10px; }
.panel.wide { width: min(720px, 94vw); }
.panel p { line-height: 1.1; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.field { display: flex; flex-direction: column; gap: 4px; color: #e0e0e0; }
.field input { font-family: inherit; font-size: 24px; padding: 4px 8px; background: #000; color: #fff; border: 2px solid #a0a0a0; outline: none; }
.field input:focus { border-color: #fff; }
.seg { display: flex; gap: 6px; }
.seg button, button.mc { font-family: inherit; font-size: 24px; color: #e0e0e0; cursor: pointer; padding: 6px 10px; flex: 1;
  background: linear-gradient(#8b8b8b, #6f6f6f); border: 2px solid #000; box-shadow: inset 2px 2px 0 #aaa, inset -2px -2px 0 #555; text-shadow: 2px 2px 0 #3f3f3f; }
.seg button:hover, button.mc:hover { background: linear-gradient(#9aa6d8, #7180c0); color: #ffffa0; }
.seg button.on { background: linear-gradient(#5f9a3a, #3f7a22); color: #fff; box-shadow: inset 2px 2px 0 #8fd060, inset -2px -2px 0 #2a5016; }
button.mc.big { font-size: 30px; padding: 10px; }
.slider { display: flex; flex-direction: column; gap: 2px; }
.slider input { width: 100%; accent-color: #6f9a3a; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: #6f9a3a; }
.footer { position: fixed; bottom: 8px; left: 10px; font-size: 18px; color: #ddd; }
.warn { color: #ff5555; font-size: 22px; }
.keys { border-collapse: collapse; width: 100%; }
.keys td { padding: 3px 6px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.keys td:first-child { color: #ffff55; white-space: nowrap; width: 150px; }
.tip { color: #ddd; font-size: 20px; }
.stats { border-collapse: collapse; width: 100%; font-size: 22px; }
.stats th { color: #aaa; text-align: left; padding: 2px 6px; font-weight: normal; }
.stats td { padding: 2px 6px; border-top: 1px solid rgba(255,255,255,0.08); }
.stats tr.me td { background: rgba(255, 255, 85, 0.1); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); mix-blend-mode: difference; }
#crosshair::before, #crosshair::after { content: ''; position: absolute; background: #fff; }
#crosshair::before { left: 10px; top: 0; width: 2px; height: 22px; }
#crosshair::after { left: 0; top: 10px; width: 22px; height: 2px; }
#vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px 40px rgba(255, 0, 0, 0.6); opacity: 0; transition: opacity 0.35s; }
#bottom { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
#hearts { image-rendering: pixelated; width: 240px; height: 27px; }
#hotbar { display: flex; background: rgba(0, 0, 0, 0.45); border: 3px solid #1a1a1a; box-shadow: inset 0 0 0 2px #8b8b8b; padding: 2px; }
.slot { width: 52px; height: 52px; position: relative; border: 2px solid #555; margin: 0 1px; display: flex; align-items: center; justify-content: center; }
.slot.sel { border: 3px solid #fff; box-shadow: 0 0 0 2px #000; margin: -2px -1px; width: 58px; height: 58px; z-index: 2; }
.slot canvas { width: 38px; height: 38px; image-rendering: pixelated; }
.slot .cnt { position: absolute; right: 3px; bottom: -2px; font-size: 24px; }
.slot .cool { position: absolute; left: 4px; right: 4px; bottom: 4px; height: 4px; background: #000; }
.slot .cool > i { display: block; height: 100%; background: #55ff55; }
.slot.empty canvas { opacity: 0.25; }
#scorebar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; background: rgba(0,0,0,0.4); padding: 4px 14px; font-family: 'Press Start 2P', monospace; font-size: 22px; }
.sb-team { display: flex; align-items: center; gap: 10px; }
.sb-team.red { color: #ff5555; } .sb-team.blue { color: #55aaff; }
.sb-mid { text-align: center; font-size: 14px; color: #fff; }
.sb-mode { font-size: 9px; color: #aaa; margin-top: 4px; }
.dots { display: flex; gap: 3px; }
.dots i { width: 10px; height: 10px; border: 2px solid currentColor; display: block; }
.dots i.on { background: currentColor; }
#sidebar { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.35); padding: 4px 8px 6px; min-width: 190px; font-size: 21px; line-height: 1; }
.sd-title { text-align: center; color: #ffff55; font-weight: bold; margin-bottom: 3px; font-size: 22px; }
.sd-line { white-space: nowrap; }
#chat { position: absolute; left: 6px; bottom: 120px; width: min(520px, 60vw); display: flex; flex-direction: column; gap: 1px; }
#chat .msg { background: rgba(0, 0, 0, 0.4); padding: 1px 6px; transition: opacity 1s; font-size: 20px; }
#title { position: absolute; top: 30%; left: 0; right: 0; text-align: center; opacity: 0; transition: opacity 0.2s; }
#titleMain { font-family: 'Press Start 2P', monospace; font-size: clamp(26px, 5vw, 54px); text-shadow: 4px 4px 0 #3f3f3f; }
#titleSub { font-size: 30px; margin-top: 12px; }
#killnotice { position: absolute; top: 58%; left: 0; right: 0; text-align: center; font-size: 26px; color: #ff5555; opacity: 0; transition: opacity 0.4s; }
#actionbar { position: absolute; bottom: 118px; left: 0; right: 0; text-align: center; font-size: 22px; }
#tags .tag { position: absolute; transform: translate(-50%, -100%); background: rgba(0, 0, 0, 0.35); padding: 0 5px; font-size: 20px; white-space: nowrap; text-align: center; line-height: 1; }
#tags .tag .hp { height: 3px; background: #300; margin-top: 2px; }
#tags .tag .hp i { display: block; height: 100%; background: #e33; }
#tablist { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.6); padding: 8px 14px; min-width: 380px; }
#tablist table { width: 100%; border-collapse: collapse; }
#tablist th { color: #aaa; font-weight: normal; text-align: left; padding: 0 8px; }
#tablist td { padding: 0 8px; }
#fps { position: absolute; left: 6px; top: 6px; font-size: 20px; color: #ff5; }
.overlay-msg { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.6); padding: 10px 20px; font-size: 28px; animation: blink 1s infinite alternate; }
@keyframes blink { from { opacity: 1; } to { opacity: 0.55; } }
@media (max-width: 900px) { #sidebar { display: none; } }

.skinsel { display: flex; align-items: center; gap: 8px; }
.skinsel span { flex: 1; text-align: center; font-size: 26px; color: #fff; background: rgba(0,0,0,0.4); padding: 4px; border: 2px solid #555; }
button.mc.arrow { flex: 0 0 54px; padding: 4px; }
