:root {
  --bg: #09090b; --fg: #fafafa; --muted: #8b8b94; --accent: #22c55e; --accent2: #4ade80;
  --danger: #ef4444; --good: #22c55e; --mono: ui-monospace, 'JetBrains Mono', 'Cascadia Code', 'Fira Code', Menlo, Consolas, monospace; --blue: #3b82f6; --violet: #8b5cf6;
  --card: #18181b; --card2: #1f1f23; --input: #0d0d10; --line: #2a2a2f; --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--fg);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(74,222,128,.08), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, rgba(34,211,238,.07), transparent 60%),
              linear-gradient(rgba(74,222,128,.035) 1px, transparent 1px) 0 0 / 100% 32px,
              linear-gradient(90deg, rgba(74,222,128,.035) 1px, transparent 1px) 0 0 / 32px 100%, var(--bg);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- genéricos ---------- */
.btn { padding: 13px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 16px;
  font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px; }
.btn:hover:not(:disabled) { background: var(--card2); border-color: #3f3f46; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: #052e16; border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent2); border-color: var(--accent2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.big { padding: 18px 26px; font-size: 20px; border-radius: 18px; }
.btn.danger { color: var(--danger); }
input, select { width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--input);
  font-size: 17px; font-weight: 600; outline: none; transition: border-color .15s; }
input:focus, select:focus { border-color: var(--accent); }
input::placeholder { color: var(--muted); font-weight: 500; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); letter-spacing: .12em;
  text-transform: uppercase; font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: clamp(18px, 3.5vw, 36px); }
.eyebrow { font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }
.divider { color: var(--muted); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin: 18px 0;
  display: flex; align-items: center; gap: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }

/* ---------- portada ---------- */
.home { width: 100%; max-width: 480px; text-align: center; }
.logo { font-size: clamp(36px, 8vw, 52px); font-weight: 900; letter-spacing: -.03em; margin: 6px 0 4px; line-height: 1; }
.logo span { color: var(--accent); }
.home form { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; text-align: left; }
.code-input { text-transform: uppercase; letter-spacing: .4em; text-align: center; font-weight: 900; font-size: 22px; }
.code-input::placeholder { letter-spacing: .05em; font-size: 16px; }

/* ---------- panel ---------- */
.panel { width: 100%; max-width: 1100px; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 900px) { .panel { grid-template-columns: minmax(0, 1fr); } }
.panel-main, .panel-side { display: grid; gap: 18px; }
.room-code { font-size: clamp(40px, 8vw, 64px); font-weight: 900; letter-spacing: .2em; color: var(--accent); line-height: 1; margin-top: 6px; }
.share { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.share code { background: var(--input); border: 1px solid var(--line); padding: 9px 12px; border-radius: 10px; font-size: 14px;
  font-weight: 700; word-break: break-all; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.gcard { text-align: left; padding: 18px; border-radius: 18px; background: var(--input); border: 2px solid var(--line);
  cursor: pointer; transition: border-color .15s, transform .15s, background .15s; display: flex; flex-direction: column; gap: 6px; }
.gcard:hover { border-color: #52525b; transform: translateY(-2px); }
.gcard.sel { border-color: var(--accent); background: linear-gradient(160deg, rgba(74,222,128,.14), rgba(74,222,128,.02)); }
.gcard .ge { font-size: 38px; line-height: 1; }
.gcard .gn { font-size: 18px; font-weight: 900; }
.gcard .gd { font-size: 13px; color: var(--muted); line-height: 1.4; }
.gcard .gm { font-size: 11px; color: var(--accent2); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-top: auto; }
.gcard:disabled { cursor: default; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.plist { display: grid; gap: 8px; margin-top: 12px; }
.pcard { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--input); border: 1px solid var(--line);
  border-radius: 14px; animation: popin .3s ease; }
.pcard.off { opacity: .45; }
.pcard .grow, .srow .grow { flex: 1; min-width: 0; }
.nm { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: 11px; letter-spacing: .12em; color: var(--accent); font-weight: 800; text-transform: uppercase; }
.trophy { font-size: 12px; color: var(--accent2); font-weight: 800; margin-left: 5px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15px;
  color: #111; flex-shrink: 0; position: relative; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--good);
  border: 2px solid var(--card); }
.avatar.off .dot { background: #52525b; }

/* ---------- juego ---------- */
.game { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 10px clamp(12px, 3vw, 28px); border-bottom: 1px solid var(--line);
  background: rgba(9,9,11,.75); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; flex-wrap: wrap; }
.brand { font-weight: 900; letter-spacing: -.02em; font-size: 17px; }
.brand span { color: var(--accent); }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px;
  font-weight: 700; color: var(--muted); white-space: nowrap; }
.pill b { color: var(--fg); }
.pill.mine { border-color: var(--accent); color: var(--fg); }
.pill.mine b { color: var(--accent2); font-size: 15px; }
.spacer { flex: 1; }
.conn { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); }
.conn.bad { background: var(--danger); box-shadow: 0 0 10px var(--danger); animation: blink 1s infinite; }
.groot { padding: clamp(12px, 2.5vw, 32px); max-width: 1400px; width: 100%; margin: 0 auto; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: clamp(16px, 2.5vw, 32px); align-items: start; }
.layout.wide-side { grid-template-columns: minmax(0, 1fr) 430px; }
@media (max-width: 960px) { .layout, .layout.wide-side { grid-template-columns: minmax(0, 1fr); } }
.side { display: flex; flex-direction: column; gap: 14px; }

.banner { padding: 16px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.banner .big { font-size: clamp(19px, 2.2vw, 26px); font-weight: 900; line-height: 1.15; }
.banner .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.banner.you { border-color: var(--accent); background: linear-gradient(135deg, rgba(74,222,128,.16), rgba(74,222,128,.04)); }
.banner.you .big { color: var(--accent2); }
.banner.master { border-color: var(--violet); background: linear-gradient(135deg, rgba(139,92,246,.16), rgba(139,92,246,.03)); }
.banner.timed { padding-right: 76px; }
.timer { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); transition: width .25s linear; }
.timer.hurry { background: var(--danger); }
.timer-num { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 30px; font-weight: 900;
  font-variant-numeric: tabular-nums; color: var(--muted); }
.timer-num.hurry { color: var(--danger); animation: blink .5s infinite; }

.sboard { display: flex; flex-direction: column; gap: 6px; }
.srow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; transition: border-color .2s, background .2s; }
.srow .avatar { width: 32px; height: 32px; font-size: 14px; }
.srow .role { font-size: 11px; color: var(--muted); font-weight: 700; }
.srow .pts { font-size: 20px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.srow .pos { width: 18px; text-align: center; font-weight: 900; color: var(--muted); font-size: 13px; }
.srow.hl { border-color: var(--accent); background: rgba(74,222,128,.08); }
.srow.ok { border-color: var(--good); background: rgba(34,197,94,.08); }
.srow.vi { border-color: var(--violet); }
.srow.off { opacity: .45; }
.plus { color: var(--good); font-weight: 900; font-size: 14px; animation: pop .6s; }

/* ---------- modales ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(8px); display: flex; align-items: center;
  justify-content: center; z-index: 50; padding: 20px; animation: fade .2s; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: clamp(22px, 4vw, 40px); text-align: center;
  max-width: 560px; width: 100%; max-height: 92vh; overflow-y: auto; animation: rise .3s cubic-bezier(.2,1.2,.4,1); }
.modal h2 { font-size: clamp(26px, 4vw, 40px); line-height: 1.1; margin-bottom: 8px; letter-spacing: -.02em; }
.modal p { color: var(--muted); margin-bottom: 16px; font-size: 16px; }
.modal form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 18px 0; }
.podium .step { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 30%; min-width: 0; }
.podium .blk { width: 100%; border-radius: 12px 12px 0 0; background: var(--card2); border: 1px solid var(--line); display: grid;
  place-items: center; font-weight: 900; font-size: 20px; color: var(--accent); }
.podium .nm { font-size: 14px; max-width: 100%; }
.bar { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 14px; }
.bar > div { height: 100%; background: var(--accent); transition: width .25s linear; }

/* ---------- toasts y avisos ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px;
  align-items: center; z-index: 100; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { padding: 11px 18px; border-radius: 14px; background: #27272a; border: 1px solid #3f3f46; font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: rise .25s; text-align: center; }
.toast.good { border-color: var(--good); } .toast.bad { border-color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
.alert { --d: 1.9s; --c: var(--accent2); --glow: rgba(74,222,128,.28); position: fixed; inset: 0; z-index: 90; display: flex;
  flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; padding: 20px;
  background: radial-gradient(circle, var(--glow), rgba(0,0,0,.55) 70%); animation: taFade var(--d) ease forwards; }
.alert.hit { --c: #4ade80; --glow: rgba(34,197,94,.3); }
.alert.miss { --c: #f87171; --glow: rgba(239,68,68,.32); }
.alert.info { --c: #e4e4e7; --glow: rgba(161,161,170,.22); }
.alert.violet { --c: #c4b5fd; --glow: rgba(139,92,246,.32); }
.alert .ta-big { font-size: clamp(50px, 11vw, 140px); font-weight: 900; letter-spacing: -.03em; color: var(--c); line-height: 1.02;
  text-shadow: 0 0 40px var(--glow), 0 0 80px var(--glow); animation: taPop var(--d) cubic-bezier(.2,1.5,.4,1) forwards; max-width: 95vw; overflow-wrap: anywhere; }
.alert .ta-letter { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border-radius: 28px; border: 8px solid var(--c);
  margin-right: .15em; vertical-align: middle; }
.alert.miss .ta-big { animation: taPop var(--d) cubic-bezier(.2,1.5,.4,1) forwards, taShake .5s .15s; }
.alert .ta-sub { font-size: clamp(20px, 2.8vw, 34px); font-weight: 800; margin-top: 14px; text-shadow: 0 2px 12px #000; }
body.my-turn::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 25;
  box-shadow: inset 0 0 0 4px var(--accent), inset 0 0 60px rgba(74,222,128,.35); animation: glow 1.4s ease-in-out infinite; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; }

.shake { animation: shake .45s; }
.thinking { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 10px; text-align: center; }
.dots span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); margin: 0 4px; animation: bounce 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }

@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes popin { from { opacity: 0; transform: scale(.9); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-10px); opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes swing { 0%, 100% { transform: rotate(3deg); } 50% { transform: rotate(-3deg); } }
@keyframes taFade { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes taPop { 0% { transform: scale(.3) rotate(-6deg); } 20% { transform: scale(1.08) rotate(2deg); } 30% { transform: scale(1); } 100% { transform: scale(1.04); } }
@keyframes taShake { 20%, 60% { translate: -14px 0; } 40%, 80% { translate: 14px 0; } }
@keyframes glow { 50% { box-shadow: inset 0 0 0 4px var(--accent2), inset 0 0 110px rgba(74,222,128,.5); } }

.chip { padding: 7px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--muted);
  letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }

/* ======================= CHAT COMÚN ======================= */
.chatbox { position: fixed; top: 0; right: 0; bottom: 0; width: 320px; z-index: 40; display: flex; flex-direction: column;
  background: #111114; border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(0,0,0,.35); animation: chatIn .2s ease; }
.cb-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 900; }
.cb-head .muted { font-weight: 600; font-size: 12px; }
.cb-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.cb-log .cm b { margin-right: 4px; }
.cb-log .cm.mine { background: rgba(74,222,128,.07); border-radius: 10px; padding: 4px 8px; margin: 0 -8px; }
.cb-log .cm.sys { color: var(--muted); font-style: italic; font-size: 13px; }
.cb-log .empty { color: var(--muted); font-size: 13px; text-align: center; margin-top: 20px; }
.cb-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.cb-form input { padding: 10px 12px; font-size: 15px; }
.chat-fab { position: fixed; right: 18px; bottom: 18px; z-index: 41; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--accent); color: #052e16; font-size: 24px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.5); transition: transform .15s; }
.chat-fab:hover { transform: scale(1.08); }
.chat-fab .badge { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; line-height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--danger); color: #fff; font-size: 12px; font-weight: 900; animation: pop .4s; }
@media (min-width: 1200px) { body.chat-open #panelScreen, body.chat-open #gameScreen { margin-right: 320px; } }
@media (max-width: 700px) { .chatbox { top: auto; height: 55vh; width: 100%; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; } }
@keyframes chatIn { from { transform: translateX(30px); opacity: 0; } }


/* ---------- avisos del anfitrión ---------- */
.ann-ovl { position: fixed; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(8px); display: flex; align-items: center;
  justify-content: center; z-index: 95; padding: 20px; animation: fade .2s; }
.ann-ovl[hidden] { display: none; }
.ann-presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.ann-presets .chip { cursor: pointer; font-weight: 700; }
.ann-presets .chip:hover { border-color: var(--accent); color: var(--fg); }
#annText { width: 100%; resize: vertical; min-height: 80px; padding: 12px 14px; font: inherit; font-size: 17px; border-radius: 14px;
  background: var(--input); color: var(--fg); border: 1px solid var(--line); outline: none; }
#annText:focus { border-color: var(--accent); }
.ann-check { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 18px; font-size: 14px; color: var(--muted); cursor: pointer; }
.ann-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.notice-card { border: 2px solid var(--accent); box-shadow: 0 0 0 6px rgba(74,222,128,.15), 0 0 80px rgba(74,222,128,.35); }
.notice-icon { font-size: 64px; line-height: 1; margin-bottom: 8px; animation: noticeShake 1s ease-in-out 2; }
.notice-text { font-size: clamp(24px, 4.2vw, 40px); font-weight: 900; line-height: 1.2; margin: 10px 0 24px; overflow-wrap: anywhere; letter-spacing: -.01em; }
@keyframes noticeShake { 20%, 60% { transform: rotate(-14deg) scale(1.1); } 40%, 80% { transform: rotate(14deg) scale(1.1); } }

/* ---------- cuentas de jugador ---------- */
.avatar img, .acc-face img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar .dot { z-index: 1; }
.acc-face { position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; font-weight: 900; color: #111;
  background: linear-gradient(135deg, var(--accent2), var(--accent)); overflow: hidden; }
.acc-box { margin: 18px 0 4px; text-align: left; display: grid; gap: 8px; }
.acc-guest { background: var(--input); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; font-size: 14px; }
.acc-guest .row .btn { flex: 1; }
.acc-me { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, rgba(74,222,128,.12), rgba(74,222,128,.02));
  border: 1px solid rgba(74,222,128,.45); border-radius: 16px; padding: 12px 14px; }
.acc-me .nm { font-weight: 900; font-size: 18px; }
.acc-me .muted { font-size: 12.5px; }
.acc-link { background: none; border: 0; color: var(--accent2); font: 800 14px system-ui, sans-serif; cursor: pointer; padding: 4px; justify-self: center; }
.acc-link:hover { text-decoration: underline; }
.acc-chip { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.acc-row { display: flex; align-items: center; gap: 10px; }
.acc-chip .row .btn { flex: 0 0 auto; }
.acc-modal { max-width: 430px; text-align: left; }
.acc-modal h2, .acc-modal > p { text-align: center; }
.acc-modal .field { margin-bottom: 12px; }
.acc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--input); padding: 5px; border-radius: 14px; margin-bottom: 18px; }
.acc-tabs button { border: 0; background: none; color: var(--muted); font: 800 14px system-ui, sans-serif; padding: 10px; border-radius: 10px; cursor: pointer; }
.acc-tabs button.on { background: var(--card2); color: var(--fg); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.acc-err { color: #fca5a5; font-weight: 700; font-size: 14px; min-height: 20px; margin: 2px 0 10px; text-align: center; }
.acc-note { font-size: 12px; text-align: center; margin: 14px 0 0 !important; }
.prof-modal { max-width: 640px; text-align: left; }
.prof-head { display: flex; gap: 18px; align-items: center; }
.prof-head h2 { margin: 0 0 4px; text-align: left; }
.prof-pic { position: relative; flex: 0 0 auto; border-radius: 50%; box-shadow: 0 0 0 3px var(--accent), 0 10px 30px rgba(0,0,0,.4); }
.prof-pic.edit { cursor: pointer; }
.prof-pic.edit:hover { filter: brightness(1.1); }
.prof-cam { position: absolute; right: -4px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; background: var(--card2); border: 2px solid var(--accent);
  display: grid; place-items: center; font-size: 14px; }
.prof-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.prof-pass { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.prof-pass[hidden] { display: none; }
.prof-pass input { flex: 1 1 160px; padding: 9px 12px; }
.prof-pass .acc-err { flex-basis: 100%; text-align: left; margin: 0; }
.gold { color: var(--accent2); }
.prof-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 20px 0 18px; }
.prof-tiles > div { background: var(--input); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; text-align: center; display: grid; gap: 4px; }
.prof-tiles b { font-size: clamp(17px, 2.6vw, 24px); font-weight: 900; color: var(--accent2); white-space: nowrap; }
.prof-tiles span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.prof-table { display: grid; gap: 4px; margin: 8px 0 16px; font-size: 14px; }
.prof-table > div { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--input); align-items: center; }
.prof-table > div span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.prof-table .pt-h { background: none; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 0 12px; }
.prof-recent { display: grid; gap: 4px; margin-top: 8px; font-size: 13.5px; }
.prof-recent > div { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; padding: 7px 12px; border-radius: 10px; background: var(--input); }
.prof-recent > div span:last-child { text-align: right; font-size: 12.5px; }
.rank-modal { max-width: 560px; }
.rank-game { margin: 6px 0 14px; }
.rank-list { display: grid; gap: 6px; max-height: min(58vh, 520px); overflow-y: auto; text-align: left; }
.rank-row { display: grid; grid-template-columns: 34px auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 14px; background: var(--input); border: 1px solid var(--line); color: var(--fg); cursor: pointer; font: inherit; text-align: left; }
.rank-row:hover { border-color: #52525b; }
.rank-row.me { border-color: var(--accent); background: rgba(74,222,128,.08); }
.rank-row .rk-pos { grid-row: span 2; font-size: 20px; font-weight: 900; text-align: center; color: var(--accent2); }
.rank-row .acc-face { grid-row: span 2; }
.rank-row .rk-nm { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .rk-st:nth-of-type(4) { grid-row: span 2; font-size: 18px; }
.rank-row .rk-st b { color: var(--accent2); }
.rank-row .rk-st.muted { grid-column: 3; font-size: 12px; }
@media (max-width: 560px) {
  .prof-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .prof-head { flex-direction: column; text-align: center; }
  .prof-head h2 { text-align: center; } .prof-actions { justify-content: center; }
}
.prof-tiles b { white-space: normal; line-height: 1.1; }
.prof-tiles > div:last-child b { font-size: clamp(15px, 2.1vw, 20px); }
.modal, .rank-list { scrollbar-width: thin; scrollbar-color: #3f3f46 transparent; }
.acc-me .btn { white-space: nowrap; }

/* ---------- portada ---------- */
.home-sub { margin-bottom: 24px; }
.home-step { text-align: left; display: grid; gap: 10px; }
.home-label { font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.home-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: var(--input); border: 1px solid var(--line); border-radius: 18px; }
.home-seg[hidden] { display: none; }
.home-seg button { display: grid; gap: 2px; padding: 11px 8px; border: 1px solid transparent; border-radius: 14px; background: none; color: var(--muted);
  font-family: inherit; cursor: pointer; text-align: center; transition: background .15s, color .15s, border-color .15s; }
.home-seg button b { font-size: 15px; font-weight: 800; }
.home-seg button span { font-size: 11.5px; opacity: .8; }
.home-seg button:hover { color: var(--fg); }
.home-seg button.on { background: var(--card2); color: var(--fg); border-color: rgba(74,222,128,.55); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.home-seg button.on b { color: var(--accent2); }
.home-me { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--input);
  border: 1px solid rgba(74,222,128,.5); }
.home-me[hidden] { display: none; }
.home-me .nm { font-weight: 900; font-size: 17px; }
.home-me .muted { font-size: 12.5px; }
.home-me .btn { white-space: nowrap; }
.home-auth { display: grid; gap: 10px; margin: 0 !important; animation: fade .2s; }
.home-auth[hidden] { display: none !important; }
.home-auth .acc-err { margin: 0; min-height: 0; text-align: left; }
.home-auth .acc-err:empty { display: none; }
.home-switch { text-align: center; font-size: 13.5px; color: var(--muted); }
.home-switch button { background: none; border: 0; padding: 0; color: var(--accent2); font: 800 13.5px system-ui, sans-serif; cursor: pointer; }
.home-switch button:hover { text-decoration: underline; }
#homeForm { margin-top: 14px; }
#homeForm[hidden] { display: none; }
#nameField[hidden] { display: none; }
.home-foot { margin: 16px auto 0; display: block; }

/* ---------- ambientación ASIR (terminal) ---------- */
.eyebrow, .tag, .room-code, .share code, .code-input, .pill b, .brand, .home-label, .divider { font-family: var(--mono); }
.eyebrow::before { content: "# "; color: var(--accent); opacity: .7; }
.logo { font-family: var(--mono); letter-spacing: -.05em; }
.logo span { text-shadow: 0 0 28px rgba(74,222,128,.45); }
.brand::before { content: ">_ "; color: var(--accent); }
.prompt { font: 600 13px var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--input); margin-bottom: 12px; max-width: 100%; white-space: nowrap; overflow: hidden; }
.prompt b { color: var(--accent2); font-weight: 700; }
.prompt i, .soon-log i { display: inline-block; width: 8px; height: 15px; background: var(--accent2); animation: blink 1s steps(1) infinite; vertical-align: text-bottom; }
.room-code { text-shadow: 0 0 24px rgba(74,222,128,.35); }
.home.card { box-shadow: 0 0 0 1px rgba(74,222,128,.06), 0 30px 80px rgba(0,0,0,.45); }
.soon { margin-top: 14px; padding: 26px 18px; border: 2px dashed var(--line); border-radius: 18px; background: var(--input); text-align: center; display: grid; gap: 10px; justify-items: center; }
.soon-ico { font-size: 44px; line-height: 1; }
.soon-t { font-size: 20px; font-weight: 900; }
.soon-log { font: 600 13px/1.7 var(--mono); color: var(--accent2); text-align: left; background: #050507; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; max-width: 100%; overflow-x: auto; margin: 0; }
