/* Rodamer Play — estilos del sitio (catálogo, cuenta, biblioteca, salas y panel). Los juegos usan marco.css. */
:root {
    --fondo: #070a12;
    --fondo-2: #0b101c;
    --panel: #111827;
    --panel-2: #182236;
    --borde: rgba(255, 255, 255, .09);
    --borde-fuerte: rgba(255, 255, 255, .2);
    --texto: #eef2f9;
    --suave: #9aa7bd;
    --acento: #ffb020;
    --acento-2: #ff7a3d;
    --acento-texto: #1a1200;
    --frio: #6aa9ff;
    --enlace: #8fbcff;
    --bien: #4fd18b;
    --bien-fondo: rgba(79, 209, 139, .12);
    --mal: #ff8a80;
    --mal-fondo: rgba(255, 122, 112, .12);
    --espera: #ffc861;
    --espera-fondo: rgba(255, 200, 97, .12);
    --radio: 14px;
    --sombra: 0 18px 50px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 500px at 85% -5%, rgba(255, 122, 61, .13), transparent 60%),
        radial-gradient(900px 600px at 5% 0%, rgba(106, 169, 255, .12), transparent 60%),
        var(--fondo);
    background-attachment: fixed;
    color: var(--texto);
    font: 16px/1.55 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--enlace); text-underline-offset: 3px; }
a:hover { color: #b9d5ff; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); font-weight: 800; letter-spacing: -.015em; line-height: 1.15; margin: 0 0 .75rem; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 .6rem; }
h3 { font-size: 1.08rem; font-weight: 700; margin: 0; }
small { color: var(--suave); display: block; }
code { background: rgba(0, 0, 0, .35); border: 1px solid var(--borde); border-radius: 6px; padding: .1rem .4rem; word-break: break-all; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--frio); outline-offset: 3px; border-radius: 4px; }

/* ---------- Barra de progreso al navegar o enviar ---------- */
.progreso { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .2s; }
.progreso::before { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, var(--acento), var(--acento-2)); border-radius: 3px; }
.progreso.activo { opacity: 1; }
.progreso.activo::before { animation: correr 1.1s ease-in-out infinite; }
@keyframes correr { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Barra superior ---------- */
.barra {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: .7rem clamp(1rem, 4vw, 2.5rem);
    background: rgba(7, 10, 18, .78);
    border-bottom: 1px solid var(--borde);
    backdrop-filter: blur(14px);
}
.marca { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--texto); text-decoration: none; letter-spacing: -.01em; }
.marca:hover { color: var(--texto); }
.marca i { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; background: linear-gradient(135deg, var(--acento), var(--acento-2)); color: var(--acento-texto); font-style: normal; font-size: .95rem; }
.marca-icono { width: 2rem; height: 2rem; border-radius: 9px; box-shadow: 0 4px 14px rgba(255, 122, 61, .3); }
.marca span { color: var(--acento); }
.barra nav { display: flex; gap: .25rem; flex: 1; }
.barra nav a { padding: .45rem .8rem; border-radius: 9px; color: var(--suave); text-decoration: none; font-weight: 600; font-size: .96rem; transition: background .15s, color .15s; }
.barra nav a:hover { color: var(--texto); background: rgba(255, 255, 255, .06); }
.barra nav a.aqui { color: var(--texto); background: rgba(255, 255, 255, .09); }
.sesion { display: flex; align-items: center; gap: .75rem; }
.sesion > a:not(.boton) { color: var(--suave); text-decoration: none; font-weight: 600; }
.sesion > a:not(.boton):hover { color: var(--texto); }
.avatar { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--borde-fuerte); color: var(--acento); font-weight: 800; text-transform: uppercase; }

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.75rem clamp(1rem, 4vw, 2.5rem) 4rem; flex: 1; }
footer { padding: 1.5rem; color: var(--suave); font-size: .9rem; text-align: center; border-top: 1px solid var(--borde); }

/* ---------- Avisos ---------- */
.avisos { position: fixed; top: 4.4rem; right: 1rem; z-index: 50; display: flex; flex-direction: column; gap: .5rem; width: min(24rem, calc(100vw - 2rem)); }
.aviso {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .8rem 1rem;
    border: 1px solid var(--borde-fuerte);
    border-left-width: 4px;
    border-radius: 12px;
    background: var(--panel-2);
    box-shadow: var(--sombra);
    animation: entrar .3s cubic-bezier(.2, .9, .3, 1.2);
}
.aviso.bien { border-left-color: var(--bien); }
.aviso.mal { border-left-color: var(--mal); }
.aviso p { margin: 0; flex: 1; }
.aviso button { background: none; border: none; color: var(--suave); padding: 0 .2rem; font-size: 1.1rem; min-height: 0; cursor: pointer; }
.aviso.saliendo { opacity: 0; transform: translateX(20px); transition: opacity .3s, transform .3s; }
@keyframes entrar { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------- Portada del catálogo ---------- */
.portada {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: clamp(1.25rem, 4vw, 3rem);
    align-items: center;
    padding: clamp(1rem, 3vw, 2.5rem) 0 2.25rem;
}
.portada .antetitulo, .antetitulo { margin: 0 0 .6rem; color: var(--acento); font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.portada h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.04; margin-bottom: 1rem; }
.portada h1 em { font-style: normal; background: linear-gradient(120deg, var(--acento), var(--acento-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.portada p { color: var(--suave); font-size: 1.12rem; margin: 0 0 1.4rem; max-width: 34rem; }
.ventajas { display: flex; gap: 1.25rem; flex-wrap: wrap; margin: 1.4rem 0 0; padding: 0; list-style: none; color: var(--suave); font-size: .95rem; }
.ventajas li::before { content: "✓"; color: var(--bien); font-weight: 800; margin-right: .4rem; }
.destacado {
    position: relative;
    display: block;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--borde-fuerte);
    box-shadow: var(--sombra), 0 0 80px rgba(255, 122, 61, .12);
    color: var(--texto);
    text-decoration: none;
    transition: transform .25s, box-shadow .25s;
}
.destacado:hover { transform: translateY(-4px) scale(1.01); color: var(--texto); }
.destacado img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.destacado-texto { position: absolute; inset: auto 0 0 0; padding: 2.5rem 1.2rem 1.1rem; background: linear-gradient(transparent, rgba(5, 8, 14, .95) 62%); }
.destacado-texto small { color: var(--acento); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; }
.destacado-texto strong { display: block; font-size: 1.5rem; font-weight: 800; }
.destacado-texto span { color: var(--suave); font-size: .95rem; }

/* ---------- Filtros y secciones ---------- */
.filtros { display: flex; flex-direction: column; gap: .55rem; margin: 0 0 1.5rem; padding: .9rem 1rem; background: rgba(255, 255, 255, .03); border: 1px solid var(--borde); border-radius: var(--radio); }
.filtros div { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.filtros div::before { content: attr(data-nombre); color: var(--suave); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-right: .4rem; min-width: 3.2rem; }
.filtro { padding: .3rem .9rem; border: 1px solid var(--borde); border-radius: 999px; color: var(--suave); text-decoration: none; font-size: .93rem; font-weight: 600; transition: all .15s; }
.filtro:hover { color: var(--texto); border-color: var(--borde-fuerte); background: rgba(255, 255, 255, .05); }
.filtro.activo { background: linear-gradient(135deg, var(--acento), var(--acento-2)); border-color: transparent; color: var(--acento-texto); }
.seccion { font-size: 1.35rem; font-weight: 800; margin: 2rem 0 0; display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.seccion small, h2 small { display: inline; font-size: .9rem; font-weight: 400; color: var(--suave); }

/* ---------- Fichas de juego ---------- */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.2rem; margin: 1rem 0 1.5rem; }
.ficha {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    overflow: hidden;
    color: var(--texto);
    text-decoration: none;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
a.ficha:hover, a.ficha:focus-visible, div.ficha:hover { transform: translateY(-5px); border-color: rgba(255, 176, 32, .55); box-shadow: var(--sombra); color: var(--texto); }
.ficha-portada { position: relative; overflow: hidden; background: var(--panel-2); }
.ficha img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .35s; }
.ficha:hover img { transform: scale(1.06); }
.etiqueta-precio { position: absolute; top: .6rem; right: .6rem; padding: .2rem .7rem; border-radius: 999px; background: rgba(5, 8, 14, .82); border: 1px solid var(--borde-fuerte); color: var(--acento); font-weight: 800; font-size: .88rem; backdrop-filter: blur(6px); }
.etiqueta-precio.gratis { color: var(--bien); }
.etiqueta-precio.mio { color: var(--texto); background: rgba(79, 209, 139, .28); border-color: rgba(79, 209, 139, .6); }
.ficha-texto { display: flex; flex-direction: column; gap: .45rem; padding: .9rem 1rem 1rem; flex: 1; }
.ficha-texto p { margin: 0; color: var(--suave); font-size: .94rem; flex: 1; }
.ficha-pie { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .45rem; flex-wrap: wrap; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin: 0; }
.ruta { color: var(--suave); font-size: .9rem; margin: 0 0 .9rem; }
.ruta a { color: var(--suave); }

.precio { color: var(--acento); font-weight: 800; }
.precio.grande { font-size: 2rem; margin: 0 0 .5rem; line-height: 1.1; }
.precio small { display: inline; font-size: .9rem; font-weight: 500; }

/* ---------- Página de un juego ---------- */
.heroe { position: relative; margin: 0 0 1.25rem; border: 1px solid var(--borde); border-radius: 22px; overflow: hidden; background: var(--panel); }
.heroe-fondo { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(42px) saturate(1.2); opacity: .42; }
.detalle { position: relative; display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(1rem, 3vw, 2rem); align-items: center; padding: clamp(1rem, 3vw, 2rem); }
.detalle-portada { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; border: 1px solid var(--borde-fuerte); box-shadow: var(--sombra); }
.detalle-texto h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; }
.resumen { color: #c6d0e2; font-size: 1.08rem; margin: 0 0 .9rem; }
.descripcion, .instrucciones { white-space: pre-line; color: #c6d0e2; }
.compra { display: flex; flex-direction: column; gap: .6rem; margin: 1.1rem 0 0; background: rgba(7, 10, 18, .6); backdrop-filter: blur(8px); }
.compra form { margin: 0; }
.compra .boton, .compra button { width: 100%; }

/* ---------- Tarjetas y formularios ---------- */
.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.2rem 1.35rem; margin: 1rem 0; }
.tarjeta.estrecha { max-width: 440px; margin: clamp(1rem, 6vh, 3.5rem) auto; padding: 1.8rem 1.6rem; box-shadow: var(--sombra); border-color: var(--borde-fuerte); }
.tarjeta.estrecha h1 { text-align: center; }
.tarjeta.estrecha > p { text-align: center; color: var(--suave); }
.tarjeta p { margin: .4rem 0; }

label { display: block; font-weight: 600; margin: .95rem 0 .3rem; font-size: .95rem; }
input, select, textarea {
    width: 100%;
    padding: .65rem .8rem;
    border: 1px solid var(--borde-fuerte);
    border-radius: 10px;
    background: rgba(0, 0, 0, .3);
    color: var(--texto);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--frio); box-shadow: 0 0 0 3px rgba(106, 169, 255, .22); }
select option { background: var(--panel); }
textarea { resize: vertical; }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--acento); }
.casilla { display: flex; align-items: center; gap: .5rem; padding-top: 1.9rem; }
.casilla label { margin: 0; }
.dos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }

/* ---------- Botones ---------- */
button, .boton {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.6rem;
    padding: .55rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--acento), var(--acento-2));
    color: var(--acento-texto);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: transform .12s, filter .12s, background .15s;
}
button:hover, .boton:hover { filter: brightness(1.08); transform: translateY(-1px); color: var(--acento-texto); }
button:active, .boton:active { transform: translateY(1px); }
.boton.grande, button.grande { min-height: 3.2rem; padding: .8rem 1.6rem; font-size: 1.08rem; border-radius: 12px; }
.boton.pequeno, button.pequeno { min-height: 2rem; padding: .25rem .75rem; font-size: .9rem; border-radius: 8px; }
.boton.secundario, button.secundario { background: rgba(255, 255, 255, .06); border-color: var(--borde-fuerte); color: var(--texto); }
.boton.secundario:hover, button.secundario:hover { background: rgba(255, 255, 255, .12); color: var(--texto); }
button.enlace { background: none; border: none; color: var(--suave); padding: 0; font-weight: 600; min-height: 0; }
button.enlace:hover { color: var(--texto); transform: none; }
form > button.grande { margin-top: 1.2rem; width: 100%; }
/* Mientras se envía: el botón se bloquea y muestra un giro */
.enviando { pointer-events: none; color: transparent !important; }
.enviando::after { content: ""; position: absolute; width: 1.15rem; height: 1.15rem; border: 3px solid rgba(26, 18, 0, .3); border-top-color: var(--acento-texto); border-radius: 50%; animation: girar .7s linear infinite; }
.secundario.enviando::after { border-color: rgba(255, 255, 255, .25); border-top-color: var(--texto); }
@keyframes girar { to { transform: rotate(360deg); } }

.acciones { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.tarjeta form > .acciones { margin-top: 1.1rem; }
td .acciones input { min-width: 150px; flex: 1; padding: .3rem .5rem; }
.busqueda { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.busqueda select { width: auto; }
.busqueda input { flex: 1; min-width: 200px; }
.tarjeta .busqueda { margin-bottom: 0; }

.pestanas { display: flex; gap: .25rem; margin: 0 0 1.25rem; flex-wrap: wrap; padding: .3rem; background: rgba(255, 255, 255, .04); border: 1px solid var(--borde); border-radius: 12px; width: fit-content; max-width: 100%; }
.pestanas a { padding: .45rem .95rem; color: var(--suave); text-decoration: none; border-radius: 9px; font-weight: 600; font-size: .95rem; }
.pestanas a:hover { color: var(--texto); }
.pestanas a.activa { color: var(--acento-texto); background: linear-gradient(135deg, var(--acento), var(--acento-2)); }

.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 1rem; }
.cifras .tarjeta { margin: 0; color: var(--suave); }
.cifra { font-size: 2rem; font-weight: 800; color: var(--texto); letter-spacing: -.02em; }

.nota { padding: .75rem .95rem; border-radius: 10px; border: 1px solid var(--borde); background: rgba(255, 255, 255, .04); margin: .8rem 0; }
.nota p { margin: .25rem 0; }
.nota.bien { background: var(--bien-fondo); border-color: rgba(79, 209, 139, .45); color: var(--bien); }
.nota.mal { background: var(--mal-fondo); border-color: rgba(255, 122, 112, .45); color: var(--mal); }
.nota.espera { background: var(--espera-fondo); border-color: rgba(255, 200, 97, .45); color: var(--espera); }
.nota a { color: inherit; }

.chip { display: inline-block; padding: .1rem .6rem; border-radius: 999px; border: 1px solid var(--borde); background: rgba(255, 255, 255, .05); color: var(--suave); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.chip.bien { background: var(--bien-fondo); border-color: rgba(79, 209, 139, .45); color: var(--bien); }
.chip.mal { background: var(--mal-fondo); border-color: rgba(255, 122, 112, .45); color: var(--mal); }
.chip.espera { background: var(--espera-fondo); border-color: rgba(255, 200, 97, .45); color: var(--espera); }

.tabla { overflow-x: auto; background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); }
.tarjeta .tabla { border: none; background: none; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .85rem; border-bottom: 1px solid var(--borde); vertical-align: top; }
th { font-size: .78rem; color: var(--suave); white-space: nowrap; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }

.vacio { color: var(--suave); }
.vacio.grande { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--borde-fuerte); border-radius: var(--radio); }

/* ---------- Salas ---------- */
.competir { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.competir .tarjeta { margin: 0 0 1rem; }
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: flex; align-items: center; gap: .8rem; padding: .55rem .6rem; border-bottom: 1px solid var(--borde); }
.ranking li:last-child { border-bottom: none; }
.ranking li.yo { background: rgba(255, 176, 32, .09); border-radius: 10px; border-bottom-color: transparent; }
.ranking li.salto { justify-content: center; color: var(--suave); padding: 0; }
.ranking .posicion { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); color: var(--suave); font-weight: 800; font-size: .9rem; flex: none; }
.ranking .posicion.podio { background: linear-gradient(135deg, var(--acento), var(--acento-2)); color: var(--acento-texto); }
.ranking .nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ranking strong { color: var(--acento); font-variant-numeric: tabular-nums; white-space: nowrap; }
.copiar { display: flex; gap: .5rem; }
.copiar input { flex: 1; min-width: 0; }
.separado { margin-top: 1.5rem; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 820px) {
    .portada, .detalle, .competir { grid-template-columns: 1fr; }
    .dos, .tres { grid-template-columns: 1fr; }
    .casilla { padding-top: .9rem; }
    .barra { gap: .6rem; flex-wrap: wrap; }
    .barra nav { order: 3; flex-basis: 100%; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .enviando::after { animation-duration: 1.4s !important; }
}
