/* ============================================================
   TRIVIAMED v2 — Sistema de diseño (Queezy · azul Viamed)
   Escala compacta, mobile-first, barra inferior con FAB central.
   ============================================================ */

:root {
  --brand: #0093cf;
  --brand-600: #007bb3;
  --brand-700: #0a6aa8;
  --cyan: #00b0e1;
  --navy: #0b3f5e;
  --navy-2: #0d4a70;

  --bg: #f2f4fb;
  --card: #ffffff;
  --ink: #0c092a;
  --muted: #858494;
  --line: #ecebf5;
  --line-2: #f4f3fa;

  --ok: #1fa37a;
  --ok-soft: #e6f6ef;
  --bad: #e4573b;
  --bad-soft: #fdece7;
  --warn: #f0a92b;
  --gold: #ffce4a;

  --r-xl: 24px;
  --r-lg: 20px;
  --r: 15px;
  --r-sm: 11px;

  --sh-sm: 0 3px 10px rgba(11, 63, 94, .05);
  --sh: 0 8px 24px rgba(11, 63, 94, .08);
  --sh-lg: 0 16px 40px rgba(11, 63, 94, .13);

  --hero: linear-gradient(145deg, #00b6e6 0%, #0a86c6 55%, #0a5f95 100%);

  --font: "Rubik", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

/* ---------- Tipografía (alojada aquí, no en Google) ----------
   Rubik es la fuente del kit Queezy. Se sirve desde el propio dominio para
   no enviar la IP de cada empleado a un tercero fuera de la UE. Es la fuente
   variable: un único archivo cubre de 300 a 900.                         */
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/rubik-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('../fonts/rubik-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-size: 0.9rem;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 0.9rem; }
a { color: var(--brand-700); text-decoration: none; }
svg.ic { display: block; }

.shell { min-height: 100vh; }
#app { min-height: 100vh; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(12px, 4vw, 26px);
  background: rgba(238, 244, 249, .85);
  backdrop-filter: blur(12px);
}
.appbar__logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.08rem; color: var(--navy); }
.appbar__logo img { height: 30px; }
.appbar__logo b { color: var(--brand); }
.appbar__nav { display: flex; gap: 3px; margin: 0 auto; }
.appbar__nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: .85rem; color: var(--muted);
  transition: background .15s, color .15s;
}
.appbar__nav a .ic { width: 18px; height: 18px; }
.appbar__nav a:hover { color: var(--brand-700); background: #e2eef7; }
.appbar__nav a.activo { color: #fff; background: var(--brand); box-shadow: 0 5px 14px rgba(0, 147, 207, .3); }
.coins {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #f1e4bb; color: #987619;
  font-weight: 800; padding: 6px 12px 6px 8px; border-radius: 999px; box-shadow: var(--sh-sm);
  font-size: .85rem; font-variant-numeric: tabular-nums;
}
.appbar__avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; box-shadow: var(--sh-sm); flex: none; }
.appbar__avatar svg { width: 100%; height: 100%; }

.contenido { max-width: 1000px; margin: 0 auto; padding: 4px clamp(12px, 4vw, 26px) 100px; }
@media (min-width: 760px) { .contenido { padding-bottom: 36px; } }

/* ---------- Barra inferior con FAB (móvil) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  display: grid; grid-template-columns: 1fr 1fr 74px 1fr 1fr; align-items: center;
  height: 64px; padding-bottom: env(safe-area-inset-bottom);
  background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 20px rgba(11, 63, 94, .06);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: #9fb2c2; font-size: .62rem; font-weight: 600; text-decoration: none;
}
.tabbar a .ic { width: 22px; height: 22px; }
.tabbar a.activo { color: var(--brand); }
.tabbar__fab {
  justify-self: center; width: 56px; height: 56px; margin-top: -26px;
  border-radius: 50%; background: linear-gradient(140deg, var(--cyan), var(--brand-700));
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(0, 147, 207, .45); border: 4px solid var(--bg);
}
.tabbar__fab .ic { width: 26px; height: 26px; }
@media (min-width: 760px) { .tabbar { display: none; } }
@media (max-width: 759px) { .appbar__nav { display: none; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 13px; font-size: .92rem; font-weight: 700;
  background: var(--brand); color: #fff; box-shadow: 0 7px 18px rgba(0, 147, 207, .3);
  transition: transform .12s, filter .12s;
}
.btn .ic { width: 19px; height: 19px; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--navy { background: var(--navy-2); box-shadow: 0 7px 18px rgba(11, 63, 94, .28); }
.btn--ghost { background: #e7f1f9; color: var(--brand-700); box-shadow: none; }
.btn--danger { background: var(--bad); box-shadow: 0 7px 18px rgba(228, 87, 59, .28); }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 13px; font-size: .82rem; border-radius: 10px; }
.btn--sm .ic { width: 16px; height: 16px; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh); padding: 16px; }
.card--pad0 { padding: 8px; }

.sec-titulo { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 11px; }
.sec-titulo h3 { color: var(--navy); font-size: 1rem; font-weight: 700; }
.sec-titulo a { font-weight: 700; font-size: .84rem; color: var(--brand); }

/* ---------- Formularios ---------- */
.campo { margin-bottom: 13px; }
.campo label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.campo input, .campo select, .campo textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fbfdff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.campo textarea { min-height: 84px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 147, 207, .15);
}

/* ---------- Login ---------- */
.login { max-width: 400px; margin: min(5vh, 44px) auto 0; padding: 0 16px 40px; }
.login__top { text-align: center; margin-bottom: 18px; }
.login__logo { width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 20px; background: var(--hero); display: grid; place-items: center; box-shadow: var(--sh); }
.login__logo img { width: 40px; height: 40px; }
.login__top h1 { color: var(--navy); font-size: 1.5rem; font-weight: 800; }
.login__top h1 b { color: var(--brand); }
.login__top p { color: var(--muted); margin-top: 3px; font-size: .88rem; }
.login__aviso { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.5; text-align: center; }
.login__aviso a { color: var(--brand-700); font-weight: 600; }

/* ---------- Home ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero); color: #fff;
  border-radius: var(--r-xl); padding: 18px 20px; box-shadow: var(--sh); margin-top: 2px;
}
.hero::before { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.09); top: -70px; right: -44px; }
.hero::after { content: ''; position: absolute; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.06); bottom: -50px; right: 70px; }
.hero__row { position: relative; display: flex; align-items: flex-start; gap: 12px; }
.hero__saludo { display: inline-flex; align-items: center; gap: 5px; font-size: .66rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; opacity: .9; }
.hero__saludo .ic { width: 13px; height: 13px; }
.hero__nombre { font-size: 1.22rem; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.hero__centro { font-size: .78rem; opacity: .82; margin-top: 1px; }
.hero__avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; margin-left: auto; box-shadow: 0 5px 14px rgba(0,0,0,.18); flex: none; }
.hero__avatar svg { width: 100%; height: 100%; }
.hero__ambito {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  background: rgba(255,255,255,.18); border-radius: 999px; padding: 3px 10px 3px 8px;
  font-size: .7rem; font-weight: 600;
}
.hero__ambito .ic { width: 13px; height: 13px; }
.chip-ambito {
  display: inline-flex; align-items: center; gap: 5px;
  background: #e6f2fb; color: var(--brand-700); border-radius: 999px;
  padding: 4px 11px; font-size: .74rem; font-weight: 700;
}
.chip-ambito .ic { width: 14px; height: 14px; }

/* Selector de tipo de puesto (registro) */
.ambitos { display: grid; gap: 8px; }
.opcion-ambito {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px;
  background: #fbfdff; transition: border-color .13s, background .13s;
}
.opcion-ambito:has(input:checked) { border-color: var(--brand); background: #eef8fd; }
.opcion-ambito input { margin-top: 3px; accent-color: var(--brand); }
.opcion-ambito b { display: block; font-size: .88rem; color: var(--navy); }
.opcion-ambito small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.35; }

.hero__nivel { position: relative; margin-top: 13px; }
.hero__nivel-top { display: flex; justify-content: space-between; font-size: .74rem; font-weight: 600; margin-bottom: 5px; opacity: .95; }
.hero__barra { height: 7px; background: rgba(255,255,255,.25); border-radius: 99px; overflow: hidden; }
.hero__barra i { display: block; height: 100%; background: linear-gradient(90deg, #fff, #bff0ff); border-radius: 99px; }
.hero__stats { position: relative; display: flex; gap: 8px; margin-top: 13px; }
.hero__stat { flex: 1; background: rgba(255,255,255,.14); border-radius: 13px; padding: 9px 10px; text-align: center; }
.hero__stat b { display: block; font-size: 1rem; font-weight: 800; }
.hero__stat span { font-size: .62rem; text-transform: uppercase; letter-spacing: .3px; opacity: .85; }

/* Modos: rejilla compacta 2 columnas (móvil) */
.modos { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 11px; }
.modo {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 3px;
  background: var(--card); border-radius: var(--r-lg); padding: 14px; box-shadow: var(--sh-sm);
  transition: transform .14s, box-shadow .14s;
}
.modo:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.modo:disabled { opacity: .55; cursor: default; transform: none; }
.modo__ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; margin-bottom: 5px; }
.modo__ic .ic { width: 23px; height: 23px; }
.modo__nombre { font-weight: 700; color: var(--navy); font-size: .96rem; }
.modo__desc { color: var(--muted); font-size: .76rem; line-height: 1.35; }
.modo__pie { margin-top: 6px; font-size: .74rem; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.modo__pie .ic { width: 14px; height: 14px; }

/* Cuadro de icono reutilizable */
.sq { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; }
.sq .ic { width: 23px; height: 23px; }
.sq--sm { width: 38px; height: 38px; border-radius: 11px; }
.sq--sm .ic { width: 19px; height: 19px; }

/* Filas de lista */
.fila { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); transition: background .12s; }
.fila + .fila { border-top: 1px solid var(--line-2); }
.fila:hover { background: #f6fafd; }
.fila__txt { flex: 1; min-width: 0; }
.fila__txt b { display: block; font-weight: 700; color: var(--navy); font-size: .9rem; }
.fila__txt span { color: var(--muted); font-size: .78rem; }
.fila__chevron { color: #bccddb; }
.fila__chevron .ic { width: 20px; height: 20px; }

/* ---------- Segmentado / filtros ---------- */
.filtros { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.pill {
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 8px 15px; font-weight: 700; font-size: .82rem;
  display: inline-flex; align-items: center; gap: 6px; transition: all .13s;
}
.pill .ic { width: 15px; height: 15px; }
.pill.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* Segmentado tipo Queezy (Weekly / All Time) */
.seg { display: inline-flex; background: #e4edf5; border-radius: 12px; padding: 4px; margin-bottom: 16px; width: 100%; max-width: 320px; }
.seg button { flex: 1; padding: 9px 10px; border-radius: 9px; font-weight: 700; font-size: .82rem; color: var(--muted); }
.seg button.on { background: #fff; color: var(--navy); box-shadow: var(--sh-sm); }

/* ---------- Ranking ---------- */
.podio { display: flex; align-items: flex-end; justify-content: center; gap: 14px; padding: 6px 0 16px; }
.podio__p { display: flex; flex-direction: column; align-items: center; }
.podio__av { position: relative; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: var(--sh-sm); }
.podio__av svg { width: 100%; height: 100%; }
.podio__p--1 .podio__av { width: 72px; height: 72px; border-color: var(--gold); }
.podio__corona { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); color: var(--gold); }
.podio__corona .ic { width: 22px; height: 22px; }
/* Nombre completo en dos líneas. La altura es fija para que los tres avatares
   queden alineados aunque un nombre ocupe una línea y otro dos. */
.podio__nombre {
  font-weight: 700; font-size: .76rem; line-height: 1.2; margin-top: 7px;
  color: var(--navy); width: 96px; height: 2.4em; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: break-word;
}
.podio__pts { font-size: .72rem; color: var(--muted); }
.podio__base { width: 68px; border-radius: 12px 12px 0 0; display: grid; place-items: start center; padding-top: 6px; color: #fff; font-weight: 800; font-size: 1.2rem; margin-top: 7px; }
.podio__p--1 .podio__base { height: 78px; background: linear-gradient(180deg, var(--brand), var(--brand-700)); }
.podio__p--2 .podio__base { height: 60px; background: linear-gradient(180deg, #8bb6cf, #6c9cbb); }
.podio__p--3 .podio__base { height: 48px; background: linear-gradient(180deg, #e6a97a, #d68b53); }

.rank { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 14px; }
.rank + .rank { border-top: 1px solid var(--line-2); }
.rank__n { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #eef4f9; color: var(--muted); font-weight: 800; font-size: .82rem; }
.rank__n--1 { background: #fff4d1; color: #b8860b; }
.rank__n--2 { background: #eaf0f4; color: #6c8296; }
.rank__n--3 { background: #fbe7d6; color: #c37a3f; }
.rank__av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; }
.rank__av svg { width: 100%; height: 100%; }
.rank__txt { flex: 1; min-width: 0; }
.rank__txt b { display: block; font-weight: 700; color: var(--navy); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__txt span { font-size: .74rem; color: var(--muted); }
.rank__pts { font-weight: 800; color: var(--navy); font-size: .9rem; font-variant-numeric: tabular-nums; }
.rank__medal { color: var(--gold); }
.rank__medal .ic { width: 20px; height: 20px; }
.rank--yo { background: #e8f5fc; outline: 2px solid var(--brand); }

/* ---------- Logros ---------- */
.logros-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.logro { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r); box-shadow: var(--sh-sm); padding: 12px; }
.logro__ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none; background: linear-gradient(135deg, var(--brand), var(--brand-700)); }
.logro__ic .ic { width: 22px; height: 22px; }
.logro--off { opacity: .5; }
.logro--off .logro__ic { background: #c3d2de; }
.logro b { font-size: .88rem; color: var(--navy); }
.logro p { font-size: .76rem; color: var(--muted); }
.logro__meta { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; color: #987619; margin-top: 2px; }
.logro__meta .ic { width: 14px; height: 14px; }

/* ---------- Juego ---------- */
.q-head {
  position: relative; overflow: hidden; color: #fff;
  border-radius: 0 0 var(--r-xl) var(--r-xl); padding: 14px clamp(12px, 4vw, 26px) 20px;
  margin: -4px calc(-1 * clamp(12px, 4vw, 26px)) 0;
}
.q-head::before { content: ''; position: absolute; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.08); top: -80px; right: -20px; }
.q-top { position: relative; display: flex; align-items: center; gap: 10px; }
.q-back { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.16); display: grid; place-items: center; color: #fff; }
.q-back .ic { width: 20px; height: 20px; }
.q-cat { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; min-width: 0; }
.q-cat .sq--sm { background: rgba(255,255,255,.2); }
.q-cat__txt { min-width: 0; line-height: 1.2; }
.q-cat__txt small { display: block; font-weight: 500; font-size: .72rem; opacity: .85; }
.q-lives { margin-left: auto; display: flex; gap: 3px; }
.q-lives .ic { width: 19px; height: 19px; }
.q-lives .off { opacity: .35; }
.q-progress { position: relative; display: flex; align-items: center; gap: 11px; margin-top: 15px; }
.q-bar { flex: 1; height: 7px; background: rgba(255,255,255,.25); border-radius: 99px; overflow: hidden; }
.q-bar i { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .3s; }
.q-count { font-size: .78rem; font-weight: 700; opacity: .95; white-space: nowrap; }
.q-timer { position: relative; width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#fff var(--pct, 100%), rgba(255,255,255,.22) 0); }
.q-timer::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: var(--cat, var(--brand)); }
.q-timer b { position: relative; z-index: 1; font-weight: 800; font-size: 1rem; }
.q-timer.apuro { background: conic-gradient(#ffd7cf var(--pct,100%), rgba(255,255,255,.22) 0); }

.q-body { margin-top: 18px; }
.q-texto { font-size: 1.06rem; font-weight: 700; color: var(--navy); line-height: 1.35; margin-bottom: 15px; }
.opts { display: grid; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 11px; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 13px 14px;
  font-size: .92rem; font-weight: 500; color: var(--ink); box-shadow: var(--sh-sm);
  transition: border-color .12s, background .12s, transform .1s;
}
.opt:hover:not(:disabled) { border-color: var(--brand); transform: translateX(2px); }
.opt:disabled { cursor: default; }
.opt__k { width: 29px; height: 29px; border-radius: 9px; background: #eef4f9; color: var(--navy); font-weight: 800; font-size: .85rem; display: grid; place-items: center; flex: none; }
.opt--sel { border-color: var(--brand); background: #eef8fd; }
.opt--ok { border-color: var(--ok); background: var(--ok-soft); }
.opt--ok .opt__k { background: var(--ok); color: #fff; }
.opt--bad { border-color: var(--bad); background: var(--bad-soft); }
.opt--bad .opt__k { background: var(--bad); color: #fff; }
.opt--off { opacity: .4; pointer-events: none; }

.lifelines { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.life { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 13px; font-weight: 700; font-size: .82rem; color: var(--navy); box-shadow: var(--sh-sm); transition: border-color .12s, transform .1s; }
.life .ic { width: 17px; height: 17px; }
.life__c { display: inline-flex; align-items: center; gap: 3px; color: #987619; font-size: .74rem; }
.life:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-1px); }
.life:disabled { opacity: .45; cursor: not-allowed; }

.feedback { margin-top: 14px; border-radius: var(--r); padding: 13px 14px; font-size: .88rem; animation: fade .25s; }
.feedback b { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.feedback b .ic { width: 17px; height: 17px; }
.feedback--ok { background: var(--ok-soft); border: 1.5px solid #bfe8d6; }
.feedback--ok b { color: var(--ok); }
.feedback--bad { background: var(--bad-soft); border: 1.5px solid #f4c6bb; }
.feedback--bad b { color: var(--bad); }

.fly { position: fixed; left: 50%; top: 34%; transform: translateX(-50%); font-size: 1.8rem; font-weight: 900; color: var(--ok); animation: fly 1s ease forwards; pointer-events: none; z-index: 90; }

/* ---------- Ruleta ---------- */
.ruleta-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 8px; }
.quesitos { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.quesito { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #fff; box-shadow: var(--sh-sm); border: 2.5px solid var(--line); color: #c3d2de; transition: all .3s; }
.quesito .ic { width: 22px; height: 22px; }
.quesito.on { border-color: var(--c, var(--ok)); color: var(--c, var(--ok)); transform: scale(1.06); }
.rueda-cont { position: relative; width: min(78vw, 320px); aspect-ratio: 1; }
.rueda-flecha { position: absolute; top: -5px; left: 50%; transform: translateX(-50%); z-index: 5; width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent; border-top: 22px solid var(--navy); filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.rueda { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 9px #fff, var(--sh); transition: transform 4.2s cubic-bezier(.12,.68,.16,1); }
.rueda-centro { position: absolute; inset: 0; margin: auto; width: 70px; height: 70px; background: #fff; border-radius: 50%; display: grid; place-items: center; box-shadow: var(--sh-sm); z-index: 4; color: var(--brand); }
.rueda-centro .ic { width: 32px; height: 32px; }
.vidas { display: flex; gap: 3px; color: var(--bad); }
.vidas .ic { width: 22px; height: 22px; }
.vidas .off { color: #d7e1e9; }

/* ---------- Resultado ---------- */
.result { max-width: 480px; margin: 0 auto; text-align: center; }
.result__ic { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 2px; display: grid; place-items: center; color: #fff; }
.result__ic .ic { width: 40px; height: 40px; }
.result h2 { color: var(--navy); font-size: 1.3rem; font-weight: 800; margin-top: 8px; }
.result__sub { color: var(--muted); margin-bottom: 14px; font-size: .85rem; }
.result__cifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 16px 0; }
.cifra { background: #f4f9fc; border: 1px solid var(--line); border-radius: 14px; padding: 13px 6px; }
.cifra b { display: block; font-size: 1.2rem; color: var(--navy); font-weight: 800; }
.cifra span { font-size: .72rem; color: var(--muted); }
.aviso-tope { background: #fff7e6; border: 1.5px solid #f2e0b0; color: #8a6d1f; border-radius: 12px; padding: 9px 13px; font-size: .8rem; margin-bottom: 11px; }
.logro-pop { display: flex; align-items: center; gap: 11px; text-align: left; background: #fff7e6; border: 1.5px solid #f2e0b0; border-radius: 14px; padding: 11px 13px; margin-top: 9px; animation: fade .4s; }
.logro-pop .logro__ic { background: linear-gradient(135deg, var(--gold), #e8a319); }

/* ---------- Perfil ---------- */
.perfil-hero { position: relative; overflow: hidden; background: var(--hero); color: #fff; border-radius: var(--r-xl); padding: 20px; text-align: center; box-shadow: var(--sh); }
.perfil-hero::before { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.08); top: -90px; left: -34px; }
.perfil-hero__av { position: relative; width: 74px; height: 74px; border-radius: 50%; overflow: hidden; margin: 0 auto 8px; border: 3px solid rgba(255,255,255,.5); }
.perfil-hero__av svg { width: 100%; height: 100%; }
.perfil-hero h2 { position: relative; font-size: 1.16rem; font-weight: 800; }
.perfil-hero p { position: relative; opacity: .85; font-size: .82rem; }
.perfil-stats { position: relative; display: flex; gap: 8px; margin-top: 14px; }
.perfil-stats .hero__stat { background: rgba(255,255,255,.16); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-sm); padding: 14px; }
.stat b { display: block; font-size: 1.4rem; color: var(--navy); font-weight: 800; }
.stat span { color: var(--muted); font-size: .76rem; }

.barras { display: grid; gap: 12px; }
.barra__top { display: flex; align-items: center; gap: 9px; font-size: .85rem; font-weight: 600; margin-bottom: 5px; }
.barra__top .sq--sm { width: 31px; height: 31px; border-radius: 9px; }
.barra__top .sq--sm .ic { width: 16px; height: 16px; }
.barra__top span:last-child { margin-left: auto; color: var(--muted); font-weight: 700; font-size: .8rem; }
.barra__pista { height: 9px; border-radius: 99px; background: #e9f0f6; overflow: hidden; }
.barra__pista i { display: block; height: 100%; border-radius: 99px; transition: width .6s; }

.hist { width: 100%; border-collapse: collapse; font-size: .83rem; }
.hist th { text-align: left; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .4px; padding: 7px 9px; }
.hist td { padding: 9px; border-top: 1px solid var(--line-2); }
.hist .modo-tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.hist .modo-tag .ic { width: 15px; height: 15px; color: var(--brand); }

.avatar-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin: 10px 0; }
.avatar-pick button { border-radius: 50%; overflow: hidden; border: 3px solid transparent; padding: 0; aspect-ratio: 1; }
.avatar-pick button svg { width: 100%; height: 100%; display: block; }
.avatar-pick button.on { border-color: var(--brand); }

/* ---------- Panel admin ---------- */
.ambito-bar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 9px 12px; margin: 6px 0 12px; box-shadow: var(--sh-sm);
}
.ambito-bar__lbl { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.ambito-bar__lbl .ic { width: 15px; height: 15px; }
.admin-nav { display: flex; gap: 7px; margin: 4px 0 18px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-sm); padding: 14px; display: flex; align-items: center; gap: 11px; }
.kpi__ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-700)); flex: none; }
.kpi__ic .ic { width: 21px; height: 21px; }
.kpi b { display: block; font-size: 1.35rem; color: var(--navy); font-weight: 800; }
.kpi span { color: var(--muted); font-size: .74rem; }
.tabla { width: 100%; border-collapse: collapse; font-size: .83rem; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-sm); }
.tabla th { background: #f0f6fb; text-align: left; padding: 10px 11px; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .4px; }
.tabla td { padding: 10px 11px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.tabla tr:hover td { background: #f8fbfe; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.tag--ok { background: var(--ok-soft); color: #17805d; }
.tag--no { background: var(--bad-soft); color: #b23a24; }
.tag--cat { color: #fff; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 84px; }
.bars i { flex: 1; background: linear-gradient(180deg, var(--brand), var(--brand-700)); border-radius: 3px 3px 0 0; min-height: 2px; }
.admin-flex { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 13px; }
.admin-flex input[type=text], .admin-flex select { padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; }
.icon-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.icon-pick button { aspect-ratio: 1; border-radius: 11px; border: 2px solid var(--line); background: #fbfdff; display: grid; place-items: center; color: var(--navy); }
.icon-pick button.on { border-color: var(--brand); background: #eef8fd; color: var(--brand); }

/* ---------- Modales / toasts ---------- */
.toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { padding: 12px 16px; border-radius: 12px; color: #fff; font-weight: 600; font-size: .88rem; box-shadow: var(--sh); animation: drop .25s; text-align: center; }
.toast--info { background: var(--navy-2); }
.toast--ok { background: var(--ok); }
.toast--error { background: var(--bad); }
.toast--out { opacity: 0; transition: opacity .5s; }

.modal-bg { position: fixed; inset: 0; background: rgba(11, 49, 74, .5); z-index: 150; display: grid; place-items: center; padding: 16px; animation: fade .18s; }
.modal { background: #fff; border-radius: var(--r-lg); padding: 20px; width: min(94vw, 460px); max-height: 86vh; overflow: auto; box-shadow: var(--sh-lg); }
.modal h3 { color: var(--navy); margin-bottom: 13px; font-weight: 700; font-size: 1.08rem; }
.modal-sheet { align-items: end; }
.modal-sheet .modal { width: 100%; max-width: 460px; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheet .25s; }
@media (min-width: 600px) { .modal-sheet { align-items: center; } .modal-sheet .modal { border-radius: var(--r-lg); } }

.confeti { position: fixed; inset: 0; pointer-events: none; z-index: 250; }
.cargando { display: grid; place-items: center; padding: 56px 0; color: var(--muted); }
.cargando::before { content: ''; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.vacio { text-align: center; color: var(--muted); padding: 30px 12px; font-size: .86rem; }

@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes sheet { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fly { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.7); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -66px) scale(1.15); } }
