:root {
  --ink: #0d1424; --panel: rgba(13, 20, 36, 0.78); --line: rgba(255, 255, 255, 0.16);
  --txt: #f2f5fb; --dim: #a9b4c8; --accent: #ff7a3d; --hp: #5fe07a; --sh: #4aa8ff; --zone: #b04bff; --warn: #ff4d5e;
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1424; color: var(--txt); user-select: none; -webkit-user-select: none; }
canvas#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

/* ---------- pantallas ---------- */
.screen > .panel { margin: auto; }
.screen { position: fixed; inset: 0; display: grid; background: radial-gradient(ellipse at 50% 30%, rgba(40, 70, 120, 0.55), rgba(8, 12, 24, 0.92)); z-index: 20; padding: 16px; overflow: auto; }
.panel { width: min(860px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px 32px; backdrop-filter: blur(6px); }
.panel.narrow { width: min(430px, 100%); text-align: center; }
h1 { margin: 0 0 6px; font-size: clamp(42px, 7vw, 76px); line-height: 0.95; font-weight: 900; letter-spacing: 0.04em; font-style: italic; }
h1 em { color: var(--accent); font-style: italic; }
h2 { margin: 0 0 14px; font-size: 40px; letter-spacing: 0.08em; font-weight: 900; font-style: italic; }
h3 { margin: 16px 0 8px; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.tag { color: var(--dim); max-width: 60ch; line-height: 1.5; margin: 6px 0 20px; }
.small { color: var(--dim); font-size: 13px; line-height: 1.5; }
button { font: inherit; cursor: pointer; border: 0; color: #fff; }
button.big { background: var(--accent); font-weight: 900; letter-spacing: 0.12em; font-size: 20px; padding: 14px 34px; border-radius: 8px; transform: skew(-6deg); box-shadow: 0 6px 0 #b8501f; transition: transform 0.08s, box-shadow 0.08s; }
button.big:hover { filter: brightness(1.08); }
button.big:active { transform: skew(-6deg) translateY(4px); box-shadow: 0 2px 0 #b8501f; }
button.big:focus-visible, button.ghost:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
button.ghost { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 10px 18px; margin-top: 14px; color: var(--dim); }
button.ghost:hover { color: #fff; border-color: #fff; }
.cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; margin-top: 22px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.keys dt { font-weight: 700; color: #fff; background: rgba(255, 255, 255, 0.09); border-radius: 5px; padding: 2px 8px; justify-self: start; white-space: nowrap; }
.keys dd { margin: 0; color: var(--dim); align-self: center; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--dim); margin-bottom: 10px; }
label.chk { display: flex; gap: 8px; align-items: center; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.stats { display: flex; justify-content: center; gap: 28px; margin: 14px 0 16px; }
.stats b { display: block; font-size: 28px; font-variant-numeric: tabular-nums; }
.stats span { color: var(--dim); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
#end-place { font-size: 76px; font-weight: 900; line-height: 1; color: var(--accent); font-style: italic; }
#end-sub { color: var(--dim); margin-top: 2px; }
#screen-end.win #end-place { color: #ffd23f; }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; } .panel { padding: 20px 18px; } }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); font-variant-numeric: tabular-nums; }
#mini { position: absolute; left: 18px; top: 18px; width: 200px; height: 200px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4); overflow: hidden; background: #2d7fb1; }
#mini canvas { width: 100%; height: 100%; display: block; }
#loc { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-weight: 800; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0; transition: opacity 0.4s; }
#loc.on { opacity: 1; }
#topRight { position: absolute; right: 18px; top: 18px; display: flex; gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; text-align: center; min-width: 72px; }
.stat b { display: block; font-size: 26px; line-height: 1.05; }
.stat span { font-size: 10px; letter-spacing: 0.18em; color: var(--dim); }
#zonebar { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 22px; text-align: center; min-width: 230px; border-bottom: 3px solid #fff; }
#zonebar.shrink { border-bottom-color: var(--zone); }
#zoneLabel { font-size: 10px; letter-spacing: 0.2em; color: var(--dim); }
#zoneTime { font-size: 26px; font-weight: 900; line-height: 1.1; }
#zonebar.shrink #zoneTime { color: #d9a3ff; }
#feed { position: absolute; right: 18px; top: 92px; display: grid; gap: 4px; justify-items: end; width: 320px; }
#feed div { background: rgba(10, 14, 26, 0.7); border-radius: 5px; padding: 4px 10px; font-size: 13px; animation: feedIn 0.2s ease-out; }
#feed div.me { border-left: 3px solid var(--accent); background: rgba(70, 30, 10, 0.78); }
#feed b { color: #fff; }
@keyframes feedIn { from { transform: translateX(30px); opacity: 0; } }

#cross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#cross i { position: absolute; background: #fff; box-shadow: 0 0 2px #000; opacity: 0.9; transition: transform 0.08s; }
#cross i:nth-child(1) { width: 2px; height: 9px; left: -1px; top: -16px; }
#cross i:nth-child(2) { width: 2px; height: 9px; left: -1px; top: 7px; }
#cross i:nth-child(3) { width: 9px; height: 2px; left: -16px; top: -1px; }
#cross i:nth-child(4) { width: 9px; height: 2px; left: 7px; top: -1px; }
#cross.ads { opacity: 0.4; }
#hitm { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
#hitm i { position: absolute; width: 3px; height: 10px; background: #fff; box-shadow: 0 0 3px #000; }
#hitm i:nth-child(1) { transform: translate(-13px, -13px) rotate(45deg); } #hitm i:nth-child(2) { transform: translate(10px, -13px) rotate(-45deg); }
#hitm i:nth-child(3) { transform: translate(-13px, 4px) rotate(-45deg); } #hitm i:nth-child(4) { transform: translate(10px, 4px) rotate(45deg); }
#hitm.on { opacity: 1; transition: none; } #hitm.head i { background: #ff2d3d; height: 12px; } #hitm.kill i { background: var(--warn); height: 13px; }
#hitm { transition: opacity 0.25s; }
#dmgnums { position: absolute; left: 50%; top: 50%; }
.dn { position: absolute; font-weight: 900; font-size: 22px; color: #fff; animation: dn 0.8s ease-out forwards; white-space: nowrap; text-shadow: 0 2px 3px #000, 0 0 2px #000; }
.dn.head { color: #ff2d3d; font-size: 34px; text-shadow: 0 2px 3px #000, 0 0 10px rgba(255, 40, 50, 0.75); animation: dnHead 0.95s ease-out forwards; }
@keyframes dnHead { 0% { transform: translate(var(--x), -20px) scale(0.6); opacity: 1; } 18% { transform: translate(var(--x), -34px) scale(1.35); } 100% { transform: translate(var(--x), -105px) scale(1); opacity: 0; } }
@keyframes dn { from { transform: translate(var(--x), -24px); opacity: 1; } to { transform: translate(var(--x), -90px); opacity: 0; } }
#dmgdir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; transition: opacity 0.9s; }
#dmgdir.on { opacity: 1; transition: none; }
#dmgArrow { position: absolute; left: -60px; top: -160px; width: 120px; height: 120px; background: radial-gradient(ellipse at 50% 0%, rgba(255, 60, 70, 0.9), transparent 65%); transform-origin: 60px 160px; }
#vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px 40px rgba(255, 30, 50, 0); transition: box-shadow 0.5s; }
#vignette.hurt { box-shadow: inset 0 0 160px 40px rgba(255, 30, 50, 0.55); transition: none; }
#vignette.zone { box-shadow: inset 0 0 200px 60px rgba(176, 75, 255, 0.45); }
#toast { position: absolute; left: 50%; bottom: 31%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px; font-weight: 700; opacity: 0; transition: opacity 0.15s; white-space: nowrap; }
#toast.on { opacity: 1; }
#toast kbd, .keys kbd { background: #fff; color: #000; border-radius: 4px; padding: 1px 7px; margin-right: 8px; font-weight: 900; text-shadow: none; }
#usebar { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); width: 240px; height: 22px; background: rgba(0, 0, 0, 0.55); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
#usefill { height: 100%; width: 0; background: var(--hp); } #usefill.sh { background: var(--sh); }
#uselabel { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; }

#vitals { position: absolute; left: 22px; bottom: 22px; width: 300px; display: grid; gap: 5px; }
.bar { position: relative; height: 24px; background: rgba(0, 0, 0, 0.55); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; transform: skew(-8deg); }
.bar div { height: 100%; width: 100%; transition: width 0.15s; }
.bar.health div { background: linear-gradient(#7cf08f, #3fbf5b); } .bar.shield div { background: linear-gradient(#6cc0ff, #3a80e0); }
.bar span { position: absolute; left: 10px; top: 0; line-height: 24px; font-weight: 900; font-size: 15px; transform: skew(8deg); }
#consum { position: absolute; left: 22px; bottom: 100px; font-size: 13px; color: #fff; display: flex; gap: 14px; flex-wrap: wrap; width: 340px; }
#consum span { background: rgba(0, 0, 0, 0.5); border-radius: 5px; padding: 3px 8px; }
#consum kbd { background: #fff; color: #000; border-radius: 3px; padding: 0 5px; margin-right: 5px; font-weight: 900; text-shadow: none; }
#slots { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 6px; }
.slot { width: 84px; height: 56px; background: rgba(0, 0, 0, 0.5); border: 2px solid rgba(255, 255, 255, 0.2); border-radius: 6px; padding: 4px 6px; font-size: 11px; line-height: 1.2; position: relative; }
.slot.sel { background: rgba(255, 255, 255, 0.22); transform: translateY(-5px); }
.slot i { position: absolute; left: 5px; top: 3px; font-style: normal; font-weight: 900; font-size: 11px; opacity: 0.8; }
.slot b { display: block; margin-top: 14px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot small { color: var(--dim); font-size: 10px; }
#weaponbox { position: absolute; right: 22px; bottom: 22px; text-align: right; }
#wname { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; }
#ammo b { font-size: 54px; font-weight: 900; line-height: 1; font-style: italic; } #ammo span { font-size: 24px; color: var(--dim); margin-left: 4px; }
#altimeter { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); text-align: center; }
#altimeter b { font-size: 58px; font-weight: 900; font-style: italic; } #altimeter span { font-size: 20px; color: var(--dim); }
#altHint { margin-top: 4px; font-weight: 700; letter-spacing: 0.08em; background: var(--panel); padding: 6px 14px; border-radius: 6px; }
#scope { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, transparent 0, transparent 31vmin, #000 31.4vmin); }
#scope::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, 0.8); } #scope::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(0, 0, 0, 0.8); }
#bigmap { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; background: rgba(5, 10, 20, 0.7); }
#bigmap canvas { width: min(88vh, 92vw); height: min(88vh, 92vw); border: 3px solid rgba(255, 255, 255, 0.8); border-radius: 8px; background: #2d7fb1; }
#bigmap .hint { position: absolute; bottom: 14px; color: var(--dim); font-size: 13px; }
@media (max-width: 900px) { #mini { width: 140px; height: 140px; } #feed { top: 70px; width: 220px; } #vitals { width: 220px; } .slot { width: 64px; } }
@media (prefers-reduced-motion: reduce) { #feed div, .dn { animation: none; } }

#fps { position: fixed; left: 22px; top: 226px; z-index: 6; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.45); padding: 2px 8px; border-radius: 4px; pointer-events: none; font-variant-numeric: tabular-nums; }

/* ---------- perfil, ligas y clasificación ---------- */
.profile { display: grid; grid-template-columns: auto auto 1fr 1.15fr; gap: 18px; align-items: center; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin: 0 0 18px; }
.lv { width: 66px; height: 66px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffb27a, var(--accent) 70%); display: grid; place-content: center; text-align: center; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35), 0 4px 14px rgba(255, 122, 61, 0.4); }
.lv b { font-size: 28px; line-height: 1; font-style: italic; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.lv span { font-size: 9px; letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.9); font-weight: 800; }
.lv.sm { width: 52px; height: 52px; flex: none; } .lv.sm b { font-size: 22px; }
.pf-main { min-width: 0; }
#pf-name { width: 100%; max-width: 230px; font: inherit; font-weight: 900; font-size: 20px; color: #fff; background: transparent; border: 0; border-bottom: 2px dashed rgba(255, 255, 255, 0.25); padding: 0 0 2px; outline: none; }
#pf-name:hover { border-bottom-color: rgba(255, 255, 255, 0.5); } #pf-name:focus { border-bottom: 2px solid var(--accent); }
.pf-title { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin: 4px 0 8px; }
.xpbar { height: 10px; background: rgba(0, 0, 0, 0.45); border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.xpbar > div { height: 100%; width: 0; background: linear-gradient(90deg, #ffb27a, var(--accent)); transition: width 0.8s ease-out; border-radius: 6px; }
.rkbar { height: 7px; margin: 5px 0 3px; } .rkbar > div { transition: none; }
.pf-xp { font-size: 12px; color: var(--dim); margin-top: 4px; }
.sm { font-size: 12px; color: var(--dim); }
.pf-rank { display: flex; gap: 12px; align-items: center; border-left: 1px solid var(--line); padding-left: 18px; min-width: 0; }
.pf-rank .rk { display: grid; gap: 1px; min-width: 0; flex: 1; } .pf-rank .rk b { font-size: 20px; } .pf-rank .rk span { font-size: 12px; color: var(--dim); }
.emb { flex: none; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45)); }
.play-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.play-row .ghost { margin-top: 0; }
@media (max-width: 720px) { .profile { grid-template-columns: auto auto 1fr; } .pf-rank { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; } }

.tabs { display: flex; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; }
.tabs button { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 8px; padding: 8px 18px; color: var(--dim); font-weight: 700; letter-spacing: 0.04em; }
.tabs button.on { background: var(--accent); color: #fff; border-color: transparent; } .tabs button:hover:not(.on) { color: #fff; }
.tabs button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.rk-sum { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.rk-sum > div:nth-child(2) { display: grid; } .rk-sum b { font-size: 24px; } .rk-sum span { color: var(--dim); font-size: 14px; } .rk-sum span b { font-size: inherit; color: #fff; }
.tiers { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.tiers i { width: 26px; height: 8px; border-radius: 4px; opacity: 0.35; } .tiers i.on { opacity: 1; height: 12px; box-shadow: 0 0 8px currentColor; }
.tbl-wrap { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.2); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th { position: sticky; top: 0; background: #17223a; text-align: left; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); padding: 8px 10px; z-index: 1; }
.tbl td { padding: 5px 10px; border-top: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; } .tbl .r { text-align: right; }
.tbl td:nth-child(2) { width: 30px; padding-right: 0; } .tbl td .emb { display: block; }
.tbl tr.me td { background: rgba(255, 122, 61, 0.22); font-weight: 800; }
.pill { font-size: 9px; letter-spacing: 0.12em; padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); color: var(--dim); font-weight: 800; vertical-align: 1px; }
.pill.you { background: var(--accent); color: #fff; }
.up { color: #5fe07a; font-weight: 800; } .down { color: #ff6a76; font-weight: 800; } .gold { color: #ffd23f; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.card { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; } .card b { display: block; font-size: 24px; font-style: italic; } .card span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.reset { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; } .reset .ghost { margin-top: 0; }
.empty { padding: 24px 4px; }

/* progreso al terminar la partida */
#screen-end .panel.narrow { width: min(470px, 100%); }
.xp-parts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 6px; text-align: left; font-size: 13px; }
.xp-parts li { display: flex; justify-content: space-between; padding: 3px 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.05); } .xp-parts b { color: #ffb27a; }
.xp-parts li.tot { grid-column: 1 / -1; background: rgba(255, 122, 61, 0.2); font-weight: 800; } .xp-parts li.tot b { color: #fff; }
.lvrow { display: flex; gap: 12px; align-items: center; text-align: left; } .lvrow .grow { flex: 1; min-width: 0; }
.rprow { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; text-align: left; } .rprow > div { display: grid; } .rprow b { font-size: 20px; }
.banner { margin-top: 12px; padding: 8px 12px; border-radius: 8px; font-weight: 900; letter-spacing: 0.08em; background: linear-gradient(90deg, #ff7a3d, #ffd23f); color: #1a1208; animation: pop 0.5s ease-out; }
.banner.up { background: linear-gradient(90deg, #36c46a, #8ff0a8); } .banner.down { background: rgba(255, 90, 100, 0.25); color: #ffb3b9; }
@keyframes pop { 0% { transform: scale(0.7); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
#end-prog { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .banner { animation: none; } .xpbar > div { transition: none; } }

/* ---------- monedas, monito y tienda ---------- */
.coin { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3a8, #f5c542 55%, #c8901a); box-shadow: inset 0 0 0 2px rgba(120, 70, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4); vertical-align: -3px; margin-right: 5px; position: relative; }
.coin::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 1.5px solid rgba(120, 70, 0, 0.45); }
.coin.sm { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; } .coin.sm::after { inset: 3px; border-width: 1px; }
.coins { display: inline-flex; align-items: center; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px 2px 8px; font-weight: 900; font-size: 15px; margin-bottom: 6px; }
.coins.big { font-size: 22px; padding: 4px 18px 4px 12px; margin: 0; } .coins.big .coin { width: 22px; height: 22px; } .coins.big .coin::after { inset: 5px; }
.pf-avatar { width: 96px; height: 128px; position: relative; cursor: pointer; border-radius: 10px; background: radial-gradient(ellipse at 50% 85%, rgba(255, 122, 61, 0.28), transparent 70%); }
.pf-avatar:hover { background: radial-gradient(ellipse at 50% 85%, rgba(255, 122, 61, 0.45), transparent 70%); }
.avatar-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.panel.shop { width: min(940px, 100%); }
.shop-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; } .shop-head h2 { margin: 0; }
.shop-body { display: grid; grid-template-columns: 250px 1fr; gap: 20px; }
.shop-left { text-align: center; } .preview { width: 100%; height: 360px; border-radius: 12px; background: radial-gradient(ellipse at 50% 80%, rgba(80, 120, 200, 0.35), rgba(0, 0, 0, 0.35)); border: 1px solid var(--line); cursor: grab; position: relative; overflow: hidden; }
.shop-right { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; padding: 2px 4px 2px 2px; align-content: start; }
.item { text-align: left; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-top: 4px solid var(--rc); border-radius: 8px; padding: 8px 10px; color: #fff; display: grid; gap: 3px; min-height: 58px; }
.item:hover { background: rgba(255, 255, 255, 0.12); } .item:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.item .nm { font-weight: 800; font-size: 13px; } .item .st { font-size: 11px; letter-spacing: 0.06em; color: var(--dim); font-weight: 800; }
.item.own .st { color: #8ff0a8; } .item.worn { background: rgba(255, 122, 61, 0.2); } .item.worn .st { color: #ffb27a; }
.item.sel { outline: 2px solid var(--accent); outline-offset: 0; background: rgba(255, 122, 61, 0.18); }
.act { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-height: 64px; }
.act .info { display: grid; } .act .info b { font-size: 18px; } .act .info span { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
button.big.sm { font-size: 14px; padding: 10px 20px; box-shadow: 0 4px 0 #b8501f; color: #fff; } button.big:disabled { background: #4a5268; box-shadow: 0 4px 0 #343a4c; cursor: default; filter: none; transform: skew(-6deg); color: #c8d0e0; }
.coinrow { text-align: left; background: rgba(245, 197, 66, 0.12); border: 1px solid rgba(245, 197, 66, 0.35); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; line-height: 1.4; } .coinrow b { color: #ffd23f; font-size: 17px; }
@media (max-width: 780px) { .shop-body { grid-template-columns: 1fr; } .preview { height: 260px; } .pf-avatar { width: 72px; height: 104px; } }

/* aspectos de armas */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 700; color: var(--dim); }
.chips button.on { background: #fff; color: #0d1424; border-color: #fff; } .chips button:hover:not(.on) { color: #fff; } .chips button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.act .btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
button.big.sm.alt { background: #3a7be0; box-shadow: 0 4px 0 #234f94; }

/* ---------- elección de mapa ---------- */
.panel.wide { width: min(1040px, 100%); }
.maps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 6px 0 14px; }
.mapcard { text-align: left; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; color: #fff; display: flex; flex-direction: column; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s; }
.mapcard:hover, .mapcard:focus-visible { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45); outline: none; }
.mapcard:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.mapcard .art { position: relative; aspect-ratio: 320 / 170; background: #123; } .mapcard .art svg { width: 100%; height: 100%; display: block; }
.mapcard .time { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 900; letter-spacing: 0.16em; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #1a2640; }
.mapcard .time.night { background: rgba(10, 14, 40, 0.85); color: #cfe0ff; border: 1px solid rgba(207, 224, 255, 0.4); }
.mapcard .last { position: absolute; right: 10px; top: 10px; font-size: 10px; font-weight: 900; letter-spacing: 0.14em; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: #fff; }
.mapcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mapcard h3 { margin: 0; font-size: 22px; letter-spacing: 0.02em; text-transform: none; color: #fff; font-style: italic; }
.mapcard p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--dim); flex: 1; }
.mtags { display: flex; gap: 5px; flex-wrap: wrap; } .mtags span { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); color: #d6deee; }
.mapcard .go { font-weight: 900; letter-spacing: 0.12em; font-size: 13px; color: var(--accent); }
@media (max-width: 820px) { .maps { grid-template-columns: 1fr; } }

/* elegir personaje: hombre o mujer */
.gchips { display: inline-flex; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 999px; padding: 2px; gap: 2px; margin-left: 6px; vertical-align: top; }
.gchips button { background: transparent; border-radius: 999px; padding: 2px 12px; font-size: 12px; font-weight: 800; color: var(--dim); letter-spacing: 0.04em; }
.gchips button:hover { color: #fff; } .gchips button.on { background: var(--accent); color: #fff; } .gchips button:focus-visible { outline: 3px solid #fff; outline-offset: 1px; }
.gchips.big { margin: 0 auto 0 18px; } .gchips.big button { font-size: 14px; padding: 6px 20px; }

/* ---------- multijugador ---------- */
button.ghost.online { border-color: rgba(95, 224, 122, 0.6); color: #8ff0a8; } button.ghost.online:hover { color: #fff; border-color: #8ff0a8; }
.notice { background: rgba(255, 90, 100, 0.18); border: 1px solid rgba(255, 90, 100, 0.5); color: #ffc4c8; padding: 8px 14px; border-radius: 8px; margin: 0 0 14px; font-weight: 700; }
.on-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 16px 0 6px; }
.join { display: flex; gap: 10px; align-items: center; }
#on-code { width: 130px; font: inherit; font-weight: 900; font-size: 24px; letter-spacing: 0.3em; text-align: center; text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, 0.4); border: 2px solid var(--line); border-radius: 8px; padding: 8px 4px 8px 14px; outline: none; }
#on-code:focus { border-color: var(--accent); }
button.big.alt { background: #3a7be0; box-shadow: 0 6px 0 #234f94; } button.big.alt:active { box-shadow: 0 2px 0 #234f94; }
.err { color: #ff8a93; font-weight: 700; margin: 10px 0 0; }
.code-box { text-align: center; background: rgba(255, 255, 255, 0.06); border: 1px dashed rgba(255, 255, 255, 0.3); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.code-box span { display: block; font-size: 11px; letter-spacing: 0.2em; color: var(--dim); } .code-box b { display: block; font-size: 58px; letter-spacing: 0.35em; padding-left: 0.35em; line-height: 1.1; color: #ffd23f; font-style: italic; } .code-box small { color: var(--dim); }
.seats { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.seat { display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-height: 48px; }
.seat.on { background: rgba(255, 255, 255, 0.1); } .seat.me { border-color: var(--accent); }
.seat .av { width: 32px; height: 32px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); display: grid; place-items: center; font-weight: 900; } .seat.on .av { background: var(--accent); }
.seat em { color: var(--dim); font-size: 13px; } .seat b { font-size: 17px; }
.stag { font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: 0.12em; padding: 2px 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.14); } .stag.host { background: #3a7be0; } .stag.you { background: var(--accent); }
.on-map { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; } .on-map > span { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); font-weight: 800; }
.chips button:disabled { opacity: 0.6; cursor: default; }
.loading-box { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(8, 12, 24, 0.92); font-size: 22px; font-weight: 800; letter-spacing: 0.08em; }

/* ---------- móvil / táctil ---------- */
html { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; -webkit-touch-callout: none; }
.touch-only { display: none; } body.touch .touch-only { display: grid; } body.touch .desk-only { display: none; }
#tc-look { position: fixed; inset: 0; z-index: 6; touch-action: none; }
#tc { position: fixed; inset: 0; z-index: 7; pointer-events: none; touch-action: none; --tc-op: 0.7; }
.tcb { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: auto; touch-action: none; display: grid; place-items: center; text-align: center; font-weight: 900; line-height: 1.05; letter-spacing: 0.02em; color: #fff;
  background: rgba(20, 28, 46, 0.55); border: 2px solid rgba(255, 255, 255, 0.55); opacity: var(--tc-op); text-shadow: 0 1px 2px #000; -webkit-user-select: none; user-select: none; }
.tcb.down, .tcb.on { background: rgba(255, 122, 61, 0.75); border-color: #fff; }
.tcb.fire { background: rgba(255, 60, 70, 0.45); border-color: rgba(255, 190, 190, 0.9); } .tcb.fire.down { background: rgba(255, 60, 70, 0.85); }
.tcb.stick { background: rgba(255, 255, 255, 0.1); border-width: 3px; } .tcb.stick .knob { position: absolute; width: 46%; height: 46%; border-radius: 50%; background: rgba(255, 255, 255, 0.55); border: 2px solid #fff; pointer-events: none; }
.tcb small { display: block; font-size: 0.6em; opacity: 0.8; min-height: 1em; } .tcb.empty { opacity: calc(var(--tc-op) * 0.45); }
.tcb.tap[data-id^="s"] { border-radius: 10px; } .tcb.tap[data-id^="s"].sel { background: rgba(255, 255, 255, 0.4); border-color: var(--accent); }
#tc.editing .tcb { cursor: grab; outline: 2px dashed rgba(255, 255, 255, 0.5); outline-offset: 3px; opacity: 0.95; } #tc.editing .tcb.sel { outline: 3px solid var(--accent); background: rgba(255, 122, 61, 0.45); }
#tc-bar { position: fixed; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, 56vw); background: rgba(13, 20, 36, 0.92); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: grid; gap: 4px; text-align: center; }
#tc-bar b { letter-spacing: 0.12em; font-size: 14px; } #tc-bar label { margin: 0; font-size: 12px; text-align: left; gap: 2px; } #tc-bar .row { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 4px; }
#tc-bar .ghost { margin: 0; } #tc-bar .big { padding: 8px 22px; font-size: 16px; }
#rotate { display: none; position: fixed; inset: 0; z-index: 100; background: #0d1424; place-items: center; text-align: center; font-weight: 800; font-size: 20px; } #rotate b { font-size: 70px; display: block; color: var(--accent); }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: grid; } }

body.touch #fps { display: none; }
body.touch #mini { width: 104px; height: 104px; left: 10px; top: 10px; border-width: 2px; } body.touch #loc { font-size: 9px; bottom: 6px; }
body.touch #topRight { right: 10px; top: 8px; gap: 5px; } body.touch .stat { padding: 3px 9px; min-width: 50px; } body.touch .stat b { font-size: 17px; } body.touch .stat span { font-size: 8px; }
body.touch #zonebar { top: 8px; min-width: 120px; padding: 3px 12px; } body.touch #zoneTime { font-size: 18px; } body.touch #zoneLabel { font-size: 8px; }
body.touch #feed { top: 56px; right: 10px; width: 190px; } body.touch #feed div { font-size: 11px; padding: 3px 8px; }
body.touch #vitals { left: 50%; transform: translateX(-50%); bottom: 8px; width: 200px; gap: 3px; } body.touch .bar { height: 18px; } body.touch .bar span { line-height: 18px; font-size: 12px; }
body.touch #consum, body.touch #slots { display: none; }
body.touch #weaponbox { left: 50%; right: auto; transform: translateX(-50%); bottom: 58px; text-align: center; display: flex; gap: 10px; align-items: baseline; background: rgba(0, 0, 0, 0.4); padding: 2px 12px; border-radius: 8px; }
body.touch #wname { font-size: 11px; } body.touch #ammo b { font-size: 26px; } body.touch #ammo span { font-size: 14px; }
body.touch #toast { bottom: 36%; font-size: 13px; } body.touch #toast kbd { display: none; } body.touch #usebar { bottom: 30%; width: 200px; }
body.touch #altimeter { top: 33%; } body.touch #altimeter b { font-size: 40px; }
@media (max-height: 520px) {
  .screen { padding: 8px; } .panel { padding: 12px 18px; } h1 { font-size: 36px; } h2 { font-size: 26px; margin-bottom: 8px; } h3 { margin: 8px 0 4px; } .tag { margin: 4px 0 10px; font-size: 13px; }
  button.big { font-size: 16px; padding: 9px 22px; } .profile { padding: 8px 12px; margin-bottom: 10px; gap: 12px; } .cols { margin-top: 10px; gap: 16px; } .code-box b { font-size: 40px; }
  #end-place { font-size: 50px; } .stats { margin: 8px 0; }
}
