:root {
  --bg: #05060b;
  --panel: rgba(10, 14, 24, 0.82);
  --panel2: rgba(16, 22, 36, 0.92);
  --line: rgba(110, 200, 255, 0.22);
  --line2: rgba(110, 200, 255, 0.5);
  --txt: #e6f2ff;
  --dim: #8ea3b8;
  --acc: #4fd8ff;
  --acc2: #ff5cf0;
  --good: #5effa0;
  --bad: #ff4d5e;
  --gold: #ffd24d;
  --font: 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Ubuntu', Arial, sans-serif;
  --mono: 'Consolas', 'Menlo', 'DejaVu Sans Mono', monospace;
  --ui: 1;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--txt); font-family: var(--font); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
canvas { display: block; position: fixed; inset: 0; width: 100%; height: 100%; }
#scene { visibility: hidden; }
body.no-gl #scene { visibility: visible; }
body.no-gl #gl { display: none; }
body.playing { cursor: none; }
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- arranque */
#boot { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(ellipse at center, #0e1630 0%, #05060b 70%); transition: opacity .5s; }
#boot.done { opacity: 0; pointer-events: none; }
#boot .logo { font-size: 40px; }
#boot .bar { width: 240px; height: 2px; background: rgba(79,216,255,.15); overflow: hidden; }
#boot .bar i { display: block; width: 40%; height: 100%; background: var(--acc); animation: run 1s ease-in-out infinite; }
#boot .err { color: var(--bad); max-width: 520px; text-align: center; display: none; }
#boot.failed .err { display: block; }
@keyframes run { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- logo */
.logo { font-weight: 900; letter-spacing: .22em; font-size: clamp(34px, 7vw, 86px); line-height: 1; text-transform: uppercase; color: #eaf7ff; text-shadow: 0 0 18px rgba(79,216,255,.55), 0 0 42px rgba(79,216,255,.25); white-space: nowrap; }
.logo b { color: var(--acc2); text-shadow: 0 0 18px rgba(255,92,240,.6), 0 0 42px rgba(255,92,240,.3); font-weight: 900; }
.tagline { letter-spacing: .4em; text-transform: uppercase; color: var(--dim); font-size: clamp(10px, 1.6vw, 15px); margin-top: 14px; }

/* ---------- pantallas */
#screens { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: auto; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); animation: fadein .25s ease; overflow-y: auto; }
.screen.dim { background: radial-gradient(ellipse at center, rgba(5,8,16,.55), rgba(3,4,8,.92)); backdrop-filter: blur(3px); }
.screen.clear { background: linear-gradient(90deg, rgba(3,5,10,.85) 0%, rgba(3,5,10,.35) 55%, rgba(3,5,10,.1) 100%); align-items: flex-start; padding-left: clamp(20px, 7vw, 120px); }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.menu { display: flex; flex-direction: column; gap: 10px; margin-top: 34px; min-width: min(340px, 86vw); }
.btn { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; background: linear-gradient(90deg, rgba(20,30,50,.9), rgba(12,18,30,.75)); color: var(--txt); border: 1px solid var(--line); font-size: 16px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; transition: all .12s; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); }
.btn:hover, .btn:focus-visible, .btn.sel { border-color: var(--acc); background: linear-gradient(90deg, rgba(30,70,110,.95), rgba(14,28,46,.85)); box-shadow: 0 0 22px rgba(79,216,255,.25) inset; outline: none; transform: translateX(4px); }
.btn.primary { border-color: var(--acc); background: linear-gradient(90deg, rgba(20,110,150,.9), rgba(16,40,70,.85)); }
.btn.danger { border-color: rgba(255,77,94,.5); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn small { font-size: 11px; color: var(--dim); letter-spacing: .08em; font-weight: 600; text-transform: none; }
.btn .badge { font-size: 11px; color: var(--gold); letter-spacing: .05em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 20px; max-width: min(1100px, 96vw); width: 100%; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); }
.title { font-size: clamp(22px, 3.4vw, 36px); font-weight: 900; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 16px; text-align: center; }
.subtitle { color: var(--dim); text-align: center; margin: -8px 0 18px; letter-spacing: .08em; }
.corner-info { position: absolute; right: 18px; bottom: 14px; color: var(--dim); font-size: 12px; letter-spacing: .1em; text-align: right; pointer-events: none; }
.profile-chip { position: absolute; right: 18px; top: max(14px, env(safe-area-inset-top)); display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 8px 14px; font-size: 13px; letter-spacing: .08em; }
.profile-chip .frag { color: var(--acc2); font-weight: 800; }
.profile-chip .rank { color: var(--gold); font-weight: 700; }

/* ---------- tarjetas */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; width: 100%; }
.card { position: relative; background: var(--panel2); border: 1px solid var(--line); padding: 16px; cursor: pointer; transition: all .12s; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.card:hover, .card.sel { border-color: var(--acc); box-shadow: 0 0 26px rgba(79,216,255,.22); transform: translateY(-3px); }
.card.locked { opacity: .55; }
.card .k { position: absolute; top: 8px; right: 10px; font-family: var(--mono); color: var(--dim); font-size: 12px; border: 1px solid var(--line); padding: 1px 6px; }
.card h3 { margin: 0; font-size: 18px; letter-spacing: .1em; text-transform: uppercase; }
.card p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.35; }
.card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 7px; border: 1px solid currentColor; }
.tag.fire { color: #ff8a3d; } .tag.frost { color: #8ee8ff; } .tag.shock { color: #7df3ff; } .tag.explosive { color: #ffb02e; } .tag.turret { color: #ffe14d; }
.card .icon { width: 64px; height: 64px; image-rendering: auto; }
.card .stack { color: var(--gold); font-size: 12px; letter-spacing: .1em; }
.cls-card { align-items: center; text-align: center; }
.cls-card canvas, .cls-card img { position: static; width: 96px; height: 96px; }
.stat { display: flex; justify-content: space-between; width: 100%; font-size: 13px; color: var(--dim); }
.stat i { flex: 1; margin: 0 8px; align-self: center; height: 4px; background: rgba(255,255,255,.08); position: relative; }
.stat i b { position: absolute; inset: 0 auto 0 0; background: var(--acc); }

/* ---------- overlays de elección (subida de nivel / mutador) */
.choice { position: fixed; left: 50%; transform: translateX(-50%); bottom: 8vh; z-index: 30; width: min(980px, 96vw); pointer-events: auto; animation: rise .25s ease; }
.choice.modal { top: 50%; bottom: auto; transform: translate(-50%, -50%); }
.choice h2 { text-align: center; letter-spacing: .3em; text-transform: uppercase; margin: 0 0 4px; text-shadow: 0 0 20px rgba(79,216,255,.6); }
.choice .sub { text-align: center; color: var(--dim); margin-bottom: 14px; letter-spacing: .1em; }
.choice .cards { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choice .card { background: rgba(10,16,28,.94); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; } }
.choice.modal { animation: none; }

/* ---------- HUD */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; font-size: calc(14px * var(--ui)); }
.hud-tl { position: absolute; left: max(14px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; }
.pcard { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 8px 12px 8px 8px; }
.pcard .lvl { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; border: 2px solid var(--acc); background: rgba(79,216,255,.08); }
.bars { display: flex; flex-direction: column; gap: 5px; width: clamp(180px, 22vw, 280px); }
.bar { position: relative; height: 16px; background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.12); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; transition: width .15s; }
.bar b { position: absolute; inset: 0 auto 0 0; background: rgba(140,210,255,.55); }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-shadow: 0 1px 2px #000; }
.bar.hp i { background: linear-gradient(90deg, #ff3d5a, #ff7a6a); }
.bar.hp.ok i { background: linear-gradient(90deg, #2ee88a, #8affc4); }
.bar.hp .ghost { position: absolute; inset: 0 auto 0 0; background: rgba(255,255,255,.5); transition: width .6s .2s; }
.bar.xp { height: 7px; }
.bar.xp i { background: linear-gradient(90deg, #4fd8ff, #c58bff); }
.cds { display: flex; gap: 8px; }
.cd { position: relative; width: 52px; height: 52px; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; letter-spacing: .06em; }
.cd .key { position: absolute; bottom: 2px; right: 4px; color: var(--dim); font-size: 10px; font-family: var(--mono); }
.cd .ico { font-size: 20px; }
.cd .shade { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.65); }
.cd .t { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900; }
.cd.ready { border-color: var(--acc); box-shadow: 0 0 14px rgba(79,216,255,.3); }
.weapon-chip { background: var(--panel); border: 1px solid var(--line); padding: 4px 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; display: inline-flex; gap: 8px; align-items: center; }
.weapon-chip i { width: 10px; height: 10px; display: inline-block; }
.allies { display: flex; flex-direction: column; gap: 4px; }
.ally { display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); padding: 4px 8px; font-size: 12px; min-width: 190px; }
.ally .nm { width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.ally .mini { flex: 1; height: 6px; background: rgba(0,0,0,.6); position: relative; }
.ally .mini i { position: absolute; inset: 0 auto 0 0; background: var(--good); }
.ally.down { border-color: var(--bad); animation: blink 1s infinite; }
.ally.off { opacity: .5; }
@keyframes blink { 50% { border-color: transparent; } }
.hud-tc { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(560px, 46vw); }
.phase-title { font-size: calc(15px * var(--ui)); font-weight: 800; letter-spacing: .22em; text-transform: uppercase; text-align: center; text-shadow: 0 2px 6px #000; }
.phase-title small { display: block; font-size: 11px; color: var(--dim); letter-spacing: .14em; font-weight: 600; margin-top: 2px; }
.phase-bar { width: 100%; height: 8px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.14); position: relative; overflow: hidden; }
.phase-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--acc), #a8f0ff); box-shadow: 0 0 10px var(--acc); }
.phase-bar.core i { background: linear-gradient(90deg, #ff3d5a, #ff8a6a); }
.boss-bar { width: 100%; }
.boss-bar span { display: block; text-align: center; font-weight: 900; letter-spacing: .3em; text-transform: uppercase; color: #ffd0d8; text-shadow: 0 0 12px rgba(255,60,90,.8); margin-bottom: 4px; }
.boss-bar .bb { height: 12px; background: rgba(0,0,0,.7); border: 1px solid rgba(255,90,110,.6); position: relative; overflow: hidden; }
.boss-bar .bb i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #b8002a, #ff4d6a); transition: width .2s; }
.hud-tr { position: absolute; right: max(14px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#minimap { position: static; width: calc(200px * var(--ui)); height: calc(144px * var(--ui)); border: 1px solid var(--line2); background: rgba(0,0,0,.6); }
.res { display: flex; gap: 8px; }
.res > div { background: var(--panel); border: 1px solid var(--line); padding: 4px 10px; font-weight: 800; font-size: 14px; letter-spacing: .06em; display: flex; gap: 6px; align-items: center; }
.res .scrap { color: #ffd27a; }
.res .power { color: #ffe14d; }
.res .power.full { color: var(--bad); }
.res .score { color: var(--txt); }
.chips { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.chip { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 3px 8px; background: var(--panel); border: 1px solid; }
.chip.mut { color: #ff9ab0; border-color: rgba(255,120,150,.5); }
.chip.syn { color: var(--gold); border-color: rgba(255,210,77,.5); }
.build-bar { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: auto; }
.slot { position: relative; width: calc(58px * var(--ui)); height: calc(64px * var(--ui)); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: all .1s; }
.slot img { width: calc(36px * var(--ui)); height: calc(36px * var(--ui)); }
.slot .c { font-size: 11px; font-weight: 800; color: #ffd27a; }
.slot .k { position: absolute; top: 2px; left: 4px; font-size: 10px; color: var(--dim); font-family: var(--mono); }
.slot.sel { border-color: var(--good); box-shadow: 0 0 16px rgba(94,255,160,.35); transform: translateY(-5px); }
.slot.no { opacity: .45; }
.slot .tip { display: none; position: absolute; bottom: 110%; left: 50%; transform: translateX(-50%); width: 200px; background: var(--panel2); border: 1px solid var(--line2); padding: 8px; font-size: 12px; line-height: 1.3; text-align: left; pointer-events: none; }
.slot:hover .tip, .slot.sel .tip { display: block; }
.tip b { display: block; margin-bottom: 3px; letter-spacing: .08em; text-transform: uppercase; }
.tip span { color: var(--dim); }
.hud-tut { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); background: rgba(8,14,26,.88); border: 1px solid var(--acc); padding: 10px 18px; font-size: calc(15px * var(--ui)); letter-spacing: .06em; box-shadow: 0 0 24px rgba(79,216,255,.25); max-width: 80vw; text-align: center; pointer-events: auto; }
.hud-tut button { margin-left: 12px; background: none; border: 1px solid var(--line); color: var(--dim); font-size: 11px; padding: 2px 8px; cursor: pointer; }
#fps { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--dim); }
.center-msg { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); text-align: center; font-weight: 900; letter-spacing: .3em; text-transform: uppercase; font-size: clamp(24px, 4vw, 52px); text-shadow: 0 0 24px rgba(79,216,255,.6), 0 3px 8px #000; animation: banner 2.6s ease forwards; pointer-events: none; white-space: nowrap; }
.center-msg small { display: block; font-size: .35em; letter-spacing: .25em; color: var(--dim); margin-top: 8px; }
.center-msg.red { color: #ffd0d8; text-shadow: 0 0 24px rgba(255,60,90,.8), 0 3px 8px #000; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- toasts */
#toasts { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(8,12,22,.9); border: 1px solid var(--line2); padding: 8px 16px; font-weight: 700; letter-spacing: .08em; animation: toast 2.8s ease forwards; text-align: center; }
.toast.warn { border-color: var(--bad); color: #ffd0d8; }
.toast.good { border-color: var(--good); color: #d8ffe8; }
.toast.gold { border-color: var(--gold); color: #fff2c8; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 10% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- táctil */
.touch-ui { position: fixed; inset: 0; z-index: 11; pointer-events: none; }
.tbtn { position: absolute; pointer-events: auto; width: 64px; height: 64px; border-radius: 50%; background: rgba(12,20,34,.6); border: 2px solid rgba(110,200,255,.45); color: var(--txt); font-size: 11px; font-weight: 800; letter-spacing: .05em; display: flex; align-items: center; justify-content: center; text-transform: uppercase; touch-action: none; }
.tbtn:active, .tbtn.on { background: rgba(40,120,170,.7); }
.tbtn.dash { right: 18px; bottom: 18px; width: 74px; height: 74px; }
.tbtn.ability { right: 104px; bottom: 14px; }
.tbtn.use { right: 22px; bottom: 104px; }
.tbtn.build { right: 100px; bottom: 92px; width: 56px; height: 56px; font-size: 9px; }
.tbtn.pause { left: 50%; top: calc(env(safe-area-inset-top) + 70px); transform: translateX(-50%); width: 40px; height: 40px; }
.joy { position: fixed; z-index: 12; width: 120px; height: 120px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04); transform: translate(-50%, -50%); pointer-events: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; border-radius: 50%; background: rgba(110,200,255,.35); transform: translate(-50%, -50%); }
#touch-layer { position: fixed; inset: 0; z-index: 5; touch-action: none; display: none; }
body.touch #touch-layer { display: block; }
body.touch .build-bar { bottom: 8px; left: 46%; }
body.touch .slot .k { display: none; }

/* ---------- tablas / formularios */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 7px 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.06); }
th { color: var(--dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
tr.me td { color: var(--gold); }
.tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 7px 14px; border: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; font-weight: 700; }
.tab.on { color: var(--txt); border-color: var(--acc); background: rgba(79,216,255,.1); }
.form { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr; gap: 10px 18px; align-items: center; }
.form label { color: var(--dim); letter-spacing: .06em; font-size: 14px; }
input[type=range] { width: 100%; accent-color: var(--acc); }
input[type=text], textarea, select { width: 100%; padding: 9px 10px; background: rgba(0,0,0,.4); border: 1px solid var(--line); color: var(--txt); font-family: inherit; font-size: 15px; user-select: text; -webkit-user-select: text; }
textarea { min-height: 70px; font-family: var(--mono); font-size: 11px; }
.toggle { display: flex; gap: 6px; }
.toggle button { flex: 1; padding: 7px; background: transparent; border: 1px solid var(--line); color: var(--dim); cursor: pointer; font-weight: 700; letter-spacing: .08em; }
.toggle button.on { color: var(--txt); border-color: var(--acc); background: rgba(79,216,255,.12); }
.code { font-family: var(--mono); font-size: 42px; letter-spacing: .35em; color: var(--acc); text-shadow: 0 0 18px rgba(79,216,255,.5); text-align: center; }
.lobby-list { display: grid; gap: 8px; margin: 16px 0; }
.lobby-p { display: flex; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--line); padding: 10px 14px; }
.lobby-p .dot { width: 12px; height: 12px; border-radius: 50%; }
.lobby-p .nm { flex: 1; font-weight: 700; }
.lobby-p .st { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.lobby-p .st.ok { color: var(--good); }
.mini-cls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mini-cls button { padding: 8px 12px; border: 1px solid var(--line); background: transparent; color: var(--txt); cursor: pointer; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.mini-cls button.on { border-color: var(--acc); background: rgba(79,216,255,.14); }
.mini-cls button:disabled { opacity: .35; }
.mini-cls.skins button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 8px 6px; font-size: 10px; min-width: 72px; }
.mini-cls.skins img { width: 52px; height: 52px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.stats-grid div { background: var(--panel2); border: 1px solid var(--line); padding: 10px; text-align: center; }
.stats-grid b { display: block; font-size: 24px; font-weight: 900; }
.stats-grid span { font-size: 11px; color: var(--dim); letter-spacing: .14em; text-transform: uppercase; }
.build-recap { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.build-recap span { background: var(--panel2); border: 1px solid var(--line); padding: 4px 9px; font-size: 12px; letter-spacing: .05em; }
.build-recap span b { color: var(--gold); }
.go-title { font-size: clamp(30px, 6vw, 64px); font-weight: 900; letter-spacing: .25em; text-align: center; text-transform: uppercase; margin: 0; }
.go-title.win { color: #d8ffe8; text-shadow: 0 0 28px rgba(94,255,160,.6); }
.go-title.lose { color: #ffd0d8; text-shadow: 0 0 28px rgba(255,60,90,.6); }
.rankbar { height: 8px; background: rgba(0,0,0,.5); border: 1px solid var(--line); position: relative; margin: 6px 0 2px; }
.rankbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--acc2), var(--gold)); }
.unlock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.unlock { background: var(--panel2); border: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.unlock h4 { margin: 0; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; }
.unlock p { margin: 0; color: var(--dim); font-size: 12px; min-height: 30px; }
.unlock .btn { padding: 8px 12px; font-size: 12px; justify-content: center; }
.unlock.owned { border-color: rgba(94,255,160,.4); }
.section-h { letter-spacing: .25em; text-transform: uppercase; color: var(--acc); font-size: 13px; margin: 18px 0 8px; }
.quick-chat { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 31; background: var(--panel2); border: 1px solid var(--line2); padding: 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; pointer-events: auto; }
.quick-chat button { padding: 8px 12px; background: transparent; border: 1px solid var(--line); color: var(--txt); cursor: pointer; font-weight: 700; }
.howto p { color: var(--dim); line-height: 1.5; margin: 0 0 10px; }
.howto p b { color: var(--txt); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line2); padding: 1px 6px; background: rgba(255,255,255,.04); }
@media (max-width: 720px) {
  .hud-tc { width: 52vw; top: max(8px, env(safe-area-inset-top)); }
  .bars { width: 34vw; }
  #minimap { width: 120px; height: 86px; }
  .res > div { font-size: 12px; padding: 3px 6px; }
  .cd { width: 40px; height: 40px; }
  .phase-title { font-size: 12px; letter-spacing: .12em; }
  .choice .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; padding: 10px; }
  .form { grid-template-columns: 1fr; }
}
@media (max-height: 520px) {
  .hud-tut { top: 34%; font-size: 12px; padding: 6px 10px; }
  .build-bar { transform: translateX(-50%) scale(.82); transform-origin: bottom center; }
  .menu { margin-top: 12px; gap: 6px; }
  .btn { padding: 8px 16px; font-size: 13px; }
  .choice .cards { grid-template-columns: repeat(3, 1fr); }
  .card p { font-size: 12px; }
}
