/* Juegos de Navegador: portal compacto adaptado de Browser Games List. */
:root {
    color-scheme: light;
    --canvas: #f7f8fc;
    --surface: #fff;
    --soft: #f0f3fb;
    --ink: #12142a;
    --muted: #4f5670;
    --line: #d0d6e8;
    --link: #4338ca;
    --link-hover: #312e81;
    --masthead: #1e1b4b;
    --navigation: #2e285e;
    --nav-text: #eeebff;
    --nav-active: #c4b5fd;
    --radius: 4px;
    --container: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 12px; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font: 15px/1.55 system-ui, sans-serif;
}
img, svg { max-width: 100%; }
img { display: block; height: auto; }
a { color: var(--link); }
a:hover { color: var(--link-hover); }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
[id] { scroll-margin-top: 12px; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.48rem, 3vw, 1.9rem); }
h2 { margin: 0 0 .65rem; font-size: 1.15rem; }
h3 { margin: 0 0 .5rem; font-size: 1rem; }
p { margin: 0 0 .8rem; }

.container { width: min(calc(100% - 32px), var(--container)); margin-inline: auto; }
.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    padding: 8px 12px;
    background: var(--surface);
    transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* Masthead, navigation and native search (usable without JavaScript). */
.site-header { background: var(--masthead); color: #fff; }
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding-block: 8px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
}
.brand:hover { color: inherit; text-decoration: underline; }
.brand img { flex: none; }
.brand__copy { display: grid; line-height: 1.25; }
.brand__sub { font-size: .78rem; font-weight: 400; }
.header-search, .page-search {
    display: flex;
    width: min(100%, 390px);
    gap: 6px;
    align-items: stretch;
}
.header-search input, .page-search input {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    padding: 6px 10px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.header-search button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 5px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.header-search button { color: var(--ink); background: #ede9fe; }
.header-search button:hover { background: #fff; }
.site-header :focus-visible { outline-color: var(--nav-active); }
.nav-bar { background: var(--navigation); border-top: 1px solid #514883; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 4px; }
.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border-bottom: 2px solid transparent;
    color: var(--nav-text);
    font-size: .92rem;
    text-decoration: none;
}
.site-nav a:hover, .site-nav a.is-active, .site-nav a[aria-current] {
    color: #fff;
    border-bottom-color: var(--nav-active);
}
.btn--primary { color: #fff; background: var(--link); }
.btn--primary:hover { color: #fff; background: var(--link-hover); }
.btn--ghost { color: var(--link); background: var(--surface); border-color: var(--line); }
.btn--ghost:hover { background: var(--soft); }
.page-search > svg { display: none; }

/* Directory and filters. */
.game-directory, .page-head { padding-block: 16px 20px; }
.section-heading--split {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 10px;
}
.section-heading--split h2 { margin-bottom: 0; }
.section-note, .page-head__lede, .archive-note, .breadcrumb, .game-card__status {
    color: var(--muted);
    font-size: .87rem;
}
.page-head__lede { margin: .4rem 0 0; }
.directory-intro, .strategy-intro { max-width: 70ch; margin: 0 0 12px; }
.strategy-intro { margin-top: 6px; }
.strategy-group, .directory-group + .directory-group { margin-top: 18px; }
.strategy-group > p { max-width: 74ch; }
.pagination-jump { margin-top: 8px; }
.pagination-jump summary { width: fit-content; color: var(--link); cursor: pointer; }
.pagination-jump .pagination { margin-top: 6px; }
.category-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    margin-bottom: 12px;
    padding: 2px 6px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.category-nav__label { padding: 0 4px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.category-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 2px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.category-nav a {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 2px 8px;
    color: var(--link);
    border-bottom: 2px solid transparent;
    font-size: .88rem;
    text-decoration: none;
}
.category-nav a:hover, .category-nav a[aria-current] {
    background: var(--soft);
    border-bottom-color: var(--link);
    color: var(--link-hover);
}
.category-nav a[aria-current] { font-weight: 650; }
.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.game-card {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.game-card:focus-within, .game-card:hover { border-color: #899baa; }
.game-card__media {
    display: block;
    overflow: hidden;
    border-radius: 3px 3px 0 0;
    background: #d9e0e6;
    aspect-ratio: 16 / 9;
}
.game-card__media picture { display: block; height: 100%; }
.game-card__media img { width: 100%; height: 100%; object-fit: cover; }
.game-card__placeholder, .game-hero__placeholder, .sidebar-games__fallback {
    display: grid;
    place-items: center;
    height: 100%;
    color: #405262;
    background: #d9e0e6;
    font-weight: 700;
}
.game-card__body { padding: 9px 10px 10px; }
.game-card__title { margin: 0; font-size: 1rem; }
.game-card__title a { text-decoration: none; }
.game-card__title a:hover { text-decoration: underline; }
.game-card__excerpt { margin: 4px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.4; overflow-wrap: anywhere; }
.game-card__status { margin: 4px 0 0; font-weight: 600; }
.empty-state { padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.archive-note { margin: 12px 0 0; }
.pagination { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 14px; }
.page-link, .page-ellipsis {
    display: inline-flex;
    min-width: 36px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 7px;
    font-size: .88rem;
}
.page-link { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.page-link:hover { border-color: #899baa; }
.page-link.is-current { color: #fff; background: var(--link); border-color: var(--link); }
.page-link.is-disabled { color: var(--muted); background: var(--soft); }
.breadcrumb { margin: 0 0 7px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px 7px; list-style: none; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 7px; }
.archive-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 0 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.archive-list li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }

/* Sponsored listings and reference material sit after the directory. */
.spotlight { padding-block: 10px 18px; }
.spotlight-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.spotlight-card {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    height: 100%;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    text-decoration: none;
}
.spotlight-card:hover { border-color: #899baa; }
.spotlight-card:hover strong { text-decoration: underline; }
.spotlight-card img, .spotlight-card__fallback { flex: none; width: 60px; }
.spotlight-card__fallback {
    display: grid;
    place-items: center;
    height: 45px;
    background: var(--soft);
}
.spotlight-card__body { display: grid; gap: 2px; overflow-wrap: anywhere; }
.spotlight-card__body > span { color: var(--muted); font-size: .8rem; line-height: 1.4; }
.directory-reference {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-bottom: 18px;
}
.content-panel, .faq, .prose--game, .sidebar-games {
    min-width: 0;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.content-panel__body { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.content-panel .faq { margin-top: 16px; }
.feature-list { display: grid; align-content: start; gap: 10px; }
.feature { display: flex; gap: 6px; }
.feature__icon { flex: none; color: var(--link); }
.feature strong, .feature span { display: block; }
.feature div > span { color: var(--muted); }
.kicker { color: var(--muted); font-size: .8rem; }
.prose p:last-child, .prose ul:last-child, .faq__item p:last-child { margin-bottom: 0; }
.prose ul { margin: 0 0 .8rem; padding-left: 1.2rem; }
.prose li + li { margin-top: 4px; }
.faq__item { border-top: 1px solid var(--line); }
.faq__item summary { padding: 8px 0; cursor: pointer; font-weight: 600; }
.faq__item p { padding: 0 0 8px; }

/* Game profiles, screenshots and alternatives. */
.game-detail { padding: 12px 0 14px; }
.game-hero { margin-bottom: 12px; }
.game-status { margin: 8px 0 3px; }
.game-hero__lede, .game-hero__note { margin: 5px 0 0; color: var(--muted); }
.game-hero__note { margin: 0; font-size: .83rem; }
.game-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; }
.game-hero__media {
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    background: #1f2a36;
    border: 1px solid var(--line);
}
.game-hero__media picture { display: block; }
.game-hero__media img { width: auto; height: auto; max-height: 520px; object-fit: contain; }
.game-hero__placeholder { width: 100%; min-height: 150px; }
.game-body { display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(0, 310px); gap: 14px; }
.game-content, .game-sidebar { min-width: 0; }
.game-sidebar { display: grid; gap: 12px; }
.info-card { padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); }
.info-card dl { margin: 0; }
.info-card dl div { display: flex; justify-content: space-between; gap: 8px; }
.info-card dd { margin: 0; font-weight: 600; }
.sidebar-games ul { margin: 0; padding: 0; list-style: none; }
.sidebar-games li { border-top: 1px solid var(--line); }
.sidebar-games li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.sidebar-games li a:hover { text-decoration: underline; }
.sidebar-games img, .sidebar-games__fallback { flex: none; width: 54px; height: 40px; object-fit: cover; }

/* Keep both ad placements and their dimensions; avoid decorated empty panels. */
.ad-band { margin: 10px 0 18px; }
.ad-band__slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ad-band__label { display: none; }
.ad-slot {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    min-width: 0;
    width: min(100%, 300px);
    margin-inline: auto;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .72rem;
}
.ad-slot__label { margin-bottom: 4px; }
.ad-slot > div { max-width: 100%; overflow: hidden; }

.not-found { padding-block: 18px 10px; }
.not-found__code { color: var(--muted); font-weight: 700; }
.not-found h1 { margin: 0 0 6px; }
.not-found .page-search { margin-bottom: 10px; }

.site-footer {
    margin-top: 12px;
    padding-top: 15px;
    background: var(--soft);
    border-top: 1px solid var(--line);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
.footer-brand .brand { margin-bottom: 6px; }
.footer-pill { color: var(--muted); font-size: .85rem; }
.footer-note, .footer-bottom { color: var(--muted); font-size: .83rem; }
.footer-col h2 { margin-bottom: 4px; font-size: .88rem; }
.footer-col a { display: table; padding: 4px 0; font-size: .87rem; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-top: 12px;
    padding-block: 8px;
    border-top: 1px solid var(--line);
}
.footer-bottom p { margin: 0; }

@media (max-width: 900px) {
    .game-grid, .spotlight-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .game-body, .directory-reference, .content-panel__body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
    .container { width: calc(100% - 24px); }
    .header-inner { flex-wrap: wrap; gap: 8px; }
    .header-search { width: 100%; }
    .site-nav { justify-content: space-between; gap: 0; }
    .site-nav a { min-height: 44px; padding-inline: clamp(3px, 1.5vw, 8px); font-size: .85rem; }
    .game-grid, .spotlight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .game-card__excerpt {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }
    .category-nav { display: block; overflow-x: auto; }
    .category-nav__label { display: none; }
    .category-nav ul { flex-wrap: nowrap; }
    .category-nav a { min-height: 44px; white-space: nowrap; }
    .category-nav a:focus-visible { outline-offset: -2px; }
    .pagination .page-link { min-width: 42px; min-height: 44px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
    .spotlight-card { display: block; }
    .spotlight-card img { margin-bottom: 4px; }
    .page-link--arrow span { display: none; }
}
