/* ============================================================
   TEMA DE CARD N ROLE  (todas las páginas)
   Para cambiar colores edita SOLO los dos bloques de colores:
   el primero es el tema claro y el segundo el oscuro.
   ============================================================ */

/* ---- TEMA CLARO ---- */
:root {
    color-scheme: light;
    --topbar: #00aade;          /* barra superior (igual en ambos temas: el logo es negro) */
    --topbar-texto: #0b1f3f;
    --page-bg: #eaf6fb;         /* fondo de la página */
    --surface: #ffffff;         /* tarjetas */
    --surface-2: #f2f8fc;       /* tarjetas secundarias, filas, hover */
    --ink: #15243a;             /* texto */
    --muted: #5d6e86;           /* texto secundario */
    --line: #d5e4f1;            /* bordes */
    --heading: #102b59;         /* títulos */
    --accent: #1d5aa6;          /* botones y enlaces */
    --accent-texto: #ffffff;
    --accent-2: #00aade;        /* resaltes (cian de la marca) */
    --resalte: #e3f4fb;         /* pestaña activa, etiquetas */
    --banda-1: #102b59;         /* encabezados oscuros (degradado) */
    --banda-2: #1d5aa6;
    --ganador: #1f8a4c;
    --ok: #1e7a43;
    --error: #b3261e;
    --shadow: 0 10px 28px #102b5914;
    --fuente: Inter, system-ui, "Segoe UI", Arial, sans-serif;
    /* Fondo de todas las páginas: degradado inspirado en Mew shiny (azul cielo + lavanda) */
    --page-grad:
        radial-gradient(1100px 620px at 8% -8%, #9fd8fb 0%, transparent 62%),
        radial-gradient(900px 640px at 100% 4%, #cdbfff 0%, transparent 58%),
        radial-gradient(800px 520px at 50% 110%, #a8e6fb 0%, transparent 60%),
        linear-gradient(165deg, #e4f5ff 0%, #cfe9fb 45%, #e2d9fb 100%);
    /* Bandas y encabezados (carrusel, encabezado del torneo, pantalla grande) */
    --banda-grad: linear-gradient(115deg, #13305f 0%, #1f5ea6 48%, #3fa7dd 78%, #8d86e3 100%);

    /* Nombres antiguos (las plantillas aún los usan) */
    --navy: var(--heading);
    --blue: var(--accent);
    --cyan: var(--accent-2);
    --white: var(--surface);
    --ice: var(--resalte);
    --surface-secondary: var(--surface-2);
}

/* ---- TEMA OSCURO ---- */
:root[data-theme="dark"] {
    color-scheme: dark;
    --topbar: #00aade;
    --topbar-texto: #0b1f3f;
    --page-bg: #0d1829;
    --surface: #bd2b7b;
    --surface-2: #1d3150;
    --ink: #e5edf8;
    --muted: #9fb0c6;
    --line: #2a3d5a;
    --heading: #f1f6fd;
    --accent: #3fb6e6;
    --accent-texto: #06213a;
    --accent-2: #69c9ed;
    --resalte: #21406a;
    --banda-1: #0a1424;
    --banda-2: #173a66;
    --ganador: #3ccf7f;
    --ok: #5fd394;
    --error: #ff8a80;
    --shadow: 0 10px 28px #00000055;
    --page-grad:
        radial-gradient(1100px 620px at 8% -8%, #1f6fae66 0%, transparent 62%),
        radial-gradient(900px 640px at 100% 4%, #6a5cc455 0%, transparent 58%),
        radial-gradient(800px 520px at 50% 110%, #2aa6d944 0%, transparent 60%),
        linear-gradient(165deg, #0a1730 0%, #0f2545 48%, #1a1b47 100%);
    --banda-grad: linear-gradient(115deg, #0b1d3d 0%, #17417c 48%, #2a86bf 80%, #6c63c9 100%);
}

/* ---- Zona de Administración: fondo rosa para distinguirla del sitio público ---- */
/* Rosa Mew liso (sin degradado), solo en Administración */
body.zona-admin {
    --page-grad: none;
    --page-bg: #f5b5cb;
}
:root[data-theme="dark"] body.zona-admin {
    --page-grad: none;
    --page-bg: #8a3a5c;
    --surface: #2b0c1b;
    --surface-2: #3d1229;
    --line: #5e2142;
    --resalte: #5a1838;
    --banda-1: #3a0c22;
}
body.zona-admin { --line: #f3c2d4; --resalte: #ffe0eb; }
:root[data-theme="dark"] body.zona-admin { --line: #5e2142; --resalte: #5a1838; }
body.zona-admin .topbar::after { content: "ADMINISTRACIÓN"; position: absolute; left: 50%; top: 100%; transform: translate(-50%, -50%);
    font-size: 1rem; font-weight: 900; letter-spacing: .2em; padding: .35rem 1.4rem; border-radius: 999px; background: #e0457b; color: #fff;
    box-shadow: 0 4px 14px #0004; pointer-events: none; white-space: nowrap; }
body.zona-admin main.contenedor { padding-top: 2.4rem; }
/* Mew saludando en la esquina de Administración */
body.zona-admin::after { content: ""; position: fixed; right: 18px; bottom: 14px; width: 110px; height: 110px; z-index: 40; pointer-events: none;
    background: url("/web/img/mascota.png") center / contain no-repeat; filter: drop-shadow(0 6px 10px #0005);
    transform-origin: 50% 90%; animation: cnr-saludo 2.4s ease-in-out infinite; }
@keyframes cnr-saludo { 0%, 55%, 100% { transform: rotate(0); } 12% { transform: rotate(-10deg); } 25% { transform: rotate(8deg); } 38% { transform: rotate(-6deg); } }
@media (max-width: 700px) {
    body.zona-admin::after { width: 70px; height: 70px; right: 8px; bottom: 8px; }
    body.zona-admin .topbar::after { font-size: .78rem; letter-spacing: .14em; }
}
@media (prefers-reduced-motion: reduce) { body.zona-admin::after { animation: none; } }

/* ---- Base ---- */
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { background: var(--page-bg); }
body { margin: 0; min-height: 100vh; background: var(--page-grad); background-color: var(--page-bg); background-attachment: fixed;
       color: var(--ink); font-family: var(--fuente); line-height: 1.5; }a { color: var(--accent); }
img { max-width: 100%; }
.contenedor, .container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
main.contenedor { padding: 1.6rem 0 3rem; }

/* ---- Barra superior ---- */
.topbar { background: var(--topbar); color: var(--topbar-texto); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px #0000001f; }
.topbar:empty { min-height: 76px; }
.topbar .nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 76px; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 56px; width: auto; display: block; }
.nav-derecha { display: flex; align-items: center; gap: .5rem; }
.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a { color: var(--topbar-texto); text-decoration: none; font-weight: 700; padding: .5rem .8rem; border-radius: 10px; }
.nav-links a:hover, .nav-links a.activo { background: #ffffff38; }
.nav-links a.destacado { background: var(--topbar-texto); color: #fff; }
.nav-links a.destacado:hover { filter: brightness(1.25); }

.menu { position: relative; }
.menu-boton { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .8rem; border-radius: 10px; border: 2px solid var(--topbar-texto);
              background: transparent; color: var(--topbar-texto); font: inherit; font-weight: 800; cursor: pointer; }
.menu-boton:hover, .menu-boton[aria-expanded="true"] { background: #ffffff38; }
.menu-boton .flecha { font-size: .75em; transition: transform .15s; }
.menu-boton[aria-expanded="true"] .flecha { transform: rotate(180deg); }
.header-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 1000; width: 250px; padding: .5rem;
               background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.header-menu[hidden] { display: none; }
.menu-saludo { padding: .45rem .75rem .6rem; font-size: .85rem; color: var(--muted); }
.menu-saludo strong { display: block; color: var(--heading); font-size: 1rem; }
.dropdown-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .65rem .75rem; border: 0; border-radius: 9px; background: transparent;
                 color: var(--ink); text-decoration: none; text-align: left; font: inherit; font-weight: 600; cursor: pointer; }
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--surface-2); outline: none; }
.dropdown-item .ico { width: 1.2em; text-align: center; }
.dropdown-item.deshabilitado { cursor: default; color: var(--muted); }
.dropdown-item.deshabilitado:hover { background: transparent; }
.dropdown-item .pronto { margin-left: auto; font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
                         padding: .12rem .5rem; border-radius: 999px; background: var(--resalte); color: var(--accent); }
.dropdown-divider { height: 1px; background: var(--line); margin: .4rem 0; }
.header-menu form { margin: 0; }
.solo-movil { display: none; }
@media (max-width: 700px) {
    .topbar .nav { min-height: 62px; }
    .brand img { height: 42px; }
    .nav-links { display: none; }
    .solo-movil { display: flex; }
    .menu-boton .texto { display: none; }
}

/* ---- Secciones comunes (index, torneos, página del torneo) ---- */
.hero { padding: 36px 0 22px; }
.section { padding: 30px 0; }
.eyebrow { font-size: 0.75rem; font-weight: 850; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 0 18px; }
.section-head h1, .section-head h2 { margin: 5px 0 0; color: var(--heading); letter-spacing: -0.03em; }
.section-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; }
.section-head h2 { font-size: 1.65rem; }
.section-head .sub { margin: 7px 0 0; }
.link { font-weight: 800; color: var(--accent); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.stat strong { display: block; font-size: 2rem; line-height: 1.2; color: var(--accent); overflow-wrap: anywhere; }
.stat strong.texto { font-size: 1.15rem; padding: .45rem 0; }
.stat span { color: var(--muted); font-size: 0.9rem; }
.empty { grid-column: 1/-1; background: var(--surface); border: 1px dashed var(--line); padding: 26px; border-radius: 18px; text-align: center; color: var(--muted); }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
    .hero { padding-top: 24px; }
    .section { padding: 22px 0; }
    .section-head { align-items: start; flex-direction: column; }
    .stats { gap: 9px; }
    .stat { padding: 16px; }
    .stat strong { font-size: 1.6rem; }
}

/* ---- Pie ---- */
.footer { margin-top: 2.5rem; background: var(--banda-1); color: #dcecff; padding: 1.6rem 0; }
.footer .container, .footer .contenedor { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---- Títulos, tarjetas, formularios, botones ---- */
h1 { margin: 0 0 .3rem; color: var(--heading); font-size: 1.9rem; }
h2 { color: var(--heading); margin: 1.6rem 0 .6rem; }
.sub { color: var(--muted); margin: 0 0 1.2rem; }
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.4rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; color: var(--ink); }
a.tarjeta:hover { border-color: var(--accent); }
.rejilla { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
label { display: block; font-weight: 600; margin: .8rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=datetime-local], input[type=search],
input[type=file], select, textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: var(--surface); color: var(--ink); }
textarea { min-height: 90px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid var(--line);
       background: var(--surface); color: var(--heading); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-texto); border-color: var(--accent); }
.btn.peligro { background: var(--surface); color: var(--error); border-color: var(--error); }
.btn.chico { padding: .3rem .7rem; font-size: .88rem; }
.decklist-form label { font-size: .88rem; }
.decklist-form input[type=file] { padding: .45rem; background: var(--surface-2); }
.decklist-form textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; min-height: 120px; }
.btn.peligro-fuerte { background: #c62828; color: #fff; border-color: #c62828; }
.zona-peligro { border: 2px solid color-mix(in srgb, var(--error) 55%, transparent); }
.peligro-fila { display: grid; grid-template-columns: 1fr minmax(260px, auto); gap: 1rem; align-items: center; padding: .6rem 0; }
.peligro-fila + .peligro-fila { border-top: 1px solid var(--line); }
.peligro-fila p { margin: .2rem 0 0; }
.peligro-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.peligro-form input { width: 11rem; }
@media (max-width: 700px) { .peligro-fila { grid-template-columns: 1fr; } }
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.acciones { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.acciones form, form.en-linea { display: inline; margin: 0; }
.aviso { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; border: 1px solid; }
.aviso.ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.aviso.error { background: color-mix(in srgb, var(--error) 12%, var(--surface)); color: var(--error); }
.aviso.info { background: var(--resalte); color: var(--accent); }
.pequeno { font-size: .88rem; color: var(--muted); }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }

/* ---- Icono de Pokémon (los sprites traen mucho margen: se recortan) ---- */
.poke { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; vertical-align: middle; }
.poke img { width: 100%; height: 100%; object-fit: contain; }
.poke.chico { width: 24px; height: 24px; }
.cm-lista li .poke + .poke { margin-left: -10px; }
.cm-lista li.cm-titulo { cursor: default; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: .5rem .45rem .2rem; }
.cm-lista li.cm-titulo:hover { background: transparent; }
.cm-estado { font-size: .8rem; font-weight: 700; color: var(--muted); align-self: center; }
.cm-estado.ok { color: var(--ok); } .cm-estado.error { color: var(--error); }

/* ---- Selector de mazo ---- */
.selector-mazo { min-width: min(100%, 420px); }
.cm-campos { display: flex; gap: .5rem; flex-wrap: wrap; }
.cm-campo { position: relative; flex: 1 1 190px; }
.cm-etiqueta { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: .15rem; }
.cm-entrada { display: flex; align-items: center; gap: .2rem; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 0 .3rem; }
.cm-entrada:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.cm-entrada input[type=text] { border: 0; background: transparent; padding: .5rem .3rem; min-width: 0; box-shadow: none; outline: none; }
.cm-entrada input:disabled { cursor: not-allowed; opacity: .55; }
.cm-ico:empty { width: 6px; }
.cm-quitar { border: 0; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 0 .3rem; }
.cm-lista { position: fixed; z-index: 60; margin: 0; padding: .3rem; list-style: none; max-height: 290px; overflow-y: auto;
            background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.cm-lista[hidden] { display: none; }
.cm-lista li { display: flex; align-items: center; gap: .45rem; padding: .15rem .45rem; border-radius: 8px; cursor: pointer; }
.cm-lista li small { margin-left: auto; color: var(--muted); }
.cm-lista li:hover, .cm-lista li.activa { background: var(--surface-2); }
.cm-lista li.cm-vacio { color: var(--muted); cursor: default; padding: .5rem; }
.cm-nota { display: block; color: var(--muted); margin-top: .25rem; }
td .selector-mazo { min-width: 400px; }
.mazo-fila { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; }

/* ---- Tablas ---- */
.tabla-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); color: var(--ink); }
th, td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--banda-1); color: #fff; font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Etiquetas de estado ---- */
.etiqueta { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--resalte); color: var(--accent); }
.etiqueta.registro_abierto, .etiqueta.confirmado { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); }
.etiqueta.en_curso, .etiqueta.detectado_tom { background: #fff1c2; color: #7a5b00; }
.etiqueta.cancelado { background: color-mix(in srgb, var(--error) 14%, var(--surface)); color: var(--error); }
.etiqueta.finalizado { background: var(--surface-2); color: var(--muted); }
.centrado { max-width: 460px; margin: 2rem auto; }
.reloj { font-size: 3.2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--heading); }
@media (max-width: 640px) { h1 { font-size: 1.5rem; } .reloj { font-size: 2.4rem; } }

/* ==========================================================================
   ÁREA DE TORNEOS (lista, página pública del torneo y pantalla grande)
   ========================================================================== */
:root { --t-mesa-texto: #06213a; --t-oro: #f4c542; --t-plata: #c9d3df; --t-bronce: #d99a5b; }
.envoltura-torneo { padding-bottom: 3rem; }
.nota { color: var(--muted); font-size: .9rem; }

/* ---- Encabezado del torneo y pestañas ---- */
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .7rem; border-radius: 999px; background: #ffffff1f; border: 1px solid #ffffff33; font-size: .82rem; font-weight: 700; color: #fff; }
.chip.vivo::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #ff5a5a; animation: latido-t 1.4s infinite; }
@keyframes latido-t { 50% { opacity: .25; } }
.cabeza-torneo .eyebrow { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cabeza-torneo .chip { background: var(--resalte); border-color: var(--line); color: var(--accent); font-size: .72rem; letter-spacing: .08em; }
.cabeza-torneo .acciones { margin-top: 0; }
/* Pestañas: barra clara como las tarjetas; la activa lleva el degradado de marca */
.pestanas { display: flex; gap: .3rem; margin-top: 1.2rem; padding: .35rem; background: var(--surface); border: 1px solid var(--line);
            border-radius: 16px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.pestanas button { flex: 1 0 auto; background: transparent; color: var(--muted); border: 0; border-radius: 12px; padding: .7rem 1rem; cursor: pointer; font: inherit; font-weight: 750; white-space: nowrap; }
.pestanas button:hover { background: var(--surface-2); color: var(--heading); }
.pestanas button.activa { background: var(--banda-grad); color: #fff; box-shadow: 0 4px 14px #1f5ea64d; }
.pestanas button[hidden] { display: none; }

/* ---- Secciones y controles ---- */
.controles { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.controles select, .controles input { flex: 1 1 180px; width: auto; }
.seccion { display: none; padding: 28px 0 10px; }
.seccion.activa { display: block; }
.seccion .section-head { margin-bottom: 12px; }
.seccion h3 { margin: 1.6rem 0 .7rem; font-size: 1.2rem; color: var(--heading); }
.detalles { margin-top: 14px; }
.detalles p { margin: .3rem 0 0; white-space: pre-line; }

/* ---- Pareos ---- */
.lista-pareos { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: .6rem; }
.pareo { position: relative; display: grid; grid-template-columns: 1fr 52px 1fr; align-items: center; background: var(--surface); border: 1px solid var(--line);
         border-radius: 14px; padding: .8rem .4rem; box-shadow: var(--shadow); }
.pareo.izq::before, .pareo.der::after { content: ""; position: absolute; top: 10px; bottom: 10px; width: 5px; background: var(--ganador); border-radius: 4px; }
.pareo.izq::before { left: 5px; } .pareo.der::after { right: 5px; }
.jug { text-align: center; padding: 0 .8rem; min-width: 0; }
.jug .nombre { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.jug small { display: block; color: var(--muted); font-variant-numeric: tabular-nums; }
.jug.gano .nombre { font-weight: 800; color: var(--heading); } .jug.perdio .nombre { color: var(--muted); font-weight: 500; }
.mesa { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-2); color: var(--t-mesa-texto); display: grid; place-items: center; font-weight: 800; margin: auto; }
.pareo.inscrito { grid-template-columns: 52px 1fr auto; padding: .6rem .8rem; }
.pareo.inscrito .mesa { width: 34px; height: 34px; font-size: .85rem; background: var(--surface-2); color: var(--muted); }
.pareo.inscrito .nombre { font-weight: 650; overflow-wrap: anywhere; }
.pareo.inscrito .ok-tom { font-size: .78rem; font-weight: 800; color: var(--ok); white-space: nowrap; }
.lista-pareos:has(.inscrito) { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.resultado-texto { text-align: center; font-size: .8rem; color: var(--muted); grid-column: 1 / -1; margin-top: .3rem; }

/* ---- Tablas del torneo ---- */
.tabla-scroll { border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.tabla-scroll th { padding: .7rem; }
.tabla-scroll td { padding: .6rem .7rem; }
.tabla-scroll tr:last-child td { border-bottom: 0; }
.medalla { display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--resalte); color: var(--heading); font-weight: 800; }
.medalla.p1 { background: var(--t-oro); color: #3d2c00; } .medalla.p2 { background: var(--t-plata); color: #1d2733; } .medalla.p3, .medalla.p4 { background: var(--t-bronce); color: #3a1f05; }

/* ---- Mazo (iconos + nombre) ---- */
.mazo { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; }
.mazo .iconos { display: inline-flex; flex: none; }
.mazo .iconos:empty { display: none; }
.mazo .iconos .poke + .poke { margin-left: -8px; }
.mazo .texto { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.mazo .texto small { color: var(--muted); font-size: .8rem; }
.sin-mazo { color: var(--muted); font-style: italic; }

/* ---- TOP final ---- */
.top-lista { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.top-fila { display: grid; grid-template-columns: 3rem 1fr minmax(0, 1.2fr) auto; align-items: center; gap: .9rem; background: var(--surface); border: 1px solid var(--line);
            border-radius: 14px; padding: .7rem 1rem; box-shadow: var(--shadow); }
.top-fila .pos { font-size: 1.4rem; font-weight: 900; color: var(--heading); text-align: center; }
.top-fila.p1 { border-color: var(--t-oro); background: linear-gradient(90deg, color-mix(in srgb, var(--t-oro) 18%, var(--surface)), var(--surface) 60%); }
.top-fila .nombre { font-weight: 700; overflow-wrap: anywhere; }
.top-fila .record { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Estadísticas de mazos ---- */
.barra-fila { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr auto; align-items: center; gap: .8rem; padding: .45rem 0; }
.barra-fila + .barra-fila { border-top: 1px solid var(--line); }
.barra-fondo { background: var(--surface-2); border-radius: 6px; height: 16px; overflow: hidden; }
.barra { background: var(--banda-grad); height: 100%; border-radius: 6px; }
.barra-fila .cifra { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }
.variantes { margin: .2rem 0 .3rem 2.6rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.variante { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; padding: .15rem .55rem .15rem .25rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }

/* ---- Logo en la pantalla grande ---- */
.logo { position: relative; display: grid; place-items: center; overflow: hidden; }
.logo img { width: 100%; height: 100%; object-fit: contain; }

@media (max-width: 620px) {
    .lista-pareos { grid-template-columns: 1fr; }
    .jug { padding: 0 .4rem; } .jug .nombre { font-size: .98rem; }
    .barra-fila { grid-template-columns: 1fr auto; }
    .barra-fila .barra-fondo { grid-column: 1 / -1; grid-row: 2; }
    .variantes { margin-left: 0; }
    .top-fila { grid-template-columns: 2.4rem 1fr auto; row-gap: .3rem; }
    .top-fila .mazo-celda { grid-column: 2 / -1; grid-row: 2; }
}

/* ==========================================================================
   ESTILO DE MARCA (detalles que le dan personalidad a todas las páginas)
   ========================================================================== */
/* Franja de color bajo la barra superior */
.topbar { border-bottom: 4px solid transparent; border-image: var(--banda-grad) 1; }

/* Botón «regresar»: pastilla con flecha */
.volver { display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1.1rem; padding: .35rem 1rem .35rem .35rem; border-radius: 999px;
          background: var(--surface); border: 1px solid var(--line); color: var(--heading); font-weight: 800; font-size: .92rem; text-decoration: none;
          box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.volver::before { content: "‹"; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--banda-grad);
                  color: #fff; font-size: 1.35rem; line-height: 1; padding-bottom: 2px; }
.volver:hover { transform: translateX(-3px); border-color: var(--accent); }

/* Títulos de sección: dado d20 en el rótulo y barrita de color bajo el título */
.eyebrow { display: flex; align-items: center; gap: .45rem; }
.eyebrow::before { content: ""; width: 1.1rem; height: 1.1rem; flex: none; background: url("/web/img/iconologo.png") center / contain no-repeat; }
.cabeza-torneo .eyebrow::before { display: none; }
.section-head h1::after, .section-head h2::after { content: ""; display: block; width: 64px; height: 5px; margin-top: .55rem;
                                                   border-radius: 5px; background: var(--banda-grad); }
.section-head h2::after { width: 46px; height: 4px; }

/* Tarjetas que se elevan al pasar el mouse */
.t-card, .event, .stat, a.tarjeta, .card, .top-fila, .pareo { transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.t-card:hover, .event:hover, a.tarjeta:hover, .card:hover, .top-fila:hover { transform: translateY(-3px); box-shadow: 0 16px 34px #102b5926; }
.stat strong { background: var(--banda-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat strong.texto { color: var(--heading); background: none; }
@media (prefers-reduced-motion: reduce) { .t-card, .event, .stat, a.tarjeta, .card, .top-fila, .pareo, .volver { transition: none; } }

/* Banner de la portada: a todo lo ancho de la pantalla */
.banner-hero { position: relative; background: #1a1418; box-shadow: 0 18px 40px #0b1f3f40; }
.banner-hero img { display: block; width: 100%; height: auto; max-height: min(80vh, 820px); object-fit: cover; object-position: center bottom; }
.banner-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
                      background: linear-gradient(180deg, #00000059 0%, #0000 30%, #0000 70%, #00000033 100%); }
/* Arriba a la derecha: primero «En curso ahora», debajo los botones */
.banner-capa { position: absolute; z-index: 1; top: 22px; right: max(16px, calc((100vw - 1160px) / 2)); width: min(460px, calc(100% - 32px));
               display: flex; flex-direction: column; align-items: flex-end; gap: .7rem; }
.banner-capa #enCurso:empty { display: none; }
.banner-capa .en-curso { margin: 0; width: 100%; backdrop-filter: blur(6px); background: #0b1f3fcc; border: 1px solid #ffffff2e; }
.banner-acciones { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.banner-acciones .btn { box-shadow: 0 8px 20px #0005; }
.banner-acciones .btn:not(.primary) { background: #ffffffe6; color: #102b59; border-color: transparent; }
@media (max-width: 700px) {
    .banner-capa { position: static; width: auto; padding: .8rem; background: #1a1418; align-items: stretch; }
    .banner-acciones .btn { flex: 1; }
}

/* Pie de página */
.footer { border-top: 4px solid transparent; border-image: var(--banda-grad) 1; }
.footer .pie { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem; align-items: center; }
.footer .pie img { height: 54px; width: auto; background: var(--topbar); padding: .35rem .6rem; border-radius: 12px; }
.footer .pie p { margin: 0; color: #b8cbe6; font-size: .9rem; }
.footer .pie nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer .pie nav a { color: #fff; font-weight: 700; text-decoration: none; }
.footer .pie nav a:hover { color: var(--accent-2); }
@media (max-width: 700px) { .footer .pie { grid-template-columns: 1fr; text-align: center; justify-items: center; } }
