/* Tacazo — base: fuentes, tokens, escenario escalado y componentes comunes.

   Dos capas (ver ARQUITECTURA.md y la spec de los menús):
   1) REGLAS HEREDADAS (sección 3, sin ámbito). Las usa el HUD de la partida (game.css, hud.js):
      .t .muted .small .cap .av .star .ib .btn .g .b .pnl .actions .slot .sv .wheel .modal .modal-bg
      .toast. No se tocan: la partida no puede cambiar ni un píxel.
   2) SISTEMA DE DISEÑO DE LOS MENÚS (sección 4). Siempre con ámbito:
        .ui  → raíz de cada pantalla de menú (app.js), velo de las ventanas fuera de la partida, #boot
        .mdl → la ventana (.modal) cuando se abre fuera de la partida
        .mt  → el aviso (.toast) cuando sale fuera de la partida
      o con nombres nuevos que el HUD no usa (.ty-*, .pill, .well, .avf, .lvsh, .segs, .count…).
      Prohibido restilar .btn/.ib/.av/.t/.pnl sin ámbito.
   En los menús: nada de mezclas de color de CSS, consultas de contenedor, selector has ni desenfoque de fondo; solo se animan
   transform y opacity. */

/* ============================================================================================ */
/* 0. Fuentes (auto-alojadas: la CSP solo deja cargar fuentes del propio origen)                */
/* ============================================================================================ */

@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('../fonts/montserrat-latin-600-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('../fonts/montserrat-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url('../fonts/montserrat-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 900; font-display: swap; src: url('../fonts/montserrat-latin-900-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('../fonts/montserrat-latin-ext-600-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Montserrat'; font-weight: 700; font-display: swap; src: url('../fonts/montserrat-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Montserrat'; font-weight: 800; font-display: swap; src: url('../fonts/montserrat-latin-ext-800-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Montserrat'; font-weight: 900; font-display: swap; src: url('../fonts/montserrat-latin-ext-900-normal.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Barlow Condensed (OFL-1.1, @fontsource/barlow-condensed 5.3.0): cursiva 700 y 800, solo para los menús. */
@font-face { font-family: 'Barlow Condensed'; font-style: italic; font-weight: 700; font-display: swap; src: url('../fonts/barlow-condensed-latin-700-italic.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: italic; font-weight: 800; font-display: swap; src: url('../fonts/barlow-condensed-latin-800-italic.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Barlow Condensed'; font-style: italic; font-weight: 700; font-display: swap; src: url('../fonts/barlow-condensed-latin-ext-700-italic.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: 'Barlow Condensed'; font-style: italic; font-weight: 800; font-display: swap; src: url('../fonts/barlow-condensed-latin-ext-800-italic.woff2') format('woff2'); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ============================================================================================ */
/* 1. Tokens                                                                                    */
/* ============================================================================================ */

:root {
  /* Heredados (los usa el CSS de la partida y el que queda sin migrar): no se borran. */
  --blue-1: #11408f;
  --blue-2: #0a2a66;
  --blue-3: #061a45;
  --ink: #04112b;
  --line: rgba(120, 180, 255, .35);
  --txt-2: #cfe2ff;
  --txt-3: #9fc0f0;
  --gold: #ffc81f;
  --green: #46b82a;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);

  /* Fondo */
  --bg-0: #040b1c; --bg-1: #061430; --bg-2: #0a2250; --bg-3: #10306c;
  /* Superficies */
  --sf-top: #153a7a; --sf-mid: #0e2a5c; --sf-bot: #0a1f47;
  --sf-line: rgba(126,174,255,.26); --sf-hi: rgba(255,255,255,.13);
  --well-top: #030b1f; --well-bot: #071736; --well-line: rgba(126,174,255,.20);
  --hair: rgba(126,174,255,.12);                       /* separadores de filas */
  /* Texto */
  --tx-1: #ffffff; --tx-2: #c3d5f4; --tx-3: #8ba7d8; --tx-4: #5e79a8;
  /* Oro */
  --gold-1: #fff3c4; --gold-2: #ffd34d; --gold-3: #e7a412; --gold-4: #955c06; --gold-ink: #3a2204;
  --gold-frame: linear-gradient(160deg, #fff4c8 0%, #f2bb3c 22%, #9a6208 46%, #f7d46e 70%, #8a5306 100%);
  --silver-frame: linear-gradient(160deg, #ffffff 0%, #c9d4e4 24%, #5b6a82 48%, #e6edf6 72%, #465469 100%);
  --bronze-frame: linear-gradient(160deg, #ffe4bd 0%, #d08a4c 24%, #6a3a14 48%, #efb27a 72%, #4f280e 100%);
  /* Acentos */
  --c-cyan: #52d4ff; --c-green: #4cc424; --c-green-hi: #8ff06a; --c-red: #ec3b2c; --c-red-hi: #ff8a7a;
  --c-purple: #8a45e8; --c-pink: #ff4fd8; --c-orange: #ff9a3a;
  /* Rarezas: base (shared/content/cues.js) y clara (70 % base + 30 % blanco, precalculada) */
  --r-comun: #9fb3c8;      --r-comun-hi: #bccad8;
  --r-raro: #4aa3ff;       --r-raro-hi: #80bfff;
  --r-epico: #b36bff;      --r-epico-hi: #ca97ff;
  --r-legendario: #ff9a2e; --r-legendario-hi: #ffb86d;
  --r-victoria: #3fd46b;   --r-victoria-hi: #79e197;
  --r-pase: #ff4fd8;       --r-pase-hi: #ff84e4;
  /* Tipografía */
  --f-disp: 'Barlow Condensed', 'Oswald', 'Arial Narrow', sans-serif;
  --f-ui: 'Montserrat', system-ui, -apple-system, sans-serif;
  /* Espaciado (rejilla de 4) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  /* Radios */
  --rd-xs: 5px; --rd-s: 8px; --rd-m: 10px; --rd-l: 12px; --rd-xl: 14px; --rd-pill: 999px;
  /* Sombras */
  --sh-card: 0 10px 22px -10px rgba(0,0,0,.75), 0 2px 4px rgba(0,0,0,.25);
  --sh-row: 0 4px 10px -4px rgba(0,0,0,.6);
  --sh-pop: 0 18px 40px -12px rgba(0,0,0,.8);
  /* Escala del arte grande según el alto del escenario (#stage[data-h]) */
  --art-k: 1;
  color-scheme: dark;
}

/* ============================================================================================ */
/* 2. Base, fondo y escenario                                                                   */
/* ============================================================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); overscroll-behavior: none; }
body {
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 700;
  color: #fff;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
img { -webkit-user-drag: none; user-select: none; }

/* El escenario: un lienzo lógico de al menos 844×390 que se escala para llenar la pantalla. */
#app { position: fixed; inset: 0; overflow: hidden; }
/* Fondo de los menús: marino profundo con foco cenital, suelo oscuro, grano y trama de paño.
   En la partida manda body.ingame #bg (game.css), que gana a este. */
#bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 58% 62% at 50% -8%, rgba(72,142,255,.30), rgba(72,142,255,0) 70%),
    radial-gradient(ellipse 90% 55% at 50% 118%, rgba(1,5,16,.85), rgba(1,5,16,0) 72%),
    var(--noise, none),
    repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 1px, rgba(255,255,255,0) 1px 7px),
    linear-gradient(180deg, #0c2758 0%, #081c43 48%, #051331 100%);
}
#bg::before { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px rgba(0,4,14,.55); } /* viñeta */
body.ingame #bg::before { display: none; }

#stage {
  position: absolute; left: 0; top: 0;
  width: var(--w, 844px); height: var(--h, 390px);
  transform-origin: 0 0;
  transform: scale(var(--s, 1));
}
/* layoutStage() pone data-h según el alto lógico: m (< 440), l (440–539), xl (≥ 540). */
#stage[data-h="l"] { --art-k: 1.2; }
#stage[data-h="xl"] { --art-k: 1.35; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }
.screen.enter { animation: scr-in .18s ease-out; }
@keyframes scr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fill { flex: 1 1 auto; min-height: 0; }
.menu { z-index: 1; }

/* ============================================================================================ */
/* 3. REGLAS HEREDADAS — las usa el HUD de la partida. NO TOCAR.                                */
/*    (Los menús las sobrescriben con ámbito .ui en la sección 4.)                              */
/* ============================================================================================ */

/* Texto de título */
.t { font-weight: 900; text-transform: uppercase; letter-spacing: .2px; text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.muted { color: var(--txt-2); font-weight: 700; }
.small { font-size: 11px; }

/* Barra superior */
.topbar {
  flex: none; position: relative; z-index: 5;
  height: calc(44px + var(--sat-l, 0px)); padding: 0 10px; padding-top: var(--sat-l, 0px);
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(#0c2656, #071a3d);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.topbar .title { font-size: 17px; }
.topbar .sp { flex: 1; }

/* Avatar cuadrado con estrella de nivel */
.av {
  position: relative; flex: none; width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--av1, #2a6ad8), var(--av2, #123a88));
  box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0,0,0,.5);
}
.av img, .av canvas { width: 80%; height: 80%; }
.star {
  position: absolute; width: 20px; height: 20px;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: linear-gradient(#fff3a0, #f7b400 60%, #c07a00);
  color: #4a2400; font-size: 8px; font-weight: 900; line-height: 22px; text-align: center;
}
.av .star { left: -9px; bottom: -8px; }

/* Monedero */
.cur {
  position: relative; display: flex; align-items: center; height: 26px; padding: 0 3px 0 28px; border-radius: 6px;
  background: linear-gradient(#051430, #0b2458); box-shadow: inset 0 0 0 1px rgba(120,180,255,.4);
  font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 70px;
}
.cur img { position: absolute; left: -10px; top: -5px; width: 34px; height: 34px; }
.cur.cash img { left: -12px; top: -7px; width: 38px; height: 38px; }
.cur .plus {
  margin-left: auto; padding-left: 0; margin-right: 0; width: 20px; height: 20px; border: 0; border-radius: 5px;
  background: linear-gradient(#8ff05b, #3ab320 50%, #2b9713 51%); color: #fff;
  font: 900 16px/20px Montserrat, sans-serif; box-shadow: inset 0 1px 0 rgba(255,255,255,.6); cursor: pointer;
}
.cur .v { margin-right: 10px; }
.cur.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: scale(1.12); } }

/* Botones */
.btn {
  position: relative; border: 0; border-radius: 8px; padding: 0 16px; min-height: 34px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: 'Montserrat', sans-serif; font-weight: 900; text-transform: uppercase; color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.35); cursor: pointer; white-space: nowrap;
  transition: transform .06s, filter .12s;
}
.btn:active { transform: translateY(2px); filter: brightness(.95); }
.btn[disabled] { filter: grayscale(.8) brightness(.7); cursor: default; }
.btn img { height: 22px; }
.g { background: linear-gradient(#8ff05b, #46b82a 50%, #2f9a16 51%, #38a81e); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 0 0 1px rgba(0,60,0,.4), 0 3px 0 #1a5c0a; }
.y { background: linear-gradient(#ffe877, #ffc81f 50%, #f2a500 51%, #f7b400); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 0 0 1px rgba(120,60,0,.4), 0 3px 0 #9a5a00; }
.b { background: linear-gradient(#66b6ff, #2f7fe8 50%, #1f65cf 51%, #2670da); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 0 0 1px rgba(0,30,90,.5), 0 3px 0 #0d3a8a; }
.r { background: linear-gradient(#ff7a6a, #e0382a 50%, #c42418 51%, #cf2a1c); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 3px 0 #7a1008; }
.p { background: linear-gradient(#b98cff, #7a3fd8 50%, #6a2ac0 51%, #7434d0); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 3px 0 #3a0e7a; }
.ib {
  flex: none; width: 32px; height: 32px; border-radius: 8px; border: 0; padding: 0;
  background: linear-gradient(#2d6fd6, #1a4aa6 50%, #153f92 51%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 0 #0a2458;
  color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.ib:active { transform: translateY(1px); }
.ib svg { width: 17px; height: 17px; }
.ib { position: relative; }
.badge {
  position: absolute; right: -5px; top: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #e0382a; font-size: 10px; font-weight: 900; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px #071a3d;
}

/* Paneles */
.pnl { position: relative; border-radius: 10px; background: linear-gradient(#1f5fbd, #14428f); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 0 0 1px #4f8fe8, 0 4px 10px rgba(0,0,0,.45); }
.dk { border-radius: 8px; background: rgba(2,10,30,.55); box-shadow: inset 0 0 0 1px rgba(120,180,255,.25); }
.card-row { border-radius: 10px; background: linear-gradient(#1c549f, #123b7a); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 1px #3f7ed8, 0 3px 6px rgba(0,0,0,.35); }

/* Barras de progreso */
.bar { height: 9px; border-radius: 5px; background: #03102a; box-shadow: inset 0 1px 2px rgba(0,0,0,.8), 0 0 0 1px rgba(120,180,255,.3); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; background: linear-gradient(#aaf57a, #4cc22a 50%, #35a51a 51%); transition: width .5s; }
.bar.blue > i { background: linear-gradient(#9fe0ff, #3aa0f0 50%, #2585da 51%); }
.bar.gold > i { background: linear-gradient(#ffe877, #ffc81f 50%, #f2a500 51%); }

/* Pestañas */
.tabs { display: flex; gap: 7px; }
.tab {
  height: 30px; padding: 0 14px; border: 0; border-radius: 8px; cursor: pointer;
  font: 900 11px Montserrat, sans-serif; text-transform: uppercase; color: #a9c6f0;
  background: rgba(2,10,30,.5); box-shadow: inset 0 0 0 1px rgba(120,180,255,.3);
}
.tab.on { color: #fff; background: linear-gradient(#5aaaff, #2a74dd 50%, #1d5fc6 51%); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 0 #0d3a8a; }

.rar { display: inline-block; font-size: 9px; font-weight: 900; letter-spacing: .8px; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }

/* Barra de navegación inferior */
.nav {
  flex: none; height: calc(48px + var(--sab-l, 0px)); padding-bottom: var(--sab-l, 0px);
  display: flex; justify-content: center; gap: 2px; position: relative; z-index: 5;
  background: linear-gradient(#0c2656, #061634); border-top: 1px solid var(--line); box-shadow: 0 -2px 8px rgba(0,0,0,.4);
}
.nv { position: relative; width: 96px; border: 0; background: none; color: #a9c6f0; font: 800 10px Montserrat, sans-serif; letter-spacing: .4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; }
.nv.on { color: #fff; background: linear-gradient(rgba(90,160,255,.35), rgba(90,160,255,0)); box-shadow: inset 0 2px 0 var(--gold); }
.nv svg { width: 20px; height: 20px; }
.nv img { height: 20px; }
.nv .badge { right: 22px; top: 3px; }

/* Ventanas modales */
.modal-bg { position: absolute; inset: 0; z-index: 50; background: rgba(2,8,24,.72); display: flex; align-items: center; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; min-width: 300px; max-width: 92%; max-height: 92%; overflow: auto; padding: 16px 18px; border-radius: 12px; background: linear-gradient(#1f5fbd, #12397d); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 0 0 1px #4f8fe8, 0 10px 30px rgba(0,0,0,.6); animation: pop .2s ease-out; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.modal h2 { margin: 0 0 10px; font-size: 18px; text-align: center; }
.modal .close { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; }
.modal .actions { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }

/* Avisos */
#toasts { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 800; background: rgba(4,17,43,.92); box-shadow: inset 0 0 0 1px var(--line), 0 4px 12px rgba(0,0,0,.5); animation: pop .2s; }
.toast.err { background: linear-gradient(#e0382a, #a8180e); }
.toast.ok { background: linear-gradient(#46b82a, #2a7a14); }

input.txt {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 8px; border: 0; outline: none;
  background: #051430; color: #fff; font: 800 15px Montserrat, sans-serif;
  box-shadow: inset 0 0 0 1px rgba(120,180,255,.5); -webkit-user-select: text; user-select: text;
}
input.txt:focus { box-shadow: inset 0 0 0 2px var(--gold); }

/* Valor de característica heredado: lo pisa .sball .sv en el HUD (no borrar). */
.sv { width: 18px; text-align: right; font-size: 12px; font-weight: 900; }
/* Barra del antiguo statBar. NO BORRAR ni mover antes de .av: el avatar del HUD es .av.big y hereda
   de aquí flex: 1 y el fondo transparente (el degradado no es válido sin --v). */
.big { flex: 1; height: 11px; border-radius: 2px; background: repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 calc(10% - 2px), #0e2f66 calc(10% - 2px) 10%), linear-gradient(90deg, #ffc81f 0 var(--v), #5cf07a var(--v) var(--n), #03102a var(--n)); box-shadow: 0 0 0 1px rgba(0,0,0,.5); }

.scroll { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: rgba(120,180,255,.4) transparent; }
.scroll-x { overflow-x: auto; overflow-y: hidden; touch-action: pan-x; scrollbar-width: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* Gira el móvil */
#rotate { position: fixed; inset: 0; z-index: 1000; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--ink); text-align: center; padding: 24px; }
#rotate svg { width: 70px; height: 70px; animation: rot 1.6s ease-in-out infinite; }
@keyframes rot { 50% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (max-width: 700px) { #rotate { display: flex; } }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

body.offline .needs-net { opacity: .45; pointer-events: none; }

/* ============================================================================================ */
/* 4. SISTEMA DE DISEÑO DE LOS MENÚS                                                            */
/* ============================================================================================ */

/* ---- 4.1 Tipografía ------------------------------------------------------------------------ */
/* Titulares en Barlow Condensed cursiva (mayúsculas); texto corrido en Montserrat.
   Los tamaños distintos se ponen en el CSS de la pantalla (.s-home .mode .ty-h3 { font-size: 22px }),
   nunca en línea desde el JS. */
.ty-vs, .ty-xl, .ty-display, .ty-h1, .ty-h2, .ty-h3, .ty-h4 {
  font-family: var(--f-disp); font-style: italic; font-weight: 800; line-height: 1;
  text-transform: uppercase; color: #fff;
  text-shadow: 0 2px 0 rgba(0,8,30,.55), 0 0 1px rgba(0,8,30,.6);
}
.ty-vs { font-size: 64px; letter-spacing: .6px; }
.ty-xl { font-size: 44px; letter-spacing: .6px; }
.ty-display { font-size: 36px; letter-spacing: .6px; }
.ty-h1 { font-size: 25px; letter-spacing: .4px; }
.ty-h2 { font-size: 28px; letter-spacing: .4px; }
.ty-h3 { font-size: 21px; line-height: .95; letter-spacing: .4px; }
.ty-h4 { font-size: 18px; letter-spacing: .3px; }
.ty-num { font-family: var(--f-disp); font-style: italic; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .2px; line-height: 1; }
.ty-body { font-family: var(--f-ui); font-style: normal; font-weight: 600; font-size: 11px; line-height: 1.35; color: var(--tx-2); }
.ty-small { font-family: var(--f-ui); font-style: normal; font-weight: 700; font-size: 10px; line-height: 1.3; color: var(--tx-3); }
.ty-over { font-family: var(--f-ui); font-style: normal; font-weight: 800; font-size: 9.5px; line-height: 1; letter-spacing: 1.1px; text-transform: uppercase; color: var(--tx-3); }
.fs-13 { font-size: 13px; } .fs-15 { font-size: 15px; } .fs-16 { font-size: 16px; } .fs-18 { font-size: 18px; }
.fs-19 { font-size: 19px; } .fs-20 { font-size: 20px; } .fs-22 { font-size: 22px; } .fs-27 { font-size: 27px; } .fs-32 { font-size: 32px; }
.ts { text-shadow: 0 2px 0 rgba(0,8,30,.55), 0 0 1px rgba(0,8,30,.6); }
/* Oro en el texto: nunca con text-shadow (lo taparía); la caída va con drop-shadow. */
.gold-t, .ty-vs {
  background: linear-gradient(180deg, #fff8d8 0%, #ffe07a 45%, #f2b126 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  text-shadow: none !important; filter: drop-shadow(0 2px 0 rgba(70,36,0,.75));
}
/* Lo heredado que quede sin migrar: .t pasa a Barlow (sin tocar su tamaño). */
.ui .t { font-family: var(--f-disp); font-style: italic; font-weight: 800; line-height: 1; text-transform: uppercase; letter-spacing: .4px; text-shadow: 0 2px 0 rgba(0,8,30,.55), 0 0 1px rgba(0,8,30,.6); }
.ui .muted { color: var(--tx-2); }

/* ---- 4.2 Luz y escenario -------------------------------------------------------------------- */
/* .spot: cono de lámpara · .rays-l: rayos con máscara (.spin para girar) · .halo: resplandor
   redondo (--gc) · .podium: peana dorada. Todos position: absolute; el que los usa los coloca. */
.spot {
  position: absolute; top: 0; left: 50%; width: calc(180px * var(--art-k)); height: 72%; transform: translateX(-50%);
  background: linear-gradient(rgba(170,210,255,.20), rgba(170,210,255,0));
  clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); pointer-events: none;
}
.rays-l {
  position: absolute; pointer-events: none; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--ray, rgba(255,236,190,.10)) 0 6deg, rgba(0,0,0,0) 6deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 0 20%, transparent 62%); mask-image: radial-gradient(circle, #000 0 20%, transparent 62%);
}
.rays-l.spin { animation: spinrays 60s linear infinite; }
.halo { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, var(--gc, rgba(90,170,255,.45)), rgba(0,0,0,0)); pointer-events: none; }
.podium { position: absolute; left: 50%; transform: translateX(-50%); width: calc(230px * var(--art-k)); height: calc(64px * var(--art-k)); pointer-events: none; }
.podium::before {
  content: ''; position: absolute; left: 0; right: 0; top: 30%; bottom: 0; border-radius: 0 0 50% 50% / 0 0 40% 40%;
  background: linear-gradient(90deg, #040b1c, #0c2656 35%, #133a7c 50%, #0c2656 65%, #040b1c); box-shadow: 0 14px 24px rgba(0,0,0,.6);
}
.podium::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 60%; border-radius: 50%; border: 3px solid transparent;
  background: radial-gradient(ellipse at 50% 40%, #2458b0, #10306c 60%, #0a2250) padding-box, var(--gold-frame) border-box;
  box-shadow: inset 0 4px 10px rgba(0,0,0,.45);
}

/* ---- 4.3 Barra superior, monedero y botones de icono ---------------------------------------- */
.ui .topbar {
  height: calc(48px + var(--sat-l, 0px)); padding: var(--sat-l, 0px) 12px 0; gap: 12px; z-index: 5;
  background: linear-gradient(180deg, rgba(10,28,64,.97), rgba(5,16,40,.95));
  border-bottom: 0; box-shadow: inset 0 -1px 0 rgba(126,174,255,.16), 0 6px 16px rgba(0,0,0,.35);
}
.ui .topbar .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ui .topbar .title { font-size: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 2px; }
.ui .topbar .sp { flex: 1; }
/* Inicio: avatar, nombre, bandera y experiencia (lleva al perfil) */
.me-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; cursor: pointer; color: #fff; text-align: left; }
.me-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.me-info .r1, .me-info .r2 { display: flex; align-items: center; gap: 6px; }
.me-info .hn { font: 800 13px/1 var(--f-ui); max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-info .flag { width: 16px; height: 11px; }
.me-info .bar { width: 96px; }
.me-info .xpt { font: 800 9px/1 var(--f-ui); color: var(--tx-3); letter-spacing: .4px; font-variant-numeric: tabular-nums; }

/* Monedero: div.wallet > div.cur(.cash) > img + span.v.ty-num + button.plus (siempre bajo .wallet:
   .tn.cur es el número actual del pase). flyCoins() busca .cur.cash img y .cur:not(.cash) img. */
.ui .wallet { display: flex; align-items: center; gap: 20px; }
.ui .wallet .cur {
  display: flex; align-items: center; height: 28px; min-width: 120px; padding: 0 3px 0 30px; border-radius: 14px;
  background: linear-gradient(180deg, #030a1d, #0a1c42);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.7), inset 0 0 0 1px var(--well-line), 0 1px 0 rgba(255,255,255,.05);
  font-size: 19px;
}
.ui .wallet .cur.cash { min-width: 88px; }
.ui .wallet .cur img { left: -10px; top: 50%; width: 36px; height: 36px; margin-top: -18px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.ui .wallet .cur.cash img { left: -13px; width: 40px; height: 40px; margin-top: -20px; }
.ui .wallet .cur .v { flex: 1; margin: 0; padding: 0 6px; text-align: center; font-size: 19px; white-space: nowrap; }
.ui .wallet .cur .plus {
  flex: none; margin: 0; padding: 0; width: 22px; height: 22px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(180deg, #a6f56a, #4cc424 55%, #2c9612); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 0 1px #1b5e08;
}
.ui .wallet .cur .plus svg { width: 12px; height: 12px; filter: drop-shadow(0 1px 0 rgba(20,70,0,.6)); }
.ui .wallet .cur .plus:active { transform: translateY(1px); }

/* Botón de icono (.ib): azul; .gift.ready verde que se balancea; .r rojo (cerrar, quitar); .sm pequeño */
.ui .ib {
  width: 36px; height: 36px; border-radius: 10px; color: #fff;
  background: linear-gradient(180deg, #5aa8ff 0%, #2a74e0 50%, #1a55bf 100%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), inset 0 -2px 0 rgba(0,0,0,.18), 0 0 0 1px #0b3383, 0 3px 0 #0b3383, 0 5px 8px rgba(0,0,0,.35);
}
.ui .ib svg { width: 19px; height: 19px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.35)); }
.ui .ib.back svg { stroke-width: 3.4; }
.ui .ib:active { transform: translateY(2px); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), inset 0 -2px 0 rgba(0,0,0,.18), 0 0 0 1px #0b3383, 0 1px 0 #0b3383, 0 3px 5px rgba(0,0,0,.35); }
.ui .ib.gift.ready, .ui .ib.g {
  background: linear-gradient(180deg, #a6f56a 0%, #4cc424 50%, #2c9612 100%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.55), inset 0 -2px 0 rgba(0,0,0,.15), 0 0 0 1px #1b5e08, 0 3px 0 #1b5e08, 0 5px 8px rgba(0,0,0,.35);
}
.ui .ib.gift.ready { animation: wiggle 2.5s infinite; }
.ui .ib.r {
  background: linear-gradient(180deg, #ff8a7a 0%, #e2392a 55%, #b51d12 100%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.5), inset 0 -2px 0 rgba(0,0,0,.15), 0 0 0 1px #640a04, 0 3px 0 #640a04, 0 5px 8px rgba(0,0,0,.35);
}
.ui .ib.sm { width: 28px; height: 28px; border-radius: 8px; }
.ui .ib.sm svg { width: 14px; height: 14px; }
.ui .ib .badge { right: -7px; top: -7px; }
/* en la barra de arriba el botón está a 6 px del borde: el distintivo baja para no cortarse */
.ui .topbar .ib .badge { top: -5px; right: -6px; }

/* Con muesca (iPhone), el escenario queda dentro del área segura: el fondo de las barras se
   alarga hasta el borde de la pantalla (--bleed-* los pone layoutStage) y el contenido no. */
.ui .topbar::before, .ui .nav::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: calc(-1 * var(--bleed-l, 0px)); right: calc(-1 * var(--bleed-r, 0px));
  background: inherit;
}
.ui .topbar::before { top: calc(-1 * var(--bleed-t, 0px)); bottom: 0; }
/* el velo de las ventanas también cubre la zona de la muesca (el relleno mantiene centrado lo de dentro) */
.modal-bg {
  top: calc(-1 * var(--bleed-t, 0px)); right: calc(-1 * var(--bleed-r, 0px));
  bottom: calc(-1 * var(--bleed-b, 0px)); left: calc(-1 * var(--bleed-l, 0px));
  padding: var(--bleed-t, 0px) var(--bleed-r, 0px) var(--bleed-b, 0px) var(--bleed-l, 0px); box-sizing: border-box;
}
.ui .nav::before { top: 0; bottom: calc(-1 * var(--bleed-b, 0px)); }

/* ---- 4.4 Navegación inferior ---------------------------------------------------------------- */
/* nav.nav > button.nv[data-nav] > span.ic > img (art.navIcon) + b (etiqueta) (+ .badge) */
.ui .nav {
  height: calc(54px + var(--sab-l, 0px)); padding: 0 8px var(--sab-l, 0px); gap: 0; justify-content: center;
  background: linear-gradient(180deg, #0b1f49 0%, #061536 60%, #040e27 100%);
  border-top: 0; box-shadow: inset 0 1px 0 rgba(126,174,255,.22), 0 -6px 16px rgba(0,0,0,.35);
}
.ui .nv {
  flex: 1; width: auto; max-width: 132px; justify-content: flex-end; gap: 4px; padding: 0 0 7px;
  color: var(--tx-3); background: none; box-shadow: none; font: inherit;
}
.ui .nv .ic { position: relative; z-index: 1; height: 28px; display: flex; align-items: center; justify-content: center; }
.ui .nv .ic img { width: 42px; height: 28px; filter: saturate(.85) brightness(.9); transition: transform .15s; }
.ui .nv b { position: relative; z-index: 1; font-family: var(--f-disp); font-style: italic; font-weight: 700; font-size: 13px; line-height: 1; letter-spacing: .8px; text-transform: uppercase; }
.ui .nv.on { color: #fff; background: none; box-shadow: none; }
.ui .nv.on::before {
  content: ''; position: absolute; left: 6px; right: 6px; top: -6px; bottom: 0; border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #2d6fd8 0%, #1a4aa6 60%, #0f3079 100%);
  box-shadow: inset 0 2px 0 var(--gold-2), inset 0 0 0 1px rgba(160,200,255,.3), 0 -4px 14px rgba(40,120,255,.35);
}
.ui .nv.on .ic img { filter: none; transform: scale(1.14) translateY(-3px); }
.ui .nv.on b { text-shadow: 0 1px 0 #0b3486; }
.ui .nv .badge { top: 2px; right: auto; left: calc(50% + 10px); }

/* ---- 4.5 Tarjetas --------------------------------------------------------------------------- */
.ui .pnl {
  position: relative; overflow: hidden; border-radius: 14px; padding: 12px;
  background: linear-gradient(180deg, var(--sf-top) 0%, var(--sf-mid) 52%, var(--sf-bot) 100%);
  box-shadow: inset 0 0 0 1px var(--sf-line), inset 0 1px 0 var(--sf-hi), var(--sh-card);
}
.ui .pnl > .badge { right: 8px; top: 8px; }   /* el .pnl recorta lo que sale: el distintivo va dentro */
.ui button.pnl { border: 0; color: #fff; font: inherit; text-align: left; cursor: pointer; }
.ui .card-row {
  position: relative; border-radius: 12px;
  background: linear-gradient(180deg, var(--sf-top) 0%, var(--sf-mid) 52%, var(--sf-bot) 100%);
  box-shadow: inset 0 0 0 1px var(--sf-line), inset 0 1px 0 var(--sf-hi), var(--sh-row);
}
/* Seleccionables: el mismo borde transparente con o sin marco, para que nada salte al elegir. */
.ui .inv, .ui .cue-row, .ui .vcard, .ui .rank-row { position: relative; border: 2px solid transparent; background-clip: padding-box; }
/* Pozo: hundido, para cifras, listas y huecos */
.well {
  border-radius: 10px; background: linear-gradient(180deg, var(--well-top), var(--well-bot));
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65), inset 0 0 0 1px var(--well-line), 0 1px 0 rgba(255,255,255,.05);
}
/* Marco dorado: UNO por pantalla (el protagonista o el elegido). Excepciones: los dos jugadores en
   Buscar/VS, el 1.º del podio y la ventana. */
.ui .pnl.gold, .ui .cue-row.sel, .ui .inv.sel, .ui .vcard.sel, .ui .rank-me, .pcard-big:not(.searching), .modal.mdl {
  border: 2px solid transparent;
  background: linear-gradient(180deg, #14397a 0%, #0c2656 55%, #081c44 100%) padding-box, var(--gold-frame) border-box;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), 0 0 22px rgba(255,186,50,.16), var(--sh-card);
}
.ui .pnl.gold::before, .ui .cue-row.sel::before, .ui .inv.sel::before, .ui .vcard.sel::before, .ui .rank-me::before, .pcard-big:not(.searching)::before, .modal.mdl::before {
  content: ''; position: absolute; inset: 0; border-radius: 12px; pointer-events: none; z-index: 5;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.14);
}
.ui .cue-row.sel::before, .ui .inv.sel::before, .ui .rank-me::before { border-radius: 10px; }
/* Plata y bronce (podio del ranking) con la misma técnica */
.ui .pnl.silver, .ui .pnl.bronze { border: 2px solid transparent; background: linear-gradient(180deg, #14397a 0%, #0c2656 55%, #081c44 100%) padding-box, var(--silver-frame) border-box; box-shadow: 0 0 0 1px rgba(0,0,0,.55), var(--sh-card); }
.ui .pnl.bronze { background: linear-gradient(180deg, #14397a 0%, #0c2656 55%, #081c44 100%) padding-box, var(--bronze-frame) border-box; }
/* Pase de temporada */
.ui .pnl.pass {
  background: radial-gradient(ellipse 90% 60% at 80% 110%, rgba(255,79,216,.45), rgba(255,79,216,0) 70%), linear-gradient(160deg, #6a2ad0 0%, #3b138c 58%, #22095a 100%);
  box-shadow: inset 0 0 0 1px rgba(255,150,255,.38), inset 0 1px 0 rgba(255,255,255,.22), var(--sh-card);
}
/* Tinte por modo: .pnl.tinted + .ac-gold | .ac-cyan | .ac-green | .ac-red (luz en la esquina) */
.ui .pnl.tinted { --ac: rgba(40,200,255,.34); isolation: isolate; }
.ui .pnl.tinted::before { content: ''; position: absolute; z-index: -1; left: -30px; top: -30px; width: 140px; height: 140px; background: radial-gradient(closest-side, var(--ac), rgba(0,0,0,0)); opacity: .5; pointer-events: none; }
.ui .ac-gold { --ac: rgba(255,180,40,.38); }
.ui .ac-cyan { --ac: rgba(40,200,255,.34); }
.ui .ac-green { --ac: rgba(70,210,70,.32); }
.ui .ac-red { --ac: rgba(255,90,70,.32); }
/* Tarjetas pulsables: flotan con el ratón y se hunden al tocar (sin transición de sombra) */
@media (hover: hover) {
  .ui button.pnl:not([disabled]):hover, .ui button.card-row:not([disabled]):hover { transform: translateY(-2px); filter: brightness(1.08); }
}
.ui button.pnl:active, .ui button.card-row:active { transform: scale(.97) !important; }

/* ---- 4.6 Botones ---------------------------------------------------------------------------- */
/* .btn + color (.g verde: acción gratis · .y amarillo: TODO lo que gasta · .b azul: secundaria ·
   .r rojo: peligro · .gh fantasma: cancelar/no) + tamaño (.sz-xl 48 · L 40 por defecto · .sz-m 34 ·
   .sz-s 28). Precio: ETIQUETA [img] <span class="ty-num">1.500</span>.
   OJO: :active mueve el botón con transform (!important): no centres un .btn con transform. */
.ui .btn {
  --c1: #a6f56a; --c2: #4cc424; --c3: #2c9612; --edge: #1b5e08;
  position: relative; isolation: isolate; border: 0; min-height: 0; height: 40px; padding: 0 20px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  font-family: var(--f-disp); font-style: italic; font-weight: 800; font-size: 21px; line-height: 1; letter-spacing: .7px; text-transform: uppercase; color: #fff;
  text-shadow: 1px 0 0 var(--edge), -1px 0 0 var(--edge), 0 1px 0 var(--edge), 0 -1px 0 var(--edge), 1px 1px 0 var(--edge), -1px 1px 0 var(--edge), 1px -1px 0 var(--edge), -1px -1px 0 var(--edge), 0 2.5px 0 var(--edge);
  background: linear-gradient(180deg, var(--c1) 0%, var(--c2) 52%, var(--c3) 100%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.55), inset 0 -3px 0 rgba(0,0,0,.14), 0 0 0 1px var(--edge), 0 4px 0 var(--edge), 0 7px 12px rgba(0,0,0,.4);
}
.ui .btn::before { /* brillo superior (detrás del texto: si no, lo agrisa) */
  content: ''; position: absolute; left: 4px; right: 4px; top: 2px; height: 44%; border-radius: 8px 8px 12px 12px / 8px 8px 6px 6px;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.06)); pointer-events: none; z-index: -1;
}
.ui .btn.g { --c1: #a6f56a; --c2: #4cc424; --c3: #2c9612; --edge: #1b5e08; }
.ui .btn.y { --c1: #ffeb8a; --c2: #ffc21a; --c3: #f09600; --edge: #8a4300; }
.ui .btn.b { --c1: #7cc4ff; --c2: #2f86ec; --c3: #1a5ccc; --edge: #0b3486; }
.ui .btn.r { --c1: #ff8a7a; --c2: #e2392a; --c3: #b51d12; --edge: #640a04; }
.ui .btn.p { --c1: #d09aff; --c2: #8a45e8; --c3: #6224c2; --edge: #33107a; }
.ui .btn img { width: 24px; height: 24px; flex: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
.ui .btn svg { width: 16px; height: 16px; flex: none; filter: drop-shadow(0 1px 0 var(--edge)); }
.ui .btn .ty-num { font-size: inherit; }
.ui .btn.sz-xl { height: 48px; padding: 0 34px; font-size: 27px; border-radius: 12px; }
.ui .btn.sz-xl img { width: 26px; height: 26px; }
.ui .btn.sz-m { height: 34px; padding: 0 16px; font-size: 18px; border-radius: 9px; box-shadow: inset 0 1.5px 0 rgba(255,255,255,.55), inset 0 -2px 0 rgba(0,0,0,.14), 0 0 0 1px var(--edge), 0 3px 0 var(--edge), 0 6px 10px rgba(0,0,0,.35); }
.ui .btn.sz-m img { width: 22px; height: 22px; }
.ui .btn.sz-s { height: 28px; padding: 0 12px; font-size: 15px; border-radius: 8px; gap: 5px; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 0 0 1px var(--edge), 0 3px 0 var(--edge), 0 4px 8px rgba(0,0,0,.3); }
.ui .btn.sz-s img { width: 18px; height: 18px; }
.ui .btn.sz-s svg { width: 14px; height: 14px; }
.ui .btn.sz-s::before { border-radius: 6px 6px 10px 10px / 6px 6px 5px 5px; }
/* Pulsado: baja y el canto se queda en 1 px */
.ui .btn:active { transform: translateY(3px) !important; box-shadow: inset 0 1.5px 0 rgba(255,255,255,.55), inset 0 -3px 0 rgba(0,0,0,.14), 0 0 0 1px var(--edge), 0 1px 0 var(--edge), 0 3px 6px rgba(0,0,0,.35); }
.ui .btn.sz-m:active, .ui .btn.sz-s:active { transform: translateY(2px) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 0 0 1px var(--edge), 0 1px 0 var(--edge), 0 2px 4px rgba(0,0,0,.3); }
/* Fantasma */
.ui .btn.gh {
  --edge: #06163a; color: var(--tx-2); text-shadow: 0 1px 0 rgba(0,0,0,.5);
  background: linear-gradient(180deg, #1c4288, #122f66);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 1px rgba(126,174,255,.3), 0 3px 0 #06163a;
}
.ui .btn.gh::before { display: none; }
.ui .btn.gh:active { transform: translateY(2px) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 0 1px rgba(126,174,255,.3), 0 1px 0 #06163a; }
@media (hover: hover) { .ui .btn:not([disabled]):hover { filter: brightness(1.08); } }
/* Desactivado (también con la cuenta atrás: icono clock 16 + <span class="ty-num">) */
.ui .btn[disabled] { filter: grayscale(.85) brightness(.7); cursor: default; animation: none; }
.ui .btn[disabled]:active { transform: none !important; }
.ui .btn[disabled].shine::after { display: none; }
/* Burbuja con la cantidad dentro de un botón (ABRIR ①) */
.ui .btn .bub { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font: italic 800 14px/22px var(--f-disp); color: #2c9612; background: #fff; text-shadow: none; box-shadow: 0 1px 2px rgba(0,0,0,.3); }

/* ---- 4.7 Pestañas y selectores -------------------------------------------------------------- */
.ui .tabs { display: flex; gap: 8px; margin-bottom: 8px; }
.ui .tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 16px; border: 0; border-radius: 10px;
  font-family: var(--f-disp); font-style: italic; font-weight: 800; font-size: 17px; line-height: 1; letter-spacing: .6px; text-transform: uppercase; color: var(--tx-3);
  background: linear-gradient(180deg, rgba(8,24,58,.9), rgba(5,16,40,.9));
  box-shadow: inset 0 0 0 1px rgba(126,174,255,.2), inset 0 1px 0 rgba(255,255,255,.06);
}
.ui .tab.on, .ui .seg .on, .ui .chip.on {
  color: #fff; text-shadow: 0 2px 0 #0b3486;
  background: linear-gradient(180deg, #5aa8ff 0%, #2a74e0 52%, #1a55bf 100%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), 0 0 0 1px #0b3486, 0 3px 0 #0b3486, 0 0 16px rgba(60,140,255,.35);
}
.ui .tab.on::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 22px; height: 3px; margin-left: -11px; border-radius: 2px; background: var(--gold-2); box-shadow: 0 0 8px rgba(255,200,60,.8); }
.ui .tab .badge { right: -7px; top: -7px; }
/* Verticales (Tacos): .vtabs > button.tab > etiqueta + span.cnt */
.ui .vtabs { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.ui .vtabs .tab { width: 100%; height: auto; flex: 1 1 38px; min-height: 30px; max-height: 48px; justify-content: space-between; padding: 0 12px; font-size: 16px; }
.ui .vtabs .tab .cnt { font: 800 10px/1 var(--f-ui); font-style: normal; letter-spacing: .3px; color: var(--tx-3); text-shadow: none; }
.ui .vtabs .tab.on .cnt { color: rgba(255,255,255,.85); }
.ui .vtabs .tab.on::after { left: 0; top: 50%; bottom: auto; width: 3px; height: 20px; margin: -10px 0 0; }
/* Conmutador (Elige mesa): .seg > button (.on) */
.ui .seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px;
  background: linear-gradient(180deg, var(--well-top), var(--well-bot));
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65), inset 0 0 0 1px var(--well-line), 0 1px 0 rgba(255,255,255,.05);
}
.ui .seg button {
  height: 28px; padding: 0 16px; border: 0; border-radius: 9px; background: none; cursor: pointer; color: var(--tx-3);
  font-family: var(--f-disp); font-style: italic; font-weight: 800; font-size: 15px; letter-spacing: .5px; text-transform: uppercase;
}
.ui .seg .on { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), 0 0 0 1px #0b3486; }
/* Opciones (Práctica, Sala, Retar): .chips > button.chip (.on) */
.ui .chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ui .chip {
  height: 30px; padding: 0 12px; border: 0; border-radius: 9px; cursor: pointer; color: var(--tx-3);
  font-family: var(--f-disp); font-style: italic; font-weight: 800; font-size: 15px; line-height: 1; letter-spacing: .4px; text-transform: uppercase;
  background: linear-gradient(180deg, var(--well-top), var(--well-bot));
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65), inset 0 0 0 1px var(--well-line), 0 1px 0 rgba(255,255,255,.05);
}
.ui .chip.on { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), 0 0 0 1px #0b3486, 0 2px 0 #0b3486; }
/* Muestras de paño: .theme-pick > button (fondo = color del paño) */
.ui .theme-pick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ui .theme-pick button { position: relative; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), inset 0 3px 5px rgba(255,255,255,.18); }
.ui .theme-pick button::after { content: ''; position: absolute; inset: -6px; }
.ui .theme-pick button.on { box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), inset 0 3px 5px rgba(255,255,255,.18), 0 0 0 2px #0a2250, 0 0 0 4px var(--gold-2); }

/* ---- 4.8 Pastillas, rareza, contador, cintas y distintivos ---------------------------------- */
/* .pill (neutra) · .ok verde (EQUIPADO, HECHA, GRATIS) · .gold (NIVEL N) · .red · .dark (pozo: cuentas
   atrás, «● N jugando») · .lg (22 de alto). Dentro puede llevar un svg de 11–12 o un .dot. */
.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 18px; padding: 0 7px; border-radius: 5px; white-space: nowrap; flex: none;
  font: 800 9.5px/1 var(--f-ui); font-style: normal; letter-spacing: .8px; text-transform: uppercase; color: #fff; text-shadow: none;
  background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.pill svg { width: 11px; height: 11px; flex: none; }
.pill.ok { background: linear-gradient(#5fd836, #2c9612); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(0,0,0,.4); }
.pill.gold { color: var(--gold-ink); background: linear-gradient(#ffe88a, #f2ab1c); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(0,0,0,.4); }
.pill.red { background: linear-gradient(#ff6a55, #d8261a); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 2px rgba(0,0,0,.4); }
.pill.orange { background: linear-gradient(#ffb070, #e2641a); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 1px 2px rgba(0,0,0,.4); }
.pill.dark { color: var(--tx-2); background: linear-gradient(180deg, var(--well-top), var(--well-bot)); box-shadow: inset 0 1px 3px rgba(0,0,0,.7), inset 0 0 0 1px var(--well-line); }
.pill.lg { height: 22px; padding: 0 9px; font-size: 11px; border-radius: 6px; gap: 5px; }
.pill.lg svg { width: 12px; height: 12px; }
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #5dff3a; box-shadow: 0 0 6px #5dff3a; }
/* Rareza: rarityTag(r) pone --rc y --rch */
.ui .rar {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 5px; flex: none; white-space: nowrap;
  font: 800 9.5px/1 var(--f-ui); font-style: normal; letter-spacing: .8px; text-transform: uppercase; color: #0b1630; text-shadow: none;
  background: linear-gradient(180deg, var(--rch, #bccad8), var(--rc, #9fb3c8));
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.4);
}
/* Contador de inventario («×2»; .zero: «0» en un pozo) */
.count {
  display: inline-flex; align-items: center; justify-content: center; flex: none; height: 26px; min-width: 38px; padding: 0 8px; border-radius: 13px;
  font-family: var(--f-disp); font-style: italic; font-weight: 700; font-size: 16px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--gold-ink);
  background: linear-gradient(#ffe88a, #f2ab1c); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 0 1px #7a4a06, 0 2px 3px rgba(0,0,0,.4);
}
.count.zero { color: var(--tx-4); background: linear-gradient(180deg, var(--well-top), var(--well-bot)); box-shadow: inset 0 1px 3px rgba(0,0,0,.7), inset 0 0 0 1px var(--well-line); }
/* Pastilla «IA» de los rivales controlados por la IA */
.ui .botbadge {
  display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 4px; flex: none;
  font: 800 9px/1 var(--f-ui); font-style: normal; letter-spacing: .8px; color: #fff; text-shadow: none;
  background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
/* Cinta en la esquina superior derecha de una tarjeta («SOLO UNA VEZ»); .green */
.corner {
  position: absolute; right: -2px; top: 10px; z-index: 4; height: 20px; padding: 0 10px 0 12px;
  display: flex; align-items: center; white-space: nowrap;
  font-family: var(--f-disp); font-style: italic; font-weight: 800; font-size: 13px; line-height: 1; letter-spacing: .6px; text-transform: uppercase; color: #fff;
  background: linear-gradient(#ff6a55, #d8261a); clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%);
  text-shadow: 0 1px 0 rgba(90,0,0,.6);
}
.corner.green { background: linear-gradient(#7ee84a, #2c9612); text-shadow: 0 1px 0 rgba(10,60,0,.6); }
/* Distintivo rojo con un número (setBadge). Va por encima del filo interior del marco dorado (5). */
.ui .badge {
  position: absolute; right: -6px; top: -6px; z-index: 6; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font: 800 10.5px/18px var(--f-ui); font-style: normal; letter-spacing: 0; text-align: center; color: #fff; text-shadow: none;
  background: linear-gradient(#ff7a68, #e2291a); box-shadow: 0 0 0 2px #071733, 0 2px 4px rgba(0,0,0,.5);
}

/* ---- 4.9 Progreso --------------------------------------------------------------------------- */
/* .bar > i (verde) · .bar.blue (experiencia) · .bar.gold (pase, piezas, compras). Dos capas: i + i. */
.ui .bar {
  height: 8px; border-radius: 4px; overflow: hidden; display: flex; background: #020816;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.9), 0 0 0 1px rgba(126,174,255,.2), 0 1px 0 rgba(255,255,255,.06);
}
.ui .bar > i { display: block; flex: none; height: 100%; border-radius: 4px; transition: width .5s; background: linear-gradient(180deg, #c4ff9a, #5ed22c 55%, #33a014); box-shadow: inset 0 1px 0 rgba(255,255,255,.55); }
.ui .bar.blue > i { background: linear-gradient(180deg, #9ff0ff, #37b9f0 55%, #1f8fd6); }
.ui .bar.gold > i { background: linear-gradient(180deg, #fff1a0, #ffc629 55%, #e89a06); }
.ui .bar > i:first-child:not(:last-child) { border-radius: 4px 0 0 4px; }
.ui .bar > i + i { border-radius: 0 4px 4px 0; opacity: .55; }
/* Segmentos de característica (statBar): .segs > i ×10 (.on conseguido, .nx lo que sube al mejorar) */
.segs { display: flex; gap: 2px; }
.segs > i { flex: 1; height: 10px; border-radius: 2px; background: #041029; box-shadow: inset 0 1px 2px rgba(0,0,0,.8), inset 0 0 0 1px rgba(126,174,255,.12); }
.segs > i.on { background: linear-gradient(180deg, #fff1a0, #ffc629 55%, #e89a06); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.segs > i.nx { background: linear-gradient(180deg, rgba(150,245,100,.55), rgba(60,190,30,.45)); box-shadow: inset 0 0 0 1px rgba(160,255,110,.6); }
/* statBar(): div.st > span.st-l + div.segs + span.st-v.ty-num (+ em «+1») */
.ui .st { display: flex; align-items: center; gap: 10px; width: auto; }
.ui .st .st-l { width: 76px; flex: none; font: 800 10px/1 var(--f-ui); letter-spacing: 1px; text-transform: uppercase; color: var(--tx-2); }
.ui .st .segs { flex: 1; min-width: 0; }
.ui .st .st-v { flex: none; min-width: 34px; text-align: right; font-size: 18px; color: #fff; }
.ui .st .st-v em { margin-left: 2px; font: 800 12px/1 var(--f-ui); font-style: normal; color: var(--c-green-hi); }
/* Minibarra de las filas de Tacos: .mini > span > (letra) + i.sb[--v] + .ty-num */
.ui .mini { display: flex; gap: 12px; }
.ui .mini > span { display: flex; align-items: center; gap: 4px; font: 800 9px/1 var(--f-ui); color: var(--tx-3); }
.ui .mini .sb { display: inline-block; width: 44px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #ffc629 0 var(--v), rgba(0,0,0,0) var(--v)), #041029; box-shadow: inset 0 0 0 1px rgba(126,174,255,.15); }
.ui .mini .ty-num { font-size: 13px; color: #fff; }
/* Nivel del taco: .pips > i (.on, .nx) */
.ui .pips { display: flex; align-items: center; gap: 4px; }
.ui .pips i { width: 26px; height: 8px; border-radius: 4px; background: linear-gradient(180deg, var(--well-top), var(--well-bot)); box-shadow: inset 0 1px 2px rgba(0,0,0,.8), inset 0 0 0 1px var(--well-line); }
.ui .pips i.on { background: linear-gradient(180deg, #fff1a0, #ffc629 55%, #e89a06); box-shadow: inset 0 1px 0 rgba(255,255,255,.6); }
.ui .pips i.nx { background: rgba(90,200,40,.2); box-shadow: inset 0 0 0 1.5px rgba(150,245,100,.8); }
/* Hitos de la caja de victoria: .vpips > i ×5 (.on con un svg check) */
.vpips { display: flex; gap: 4px; }
.vpips > i { width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #030a1d; box-shadow: inset 0 1px 2px rgba(0,0,0,.9), 0 0 0 1px rgba(126,174,255,.28); }
.vpips > i.on { background: radial-gradient(circle at 35% 30%, #fff6c0, #ffc629 50%, #c47b06); box-shadow: 0 0 0 1px #6a3f02; }
.vpips > i svg { width: 10px; height: 10px; color: #5a3300; }
/* Misiones: .msq > i ×n (.on hecha, con check · .rd lista para recoger) */
.msq { display: flex; gap: 6px; }
.msq > i { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #030a1d; box-shadow: inset 0 1px 3px rgba(0,0,0,.9), 0 0 0 1px rgba(126,174,255,.25); }
.msq > i.on { background: linear-gradient(#7ee84a, #2c9612); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 0 1px #1b5e08; }
.msq > i.on svg { width: 15px; height: 15px; color: #fff; }
.msq > i.rd { box-shadow: inset 0 1px 3px rgba(0,0,0,.9), 0 0 0 1.5px var(--gold-2), 0 0 8px rgba(255,200,60,.45); }

/* ---- 4.10 Interruptor y campos -------------------------------------------------------------- */
.ui .switch {
  position: relative; flex: none; width: 44px; height: 24px; padding: 0; border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, var(--well-top), var(--well-bot));
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65), inset 0 0 0 1px var(--well-line), 0 1px 0 rgba(255,255,255,.05);
}
.ui .switch::after { content: ''; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #8ba7d8; box-shadow: 0 1px 2px rgba(0,0,0,.6); transition: transform .15s; }
.ui .switch.on { background: linear-gradient(#5fd836, #2c9612); box-shadow: inset 0 1px 2px rgba(0,0,0,.35), 0 0 0 1px #1b5e08; }
.ui .switch.on::after { left: 2px; background: #fff; transform: translateX(20px); }
.ui input.txt {
  width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 10px; outline: none; color: #fff;
  font: 800 15px var(--f-ui);
  background: linear-gradient(180deg, var(--well-top), var(--well-bot));
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65), inset 0 0 0 1px var(--well-line), 0 1px 0 rgba(255,255,255,.05);
}
.ui input.txt::placeholder { color: var(--tx-4); opacity: 1; }
.ui input.txt:focus { box-shadow: inset 0 0 0 2px var(--gold-2), 0 0 10px rgba(255,200,60,.3); }
.ui input.txt.code { height: 48px; text-align: center; font: italic 800 28px/1 var(--f-disp); letter-spacing: 6px; text-transform: uppercase; }
.ui input.txt.code::placeholder { letter-spacing: 3px; }

/* ---- 4.11 Avatar y escudo de nivel ---------------------------------------------------------- */
/* avatar(p, { size, star }) → div.avf (marco de oro) > i (fondo del color del avatar) > img + span.lvsh */
.avf { position: relative; flex: none; padding: 2px; background: var(--gold-frame); box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.avf.av-lg { padding: 3px; }
.avf > i { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; background: radial-gradient(circle at 40% 30%, var(--av1, #3a7be6), var(--av2, #143b8c) 75%); }
.avf > i > img { width: 78%; height: 78%; }
.lvsh {
  position: absolute; left: -6px; bottom: -6px; z-index: 1; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-disp); font-style: italic; font-weight: 800; font-size: 13px; line-height: 1; color: var(--gold-ink); text-shadow: none;
  background: linear-gradient(180deg, #ffe27a, #f2a91c 60%, #c47b06); box-shadow: 0 0 0 1.5px var(--gold-ink), 0 2px 3px rgba(0,0,0,.5);
  transform: skewX(-6deg);
}
.avf.av-lg .lvsh { left: -9px; bottom: -9px; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; font-size: 18px; }
.lvsh.silver { color: #1c2533; background: linear-gradient(180deg, #ffffff, #b9c7db 60%, #6a7890); box-shadow: 0 0 0 1.5px #1c2533, 0 2px 3px rgba(0,0,0,.5); }
.lvsh.bronze { color: #2e1606; background: linear-gradient(180deg, #ffd3a0, #c7834a 60%, #7a4418); box-shadow: 0 0 0 1.5px #2e1606, 0 2px 3px rgba(0,0,0,.5); }
.lvsh.lv-big { position: relative; left: auto; bottom: auto; width: 90px; height: 90px; border-radius: 20px; font-size: 48px; box-shadow: 0 0 0 3px var(--gold-ink), 0 6px 14px rgba(0,0,0,.5); }
.flag { display: inline-block; width: 22px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.7); flex: none; }

/* ---- 4.12 Ventanas y avisos ----------------------------------------------------------------- */
/* modal() fuera de la partida: .modal-bg.ui > .modal.mdl > h2 (cabecera) + .close + contenido */
.modal-bg.ui { background: rgba(2,8,24,.74); }
.modal.mdl { min-width: 320px; max-width: 92%; max-height: 92%; overflow: auto; padding: 0 16px 16px; border-radius: 14px; }
.modal.mdl.nt { padding-top: 16px; }          /* sin título */
.modal.mdl > h2 {
  position: relative; margin: 0 -16px 12px; height: 42px; line-height: 42px; padding: 0 44px; text-align: center;
  font-family: var(--f-disp); font-style: italic; font-weight: 800; font-size: 24px; letter-spacing: .4px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(rgba(255,255,255,.08), rgba(0,0,0,.18)); box-shadow: inset 0 -1px 0 rgba(255,211,77,.45);
}
.modal.mdl > h2 > span { display: inline-block; }      /* título en oro: h2 > span.gold-t (titleClass) */
.modal.mdl .close { right: 8px; top: 7px; z-index: 6; width: 28px; height: 28px; border-radius: 50%; }
.modal.mdl .close svg { width: 14px; height: 14px; }
.modal.mdl .actions { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.modal.mdl .confirm-txt { margin: 6px auto 4px; max-width: 360px; text-align: center; font-size: 13.5px; line-height: 1.4; }
/* toast() fuera de la partida: .toast.mt (.ok verde · .err rojo: solo cambia el filo) */
.toast.mt {
  --tc: var(--c-cyan);
  display: flex; align-items: center; min-height: 34px; max-width: 560px; padding: 8px 16px 8px 14px; border-radius: 17px; text-align: center;
  font: 800 12.5px/1.3 var(--f-ui); color: #fff;
  background: linear-gradient(180deg, #030b1f, #0a1c42);
  box-shadow: inset 3px 0 0 var(--tc), inset 0 0 0 1px var(--well-line), 0 6px 14px rgba(0,0,0,.5);
}
.toast.mt.ok { --tc: var(--c-green); background: linear-gradient(180deg, #030b1f, #0a1c42); }
.toast.mt.err { --tc: var(--c-red); background: linear-gradient(180deg, #030b1f, #0a1c42); }

/* ---- 4.13 Premios (itemCard, rewardsModal) y subida de nivel (levelUpModal) ----------------- */
.rewards, .levelup { position: relative; display: flex; flex-direction: column; align-items: center; }
.rewards > .rays-l { left: 50%; top: calc(50% - 24px); width: 360px; height: 360px; margin: -180px 0 0 -180px; }
.rgrid { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 494px; }
.rewards .actions .btn, .levelup .actions .btn { min-width: 180px; }
/* .reward.{blue|green|purple|orange|pink} > .rpic + .rtitle (+ .ty-num si es cifra) + .rsub */
.reward {
  --k-hi: #5aa8ff; --k: #1d5fc6;
  position: relative; width: 116px; height: 148px; border-radius: 12px; padding: 10px 8px; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  background: radial-gradient(ellipse 80% 55% at 50% 30%, rgba(255,255,255,.18), rgba(255,255,255,0) 70%), linear-gradient(180deg, var(--k-hi) 0%, var(--k) 40%, #0a1f47 100%);
  box-shadow: inset 0 0 0 1.5px var(--k-hi), inset 0 1px 0 rgba(255,255,255,.35), 0 8px 16px -6px rgba(0,0,0,.7);
  animation: flip .45s ease-out both;
}
.reward:nth-child(2) { animation-delay: .12s; } .reward:nth-child(3) { animation-delay: .24s; } .reward:nth-child(4) { animation-delay: .36s; } .reward:nth-child(5) { animation-delay: .48s; }
@keyframes flip { from { transform: perspective(600px) rotateY(90deg) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.reward.blue { --k-hi: #5aa8ff; --k: #1d5fc6; }
.reward.green { --k-hi: #7ee84a; --k: #2c8a14; }
.reward.purple { --k-hi: #b98cff; --k: #6a2ac0; }
.reward.orange { --k-hi: #ffc070; --k: #d0620e; }
.reward.pink { --k-hi: #ff8ae6; --k: #b0228e; }
.rpic { height: 64px; display: flex; align-items: center; justify-content: center; }
.rpic img { max-width: 76px; max-height: 64px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
.cuepic img { width: 150px !important; max-width: none !important; height: 4px !important; transform: rotate(-38deg); filter: drop-shadow(0 3px 3px rgba(0,0,0,.6)); }
.rtitle {
  max-width: 100%; font-family: var(--f-disp); font-style: italic; font-weight: 800; font-size: 22px; line-height: 1; letter-spacing: .2px; color: #fff;
  text-shadow: 0 2px 0 rgba(0,8,30,.55), 0 0 1px rgba(0,8,30,.6); overflow-wrap: anywhere;
}
.rtitle.long { font-size: 18px; }
/* En los menús el nombre del premio va en mayúsculas, como el resto de títulos en Barlow, y el taco
   cabe dentro de la carta (antes asomaba por la esquina de arriba) */
.ui .rtitle { text-transform: uppercase; letter-spacing: .3px; }
.ui .cuepic img { width: 108px !important; transform: rotate(-34deg); }
.rsub { min-height: 22px; display: flex; align-items: center; justify-content: center; font: 800 9.5px/11px var(--f-ui); letter-spacing: .5px; text-transform: uppercase; color: rgba(255,255,255,.85); }
/* Nivel nuevo: .levelup > .lv-main (fila: .lv-side con rayos, escudo y texto + .rgrid) + .actions */
.levelup .lv-main { display: flex; align-items: center; justify-content: center; gap: 22px; }
.levelup .lv-side { width: 150px; flex: none; }
.levelup .lv-side .rays2 { top: 49px; z-index: 0; }
.levelup .lv-side > :not(.rays2) { position: relative; }
.levelup .lvsh.lv-big { margin: 4px 0; animation: lvsh-in .6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes lvsh-in { from { transform: skewX(-6deg) scale(0); } to { transform: skewX(-6deg) scale(1); } }
.levelup .lv-txt { margin: 10px 0 0; text-align: center; font-size: 13px; }

/* ---- 4.14 Estado vacío y listas compartidas (Amigos, Ranking, Historial…) -------------------- */
/* emptyState({ art, title, text, action }) */
.empty-st { height: 100%; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; }
.empty-st .empty-art { position: relative; display: flex; align-items: center; justify-content: center; width: calc(84px * var(--art-k)); height: calc(84px * var(--art-k)); }
.empty-st .empty-art .halo { left: 50%; top: 50%; width: 150px; height: 150px; margin: -75px 0 0 -75px; }
.empty-st .empty-art > :not(.halo) { position: relative; max-width: 100%; max-height: 100%; }
.empty-st .empty-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0,0,0,.5)); }
.empty-st .ty-h3 { font-size: 22px; }
.empty-st .ty-body { margin: 0; max-width: 300px; }
.empty-st .btn { margin-top: 6px; }
.empty-st.sm { padding: 10px; gap: 6px; }
.empty-st.sm .empty-art { width: 56px; height: 56px; }
.empty { padding: 24px; text-align: center; color: var(--txt-2); font-size: 13px; }
.ui .empty { color: var(--tx-2); }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5cf07a; box-shadow: 0 0 6px #5cf07a; }
/* Filas de lista (Amigos, Ranking): .flist > .card-row.frow */
.flist { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.frow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex: none; }
.frow .fname { flex: 1; min-width: 0; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .fsub { font-size: 10.5px; color: var(--txt-2); font-weight: 700; }
.ui .frow .fsub { font: 700 10px/1.3 var(--f-ui); color: var(--tx-3); margin-top: 2px; }

/* ---- 4.15 Utilidades ------------------------------------------------------------------------ */
.ui .sp { flex: 1; }
.ui .row { display: flex; align-items: center; }
.ui .col { display: flex; flex-direction: column; }
.ui .gap-4 { gap: 4px; } .ui .gap-8 { gap: 8px; } .ui .gap-12 { gap: 12px; }
.c-gold { color: var(--gold-2); } .c-green { color: var(--c-green-hi); } .c-red { color: var(--c-red-hi); } .c-cyan { color: var(--c-cyan); }
.c-tx2 { color: var(--tx-2); } .c-tx3 { color: var(--tx-3); } .c-tx4 { color: var(--tx-4); }
.ui .ico-coin { width: 18px; height: 18px; flex: none; }
