/* ============================================================================
   Barlin Games — public Game Directory
   ----------------------------------------------------------------------------
   Loaded only by the game pages, via @push('styles'), so no other page pays for
   it and no existing stylesheet is edited. Inherits the tokens article.css
   already defines (--ba-red, --ba-ink, --ba-line …) and only adds what the
   directory and the game detail page need on top.
   ========================================================================== */

:root {
    --bg-radius: 14px;
    --bg-gap: 18px;
}

/* ── Directory head ─────────────────────────────────────────────────────── */

.bg-dir { max-width: 1240px; margin: 0 auto; padding: 26px 18px 64px; }

.bg-dirhead { margin-bottom: 22px; }
.bg-dirhead h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 900; letter-spacing: -.02em; margin: 10px 0 6px; }
.bg-dirintro { color: var(--ba-muted, #6b7280); max-width: 68ch; line-height: 1.6; margin: 0 0 8px; }
.bg-dircount { color: var(--ba-muted, #6b7280); font-size: 13px; font-weight: 600; margin: 0; }

/* ── Collection chips ───────────────────────────────────────────────────── */

.bg-collections { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.bg-coll {
    display: inline-flex; align-items: center; padding: 8px 14px;
    border: 1px solid var(--ba-line, #e6e8ec); border-radius: 999px;
    font-size: 13px; font-weight: 700; color: var(--ba-ink, #12141a);
    text-decoration: none; background: #fff; transition: .15s ease;
}
.bg-coll:hover { border-color: var(--ba-red, #e51b23); color: var(--ba-red, #e51b23); }

/* ── Layout ─────────────────────────────────────────────────────────────── */

.bg-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 26px; align-items: start; }

.bg-facets {
    position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px;
    padding: 16px; border: 1px solid var(--ba-line, #e6e8ec); border-radius: var(--bg-radius); background: #fff;
}
.bg-facet { display: flex; flex-direction: column; gap: 6px; }
.bg-flabel { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ba-muted, #6b7280); }
.bg-input {
    width: 100%; padding: 9px 11px; font-size: 14px; color: var(--ba-ink, #12141a);
    border: 1px solid var(--ba-line, #e6e8ec); border-radius: 10px; background: #fff;
}
.bg-input:focus { outline: none; border-color: var(--ba-red, #e51b23); box-shadow: 0 0 0 3px rgba(229, 27, 35, .12); }
.bg-clear {
    align-self: flex-start; padding: 8px 14px; border: 1px solid var(--ba-line, #e6e8ec);
    border-radius: 999px; background: #fff; font-size: 13px; font-weight: 700;
    color: var(--ba-red, #e51b23); cursor: pointer; text-decoration: none;
}

.bg-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 14px; }
.bg-sortsel { width: auto; min-width: 170px; }

/* ── Grid ───────────────────────────────────────────────────────────────── */

.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--bg-gap); }

.bg-card { display: flex; flex-direction: column; gap: 8px; }
.bg-card-link { text-decoration: none; color: inherit; display: block; }
.bg-card-media {
    position: relative; display: block; aspect-ratio: 3 / 4; overflow: hidden;
    border-radius: var(--bg-radius); background: #f2f3f5; border: 1px solid var(--ba-line, #e6e8ec);
}
.bg-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.bg-card-link:hover .bg-card-media img { transform: scale(1.04); }
.bg-card-score {
    position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 999px;
    background: var(--ba-red, #e51b23); color: #fff; font-size: 12px; font-weight: 800;
}
.bg-card-title { font-size: 15px; font-weight: 800; line-height: 1.3; margin: 0; }
.bg-card-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ba-muted, #6b7280); }
.bg-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; display: inline-block; }
.bg-card-plats { display: flex; flex-wrap: wrap; gap: 5px; }
.bg-plat {
    font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px;
    background: #f4f5f7; color: var(--ba-muted, #6b7280);
}

.bg-empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--ba-line, #e6e8ec); border-radius: var(--bg-radius); }
.bg-empty h2 { font-size: 20px; font-weight: 800; margin: 0 0 8px; }
.bg-empty p { color: var(--ba-muted, #6b7280); margin: 0 0 16px; }

.bg-pager { margin-top: 28px; display: flex; justify-content: center; }

/* ── Game detail ────────────────────────────────────────────────────────── */

.ba-game-hero { position: relative; overflow: hidden; border-radius: 0 0 18px 18px; }
.ba-game-banner {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    filter: saturate(1.05); opacity: .28;
}
.ba-game-heroin {
    position: relative; display: grid; grid-template-columns: 220px minmax(0, 1fr);
    gap: 26px; max-width: 1240px; margin: 0 auto; padding: 34px 18px;
}
.ba-game-cover { width: 220px; height: auto; border-radius: var(--bg-radius); box-shadow: 0 12px 34px rgba(0, 0, 0, .18); }
.ba-game-herotx h1 { font-size: clamp(28px, 4.4vw, 44px); font-weight: 900; letter-spacing: -.02em; margin: 10px 0 8px; }
.ba-game-lede { color: var(--ba-muted, #6b7280); max-width: 70ch; line-height: 1.6; margin: 0 0 14px; }

.ba-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ba-badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px;
    background: #fff; border: 1px solid var(--ba-line, #e6e8ec); font-size: 12px; font-weight: 700;
    color: var(--ba-ink, #12141a); text-decoration: none;
}
.ba-badge-score { background: var(--ba-red, #e51b23); border-color: var(--ba-red, #e51b23); color: #fff; }

.ba-game-facts { display: flex; flex-wrap: wrap; gap: 22px; margin: 0 0 18px; }
.ba-game-facts dt { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ba-muted, #6b7280); }
.ba-game-facts dd { margin: 2px 0 0; font-size: 14px; font-weight: 700; }
.ba-game-cta { display: flex; flex-wrap: wrap; gap: 10px; }

.ba-specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.ba-spec { border: 1px solid var(--ba-line, #e6e8ec); border-radius: var(--bg-radius); padding: 16px; }
.ba-spec h3 { font-size: 14px; font-weight: 800; margin: 0 0 10px; }
.ba-spec dl > div { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--ba-line, #e6e8ec); }
.ba-spec dl > div:first-child { border-top: 0; }
.ba-spec dt { min-width: 92px; font-size: 12px; font-weight: 800; color: var(--ba-muted, #6b7280); }
.ba-spec dd { margin: 0; font-size: 13px; }

.ba-platformlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ba-platformlist li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ba-muted { color: var(--ba-muted, #6b7280); font-size: 12px; }

.ba-preview-bar {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    padding: 10px 16px; background: #fff4e5; border-bottom: 1px solid #f5c98a;
    color: #8a5300; font-size: 13px; font-weight: 700;
}

/* ── Dark mode ──────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    .bg-coll, .bg-facets, .bg-input, .bg-clear, .ba-badge { background: #14161c; }
    .bg-card-media { background: #14161c; }
    .bg-plat { background: #1b1e26; }
}

html.theme-dark .bg-coll,
html.theme-dark .bg-facets,
html.theme-dark .bg-input,
html.theme-dark .bg-clear,
html.theme-dark .ba-badge { background: #14161c; }
html.theme-dark .bg-card-media { background: #14161c; }
html.theme-dark .bg-plat { background: #1b1e26; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .bg-layout { grid-template-columns: 1fr; }
    .bg-facets { position: static; }
    .ba-game-heroin { grid-template-columns: 1fr; justify-items: start; }
    .ba-game-cover { width: 160px; }
}

@media (max-width: 520px) {
    .bg-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}
