/* ---------- Page shell (games.html) - same dark background as the table ---------- */

body {
    margin: 0;
    background: #17181d;
    color: #f0f0ec;
    font-family: "Inter", system-ui, sans-serif;
}

a {
    color: #7aa2ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.site-header {
    border-bottom: 1px solid #23252c;
    padding: 1.25rem 0;
}

.site-header-inner {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #f0f0ec;
}

.tagline {
    margin: 0;
    color: #63656d;
    font-size: 0.9rem;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
    padding: 1.5rem 0 3rem;
}

.games-column {
    min-width: 0;
}

.news-column {
    min-width: 0;
    border: 1px solid #23252c;
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.news-column h2 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
}

.news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.news-item {
    padding-bottom: 1rem;
    border-bottom: 1px solid #23252c;
}

.news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.news-date {
    display: block;
    font-size: 0.75rem;
    color: #63656d;
    margin-bottom: 0.15rem;
}

.news-title {
    display: block;
    font-weight: 600;
    color: #f0f0ec;
    margin-bottom: 0.25rem;
}

.news-excerpt {
    margin: 0;
    font-size: 0.85rem;
    color: #63656d;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

.filter-bar {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.filter-bar input[type="search"] {
    flex: 1;
    min-width: 0;
}

.filter-bar input[type="search"],
.filter-bar select {
    background: #1c1e24;
    border: 1px solid #23252c;
    color: #f0f0ec;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    font-family: "Inter", system-ui, sans-serif;
}

.filter-bar input[type="search"]::placeholder {
    color: #63656d;
}

.filter-bar input[type="search"]:focus,
.filter-bar select:focus {
    outline: none;
    border-color: #7aa2ff;
}

/* Filter popup (store + publisher) */
.filter-menu {
    position: relative;
}

.filter-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    background: #1c1e24;
    border: 1px solid #23252c;
    color: #f0f0ec;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 14px;
    font-family: "Inter", system-ui, sans-serif;
    white-space: nowrap;
}

.filter-menu > summary::-webkit-details-marker {
    display: none;
}

.filter-menu[open] > summary,
.filter-menu > summary:focus-visible {
    outline: none;
    border-color: #7aa2ff;
}

.filter-count {
    display: inline-block;
    min-width: 1.3em;
    margin-left: 0.4rem;
    padding: 0 0.35em;
    border-radius: 999px;
    background: #7aa2ff;
    color: #0e0f13;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.filter-count[hidden] {
    display: none;
}

.filter-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    width: 280px;
    max-width: calc(100vw - 32px);
    padding: 0.75rem 1rem;
    background: #1c1e24;
    border: 1px solid #2f323b;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    font-family: "Inter", system-ui, sans-serif;
    font-size: 14px;
    color: #f0f0ec;
}

.filter-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #9a9ca3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-close:hover,
.filter-close:focus-visible {
    background: #2a2c34;
    color: #f0f0ec;
}

.filter-close svg {
    width: 18px;
    height: 18px;
}

.filter-panel fieldset {
    border: 0;
    margin: 0 0 0.75rem;
    padding: 0;
}

.filter-panel legend {
    padding: 0;
    margin-bottom: 0.3rem;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #63656d;
}

.filter-panel label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    cursor: pointer;
}

.filter-panel label.filter-toggle {
    margin-top: 0.35rem;
    padding-top: 0.5rem;
    border-top: 1px solid #2f323b;
}

.filter-panel label.disabled {
    opacity: 0.45;
    cursor: default;
}

.filter-scroll {
    max-height: 220px;
    overflow-y: auto;
}

.filter-clear {
    background: none;
    border: 0;
    padding: 0;
    color: #7aa2ff;
    font: inherit;
    cursor: pointer;
}

.filter-clear:hover {
    text-decoration: underline;
}

.game-table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 14px;
    background: #17181d;
    color: #f0f0ec;
    border-radius: 12px;
    overflow: hidden;
}

.game-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #63656d;
    padding: 10px 16px;
    border-bottom: 1px solid #23252c;
}

.game-table tbody tr {
    border-bottom: 1px solid #1e2026;
}

.game-table tbody tr:last-child {
    border-bottom: none;
}

.game-table tbody tr:hover {
    background: #1c1e24;
}

.game-table td {
    padding: 8px 16px;
    vertical-align: middle;
}

/* the part that matters for "make smaller" */
.game-table td.cover {
    width: 56px;
    padding-right: 0;
}

.game-table .cover-img {
    width: 112px;
    height: 112px;
    object-fit: contain;
    border-radius: 0;
    /*box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);*/
    display: block;
}

.game-table .title-cell {
    background: #000000;
    line-height: 1.35;
        overflow: hidden;

}

.game-table .game-title {
    display: block;
    color: #f0f0ec;
}

.game-table .game-title:hover {
    text-decoration: underline;
}

.game-table .game-publisher {
    font-size: 12px;
    color: #63656d;
    margin-top: 2px;
}

.game-table .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
}

.game-table .badge-row {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* eShop price next to the format badge: physical is the main comparison,
   so it stays grey unless digital is actually cheaper */
.game-table .badge-eshop {
    background: rgba(240, 240, 236, 0.04);
    border-color: rgba(240, 240, 236, 0.18);
    color: #b4b6bd;
}

/* regular price while on sale, struck through after the sale price */
.game-table .badge-eshop s {
    font-weight: 400;
    opacity: 0.6;
}

.game-table .badge-eshop.badge-eshop-cheaper {
    background: rgba(53, 212, 136, 0.08);
    border-color: rgba(53, 212, 136, 0.35);
    color: #35d488;
}

.game-table .badge-icon {
    width: 9px;
    height: 9px;
    flex-shrink: 0;
}

.game-table .badge-keycard {
    background: rgba(214, 108, 100, 0.08);
    border-color: rgba(214, 108, 100, 0.4);
    color: #d97066;
}

.game-table .badge-cart {
    background: rgba(53, 212, 136, 0.08);
    border-color: rgba(53, 212, 136, 0.35);
    color: #35d488;
}

.game-table .badge-codebox {
    background: rgba(255, 149, 0, 0.08);
    border-color: rgba(255, 149, 0, 0.4);
    color: #ff9500;
}

.game-table .badge-discount {
    margin-left: 6px;
    background: rgba(53, 212, 136, 0.08);
    border-color: rgba(53, 212, 136, 0.35);
    color: #35d488;
    white-space: nowrap;
    vertical-align: top;
}

/* price with the expand button centred under it */
.game-table .price-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    vertical-align: top;
}

/* keep the discount badge beside the price instead of wrapping under it
   when long titles squeeze the column */
.game-table td.price-cell {
    white-space: nowrap;
}

.game-table .no-price {
    color: #63656d;
    font-style: italic;
}

.game-table a {
    color: #7aa2ff;
    text-decoration: none;
}

.game-table a:hover {
    text-decoration: underline;
}

.game-table .empty-state {
    text-align: center;
    padding: 32px 16px;
    color: #63656d;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0;
}

.pagination-btn {
    background: #1c1e24;
    border: 1px solid #23252c;
    color: #f0f0ec;
    border-radius: 8px;
    padding: 0.4rem 0.9rem;
    font-size: 13px;
    font-family: "Inter", system-ui, sans-serif;
    cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #7aa2ff;
}

.pagination-btn:disabled {
    color: #63656d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-info {
    font-size: 13px;
    color: #63656d;
}

.expand-toggle {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #2f3a55;
    border-radius: 50%;
    background: none;
    color: #7aa2ff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.expand-toggle:hover,
.expand-toggle:focus-visible {
    border-color: #7aa2ff;
    color: #a9c2ff;
}

.expand-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease;
}

.expand-toggle[aria-expanded="true"] .expand-arrow {
    transform: rotate(180deg);
}

.detail-row { display: none; }
.detail-row.open { display: table-row; }

.detail-row td { background: var(--row-detail-bg, #14151a); padding: 0.75rem 1rem; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.game-stores {
    font-family: "Inter", system-ui, sans-serif;
    font-size: 13px;
    color: #f0f0ec;
}

.game-stores .metacritic-link {
    display: inline-block;
    margin-bottom: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 204, 51, 0.08);
    border: 1px solid rgba(255, 204, 51, 0.4);
    color: #ffcc33;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
}

.game-stores .metacritic-link:hover {
    text-decoration: underline;
}

.stores-table {
    width: 100%;
    border-collapse: collapse;
    background: #1c1e24;
    border-radius: 8px;
    overflow: hidden;
}

.stores-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #63656d;
    padding: 8px 12px;
    border-bottom: 1px solid #23252c;
}

.stores-table tbody tr {
    border-bottom: 1px solid #23252c;
}

.stores-table tbody tr:last-child {
    border-bottom: none;
}

.stores-table td {
    padding: 8px 12px;
    vertical-align: middle;
}

.stores-table a {
    color: #7aa2ff;
    text-decoration: none;
}

.stores-table a:hover {
    text-decoration: underline;
}

.stores-table .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
}

.stores-table .badge-in-stock {
    background: rgba(53, 212, 136, 0.08);
    border: 1px solid rgba(53, 212, 136, 0.35);
    color: #35d488;
}

.stores-table .badge-out-of-stock {
    background: rgba(255, 90, 99, 0.08);
    border: 1px solid rgba(255, 90, 99, 0.4);
    color: #ff5a63;
}

.stores-table .badge-preorder {
    background: rgba(255, 204, 51, 0.08);
    border: 1px solid rgba(255, 204, 51, 0.4);
    color: #ffcc33;
}

.stores-table .empty-state {
    text-align: center;
    padding: 16px 12px;
    color: #63656d;
}

/* ---------- Mobile: title across the full width, price + store below it ---------- */

.mobile-tabs {
    display: none;
}

@media (max-width: 600px) {
    .mobile-tabs {
        display: flex;
        border-bottom: 1px solid #23252c;
    }

    .mobile-tabs button {
        flex: 1;
        margin: 0;
        padding: 0.75rem 0;
        background: none;
        border: none;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        color: #63656d;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
    }

    .mobile-tabs button.active {
        color: #f0f0ec;
        border-bottom-color: #f0f0ec;
    }

    .layout[data-tab="games"] .news-column,
    .layout[data-tab="news"] .games-column {
        display: none;
    }

    .news-column {
        border: none;
        padding: 0;
    }

    .news-column h2 {
        display: none;
    }

    .filter-bar {
        flex-wrap: wrap;
    }

    .filter-bar input[type="search"] {
        flex-basis: 100%;
    }

    .filter-bar select {
        flex: 1;
    }

    .game-table,
    .game-table > tbody {
        display: block;
    }

    .game-table > thead {
        display: none;
    }

    .game-table .game-row {
        display: grid;
        grid-template-columns: auto auto 1fr;
        grid-template-areas:
            "cover title title"
            "cover price store";
        position: relative;
        padding: 8px 0;
        border-bottom: 1px solid #2f323b;
    }

    .game-table .game-row > td {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .game-table td.cover { grid-area: cover; width: auto; padding-left: 8px; padding-right: 8px; }
    .game-table td.title-cell { grid-area: title; }
    .game-table td.price-cell { grid-area: price; padding-right: 16px; }
    .game-table td.store-cell { grid-area: store; padding-right: 56px; min-width: 0; align-items: flex-end; text-align: right; }

    /* price column only takes what it needs, so the store name fits on
       one line; very long names get an ellipsis instead of wrapping */
    .game-table td.store-cell > * {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .game-table .game-publisher {
        display: none;
    }

    /* badge beside the price, not stacked under it */
    .game-table td.price-cell {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }

    .game-table .price-cell .badge-discount {
        margin: 0;
    }

    /* on phones the expand button sits at the row's right edge, level
       with the price, instead of under it */
    .game-table .price-stack {
        display: contents;
    }

    .game-table .price-cell .expand-toggle {
        position: absolute;
        right: 18px;
    }

    .game-table .title-cell .badge-row {
        margin-top: 4px;
    }


    /* width follows the cover's own (portrait) shape, so there's no
       letterbox space beside it */
    .game-table .cover-img {
        width: auto;
        height: 88px;
    }

    .detail-row.open,
    .detail-row.open > td,
    .game-table > tbody > tr:not(.game-row):not(.detail-row),
    .game-table > tbody > tr > .empty-state {
        display: block;
    }
}
