/* =====================================================================
   SIGNAL · interfaz
   Mundo visual: pantalla de radar de noche. Azul tinta, señales en ámbar,
   presencia en turquesa. Esquinas recortadas tipo HUD solo en la tarjeta
   de jugador y en las piezas de señal; el resto, sobrio.
   ===================================================================== */

:root {
  color-scheme: light;
  --ink-0: #ffffff;      /* fondo */
  --ink-1: #f5f9fc;      /* superficies */
  --ink-2: #edf4fa;      /* controles */
  --ink-3: #e1edf7;      /* hover */
  --line: #d6e3ee;
  --line-soft: #e7eff6;
  --line-strong: #b9cfe0;
  --text: #172133;
  --text-2: #475569;
  --text-3: #66738a;
  --amber: #ff7a1a;      /* naranja: acción principal y SIGNAL */
  --accent-rgb: 255, 122, 26;
  --amber-ink: #2b1300;  /* texto sobre naranja */
  --accent-text: #c2500a;/* naranja legible sobre blanco */
  --accent-hover: #ff8f3d;
  --amber-soft: rgba(255, 122, 26, .12);
  --teal: #38bdf8;       /* celeste: en línea, duo */
  --teal-rgb: 56, 189, 248;
  --teal-text: #0369a1;
  --rose: #ef4462;       /* paso, peligro, colgar */
  --rose-rgb: 239, 68, 98;
  --danger-text: #c42245;
  --violet: #7c5cff;     /* beacons */
  --violet-rgb: 124, 92, 255;
  --sky: #0ea5e9;        /* planes */
  --sky-rgb: 14, 165, 233;
  --sky-text: #0369a1;
  --mine: #ffe9d8;       /* mis mensajes */
  --overlay-rgb: 15, 23, 42;

  --display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --body: 'Onest', 'Segoe UI', system-ui, sans-serif;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --cut: 14px;
  --shadow: 0 12px 30px -14px rgba(23, 33, 51, .22), 0 2px 6px rgba(23, 33, 51, .06);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --nav-h: 64px;
  --rail-w: 0px;
  --gutter: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ink-0);
  color: var(--text);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--accent-text); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
::selection { background: var(--amber); color: var(--amber-ink); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--amber); color: var(--amber-ink); border-radius: var(--r-sm); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }
.muted { color: var(--text-2); }
.small { font-size: .875rem; }
.noscript { padding: 24px; text-align: center; }
.ic { flex: none; }
.rot-90 { transform: rotate(90deg); }
[hidden] { display: none !important; }

/* ---------- arranque ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--text-2); }
.boot-mark { width: 56px; height: 56px; fill: none; stroke: var(--amber); stroke-width: 2.5; stroke-linecap: round; }
.boot-mark circle { fill: var(--amber); stroke: none; }
.boot-mark path { animation: boot 1.6s var(--ease-out) infinite; opacity: .3; }
.boot-mark path:nth-of-type(2) { animation-delay: .2s; }
@keyframes boot { 30% { opacity: 1; } }

/* ---------- estructura ---------- */
.view { min-height: 100dvh; outline: none; }
.app[data-shell="app"] .view { padding-bottom: calc(var(--nav-h) + var(--safe-b)); }

.nav {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: rgba(12, 18, 48, .94);
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav-brand, .nav-extra { display: none; }
.nav-main { display: flex; flex: 1; }
.nav-item {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); text-decoration: none; font-size: .72rem; font-weight: 500; letter-spacing: .01em;
  transition: color .15s ease;
}
.nav-item:hover { color: var(--text); }
.nav-item.is-active { color: var(--accent-text); }
.nav-item.is-active::before { content: ''; position: absolute; top: 0; width: 28px; height: 2px; background: var(--amber); border-radius: 0 0 2px 2px; }
.nav-badge {
  position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--rose); color: #fff; font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
}

@media (min-width: 900px) {
  :root { --rail-w: 84px; }
  .app[data-shell="app"] .view { padding-bottom: 0; margin-left: var(--rail-w); }
  .nav {
    top: 0; right: auto; width: var(--rail-w); height: 100dvh; padding: 16px 10px; flex-direction: column; gap: 6px;
    border-top: 0; border-right: 1px solid var(--line-soft); background: var(--ink-0);
  }
  .nav-brand { display: flex; justify-content: center; margin-bottom: 18px; color: var(--accent-text); text-decoration: none; }
  .nav-brand .brand-word { display: none; }
  .nav-main, .nav-extra { display: flex; flex-direction: column; gap: 4px; flex: none; }
  .nav-extra { margin-top: auto; }
  .nav-item { flex: none; padding: 10px 4px; border-radius: var(--r); font-size: .7rem; }
  .nav-item:hover { background: var(--ink-1); }
  .nav-item.is-active { background: var(--amber-soft); }
  .nav-item.is-active::before { display: none; }
  .nav-badge { top: 4px; left: calc(50% + 8px); }
}
@media (min-width: 1240px) {
  :root { --rail-w: 232px; }
  .nav { padding: 22px 14px; }
  .nav-brand { justify-content: flex-start; padding: 0 12px; }
  .nav-brand .brand-word { display: inline; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 11px 14px; font-size: .95rem; }
  .nav-badge { position: static; margin-left: auto; }
}

/* ---------- marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--amber-soft); color: var(--accent-text); }
.brand-word { font: 700 1.25rem/1 var(--display); letter-spacing: .14em; }

/* ---------- páginas ---------- */
.page { width: 100%; max-width: 1100px; margin: 0 auto; padding: 20px var(--gutter) 40px; }
.page-narrow { max-width: 680px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .btn { margin-left: auto; }
.page-head.with-back .page-title { flex: 1; min-width: 0; }
.page-title { font: 700 clamp(1.5rem, 4vw, 2rem)/1.1 var(--display); letter-spacing: .01em; overflow-wrap: anywhere; }
.page-sub { width: 100%; color: var(--text-2); }
.section-title { font: 600 1.1rem/1.3 var(--display); margin-bottom: 4px; }
.section-text { color: var(--text-2); font-size: .94rem; }
.mini-title { font: 600 .9rem/1 var(--display); color: var(--text-2); margin-bottom: 10px; }
.stack { display: grid; gap: 14px; }
.stack-lg { display: grid; gap: 22px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.row-center { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.row-wrap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.form-section { display: grid; gap: 14px; padding: 20px; background: var(--ink-1); border: 1px solid var(--line-soft); border-radius: var(--r-lg); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--r); border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .12s var(--ease-out);
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .55; }
.btn-primary { background: var(--amber); color: var(--amber-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: var(--ink-2); border-color: var(--line); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--ink-3); }
.btn-danger { background: rgba(var(--rose-rgb), .14); border-color: rgba(var(--rose-rgb), .45); color: var(--danger-text); }
.btn-danger:hover:not(:disabled) { background: rgba(var(--rose-rgb), .24); }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 1rem; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.btn-xs { min-height: 30px; padding: 0 10px; font-size: .8rem; border-radius: var(--r-sm); gap: 4px; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--text) transparent var(--text) transparent; animation: spin .7s linear infinite;
}
.btn-primary.is-busy::after { border-color: var(--amber-ink) transparent var(--amber-ink) transparent; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none;
  border-radius: var(--r); border: 0; background: transparent; color: var(--text-2); text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover:not(:disabled) { background: var(--ink-2); color: var(--text); }
.icon-btn:disabled { opacity: .4; }
.icon-btn.has-label { display: inline-flex; width: auto; gap: 8px; padding: 0 12px; font-weight: 500; font-size: .9rem; background: var(--ink-1); border: 1px solid var(--line-soft); }
.page-head .icon-btn.has-label { margin-left: auto; }

/* ---------- formularios ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field-label { display: flex; justify-content: space-between; gap: 8px; font-size: .88rem; font-weight: 600; color: var(--text-2); }
.field-hint { font-size: .82rem; color: var(--text-3); }
.field-error, .form-error { font-size: .85rem; color: var(--danger-text); }
.form-error { padding: 10px 12px; border-radius: var(--r-sm); background: rgba(var(--rose-rgb), .1); }
.counter { font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums; }
.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r);
  background: var(--ink-0); border: 1px solid var(--line); color: var(--text); font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--text-3); opacity: 1; }
.input:hover { border-color: var(--line-strong); }
.input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--amber-soft); }
.input[aria-invalid] { border-color: var(--rose); }
.input-sm { min-height: 36px; padding: 4px 10px; font-size: .88rem; width: auto; }
select.input { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23b1b9e3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type="datetime-local"].input { color-scheme: dark; }
.check { width: 20px; height: 20px; accent-color: var(--accent-text); flex: none; margin-top: 2px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--text-2); cursor: pointer; }
.radio-list { display: grid; gap: 4px; }
.radio-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; }
.radio-row:hover { background: var(--ink-2); }
.radio-row input { accent-color: var(--accent-text); width: 18px; height: 18px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 0; cursor: pointer; }
.switch-row small { display: block; color: var(--text-3); font-size: .82rem; }
.switch {
  appearance: none; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--ink-3); position: relative; cursor: pointer;
  transition: background-color .2s ease;
}
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease-out), background-color .2s ease; }
.switch:checked { background: var(--amber); }
.switch:checked::after { transform: translateX(18px); background: var(--amber-ink); }
.range { width: 100%; accent-color: var(--accent-text); }

/* ---------- chips, etiquetas, pestañas ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 0 calc(var(--gutter) * -1) 16px; padding-left: var(--gutter); padding-right: var(--gutter); scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; flex: none;
  border-radius: 18px; border: 1px solid var(--line); background: var(--ink-1); color: var(--text-2); font-size: .9rem; font-weight: 500;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.is-active { background: var(--amber-soft); border-color: var(--accent-text); color: var(--accent-text); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; background: var(--ink-3); color: var(--text-2); font-size: .74rem; font-weight: 600; }
.tag-ok { background: rgba(var(--teal-rgb), .14); color: var(--teal-text); }
.role-tag { display: inline-flex; padding: 3px 10px; border-radius: 6px; background: rgba(237, 240, 255, .08); color: var(--text); font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.role-tag.is-taken { text-decoration: line-through; opacity: .5; }
.rank { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font: 600 .78rem/1.2 var(--display); letter-spacing: .04em; background: var(--ink-3); color: var(--text-2); white-space: nowrap; }
.rank-epico, .rank-leyenda { background: rgba(var(--violet-rgb), .16); color: #c1b6ff; }
.rank-mitico, .rank-honor_mitico { background: rgba(var(--sky-rgb), .15); color: #8fd0ff; }
.rank-gloria_mitica, .rank-inmortal { background: var(--amber-soft); color: var(--accent-text); }
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: var(--r); background: var(--ink-1); border: 1px solid var(--line-soft); width: fit-content; }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; font-size: .92rem; }
.tab.is-active { background: var(--ink-3); color: var(--text); }
.dot-online { display: inline-flex; align-items: center; gap: 6px; color: var(--teal-text); }
.dot-online::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }

/* ---------- avatar ---------- */
.avatar {
  --s: 44px; position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%; background: var(--ink-3); overflow: visible;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-initial { font: 700 calc(var(--s) * .42)/1 var(--display); color: var(--text-2); }
.avatar.is-online::after {
  content: ''; position: absolute; right: 0; bottom: 0; width: max(10px, calc(var(--s) * .26)); height: max(10px, calc(var(--s) * .26));
  border-radius: 50%; background: var(--teal); border: 2px solid var(--ink-0);
}
.plan-badge { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 14px; background: rgba(var(--sky-rgb), .14); color: var(--sky-text); }
.thread-who .plan-badge { width: 40px; height: 40px; border-radius: 11px; }

/* ---------- estados ---------- */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent-text); animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px 16px; color: var(--text-2); }
.empty { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: var(--ink-1); border: 1px dashed var(--line); color: var(--accent-text); margin-bottom: 4px; }
.empty-mark.is-error { color: var(--rose); }
.empty-title { font: 600 1.15rem/1.3 var(--display); }
.empty-text { color: var(--text-2); max-width: 42ch; }
.empty .row-center, .empty > .btn { margin-top: 8px; }

/* ---------- avisos ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; left: calc(50% + var(--rail-w) / 2); } }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-radius: var(--r); pointer-events: auto;
  background: #ffffff; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .93rem;
  opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .25s var(--ease-out);
}
.toast.is-in { opacity: 1; transform: none; }
.toast-text { flex: 1; }
.toast-success { border-color: rgba(var(--teal-rgb), .5); }
.toast-error { border-color: rgba(var(--rose-rgb), .6); }
.toast-warn { border-color: rgba(var(--accent-rgb), .55); }
.toast-action { border: 0; background: none; color: var(--accent-text); font-weight: 700; }
.toast-close { border: 0; background: none; color: var(--text-3); display: grid; place-items: center; padding: 4px; }
.app.is-offline .view { filter: saturate(.6); }

/* ---------- diálogos ---------- */
.dialog {
  border: 1px solid var(--line); background: var(--ink-1); color: var(--text); padding: 0;
  max-height: 92dvh; overflow: auto; box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(4, 7, 22, .66); backdrop-filter: blur(3px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px 12px 6px 20px; background: var(--ink-1); }
.dialog-title { flex: 1; font: 600 1.15rem/1.3 var(--display); overflow-wrap: anywhere; }
.dialog-body { padding: 8px 20px 22px; }
.dialog-sheet { width: 100%; max-width: 100%; margin: auto auto 0; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: var(--safe-b); animation: sheet-in .32s var(--ease-drawer); }
.dialog-center { width: min(460px, calc(100vw - 32px)); border-radius: var(--r-lg); animation: pop-in .22s var(--ease-out); }
.dialog.is-closing { opacity: 0; transition: opacity .16s ease; }
@media (min-width: 640px) {
  .dialog-sheet { width: min(520px, calc(100vw - 32px)); margin: auto; border-radius: var(--r-lg); border-bottom: 1px solid var(--line); animation: pop-in .22s var(--ease-out); }
}
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.96); } }
.menu-list { display: grid; gap: 2px; }
.menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 50px; padding: 0 14px;
  border: 0; border-radius: var(--r-sm); background: transparent; text-align: left; font-weight: 500;
}
.menu-item > .ic { order: -1; color: var(--text-2); }
.menu-item:has(> .ic) { justify-content: flex-start; }
.menu-item:hover:not(:disabled) { background: var(--ink-2); }
.menu-item:disabled { opacity: .5; }
.menu-item.is-danger, .menu-item.is-danger .ic { color: var(--danger-text); }

/* ---------- configuración faltante ---------- */
.setup { max-width: 560px; margin: 0 auto; padding: 64px var(--gutter); display: grid; gap: 16px; }
.setup-title { font: 700 1.8rem/1.15 var(--display); }
.setup-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.setup code { background: var(--ink-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* ---------- portada ---------- */
.landing { max-width: 1160px; margin: 0 auto; padding: 18px var(--gutter) 40px; }
.landing-top { display: flex; align-items: center; justify-content: space-between; }
.landing-hero { display: grid; gap: 28px; align-items: center; padding: 28px 0 40px; }
.landing-title { font: 700 clamp(2.2rem, 7.5vw, 4.4rem)/1.02 var(--display); letter-spacing: -.01em; max-width: 13ch; }
.landing-lead { margin-top: 18px; font-size: clamp(1.02rem, 2.4vw, 1.2rem); color: var(--text-2); max-width: 46ch; }
.landing-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
@media (min-width: 880px) { .landing-hero { grid-template-columns: 1.1fr 1fr; padding: 64px 0 72px; } }

.radar { position: relative; width: min(100%, 460px); aspect-ratio: 1; justify-self: center; border-radius: 50%; overflow: hidden;
  background: radial-gradient(circle, #16205a 0%, #0f1745 55%, var(--ink-0) 72%); }
.radar-grid { position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 calc(25% - 1px), rgba(var(--accent-rgb), .18) 25%, transparent calc(25% + 1px) calc(50% - 1px), rgba(var(--accent-rgb), .14) 50%, transparent calc(50% + 1px) calc(75% - 1px), rgba(var(--accent-rgb), .1) 75%, transparent calc(75% + 1px)),
    linear-gradient(transparent calc(50% - .5px), rgba(var(--accent-rgb), .12) 50%, transparent calc(50% + .5px)),
    linear-gradient(90deg, transparent calc(50% - .5px), rgba(var(--accent-rgb), .12) 50%, transparent calc(50% + .5px)); }
.radar-sweep { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(var(--accent-rgb), .42), rgba(var(--accent-rgb), .08) 50deg, transparent 90deg);
  animation: sweep 4s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.radar-core { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 18px var(--amber); }
.radar-blip { position: absolute; display: flex; align-items: center; gap: 8px; transform: translate(-6px, -6px); animation: blip 4s var(--ease-out) infinite; opacity: .25; }
.radar-blip-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 14px var(--teal); }
.radar-blip-label { font: 600 .78rem/1 var(--display); letter-spacing: .06em; padding: 4px 8px; border-radius: 6px; background: rgba(12, 18, 48, .8); color: var(--text); }
@keyframes blip { 0%, 100% { opacity: .25; } 8% { opacity: 1; } 45% { opacity: .9; } }

.landing-points { display: grid; gap: 22px; padding: 28px 0; border-top: 1px solid var(--line-soft); }
@media (min-width: 880px) { .landing-points { grid-template-columns: repeat(3, 1fr); gap: 36px; } }
.point { display: flex; gap: 14px; align-items: flex-start; }
.point-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--ink-1); color: var(--accent-text); }
.point-title { font: 600 1.05rem/1.3 var(--display); }
.point-text { color: var(--text-2); font-size: .95rem; margin-top: 4px; }
.landing-foot { padding-top: 24px; color: var(--text-3); font-size: .85rem; }

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 22px; padding: 32px var(--gutter); }
.auth-card { width: min(420px, 100%); display: grid; gap: 16px; padding: 28px 22px; border-radius: var(--r-lg); background: var(--ink-1); border: 1px solid var(--line-soft); }
@media (min-width: 480px) { .auth-card { padding: 32px 30px; } }
.auth-title { font: 700 1.7rem/1.1 var(--display); }
.auth-sub { color: var(--text-2); margin-top: -8px; }
.auth-links, .auth-switch { font-size: .92rem; color: var(--text-2); text-align: center; }
.auth-done { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: rgba(var(--teal-rgb), .14); color: var(--teal-text); }

/* ---------- pasos (bienvenida) ---------- */
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.step { display: grid; gap: 6px; font-size: .8rem; color: var(--text-3); }
.step::before { content: ''; height: 4px; border-radius: 2px; background: var(--ink-3); }
.step.is-done::before { background: var(--teal); }
.step.is-current::before { background: var(--amber); }
.step.is-current { color: var(--text); }
.step-num { display: none; }
.step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.onboard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.onboard-nav .btn-primary { margin-left: auto; }

/* ---------- fotos ---------- */
.photos { display: grid; gap: 10px; }
.photo-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.photo-slot {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: var(--ink-0); border: 1px solid var(--line);
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot.is-empty { display: grid; place-content: center; justify-items: center; gap: 6px; border-style: dashed; color: var(--text-2); font-size: .8rem; text-align: center; padding: 8px; }
.photo-slot.is-empty:hover:not(:disabled) { border-color: var(--accent-text); color: var(--accent-text); }
.photo-slot.is-over { outline: 2px solid var(--amber); }
.photo-slot.is-drag { opacity: .5; }
.photo-main { position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 6px; background: var(--amber); color: var(--amber-ink); font-size: .7rem; font-weight: 700; }
.photo-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(4, 7, 22, .85)); }
.photo-tool { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(12, 18, 48, .85); color: var(--text); }
.photo-tool:disabled { opacity: .35; }
.photo-tool.is-danger { color: var(--danger-text); }
.photo-slot.is-uploading img { opacity: .5; }
.photo-progress { position: absolute; left: 10px; right: 10px; bottom: 30px; height: 4px; border-radius: 2px; background: rgba(237, 240, 255, .2); overflow: hidden; }
.photo-progress-bar { display: block; height: 100%; background: var(--amber); transition: width .2s ease; }
.photo-progress-text { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: .76rem; color: var(--text); }

/* ---------- recorte ---------- */
.crop { display: grid; gap: 14px; }
.crop-stage { position: relative; width: 100%; max-width: 360px; aspect-ratio: 4 / 5; margin: 0 auto; overflow: hidden; border-radius: var(--r); background: #000; touch-action: none; cursor: grab; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-guides { position: absolute; inset: 0; pointer-events: none; border: 2px solid rgba(var(--accent-rgb), .85); border-radius: var(--r);
  background: linear-gradient(90deg, transparent 33.2%, rgba(255, 255, 255, .25) 33.3%, transparent 33.4%, transparent 66.6%, rgba(255, 255, 255, .25) 66.7%, transparent 66.8%),
              linear-gradient(transparent 33.2%, rgba(255, 255, 255, .25) 33.3%, transparent 33.4%, transparent 66.6%, rgba(255, 255, 255, .25) 66.7%, transparent 66.8%); }
.crop-zoom { display: flex; align-items: center; gap: 10px; color: var(--text-2); max-width: 360px; width: 100%; margin: 0 auto; }

/* ---------- descubrir ---------- */
.discover { display: grid; grid-template-rows: auto 1fr auto; min-height: calc(100dvh - var(--nav-h) - var(--safe-b)); padding-bottom: 16px; max-width: 560px; }
@media (min-width: 900px) { .discover { min-height: 100dvh; } }
.discover-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.discover-tools { display: flex; gap: 8px; margin-left: auto; }
.signal-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 21px;
  border: 1px solid rgba(var(--accent-rgb), .5); background: var(--amber-soft); color: var(--accent-text); font-weight: 600; font-size: .9rem;
}
.signal-btn:hover { background: rgba(var(--accent-rgb), .22); }
.signal-btn.is-active { background: var(--amber); color: var(--amber-ink); border-color: var(--accent-text); }
.pulse { position: relative; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.pulse::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid currentColor; animation: ping 1.8s var(--ease-out) infinite; }
@keyframes ping { from { transform: scale(.5); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }

.deck { position: relative; min-height: 440px; height: min(68dvh, 640px); }
.deck > .empty, .deck > .loading-block { position: absolute; inset: 0; display: grid; place-content: center; }
.deck-card { position: absolute; inset: 0; transition: transform .28s var(--ease-out), opacity .2s ease; touch-action: pan-y; }
.deck-card:not(.is-top) { transform: scale(.95) translateY(14px); opacity: .6; pointer-events: none; }
.deck-card.is-dragging { transition: none; cursor: grabbing; }
.deck-card.is-leaving { transition: transform .26s var(--ease-out), opacity .26s ease; opacity: 0; }
.deck-actions { display: flex; justify-content: center; align-items: center; gap: 22px; padding-top: 18px; }
.deck-btn {
  display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink-1);
  transition: transform .14s var(--ease-out), background-color .15s ease, border-color .15s ease; box-shadow: var(--shadow);
}
.deck-btn:active { transform: scale(.92); }
.deck-btn.is-pass { color: var(--rose); }
.deck-btn.is-pass:hover { border-color: var(--rose); background: rgba(var(--rose-rgb), .1); }
.deck-btn.is-duo { color: var(--amber-ink); background: var(--amber); border-color: var(--accent-text); width: 74px; height: 74px; }
.deck-btn.is-duo:hover { background: var(--accent-hover); }
.deck-btn.is-info { width: 50px; height: 50px; color: var(--text-2); }

/* ---------- tarjeta de jugador (el elemento con carácter) ---------- */
.pc {
  --duo: 0; --pass: 0;
  position: relative; display: grid; height: 100%; overflow: hidden; user-select: none;
  background: var(--ink-1);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
  border-radius: 6px;
}
.pc::before { /* filo de HUD en las esquinas recortadas */
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(225deg, var(--edge, rgba(237, 240, 255, .35)) 0 19px, transparent 19px) top right / 40px 40px no-repeat,
    linear-gradient(45deg, var(--edge, rgba(237, 240, 255, .35)) 0 19px, transparent 19px) bottom left / 40px 40px no-repeat;
  -webkit-mask: linear-gradient(225deg, transparent 17.5px, #000 18px, #000 19.5px, transparent 20px) top right / 40px 40px no-repeat,
                linear-gradient(45deg, transparent 17.5px, #000 18px, #000 19.5px, transparent 20px) bottom left / 40px 40px no-repeat;
          mask: linear-gradient(225deg, transparent 17.5px, #000 18px, #000 19.5px, transparent 20px) top right / 40px 40px no-repeat,
                linear-gradient(45deg, transparent 17.5px, #000 18px, #000 19.5px, transparent 20px) bottom left / 40px 40px no-repeat;
}
.pc.has-signal { --edge: var(--amber); }
.pc-media { position: absolute; inset: 0; }
.pc-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.pc-photo.is-shown { opacity: 1; }
.pc-nophoto { display: grid; place-items: center; color: var(--text-3); background: var(--ink-2); }
.pc-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 12, 34, .5) 0%, transparent 22%, transparent 44%, rgba(8, 12, 34, .92) 80%); }
.pc-bars { position: absolute; z-index: 2; top: 10px; left: 14px; right: 40px; display: flex; gap: 5px; }
.pc-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(237, 240, 255, .3); }
.pc-bars span.is-on { background: var(--text); }
.pc-signal {
  position: absolute; z-index: 2; top: 24px; left: 14px; right: 40px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--r-sm); background: rgba(12, 18, 48, .82); border: 1px solid rgba(var(--accent-rgb), .55); color: var(--accent-text);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pc-signal .pulse { grid-row: span 2; }
.pc-signal-text { color: var(--text); font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.pc-signal-meta { font-size: .76rem; color: var(--accent-text); }
.pc-info { position: relative; z-index: 2; align-self: end; display: grid; gap: 8px; padding: 18px 18px 22px 22px; }
.pc-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-name { font: 700 clamp(1.6rem, 6vw, 2rem)/1.05 var(--display); overflow-wrap: anywhere; }
.pc-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .88rem; color: var(--text-2); }
.pc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.pc-bio { color: var(--text-2); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-stamp {
  position: absolute; z-index: 4; top: 64px; padding: 6px 14px; border: 3px solid; border-radius: 8px;
  font: 700 2rem/1 var(--display); letter-spacing: .12em; pointer-events: none;
}
.pc-stamp-duo { left: 22px; color: var(--accent-text); transform: rotate(-12deg); opacity: var(--duo); }
.pc-stamp-pass { right: 22px; color: var(--rose); transform: rotate(12deg); opacity: var(--pass); }

/* ---------- SIGNAL ---------- */
.signal-box { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--amber-soft); border: 1px solid rgba(var(--accent-rgb), .4); color: var(--accent-text); }
.signal-box div { display: grid; }
.signal-box strong { color: var(--text); font-weight: 600; }
.signal-box span:not(.pulse) { font-size: .82rem; }
.signal-left { display: flex; align-items: center; gap: 8px; color: var(--accent-text); font-size: .9rem; }

/* ---------- match ---------- */
.match-dialog { width: min(420px, calc(100vw - 32px)); overflow: hidden; }
.match-dialog .dialog-body { padding: 0; }
.match { position: relative; display: grid; justify-items: center; gap: 12px; padding: 40px 24px 26px; text-align: center; isolation: isolate; }
.match-waves { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.match-waves span { position: absolute; top: 96px; width: 200px; height: 200px; margin-top: -100px; border-radius: 50%; border: 2px solid; opacity: 0; animation: wave 2.4s var(--ease-out) infinite; }
.match-waves span:nth-child(odd) { left: calc(50% - 160px); border-color: var(--accent-text); }
.match-waves span:nth-child(even) { right: calc(50% - 160px); border-color: var(--teal-text); }
.match-waves span:nth-child(3), .match-waves span:nth-child(4) { animation-delay: 1.2s; }
@keyframes wave { from { transform: scale(.3); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.match-pair { display: flex; align-items: center; margin-bottom: 6px; }
.match-face { border-radius: 50%; padding: 4px; }
.match-face.is-me { background: var(--amber); animation: slide-r .5s var(--ease-out) both; }
.match-face.is-them { background: var(--teal); margin-left: -24px; animation: slide-l .5s var(--ease-out) both; }
@keyframes slide-r { from { transform: translateX(-40px); opacity: 0; } }
@keyframes slide-l { from { transform: translateX(40px); opacity: 0; } }
.match-title { font: 700 2.1rem/1.05 var(--display); color: var(--accent-text); }
.match-text { color: var(--text-2); max-width: 32ch; }
.match-actions { display: grid; gap: 10px; width: 100%; margin-top: 10px; }

/* ---------- chats ---------- */
.chats { display: grid; height: calc(100dvh - var(--nav-h) - var(--safe-b)); }
.chat-list { overflow-y: auto; padding: 20px var(--gutter); }
.chat-thread { display: none; min-width: 0; min-height: 0; }
.chats.has-thread .chat-list { display: none; }
.chats.has-thread .chat-thread { display: flex; }
@media (min-width: 900px) {
  .chats { height: 100dvh; grid-template-columns: 340px 1fr; }
  .chats .chat-list, .chats.has-thread .chat-list { display: block; border-right: 1px solid var(--line-soft); }
  .chat-thread { display: flex; }
  .thread-back { display: none !important; }
}
.chat-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.new-matches { margin-bottom: 14px; }
.new-matches-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.new-match { display: grid; justify-items: center; gap: 6px; width: 70px; flex: none; color: var(--text); text-decoration: none; font-size: .8rem; text-align: center; }
.new-match span:last-child { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-match .avatar { box-shadow: 0 0 0 2px var(--ink-0), 0 0 0 4px var(--amber); }
.conv-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.conv { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r); color: var(--text); text-decoration: none; }
.conv:hover { background: var(--ink-1); }
.conv.is-active { background: var(--ink-2); }
.conv-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.conv-top, .conv-bottom { display: flex; align-items: center; gap: 8px; }
.conv-title { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { color: var(--text-3); font-size: .78rem; flex: none; }
.conv-preview { flex: 1; color: var(--text-2); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.is-unread .conv-preview { color: var(--text); font-weight: 500; }
.conv.is-unread .conv-time { color: var(--accent-text); }
.conv-unread { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--amber); color: var(--amber-ink); font-size: .75rem; font-weight: 700; line-height: 22px; text-align: center; }
.thread-placeholder { flex: 1; display: grid; place-items: center; }

/* ---------- conversación ---------- */
.thread { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--ink-0); }
.thread > .empty { margin: auto; }
.thread-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 6px; border-bottom: 1px solid var(--line-soft); background: var(--ink-0); min-height: 62px; }
.thread-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; padding: 4px; border-radius: var(--r-sm); }
.thread-names { display: grid; min-width: 0; }
.thread-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-sub { font-size: .8rem; color: var(--text-3); min-height: 1.2em; }
.thread-sub.is-typing { color: var(--teal-text); }
.thread-actions { display: flex; gap: 2px; }
.msg-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px 8px; }
@media (min-width: 900px) { .msg-scroll { padding: 16px 28px 10px; } }
.msg-older { height: 24px; }
.msg-list { display: flex; flex-direction: column; gap: 2px; max-width: 760px; margin: 0 auto; }
.msg-empty { text-align: center; color: var(--text-3); padding: 40px 16px; }
.msg-day { display: flex; justify-content: center; margin: 14px 0 8px; }
.msg-day span { padding: 3px 10px; border-radius: 10px; background: var(--ink-1); color: var(--text-3); font-size: .76rem; text-transform: capitalize; }
.msg { display: grid; justify-items: start; margin-top: 8px; max-width: 100%; }
.msg.is-grouped { margin-top: 0; }
.msg.is-mine { justify-items: end; }
.msg-author { font-size: .76rem; color: var(--sky-text); margin: 0 0 3px 12px; font-weight: 600; }
.msg.is-grouped .msg-author { display: none; }
.msg-row { position: relative; display: flex; align-items: center; gap: 4px; max-width: min(84%, 520px); }
.msg.is-mine .msg-row { flex-direction: row-reverse; }
.bubble {
  position: relative; min-width: 72px; padding: 8px 12px 6px; border-radius: 16px; background: var(--ink-1); border: 1px solid var(--line-soft);
  overflow-wrap: anywhere;
}
.msg.is-mine .bubble { background: var(--mine); border-color: transparent; }
.msg:not(.is-grouped):not(.is-mine) .bubble { border-top-left-radius: 5px; }
.msg.is-mine:not(.is-grouped) .bubble { border-top-right-radius: 5px; }
.msg.is-pending .bubble { opacity: .7; }
.msg.is-failed .bubble { border-color: var(--rose); }
.msg.is-flash .bubble { animation: flash 1.2s ease; }
@keyframes flash { 20% { box-shadow: 0 0 0 3px var(--amber); } }
.msg-text { white-space: pre-wrap; line-height: 1.42; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 2px; font-size: .7rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.msg.is-mine .msg-meta { color: #aab5f0; }
.msg-tick { display: inline-flex; }
.msg-tick.is-read { color: var(--teal-text); }
.retry { border: 0; background: none; color: var(--rose); font-weight: 700; font-size: .75rem; padding: 0; }
.msg-quote { display: grid; gap: 1px; width: 100%; margin: 2px 0 6px; padding: 6px 10px; border: 0; border-radius: 10px; background: rgba(4, 7, 22, .35); text-align: left; box-shadow: inset 2px 0 0 var(--amber); }
.msg-quote-who { font-size: .75rem; font-weight: 700; color: var(--accent-text); }
.msg-quote-text { font-size: .84rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s ease; }
.msg:hover .msg-actions, .msg.is-selected .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-act { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--ink-1); color: var(--text-2); }
.msg-act:hover { color: var(--text); background: var(--ink-2); }
@media (pointer: coarse) { .msg-actions { display: none; } .msg.is-selected .msg-actions { display: flex; } }
.msg-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -4px; padding: 0 8px; position: relative; z-index: 1; }
.msg-reacts:empty { display: none; }
.react-chip { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink-1); font-size: .85rem; }
.react-chip span { font-size: .72rem; color: var(--text-2); }
.react-chip.is-mine { border-color: var(--accent-text); background: var(--amber-soft); }
.react-pop { position: absolute; z-index: 5; bottom: calc(100% + 6px); display: flex; gap: 2px; padding: 5px; border-radius: 24px; background: var(--ink-2); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop-in .16s var(--ease-out); }
.msg:not(.is-mine) .react-pop { left: 0; }
.msg.is-mine .react-pop { right: 0; }
.react-pop button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; font-size: 1.25rem; transition: transform .12s var(--ease-out); }
.react-pop button:hover, .react-pop button:focus-visible { transform: scale(1.18); background: var(--ink-3); }
.react-pop button.is-mine { background: var(--amber-soft); }
.msg-system { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin: 10px 0; font-size: .82rem; color: var(--text-3); text-align: center; }
.msg-system time { font-size: .7rem; }
.msg-call { display: flex; align-items: center; gap: 8px; align-self: center; margin: 10px 0; padding: 8px 10px 8px 14px; border-radius: 22px; background: var(--ink-1); border: 1px solid var(--line-soft); font-size: .86rem; color: var(--text-2); flex-wrap: wrap; justify-content: center; }
.msg-call.is-missed { color: var(--danger-text); border-color: rgba(var(--rose-rgb), .35); }
.msg-call-label { color: var(--text); font-weight: 500; }
.msg-call.is-missed .msg-call-label { color: var(--danger-text); }
.msg-call time { font-size: .74rem; color: var(--text-3); }
.msg-img-box { display: block; width: min(280px, 64vw); max-height: 360px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--ink-2); margin: 2px -6px 2px; }
.msg-img { width: 100%; height: 100%; object-fit: cover; }
.msg-img-box.is-broken { display: grid; place-items: center; min-height: 80px; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 2px 0; }
.voice-play { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; background: var(--amber); color: var(--amber-ink); }
.voice-track { position: relative; flex: 1; height: 6px; border-radius: 3px; background: rgba(237, 240, 255, .2); cursor: pointer; }
.voice-track::before { content: ''; position: absolute; inset: -10px 0; }
.voice-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--amber); }
.voice-time { font-size: .78rem; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 36px; }
.lightbox { width: min(960px, calc(100vw - 24px)); }
.lightbox-img { width: 100%; max-height: 80dvh; object-fit: contain; border-radius: var(--r-sm); }
.typing { padding: 0 20px 6px; font-size: .82rem; color: var(--teal-text); }
.new-pill { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 18px; background: var(--amber); color: var(--amber-ink); font-weight: 600; font-size: .85rem; box-shadow: var(--shadow); }
.composer-wrap { border-top: 1px solid var(--line-soft); background: var(--ink-0); padding: 8px 10px calc(8px); }
.composer { display: flex; align-items: flex-end; gap: 6px; max-width: 760px; margin: 0 auto; }
.composer-input {
  flex: 1; min-height: 44px; max-height: 140px; padding: 11px 14px; resize: none; border-radius: 22px;
  background: var(--ink-1); border: 1px solid var(--line); color: var(--text); line-height: 1.4;
}
.composer-input:focus { outline: none; border-color: var(--accent-text); }
.composer-main { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: var(--ink-2); color: var(--text); transition: background-color .15s ease; }
.composer-main.is-send { background: var(--amber); color: var(--amber-ink); }
.composer.is-recording { align-items: center; gap: 10px; min-height: 44px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rose); animation: blink 1s ease infinite; }
@keyframes blink { 50% { opacity: .25; } }
.rec-label { color: var(--rose); font-weight: 600; }
.rec-time { flex: 1; font-variant-numeric: tabular-nums; color: var(--text-2); }
.reply-bar { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto 8px; padding: 8px 4px 8px 12px; border-radius: var(--r); background: var(--ink-1); color: var(--accent-text); box-shadow: inset 2px 0 0 var(--amber); }
.reply-bar-text { flex: 1; min-width: 0; display: grid; font-size: .84rem; }
.reply-bar-text strong { color: var(--accent-text); font-weight: 600; }
.reply-bar-text span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-blocked { text-align: center; padding: 10px; color: var(--text-2); font-size: .9rem; }

/* ---------- llamada ---------- */
.call-layer { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.call-layer.is-active .call-full, .call-layer.is-active .call-pip { pointer-events: auto; }
body.has-call-full { overflow: hidden; }
.call-full { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; background: #070b22; color: var(--text); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; opacity: 0; transition: opacity .3s ease; }
.call-full.has-remote-video .call-remote { opacity: 1; }
@media (min-width: 900px) { .call-remote { object-fit: contain; } }
.call-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 7, 22, .7), transparent 25%, transparent 70%, rgba(4, 7, 22, .8)); pointer-events: none; }
.call-head { position: relative; z-index: 2; display: grid; justify-items: center; gap: 4px; padding: calc(28px + env(safe-area-inset-top, 0px)) 16px 0; text-align: center; }
.call-name { font: 700 1.6rem/1.15 var(--display); }
.call-status { color: var(--text-2); font-variant-numeric: tabular-nums; }
.call-flag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 12px; background: rgba(var(--rose-rgb), .2); color: var(--danger-text); font-size: .8rem; }
.call-peer { position: relative; z-index: 1; place-self: center; display: grid; place-items: center; }
.call-full.has-remote-video .call-peer { display: none; }
.call-rings { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.call-rings span { position: absolute; width: 132px; height: 132px; border-radius: 50%; border: 2px solid var(--amber); opacity: 0; }
.call-full.is-ringing .call-rings span { animation: wave 2.2s var(--ease-out) infinite; }
.call-rings span:nth-child(2) { animation-delay: .7s !important; }
.call-rings span:nth-child(3) { animation-delay: 1.4s !important; }
.call-local {
  position: absolute; z-index: 3; right: 14px; top: calc(96px + env(safe-area-inset-top, 0px)); width: min(28vw, 180px); aspect-ratio: 3 / 4;
  object-fit: cover; border-radius: var(--r); border: 2px solid rgba(237, 240, 255, .3); background: #000; display: none; box-shadow: var(--shadow);
}
.call-full.has-local-video .call-local { display: block; }
.call-full.is-mirrored .call-local { transform: scaleX(-1); }
.call-controls, .call-incoming { position: relative; z-index: 2; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 14px; padding: 18px 12px calc(26px + var(--safe-b)); }
.call-btn { display: grid; justify-items: center; gap: 6px; width: 70px; border: 0; background: none; color: var(--text); font-size: .74rem; }
.call-btn > .ic { box-sizing: content-box; padding: 16px; border-radius: 50%; background: rgba(237, 240, 255, .14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background-color .15s ease, transform .12s var(--ease-out); }
.call-btn:hover > .ic { background: rgba(237, 240, 255, .24); }
.call-btn:active > .ic { transform: scale(.92); }
.call-btn.is-off > .ic { background: var(--text); color: #070b22; }
.call-btn.is-danger > .ic { background: var(--rose); color: #fff; }
.call-btn-label { color: var(--text-2); white-space: nowrap; }
.call-answer { display: grid; justify-items: center; gap: 8px; border: 0; background: none; color: var(--text); font-weight: 600; font-size: .85rem; width: 92px; }
.call-answer > .ic { box-sizing: content-box; padding: 20px; border-radius: 50%; }
.call-answer.is-accept > .ic, .call-answer.is-accept-video > .ic { background: #1fc79f; color: #04261d; }
.call-answer.is-reject > .ic { background: var(--rose); color: #fff; }
.call-pip {
  position: fixed; right: 14px; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); width: 176px; border-radius: var(--r-lg); overflow: hidden;
  background: var(--ink-2); border: 1px solid var(--line); box-shadow: 0 18px 40px -10px rgba(0, 0, 0, .7); touch-action: none; cursor: grab;
}
.call-pip.is-dragging { cursor: grabbing; }
@media (min-width: 900px) { .call-pip { bottom: 24px; right: 24px; width: 220px; } }
.pip-media { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: #070b22; }
.pip-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.call-pip.has-remote-video .pip-video { opacity: 1; }
.call-pip.has-remote-video .pip-media .avatar { display: none; }
.pip-bar { display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px 0; font-size: .8rem; }
.pip-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pip-time { color: var(--teal-text); font-variant-numeric: tabular-nums; flex: none; }
.pip-actions { display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px 10px; }
.pip-btn { flex: 1; display: grid; place-items: center; height: 34px; border: 0; border-radius: var(--r-sm); background: var(--ink-3); color: var(--text); }
.pip-btn.is-danger { background: var(--rose); color: #fff; }

/* ---------- perfil ---------- */
.gallery { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--ink-1); margin-bottom: 18px; }
.gallery.is-empty { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--text-3); }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: start; max-height: 70dvh; }
.gallery-dots { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; gap: 5px; }
.gallery-dots span { flex: 1; height: 3px; border-radius: 2px; background: rgba(237, 240, 255, .3); }
.gallery-dots span.is-on { background: var(--text); }
.profile-info { display: grid; gap: 12px; }
.profile-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-name { font: 700 1.9rem/1.1 var(--display); overflow-wrap: anywhere; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); font-size: .92rem; }
.profile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.profile-bio { white-space: pre-wrap; color: var(--text); max-width: 65ch; }
.game-id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r); background: var(--ink-1); border: 1px solid var(--line-soft); }
.game-id-label { color: var(--text-3); font-size: .82rem; }
.game-id-value { font: 600 1.05rem/1 var(--display); letter-spacing: .04em; flex: 1; font-variant-numeric: tabular-nums; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.profile-actions .btn { flex: 1 1 140px; }
.profile-actions > p { display: flex; align-items: center; gap: 6px; }

/* ---------- llamadas (historial) ---------- */
.call-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.call-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r); }
.call-row:hover { background: var(--ink-1); }
.call-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.call-row-name { color: var(--text); font-weight: 600; text-decoration: none; }
.call-row-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: .86rem; }
.call-row.is-missed .call-row-meta { color: var(--danger-text); }
.call-row-time { color: var(--text-3); font-size: .78rem; }
.call-row-actions { display: flex; }

/* ---------- ajustes ---------- */
.settings .form-section { margin-bottom: 14px; }
.blocked-list { display: grid; gap: 8px; }
.blocked-row { display: flex; align-items: center; gap: 12px; }
.blocked-name { flex: 1; font-weight: 500; }

/* ---------- mapa ---------- */
.map-view { position: relative; height: calc(100dvh - var(--nav-h) - var(--safe-b)); overflow: hidden; }
@media (min-width: 900px) { .map-view { height: 100dvh; } }
.map-canvas { position: absolute; inset: 0; background: #0f1738; }
.map-canvas > .empty { position: absolute; inset: 0; display: grid; place-content: center; }
.map-canvas.is-placing, .map-canvas.is-placing .mapboxgl-canvas { cursor: crosshair; }
.map-chips { position: absolute; z-index: 5; top: 12px; left: 12px; right: 12px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.map-chips::-webkit-scrollbar { display: none; }
.chip-map { background: rgba(12, 18, 48, .9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.map-chips select { background-color: rgba(12, 18, 48, .9); border-radius: 18px; flex: none; }
.map-status { position: absolute; z-index: 5; top: 60px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 8px 14px; border-radius: 18px; background: var(--amber); color: var(--amber-ink); font-weight: 600; font-size: .86rem; text-align: center; box-shadow: var(--shadow); }
.map-fabs { position: absolute; z-index: 5; right: 12px; bottom: 44px; display: grid; gap: 10px; }
.map-fab { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line); background: rgba(12, 18, 48, .95); color: var(--text); box-shadow: var(--shadow); }
.map-fab:hover { background: var(--ink-2); }
.map-fab.is-beacon { color: var(--violet); }
.map-fab.is-active { background: var(--violet); color: #120c33; border-color: var(--violet); }
.map-privacy { position: absolute; z-index: 4; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 140px); padding: 5px 10px; border-radius: 14px; background: rgba(12, 18, 48, .85); color: var(--text-2); font-size: .72rem; }
@media (max-width: 599px) { .map-privacy { display: none; } }
.map-panel {
  position: absolute; z-index: 6; left: 12px; right: 12px; bottom: 12px; display: grid; gap: 12px; padding: 16px; max-width: 400px;
  border-radius: var(--r-lg); background: var(--ink-1); border: 1px solid var(--line); box-shadow: var(--shadow); animation: sheet-in .28s var(--ease-drawer);
}
@media (min-width: 900px) { .map-panel { left: auto; right: 76px; top: 64px; bottom: auto; width: 360px; animation: pop-in .2s var(--ease-out); } }
.panel-close { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; }
.panel-row { display: flex; gap: 12px; align-items: center; padding-right: 26px; }
.panel-title { font: 600 1.15rem/1.2 var(--display); overflow-wrap: anywhere; }
.panel-meta { font-size: .86rem; color: var(--text-2); }
.panel-text { font-size: .92rem; color: var(--text); }
.panel-note { font-size: .78rem; color: var(--text-3); }
.panel-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 14px; }
.panel-icon.is-beacon { background: rgba(var(--violet-rgb), .16); color: var(--violet); }
.panel-icon.is-plan { background: rgba(var(--sky-rgb), .14); color: var(--sky-text); }
.mapboxgl-ctrl-group { background: rgba(12, 18, 48, .92) !important; border: 1px solid var(--line); }
.mapboxgl-ctrl-group button .mapboxgl-ctrl-icon { filter: invert(1) brightness(1.4); }
.mapboxgl-ctrl-attrib { background: rgba(12, 18, 48, .7) !important; }
.mapboxgl-ctrl-attrib a { color: var(--text-3) !important; }
.mk { position: relative; display: grid; place-items: center; padding: 0; border: 0; cursor: pointer; }
.mk-user { width: 42px; height: 42px; border-radius: 50%; background: var(--ink-2); border: 2px solid var(--teal); box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.mk-user img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mk-user.is-self { border-color: var(--text); }
.mk-user.is-signal { border-color: var(--accent-text); }
.mk-user.is-online::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--teal); border: 2px solid var(--ink-0); }
.mk-pulse { position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--amber); animation: ping 1.8s var(--ease-out) infinite; pointer-events: none; }
.mk-initial { font: 700 1rem/1 var(--display); color: var(--text-2); }
.mk-beacon { width: 38px; height: 38px; border-radius: 12px 12px 12px 2px; background: var(--violet); color: #120c33; box-shadow: 0 0 0 4px rgba(var(--violet-rgb), .25), 0 4px 12px rgba(0, 0, 0, .5); }
.mk-beacon.is-draft { opacity: .7; }
.mk-plan { min-width: 40px; height: 34px; padding: 0 8px; gap: 4px; grid-auto-flow: column; border-radius: 10px; background: var(--sky); color: #04233c; font: 700 .76rem/1 var(--display); box-shadow: 0 4px 12px rgba(0, 0, 0, .5); }
.mk-plan.is-joined { box-shadow: 0 0 0 3px var(--text), 0 4px 12px rgba(0, 0, 0, .5); }
.picker-map { height: 240px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #0f1738; }
.picker { display: grid; gap: 10px; }

/* ---------- planes ---------- */
.plan-list { display: grid; gap: 12px; }
@media (min-width: 900px) { .plan-list { grid-template-columns: repeat(2, 1fr); } }
.plan-card { display: flex; gap: 16px; padding: 16px; border-radius: var(--r-lg); background: var(--ink-1); border: 1px solid var(--line-soft); color: var(--text); text-decoration: none; transition: border-color .15s ease; }
.plan-card:hover { border-color: var(--line); }
.plan-card.is-joined { border-color: rgba(var(--teal-rgb), .45); }
.plan-when { display: grid; align-content: start; justify-items: center; gap: 2px; min-width: 62px; padding: 10px 6px; border-radius: var(--r); background: rgba(var(--sky-rgb), .1); color: var(--sky-text); }
.plan-time { font: 700 1.15rem/1 var(--display); font-variant-numeric: tabular-nums; }
.plan-day { font-size: .74rem; text-transform: capitalize; }
.plan-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.plan-title { font: 600 1.1rem/1.25 var(--display); overflow-wrap: anywhere; }
.plan-meta { font-size: .86rem; color: var(--text-2); }
.plan-roles { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-foot { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text-2); flex-wrap: wrap; }
.plan-sep { flex: 1; }
.plan-count { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.plan-bar { width: 60px; height: 4px; border-radius: 2px; background: var(--ink-3); overflow: hidden; }
.plan-bar span { display: block; height: 100%; background: var(--sky); }
.plan-desc { white-space: pre-wrap; color: var(--text-2); margin-bottom: 16px; max-width: 65ch; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 16px; }
.fact { padding: 12px 14px; border-radius: var(--r); background: var(--ink-1); border: 1px solid var(--line-soft); }
.fact dt { font-size: .78rem; color: var(--text-3); }
.fact dd { margin: 2px 0 0; font-weight: 600; text-transform: none; }
.role-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.role-slot { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r); border: 1px dashed var(--line); }
.role-slot.is-taken { border-style: solid; border-color: rgba(var(--teal-rgb), .45); background: rgba(var(--teal-rgb), .06); }
.role-slot-name { font: 600 .95rem/1.2 var(--display); }
.role-slot-who { font-size: .82rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.member { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 8px; border-radius: var(--r); color: var(--text); text-decoration: none; }
.member:hover { background: var(--ink-2); }
.member .avatar { grid-row: span 2; }
.member-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.member-meta { font-size: .84rem; color: var(--text-2); }
.plan-detail .form-section { margin-bottom: 14px; }

/* ---------- movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .radar-sweep { display: none; }
  .radar-blip { opacity: 1; }
}

/* =====================================================================
   Estilo tipo app de citas: barra superior, botonera, perfil y ajustes
   ===================================================================== */

/* ---------- barra inferior: solo íconos en móvil ---------- */
@media (max-width: 899px) {
  .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-item .ic { width: 27px; height: 27px; }
  .nav-item.is-active .ic { filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), .45)); }
  .nav-item.is-active::before { display: none; }
  .nav-badge { top: 10px; }
}

/* ---------- barra superior ---------- */
.topbar { display: flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: 10px; }
.topbar-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); }
.topbar-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.topbar-brand .brand-word { color: var(--text); font-size: 1.15rem; }
.topbar-title { font: 700 1.5rem/1.1 var(--display); }
.topbar-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.top-icon { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--ink-1); border: 1px solid var(--line-soft); color: var(--text-2); }
.top-badge { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--amber); color: var(--amber-ink); font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center; }
.topbar .signal-btn { min-height: 40px; }
@media (min-width: 900px) { .topbar-brand { display: none; } }

/* ---------- botonera de cinco (deshacer, paso, super, duo, signal) ---------- */
.deck-actions { gap: 14px; }
@media (max-width: 380px) { .deck-actions { gap: 8px; } }
.deck-btn { width: 64px; height: 64px; background: var(--ink-1); }
.deck-btn.is-sm { width: 48px; height: 48px; }
.deck-btn:disabled { opacity: .35; box-shadow: none; }
.deck-btn.is-undo { color: var(--accent-text); }
.deck-btn.is-undo:hover:not(:disabled) { border-color: var(--accent-text); }
.deck-btn.is-pass { color: var(--rose); border-color: rgba(var(--rose-rgb), .45); }
.deck-btn.is-super { color: var(--sky-text); border-color: rgba(var(--sky-rgb), .45); }
.deck-btn.is-super:hover { background: rgba(var(--sky-rgb), .12); }
.deck-btn.is-duo { width: 64px; height: 64px; background: var(--ink-1); color: var(--teal-text); border-color: rgba(var(--teal-rgb), .55); }
.deck-btn.is-duo:hover { background: rgba(var(--teal-rgb), .12); }
.deck-btn.is-boost { color: var(--violet); border-color: rgba(var(--violet-rgb), .45); }
.deck-btn.is-boost:hover { background: rgba(var(--violet-rgb), .12); }
.deck-btn:not(:disabled):hover { transform: scale(1.06); }
.deck-btn:not(:disabled):active { transform: scale(.92); }
.pc { --super: 0; }
.pc-stamp-duo { color: var(--teal-text); }
.pc-stamp-super { left: 50%; top: auto; bottom: 46%; transform: translateX(-50%) rotate(-6deg); color: var(--sky-text); opacity: var(--super); }
.pc-super-me { position: absolute; z-index: 3; top: 24px; right: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 16px; background: var(--sky); color: #04233c; font-size: .8rem; font-weight: 700; box-shadow: var(--shadow); }
.pc.has-signal .pc-super-me { top: 96px; }
.pc-info { padding-right: 64px; }
.pc-more { position: absolute; right: 18px; bottom: 22px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(237, 240, 255, .35); background: rgba(12, 18, 48, .55); color: var(--text); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pc-more:hover { background: rgba(12, 18, 48, .8); }
.verified { display: inline-grid; place-items: center; color: var(--sky-text); }
.verified .ic { fill: rgba(var(--sky-rgb), .18); }
.super-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r); background: rgba(var(--sky-rgb), .12); color: var(--sky-text); font-weight: 500; }

/* ---------- perfil propio ---------- */
.me-hero { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 8px 0 18px; }
.me-ring { --p: 0; position: relative; display: grid; place-items: center; width: 156px; height: 156px; border-radius: 50%;
  background: conic-gradient(var(--amber) calc(var(--p) * 1%), var(--ink-3) 0); }
.me-ring::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--ink-0); }
.me-ring .avatar { position: relative; }
.me-pct { position: absolute; bottom: -6px; padding: 3px 12px; border-radius: 12px; background: var(--amber); color: var(--amber-ink); font: 700 .8rem/1.3 var(--display); }
.me-name-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.me-name { font: 700 1.7rem/1.1 var(--display); overflow-wrap: anywhere; }
.me-sub { color: var(--text-2); }
.me-actions { display: flex; justify-content: center; align-items: flex-start; gap: 28px; margin-top: 14px; }
.round-btn { display: grid; justify-items: center; gap: 8px; width: 92px; border: 0; background: none; color: var(--text-2); font-size: .82rem; font-weight: 600; text-decoration: none; text-align: center; }
.round-btn-ic { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: var(--ink-1); border: 1px solid var(--line); color: var(--text-2); box-shadow: var(--shadow); transition: transform .14s var(--ease-out), background-color .15s ease; }
.round-btn:hover .round-btn-ic { background: var(--ink-2); }
.round-btn:active .round-btn-ic { transform: scale(.94); }
.round-btn.is-main { margin-top: 18px; }
.round-btn.is-main .round-btn-ic { width: 70px; height: 70px; background: var(--amber); border-color: var(--accent-text); color: var(--amber-ink); }
.round-btn.is-signal .round-btn-ic { color: var(--violet); }
.round-btn.is-signal.is-on .round-btn-ic { background: var(--violet); color: #120c33; border-color: var(--violet); }
.me-tip { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 6px 0 14px; border-radius: var(--r-lg); background: linear-gradient(120deg, rgba(var(--accent-rgb), .16), rgba(var(--violet-rgb), .12)); border: 1px solid rgba(var(--accent-rgb), .35); color: var(--text); text-decoration: none; }
.me-tip.is-done { background: rgba(var(--teal-rgb), .08); border-color: rgba(var(--teal-rgb), .35); }
.me-tip-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: rgba(12, 18, 48, .6); color: var(--accent-text); }
.me-tip.is-done .me-tip-ic { color: var(--teal-text); }
.me-tip-text { flex: 1; display: grid; gap: 2px; font-size: .9rem; }
.me-tip-text span { color: var(--text-2); }
.me-preview-title { margin-top: 22px; }
.me-preview { position: relative; height: min(560px, 72dvh); pointer-events: none; }
.me-preview .pc-more { display: none; }

/* ---------- ajustes agrupados ---------- */
.settings .form-section { gap: 0; padding: 0 16px; }
.settings .form-section > * { padding: 14px 0; }
.settings .form-section > * + * { border-top: 1px solid var(--line-soft); }
.settings .form-section > .section-title { padding: 16px 0 10px; font-size: .95rem; color: var(--accent-text); }
.settings .form-section > .field-hint { border-top: 0; padding-top: 0; }
.settings .switch-row strong { display: block; font-weight: 600; }

/* ---------- entrar / crear cuenta ---------- */
.auth { position: relative; overflow: hidden; }
.auth-glow { position: absolute; inset: -20% -10% auto; height: 70%; pointer-events: none;
  background: radial-gradient(closest-side at 30% 40%, rgba(var(--accent-rgb), .18), transparent), radial-gradient(closest-side at 75% 30%, rgba(var(--violet-rgb), .16), transparent); }
.auth-brand, .auth-card { position: relative; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--ink-0); border: 1px solid var(--line-soft); }
.seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); font-weight: 600; font-size: .9rem; }
.seg-btn.is-active { background: var(--ink-3); color: var(--text); }
.game-id-input { display: flex; align-items: flex-end; gap: 6px; }
.gid-part { display: grid; gap: 6px; min-width: 0; }
.gid-id { flex: 1.7; }
.gid-zone { flex: 1; }
.gid-label { font-size: .88rem; font-weight: 600; color: var(--text-2); }
.gid-paren { font: 500 1.6rem/46px var(--display); color: var(--text-3); }
.game-id-input .input { font: 600 1.1rem/1 var(--display); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.nick-result:empty { display: none; }
.nick-card { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; padding: 16px; border-radius: var(--r-lg); background: rgba(var(--teal-rgb), .08); border: 1px solid rgba(var(--teal-rgb), .45); animation: pop-in .2s var(--ease-out); }
.nick-card.is-warn { grid-template-columns: 1fr; background: var(--amber-soft); border-color: rgba(var(--accent-rgb), .45); }
.nick-card-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgba(var(--teal-rgb), .16); color: var(--teal-text); }
.nick-card-main { display: grid; gap: 2px; min-width: 0; }
.nick-card-q { font-size: .82rem; color: var(--text-2); }
.nick-card-name { font: 700 1.35rem/1.15 var(--display); overflow-wrap: anywhere; }
.nick-card-meta { font-size: .84rem; color: var(--text-2); }
.nick-card-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.acc-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--ink-0); border: 1px solid var(--line); color: var(--text-2); }
.acc-chip .is-verified { color: var(--sky-text); }
.acc-chip-main { flex: 1; min-width: 0; display: grid; }
.acc-chip-main strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-chip-main span { font-size: .8rem; }
.auth-steps { list-style: none; margin: -4px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-step { display: grid; gap: 6px; font-size: .78rem; color: var(--text-3); }
.auth-step::before { content: ''; height: 4px; border-radius: 2px; background: var(--ink-3); }
.auth-step.is-current { color: var(--text); }
.auth-step.is-current::before { background: var(--amber); }
.auth-step.is-done::before { background: var(--teal); }
.verify-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r); background: var(--ink-0); border: 1px dashed var(--line); color: var(--text-2); font-size: .9rem; }
.verify-box > span { flex: 1 1 200px; }
.verify-box.is-ok { border-style: solid; border-color: rgba(var(--sky-rgb), .45); background: rgba(var(--sky-rgb), .08); color: var(--text); }
.verify-box.is-ok .ic { color: var(--sky-text); }

/* Descubrir en escritorio: botones pegados a la tarjeta */
@media (min-width: 900px) { .discover { min-height: 0; grid-template-rows: auto auto auto; align-content: start; } }

/* Mapbox pone .mapboxgl-map { position: relative } en el contenedor: se mantiene a pantalla completa */
.map-view .map-canvas.mapboxgl-map { position: absolute; inset: 0; }
.map-privacy { left: 108px; bottom: 10px; }

/* Avisos arriba: así no tapan la botonera ni el compositor del chat */
.toasts { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; }
@media (min-width: 900px) { .toasts { top: 16px; bottom: auto; } }
.toast { transform: translateY(-10px); }
.toast.is-in { transform: none; }

/* Las tarjetas del mazo van superpuestas (más específico que .pc { position: relative }) */
.deck > .deck-card { position: absolute; inset: 0; }

/* La foto llena el círculo del avatar sin importar su proporción */
.avatar { overflow: visible; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* =====================================================================
   Tema claro: blanco, naranja y celeste
   ===================================================================== */
body { background: #ffffff; }
::selection { background: rgba(var(--accent-rgb), .25); color: var(--text); }

/* Sobre fotos y vídeo el texto sigue siendo claro */
.pc, .call-layer, .photo-tools, .gallery-dots {
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, .88);
  --text-3: rgba(255, 255, 255, .72);
  --accent-text: #ffb47a;
  --teal-text: #9be3ff;
  --sky-text: #9be3ff;
  --danger-text: #ff9db0;
}
.pc .role-tag { background: rgba(255, 255, 255, .2); color: #fff; }
.pc .rank { background: rgba(255, 255, 255, .2); color: #fff; }
.pc .verified { color: #9be3ff; }
.pc-nophoto { background: linear-gradient(150deg, #ff9a4d 0%, #ffb877 35%, #7dd3fc 100%); }
.pc-initial { font: 700 clamp(7rem, 30vw, 11rem)/1 var(--display); color: rgba(255, 255, 255, .92); text-shadow: 0 6px 30px rgba(194, 80, 10, .25); }

/* Avatares sin foto: inicial sobre degradado naranja-celeste */
.avatar { background: linear-gradient(135deg, #ffb27a, #7dd3fc); }
.avatar-initial { color: #ffffff; }

/* Navegación */
.nav { background: rgba(255, 255, 255, .97); backdrop-filter: none; -webkit-backdrop-filter: none; border-top-color: var(--line-soft); box-shadow: 0 -6px 20px -16px rgba(23, 33, 51, .4); }
@media (min-width: 900px) { .nav { background: #ffffff; border-right-color: var(--line-soft); box-shadow: none; } }
.nav-item { color: var(--text-3); }
.nav-item.is-active { color: var(--accent-text); }
.nav-item.is-active .ic { filter: none; }

/* Superficies */
.dialog, .dialog-head { background: #ffffff; }
.dialog::backdrop { background: rgba(var(--overlay-rgb), .35); backdrop-filter: none; }
.auth-card { background: #ffffff; box-shadow: var(--shadow); }
.toast { background: #ffffff; color: var(--text); box-shadow: var(--shadow); }
.deck-btn { background: #ffffff; }
.deck-btn.is-duo { background: #ffffff; }
.me-tip-ic { background: #ffffff; }
.msg-quote { background: rgba(var(--overlay-rgb), .05); }
.msg.is-mine .bubble { background: var(--mine); color: var(--text); }
.msg.is-mine .msg-meta { color: var(--text-3); }
.msg:not(.is-mine) .bubble { background: var(--ink-1); }
.switch:checked::after { background: #ffffff; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2366738a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m3 5 4 4 4-4'/%3E%3C/svg%3E"); }
.top-icon { background: #ffffff; }
.rank-epico, .rank-leyenda { background: rgba(var(--violet-rgb), .12); color: #5b3fd6; }
.rank-mitico, .rank-honor_mitico { background: rgba(var(--sky-rgb), .12); color: var(--sky-text); }
.rank-gloria_mitica, .rank-inmortal { background: var(--amber-soft); color: var(--accent-text); }
.role-tag { background: var(--ink-2); }
.btn-primary { box-shadow: 0 8px 18px -10px rgba(var(--accent-rgb), .9); }
.signal-btn { color: var(--accent-text); }

/* Portada */
.radar { background: radial-gradient(circle, #e3f5ff 0%, #f1faff 55%, #ffffff 72%); }
.radar-blip-label { background: #ffffff; box-shadow: var(--shadow); }
.radar-core { box-shadow: 0 0 18px rgba(var(--accent-rgb), .8); }

/* Mapa claro */
.map-canvas, .picker-map { background: #eaf4fb; }
.chip-map, .map-chips select { background: rgba(255, 255, 255, .96); backdrop-filter: none; -webkit-backdrop-filter: none; }
.map-fab { background: #ffffff; }
.map-privacy { background: rgba(255, 255, 255, .92); }
.mapboxgl-ctrl-group { background: #ffffff !important; }
.mapboxgl-ctrl-group button .mapboxgl-ctrl-icon { filter: none; }
.mapboxgl-ctrl-attrib { background: rgba(255, 255, 255, .8) !important; }
.mk-user { background: #ffffff; }
.mk-beacon { color: #ffffff; }
.mk-plan { color: #ffffff; }
.mk-plan.is-joined { box-shadow: 0 0 0 3px var(--amber), 0 4px 12px rgba(0, 0, 0, .25); }

/* Llamada: sigue oscura (vídeo) */
.call-full { background: #0b1220; }

/* ---------- fluidez ---------- */
/* Entrada suave de cada pantalla (solo opacidad y desplazamiento: barato para la GPU) */
.view > * { animation: view-in .22s var(--ease-out) both; }
.view[data-view="map"] > *, .view[data-view="chat"] > *, .view[data-view="chats"] > * { animation: none; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
.deck-card.is-top { will-change: transform; }
.conv-items > li, .plan-card, .call-row { content-visibility: auto; contain-intrinsic-size: auto 72px; }
.pc-more, .pc-signal { backdrop-filter: none; -webkit-backdrop-filter: none; }
.pc-more { background: rgba(var(--overlay-rgb), .45); }
@media (prefers-reduced-motion: reduce) { .view > * { animation: none; } }

/* ---------- panel principal: Deslizar / Explorar ---------- */
.mode-seg { width: min(320px, 100%); margin: 0 auto 14px; background: var(--ink-1); }
.mode-seg .seg-btn.is-active { background: #ffffff; color: var(--accent-text); box-shadow: 0 2px 8px -4px rgba(23, 33, 51, .3); }
.discover.is-grid { max-width: 1100px; grid-template-rows: auto auto 1fr; }
.discover.is-grid .deck, .discover.is-grid .deck-actions { display: none; }
.discover:not(.is-grid) .explore { display: none; }
.explore { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-content: start; padding-bottom: 12px; }
@media (min-width: 640px) { .explore { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .explore { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.explore > .empty, .explore > .loading-block, .explore-more { grid-column: 1 / -1; }
.explore-more { justify-self: center; }
.tile {
  display: grid; border-radius: var(--r-lg); overflow: hidden; background: #ffffff; border: 1px solid var(--line-soft);
  box-shadow: var(--shadow); transition: transform .2s var(--ease-out), opacity .2s ease;
}
.tile:hover { transform: translateY(-2px); }
.tile.is-out-duo { transform: translateY(-12px) scale(.96); opacity: 0; }
.tile.is-out-pass { transform: translateX(-16px) scale(.96); opacity: 0; }
.tile.has-signal { border-color: rgba(var(--accent-rgb), .55); }
.tile-media { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; color: #ffffff; text-decoration: none;
  background: linear-gradient(150deg, #ff9a4d 0%, #ffb877 35%, #7dd3fc 100%); }
.tile-media img { width: 100%; height: 100%; object-fit: cover; }
.tile-media::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(var(--overlay-rgb), .78)); }
.tile-initial { position: absolute; inset: 0; display: grid; place-items: center; font: 700 4.5rem/1 var(--display); color: rgba(255, 255, 255, .92); }
.tile-badge { position: absolute; z-index: 1; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 12px;
  background: var(--amber); color: var(--amber-ink); font-size: .72rem; font-weight: 700; }
.tile-badge.is-super { background: var(--sky); color: #ffffff; }
.tile-info { position: absolute; z-index: 1; left: 10px; right: 10px; bottom: 10px; display: grid; gap: 2px; }
.tile-name { display: flex; align-items: center; gap: 4px; font: 700 1.05rem/1.15 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-name .ic { color: #9be3ff; flex: none; }
.tile-meta { font-size: .76rem; color: rgba(255, 255, 255, .88); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-actions { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; padding: 8px; }
.tile-btn { display: grid; place-items: center; height: 40px; border-radius: 20px; border: 1px solid var(--line); background: #ffffff;
  transition: transform .12s var(--ease-out), background-color .15s ease; }
.tile-btn:active:not(:disabled) { transform: scale(.92); }
.tile-btn.is-pass { color: var(--rose); }
.tile-btn.is-pass:hover { background: rgba(var(--rose-rgb), .08); }
.tile-btn.is-super { width: 40px; color: var(--sky); }
.tile-btn.is-super:hover { background: rgba(var(--sky-rgb), .1); }
.tile-btn.is-duo { color: #ffffff; background: linear-gradient(135deg, #ff8f3d, #ff6a00); border-color: transparent; }
.tile-btn.is-duo:hover { background: linear-gradient(135deg, #ff9d55, #ff7a1a); }
.tile-btn.is-busy { opacity: .6; }
.deck-btn.is-duo { color: #ffffff; background: linear-gradient(135deg, #ff8f3d, #ff6a00); border-color: transparent; }
.deck-btn.is-duo:hover { background: linear-gradient(135deg, #ff9d55, #ff7a1a); }
.deck-btn.is-super { color: var(--sky); }

/* Texto claro sobre fotos y vídeo (hereda el color de las variables locales) */
.pc, .call-layer, .photo-tools { color: var(--text); }

/* Deslizar en celular: el mazo se ajusta al alto disponible y la botonera queda visible */
@media (max-width: 899px) {
  .discover:not(.is-grid) { height: calc(100dvh - var(--nav-h) - var(--safe-b)); min-height: 520px; grid-template-rows: auto auto minmax(0, 1fr) auto; padding-bottom: 12px; }
  .discover:not(.is-grid) .deck { height: auto; min-height: 0; }
  .discover:not(.is-grid) .deck-actions { padding-top: 12px; }
  .discover .topbar { margin-bottom: 6px; }
  .mode-seg { margin-bottom: 10px; }
}
.mk-user { overflow: visible; }
.mk-user > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ---------- recuperar acceso ---------- */
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg-3 .seg-btn { font-size: .82rem; gap: 6px; padding: 0 6px; }
@media (max-width: 380px) { .seg-3 .seg-btn .ic { display: none; } }
.notice { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(var(--teal-rgb), .12); color: var(--teal-text); font-size: .88rem; }
.notice .ic { flex: none; margin-top: 2px; }
.notice.is-warn { background: var(--amber-soft); color: var(--accent-text); }
.recovery-key { display: block; padding: 16px; border-radius: var(--r); border: 2px dashed rgba(var(--accent-rgb), .6); background: #fff8f1;
  font: 700 clamp(1.05rem, 4.6vw, 1.35rem)/1.3 var(--display); letter-spacing: .06em; text-align: center; color: var(--text); user-select: all; overflow-wrap: anywhere; }
.input-key { font: 600 1rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.recovery-status { display: grid; gap: 10px; justify-items: start; }
