:root {
    --brand: #8b2635;
    --brand-dark: #621824;
    --graphite: #303236;
    --accent: #008bc3;
    --accent-hot: #d9562a;
    --gold: #ffd22e;
    --green: #008a3d;
    --lime: #a9bf2c;
    --token-gray: #868b91;
    --ink: #303236;
    --muted: #626970;
    --surface: #f2fbfd;
    --surface-strong: #ffffff;
    --soft: #e2f4f8;
    --line: #d8e8ee;
    --shadow: 0 14px 34px rgba(48, 50, 54, 0.12);
}

body.public-body {
    min-height: 100vh;
    color: var(--ink);
    background: var(--surface);
}

a {
    color: var(--brand);
}

a:hover {
    color: var(--brand-dark);
}

.btn {
    border-radius: 6px;
    font-weight: 650;
}

.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-border-color: var(--brand);
}

.site-navbar {
    position: relative;
    background: var(--surface-strong);
    box-shadow: 0 4px 18px rgba(48, 50, 54, 0.08);
}

.site-navbar::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(
        90deg,
        var(--green) 0 18%,
        var(--accent) 18% 40%,
        var(--brand) 40% 62%,
        var(--accent-hot) 62% 82%,
        var(--gold) 82% 100%
    );
    content: "";
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 800;
}

.brand-logo {
    display: block;
    width: auto;
    height: 3rem;
    object-fit: contain;
}

.brand-name {
    color: var(--ink);
    font-size: 1.05rem;
    letter-spacing: 0;
    white-space: nowrap;
}

.brand-mark {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--brand-dark);
    background: var(--gold);
    font-size: 0.82rem;
}

.site-navbar .nav-link {
    border-bottom: 2px solid transparent;
    color: var(--ink);
    font-weight: 600;
    white-space: nowrap;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
    border-bottom-color: var(--brand);
    color: var(--brand);
}

.site-search {
    width: min(100%, 20rem);
    gap: 0.5rem;
}

.site-search .form-control {
    border-color: var(--line);
    background: var(--surface);
}

.page-shell {
    padding-top: 2rem;
    padding-bottom: 3.5rem;
}

.flash-stack {
    margin-bottom: 1.5rem;
}

.alert {
    border-radius: 8px;
    border: 1px solid transparent;
}

.section-heading {
    max-width: 48rem;
    margin-bottom: 1.4rem;
}

.eyebrow {
    margin-bottom: 0.4rem;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.lead-tight {
    max-width: 44rem;
    color: var(--muted);
}

.home-hero {
    position: relative;
    overflow: hidden;
    min-height: 0;
    padding: 3rem 0 1.75rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.home-hero::before {
    position: absolute;
    top: 1.35rem;
    left: 0;
    width: min(42vw, 18rem);
    height: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        var(--green) 0 22%,
        var(--accent) 22% 46%,
        var(--brand) 46% 70%,
        var(--accent-hot) 70% 100%
    );
    content: "";
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 46rem;
}

.hero-copy h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.4rem, 6vw, 4.75rem);
    font-weight: 850;
    line-height: 0.95;
}

.home-search {
    display: flex;
    width: min(100%, 42rem);
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
}

.home-search .form-control {
    flex: 1;
    border-color: transparent;
    box-shadow: none;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-item {
    padding: 1rem 0;
    border-top: 3px solid var(--accent);
}

.stat-item:nth-child(2) {
    border-top-color: var(--green);
}

.stat-item:nth-child(3) {
    border-top-color: var(--gold);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 820;
    line-height: 1;
}

.stat-label {
    display: block;
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.featured-strip {
    padding-top: 2.4rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.info-tile {
    display: block;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-top: 5px solid var(--accent);
    border-radius: 8px;
    color: var(--ink);
    background: var(--surface-strong);
    box-shadow: 0 8px 22px rgba(24, 36, 33, 0.06);
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.info-tile:hover,
.info-tile:focus {
    border-color: rgba(139, 38, 53, 0.4);
    border-top-color: var(--brand);
    color: var(--ink);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.info-tile:focus-visible {
    outline: 3px solid rgba(242, 201, 76, 0.75);
    outline-offset: 3px;
}

.info-tile h2,
.info-tile h3 {
    margin-bottom: 0.55rem;
    font-size: 1.1rem;
}

.info-tile p {
    margin-bottom: 0;
    color: var(--muted);
}

.info-grid .info-tile:nth-child(2) {
    border-top-color: var(--brand);
}

.info-grid .info-tile:nth-child(3) {
    border-top-color: var(--green);
}

.cover-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
}

.cover-strip-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-cover {
    color: var(--ink);
    text-decoration: none;
}

.mini-cover img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(24, 36, 33, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mini-cover:hover img {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(48, 50, 54, 0.16);
}

.mini-cover span {
    display: block;
    margin-top: 0.55rem;
    font-weight: 700;
    line-height: 1.2;
}

.catalog-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.catalog-count {
    color: var(--muted);
    font-weight: 650;
}

.filter-panel,
.form-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    box-shadow: 0 8px 22px rgba(24, 36, 33, 0.06);
}

.filter-panel {
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr)) auto;
    gap: 0.9rem;
    align-items: end;
}

.filter-grid-expanded {
    grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr));
}

.compact-filter-panel {
    padding: 1rem;
}

.quick-filter-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.8fr) repeat(3, minmax(145px, 1fr)) auto;
    gap: .8rem;
    align-items: end;
}

.advanced-filters {
    border-top: 1px solid var(--line);
    padding-top: .8rem;
}

.advanced-filters summary {
    width: fit-content;
    color: var(--brand);
    cursor: pointer;
    font-weight: 750;
}

.advanced-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .8rem;
}

.active-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: -.5rem 0 1.5rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .4rem .7rem;
    border: 1px solid var(--brand);
    border-radius: 999px;
    color: var(--brand);
    background: #fff;
    font-size: .88rem;
    text-decoration: none;
}

.filter-chip:hover,
.filter-chip:focus-visible {
    color: #fff;
    background: var(--brand);
}

.breadcrumb {
    font-size: 0.92rem;
}

.form-label {
    color: var(--ink);
    font-weight: 700;
}

.form-text {
    color: var(--muted);
}

.game-grid,
.content-grid {
    align-items: stretch;
}

.card {
    border-color: var(--line);
    border-radius: 8px;
}

.game-card,
.content-card {
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(48, 50, 54, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.game-card:hover,
.content-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.game-card:focus-within {
    outline: 3px solid rgba(0, 139, 195, .35);
    outline-offset: 3px;
}

.card-img-top,
.game-card-img {
    width: 100%;
    height: 14rem;
    object-fit: cover;
}

.thanks-logo {
    height: 11rem;
    padding: 1.25rem;
    background: var(--surface-strong);
    object-fit: contain;
}

.placeholder-cover {
    display: flex;
    height: 14rem;
    align-items: center;
    justify-content: center;
    background: var(--soft);
    color: var(--muted);
    font-weight: 700;
}

.placeholder-cover.thanks-placeholder {
    height: 11rem;
    background: var(--surface-strong);
}

.game-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.75rem 0 1rem;
}

.meta-chip {
    display: inline-flex;
    min-height: 1.9rem;
    align-items: center;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface);
    font-size: 0.86rem;
    font-weight: 700;
}

.meta-chip-muted {
    border-style: dashed;
    color: var(--muted);
    background: #f8fbfc;
}

.status-badge {
    border-radius: 6px;
    font-weight: 750;
}

.status-available {
    color: #0f5132;
    background: #d9f2e1;
}

.status-borrowed {
    color: #5d4200;
    background: #fff1b6;
}

.status-maintenance,
.status-unknown {
    color: #495057;
    background: #e9ecef;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.detail-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.detail-cover-placeholder {
    height: auto;
    aspect-ratio: 3 / 4;
    border-radius: 8px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.description,
.article-content {
    line-height: 1.7;
}

.text-preline {
    white-space: pre-line;
}

.article-shell {
    max-width: 52.5rem;
}

.description {
    white-space: pre-line;
}

.form-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 24rem);
    gap: 2rem;
    align-items: start;
}

.form-panel {
    padding: 1.25rem;
}

.summary-panel {
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.summary-panel img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.empty-state {
    padding: 2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
    text-align: center;
}

.empty-state p {
    max-width: 34rem;
    margin-right: auto;
    margin-left: auto;
    color: var(--muted);
}

.thanks-actions,
.social-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.thanks-actions {
    justify-content: center;
}

.social-button {
    display: inline-flex;
    min-height: 2.55rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: var(--surface-strong);
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.social-button span {
    display: inline-flex;
    width: 1.45rem;
    height: 1.45rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    background: var(--graphite);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0;
}

.social-button:hover,
.social-button:focus {
    color: var(--ink);
    box-shadow: 0 10px 24px rgba(48, 50, 54, 0.12);
    transform: translateY(-1px);
}

.social-button:focus-visible {
    outline: 3px solid rgba(242, 201, 76, 0.75);
    outline-offset: 3px;
}

.social-instagram span {
    background: var(--brand);
}

.social-facebook span,
.social-web span {
    background: var(--accent);
}

.social-whatsapp span {
    background: var(--green);
}

.social-x span,
.social-linkedin span {
    background: var(--graphite);
}

.social-youtube span {
    background: #c4302b;
}

.social-tiktok span,
.social-threads span {
    background: #111111;
}

.site-footer {
    margin-top: 0;
    padding: 2rem 0;
    color: rgba(255, 255, 255, 0.76);
    background: var(--graphite);
    border-top: 5px solid var(--brand);
}

.site-footer a {
    color: #ffffff;
}

.site-footer a:hover {
    color: var(--gold);
}

.bgg-attribution {
    display: inline-block;
    margin: 0.35rem 0 0.75rem;
    padding: 0.25rem 0.4rem;
    background: #ffffff;
    border-radius: 0.35rem;
}

.bgg-attribution img {
    display: block;
    width: 160px;
    max-width: 100%;
    height: auto;
}

.site-footer .social-button {
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.site-footer .social-button:hover,
.site-footer .social-button:focus {
    border-color: var(--gold);
    color: #ffffff;
}

@media (max-width: 991.98px) {
    .site-search {
        width: 100%;
        margin-top: 1rem;
    }

    .home-hero {
        padding-top: 2.5rem;
    }

    .catalog-header,
    .form-shell,
    .detail-layout {
        display: block;
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid-expanded,
    .info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-filter-search {
        grid-column: 1 / -1;
    }

    .advanced-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cover-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .summary-panel {
        margin-top: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .page-shell {
        padding-top: 1.25rem;
    }

    .home-hero {
        padding-top: 2rem;
        padding-bottom: 1.1rem;
    }

    .home-search {
        gap: 0.5rem;
        margin-top: 1.25rem;
        padding: 0.4rem;
    }

    .home-search,
    .site-search {
        flex-direction: column;
    }

    .brand-logo {
        height: 2.55rem;
    }

    .brand-name {
        font-size: 0.98rem;
    }

    .stats-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.6rem;
        margin-top: 1.25rem;
    }

    .stat-item {
        padding: 0.75rem 0 0;
    }

    .stat-value {
        font-size: 1.55rem;
    }

    .stat-label {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid-expanded,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .quick-filter-grid,
    .advanced-filter-grid {
        grid-template-columns: 1fr;
    }

    .quick-filter-search {
        grid-column: auto;
    }

    .cover-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .btn {
        width: 100%;
    }
}
