/* ===== Screen Reader Only ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #161822;
    --bg-card: #1c1f2e;
    --bg-card-hover: #242840;
    --bg-input: #1c1f2e;
    --bg-sidebar: #161822;
    --border: #2a2d3e;
    --border-hover: #3a3d5e;
    --text-primary: #e8eaf0;
    --text-secondary: #9499b3;
    --text-muted: #7a7f9e;
    --accent: #f7c948;
    --accent-hover: #f5d76e;
    --accent-dim: rgba(247, 201, 72, 0.1);
    --green: #34d399;
    --orange: #fb923c;
    --red: #f87171;
    --blue: #60a5fa;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
    --sidebar-width: 280px;
    --header-height: 74px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ===== Header — loaded from header.css ===== */
/* Homepage-specific search overrides */
#searchInput {
    width: 100%;
    height: 42px;
    padding: 0 44px 0 42px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

#searchInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.search-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: inherit;
    pointer-events: none;
}

.header-stats {
    flex-shrink: 0;
}

.result-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ===== Layout ===== */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 20px 16px 80px;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.clear-filters-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.clear-filters-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Filter Groups */
.filter-group {
    margin-bottom: 8px;
}

.filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    user-select: none;
}

.filter-title:hover {
    background: rgba(255, 255, 255, 0.03);
}

.filter-title .chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.filter-title.collapsed .chevron {
    transform: rotate(-90deg);
}

.filter-options {
    padding: 4px 0;
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.filter-options.collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
    font-size: 13px;
    color: var(--text-primary);
}

.filter-option:hover {
    background: rgba(255, 255, 255, 0.04);
}

.filter-option input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-hover);
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all var(--transition);
}

.filter-option input:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.filter-option input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid var(--bg-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* See more / See less toggle */
.see-more-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.see-more-btn:hover {
    text-decoration: underline;
}

/* Range Sliders */
.slider-filter {
    padding: 8px 8px 4px;
}

.slider-values {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 10px;
}

.range-slider {
    position: relative;
    height: 30px;
}

.range-slider input[type="range"] {
    position: absolute;
    width: 100%;
    height: 30px;
    top: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    z-index: 2;
    margin: 0;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: all;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    position: relative;
    z-index: 3;
}

.range-slider input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-primary);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    z-index: 1;
}

.slider-track::after {
    content: '';
    position: absolute;
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    left: var(--slider-left, 0%);
    right: var(--slider-right, 0%);
}

.filter-label {
    flex: 1;
}

.filter-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: 26px;
    padding: 16px 16px 80px;
    transition: margin-left 0.3s ease;
    min-width: 0;
}

.sidebar.collapsed ~ .main-content,
.main-content.expanded {
    margin-left: 0;
}

/* Welcome Banner */
.welcome-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.welcome-content {
    flex: 1;
    min-width: 0;
}

.welcome-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.welcome-content p + p {
    margin-top: 8px;
}

.welcome-content strong {
    color: var(--accent);
}

.welcome-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.welcome-close:hover {
    opacity: 1;
    color: var(--text);
}

/* Contact Overlay */
.contact-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}

.contact-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 480px;
    width: 100%;
    position: relative;
}

.contact-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.contact-close:hover {
    color: var(--text);
}

.contact-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.contact-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.contact-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(247,201,72,0.1);
}

.contact-input::placeholder {
    color: var(--text-muted);
}

.contact-textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-submit {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #0f1117;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
}

.contact-submit:hover {
    opacity: 0.9;
}

.contact-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sort Bar */
.sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 16px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.sort-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.toggle-sidebar-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.toggle-sidebar-btn svg {
    width: 18px;
    height: 18px;
}

.view-toggles {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.view-btn svg {
    width: 16px;
    height: 16px;
}

.view-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.view-btn:hover:not(.active) {
    color: var(--text-secondary);
}

.sort-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.sort-select {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    padding: 6px 12px 6px 12px;
    width: auto;
    max-width: 100%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239499b3' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
}

.sort-select:hover {
    border-color: var(--border-hover);
}

.sort-select option {
    background: var(--bg-secondary);
}

/* ===== Set Grid ===== */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.game-grid.list-view {
    grid-template-columns: 1fr;
    gap: 8px;
}

/* ===== Set Card (Grid) ===== */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.game-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.game-card .card-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #0d0f16;
    overflow: hidden;
}

.game-card .card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: transform 0.3s ease;
}

.game-card:hover .card-image img {
    transform: scale(1.05);
}

.card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.badge-available {
    background: rgba(52, 211, 153, 0.15);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-retiring {
    background: rgba(251, 146, 60, 0.15);
    color: var(--orange);
    border: 1px solid rgba(251, 146, 60, 0.25);
}

.badge-retired {
    background: rgba(248, 113, 113, 0.15);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge-new {
    background: rgba(96, 165, 250, 0.15);
    color: var(--blue);
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.card-body {
    padding: 14px;
}

.card-theme {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 4px;
}

.card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-set-number {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Favorites ===== */
.favorites-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.favorites-toggle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.favorites-toggle-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.favorites-toggle-btn.active svg {
    fill: var(--accent);
}

.favorites-count {
    font-weight: 600;
}

.card-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 23, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.card-favorite svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
    fill: none;
    transition: all var(--transition);
}

.card-favorite:hover svg {
    stroke: var(--accent);
}

.card-favorite.favorited svg {
    stroke: var(--accent);
    fill: var(--accent);
}

.card-favorite:hover {
    border-color: var(--accent);
    transform: scale(1.1);
}

.card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 10px;
}

.price-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.card-ppp {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 8px;
}

.card-status-row {
    margin-bottom: 4px;
}

.card-status {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 4px;
}

.card-status-new {
    background: rgba(96, 165, 250, 0.12);
    color: var(--blue);
    border: 1px solid rgba(96, 165, 250, 0.25);
}

.card-status-active {
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.card-status-retiring {
    background: rgba(251, 146, 60, 0.12);
    color: var(--orange);
    border: 1px solid rgba(251, 146, 60, 0.25);
}

.card-status-retired {
    background: rgba(248, 113, 113, 0.12);
    color: var(--red);
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.card-sub-theme {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: none;
    margin-left: 4px;
}

/* ===== Retailer Buttons ===== */
.card-retailers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.retailer-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
}

.retailer-btn:hover {
    transform: translateY(-1px);
    border-color: var(--border-hover);
}

.retailer-steam {
    border-color: rgba(102, 192, 244, 0.3);
    color: #66c0f4;
}
.retailer-steam:hover {
    background: rgba(102, 192, 244, 0.1);
    border-color: rgba(102, 192, 244, 0.5);
}

.retailer-gog {
    border-color: rgba(168, 100, 253, 0.3);
    color: #a864fd;
}
.retailer-gog:hover {
    background: rgba(168, 100, 253, 0.1);
    border-color: rgba(168, 100, 253, 0.5);
}

.retailer-humble {
    border-color: rgba(203, 39, 39, 0.3);
    color: #cb2727;
}
.retailer-humble:hover {
    background: rgba(203, 39, 39, 0.1);
    border-color: rgba(203, 39, 39, 0.5);
}

.retailer-amazon {
    border-color: rgba(255, 153, 0, 0.3);
    color: #ff9900;
}
.retailer-amazon:hover {
    background: rgba(255, 153, 0, 0.1);
    border-color: rgba(255, 153, 0, 0.5);
}

.retailer-walmart {
    border-color: rgba(52, 211, 153, 0.3);
    color: #34d399;
}
.retailer-walmart:hover {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.5);
}

.retailer-bestbuy {
    border-color: rgba(100, 160, 255, 0.3);
    color: #64a0ff;
}
.retailer-bestbuy:hover {
    background: rgba(100, 160, 255, 0.1);
    border-color: rgba(100, 160, 255, 0.5);
}

.retailer-ebay {
    border-color: rgba(229, 50, 56, 0.3);
    color: #e53238;
}
.retailer-ebay:hover {
    background: rgba(229, 50, 56, 0.1);
    border-color: rgba(229, 50, 56, 0.5);
}

.sale-tag {
    font-size: 9px;
    font-weight: 700;
    background: var(--green);
    color: #0f1117;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
}

.retailer-btn.on-sale {
    border-color: rgba(52, 211, 153, 0.4);
}

/* ===== List View ===== */
.game-grid.list-view .game-card {
    display: flex;
    flex-direction: row;
}

.game-grid.list-view .card-image {
    width: 140px;
    min-width: 140px;
    padding-top: 0;
    height: 140px;
}

.game-grid.list-view .card-image img {
    padding: 10px;
}

.game-grid.list-view .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-grid.list-view .card-footer {
    border-top: none;
    padding-top: 0;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 20px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

/* ===== Load More ===== */
.load-more {
    text-align: center;
    padding: 32px 0;
}

.load-more-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    padding: 12px 32px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}

.load-more-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== Mobile Filter Button ===== */
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 90;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 25px;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    align-items: center;
    gap: 8px;
    height: 46px;
    transition: all var(--transition);
}
/* Match Ko-fi button to align with filter btn */
.floatingchat-container-wrap{left:16px !important;bottom:16px !important}
.floatingchat-container-wrap .floating-chat-kofi-popup-btn{height:46px !important;border-radius:25px !important;font-size:16px !important}

.mobile-filter-btn:hover {
    background: var(--accent-hover);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 55;
}

/* Mobile nav hamburger */
/* Share button */
.share-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
    font-size: 12px;
}

.share-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Mobile nav styles loaded from header.css */

/* ===== Set Detail Modal ===== */
.game-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.game-modal-container {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.game-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 40px;
    height: 40px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-modal-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.game-modal-content {
    padding: 32px;
}

.modal-top {
    display: flex;
    gap: 32px;
    align-items: center;
    margin-bottom: 24px;
}

.modal-image {
    flex-shrink: 0;
    width: 320px;
    height: 320px;
    background: #0d0f16;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 20px;
}

.modal-info {
    flex: 1;
    min-width: 0;
}

.modal-theme {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    margin-bottom: 8px;
}

.modal-name {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.modal-set-number {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 16px;
}

/* Two-row stats layout: critic scores on the first row (GOTY, MC, OC,
   IGDB), HLTB play-times on the second. Stacking as flex-column of two
   inner groups keeps "Main Story" from floating up next to the critic
   scores when there's horizontal room, which was visually splitting the
   HLTB triplet. */
.modal-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-stats-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modal-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
}

.modal-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Each stat is a bordered card with the big yellow number + small
   muted label underneath. Shared by modal and SSR /game/{slug}.
   flex: 1 so each box stretches to fill its row evenly (4 critic
   stats each take 1/4, 3 HLTB stats each take 1/3). Without the
   flex-grow they'd only be as wide as their content plus padding
   and leave big gaps on the right. */
.modal-stat {
    flex: 1 1 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Flat-row awards layout: scales cleanly past ~10 awards per game. */
.modal-awards-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.modal-awards-list .award-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-awards-list .award-row:last-child {
    border-bottom: none;
}

.modal-awards-list .award-year a {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
}

.modal-awards-list .award-year a:hover {
    text-decoration: underline;
}

.modal-awards-list .award-pub {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.modal-awards-list .award-pub-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.modal-awards-list .award-notes {
    font-size: 12px;
    color: var(--text-muted);
}

.modal-awards-list .award-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    vertical-align: middle;
}

.modal-awards-list .award-badge-industry {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.modal-awards-list .award-badge-pub {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.modal-awards-list .award-source a {
    color: var(--accent);
    font-size: 12px;
    text-decoration: underline;
}

@media (max-width: 640px) {
    .modal-awards-list .award-row {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
        padding: 12px 16px;
    }

    .modal-awards-list .award-source {
        grid-column: 1 / span 2;
    }
}

.modal-ppp {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 8px 12px;
    background: var(--bg-tertiary, #1c1f2e);
    border-radius: var(--radius-sm);
    display: inline-block;
}

.modal-retailers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-retailers .retailer-btn {
    padding: 10px 16px;
    font-size: 13px;
}

.modal-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 20px;
    margin-bottom: 0;
}

/* Modal responsive */
@media (max-width: 768px) {
    .game-modal {
        padding: 0;
        align-items: flex-start;
    }

    .game-modal-container {
        /* iOS Safari calculates 100vh based on the URL-bar-hidden viewport,
           which is ~85px taller than what the user actually sees while the
           URL bar is visible. That pushed the bottom of the modal (and the
           104px Ko-fi clearance below the description) into a region the
           user couldn't reach without first scrolling far enough to hide
           the URL bar — but the rubber-band below kept snapping them back.
           100dvh is the dynamic viewport unit and matches the actually-
           visible viewport. Pair with the 100vh fallback for old browsers. */
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        max-width: 100%;
        /* `none` (not `contain`) eliminates the rubber-band bounce entirely
           within the modal scroll container. `contain` only prevents
           propagation to the body but still shows the local elastic
           overscroll animation on iOS/Android. */
        overscroll-behavior: none;
    }

    .game-modal-content {
        padding: 16px;
    }

    .modal-top {
        flex-direction: column;
        gap: 16px;
    }

    .modal-image {
        width: 100%;
        height: 250px;
        border-radius: var(--radius);
    }

    .modal-name {
        font-size: 20px;
    }

    .modal-price {
        font-size: 22px;
    }

    .modal-stats {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* Hide ALL floating chrome when the set modal is open. Ko-fi was
   previously kept visible with 104px bottom padding to clear it, but
   that approach fails on Android Chrome and iOS Safari where the
   fixed-positioned Ko-fi covers the description text regardless of
   padding — viewport height differences (URL bar, nav bar, notch)
   make the clearance unpredictable across devices. Hiding it is the
   only approach that works everywhere. */
body.modal-open .mobile-filter-btn,
body.modal-open #backToTop,
body.modal-open #cookieConsent,
@media (max-width: 768px) {
    body.modal-open .floatingchat-container-wrap,
    body.modal-open .floatingchat-container-wrap-mobi {
        display: none !important;
    }
}

/* ===== Footer =====
   Single canonical footer styling for the .footer class emitted by
   SHARED_FOOTER_HTML. Used on every page (worker-rendered and
   static-page-fetched). The 104px bottom padding clears the Ko-fi
   "Support Us" floating button (46px button + 16px offset + breathing
   room) so the last footer line never sits behind it. */
.footer {
    margin-top: 40px;
    padding: 24px 24px 104px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    animation: fadeInUp 0.3s ease both;
}

/* Stagger animation */
.game-card:nth-child(1) { animation-delay: 0.02s; }
.game-card:nth-child(2) { animation-delay: 0.04s; }
.game-card:nth-child(3) { animation-delay: 0.06s; }
.game-card:nth-child(4) { animation-delay: 0.08s; }
.game-card:nth-child(5) { animation-delay: 0.10s; }
.game-card:nth-child(6) { animation-delay: 0.12s; }
.game-card:nth-child(7) { animation-delay: 0.14s; }
.game-card:nth-child(8) { animation-delay: 0.16s; }
.game-card:nth-child(9) { animation-delay: 0.18s; }
.game-card:nth-child(10) { animation-delay: 0.20s; }
.game-card:nth-child(11) { animation-delay: 0.22s; }
.game-card:nth-child(12) { animation-delay: 0.24s; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .sort-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .sort-label {
        display: none;
    }

    .view-toggles {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 300px;
        z-index: 60;
        top: 0;
        padding-top: calc(var(--header-height) + 16px);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
        margin-top: calc(var(--header-height) + 16px);
        padding: 0 16px 16px;
    }

    .site-footer {
        margin-left: 0;
    }

    .mobile-filter-btn {
        display: flex;
    }

    /* header-nav, mobile-nav-btn, mobile-nav-drawer handled by header.css */

    .toggle-sidebar-btn {
        display: none;
    }

    /* header-inner, logo-text handled by header.css */


    .header-stats {
        display: none;
    }

    .search-container {
        flex: 0;
        max-width: none;
        margin-left: auto;
        display: flex;
        align-items: center;
    }

    .search-input,
    #searchInput {
        display: none;
    }

    .search-icon {
        position: static;
        transform: none;
        width: 22px;
        height: 22px;
        pointer-events: auto;
        cursor: pointer;
        color: var(--text-primary, #e8eaf0);
        stroke-width: 2.5;
    }

    .mobile-nav-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-btn svg {
        width: 22px;
        height: 22px;
        stroke-width: 2.5;
    }

    .mobile-search-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 17, 23, 0.95);
        z-index: 200;
        padding: 20px;
        flex-direction: column;
        align-items: center;
        padding-top: 80px;
    }

    .mobile-search-overlay.active {
        display: flex;
    }

    .mobile-search-overlay input {
        width: 100%;
        max-width: 500px;
        height: 52px;
        padding: 0 16px 0 48px;
        background: var(--bg-card, #1c1f2e);
        border: 2px solid var(--accent, #f7c948);
        border-radius: 12px;
        color: var(--text-primary, #e8eaf0);
        font-size: 16px;
        font-family: inherit;
        outline: none;
    }

    .mobile-search-overlay .search-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        color: var(--text-secondary, #9499b3);
        font-size: 28px;
        cursor: pointer;
    }

    .search-shortcut {
        display: none;
    }

    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .card-body {
        padding: 10px;
    }

    .card-name {
        font-size: 13px;
    }

    .card-price {
        font-size: 16px;
    }

    .sort-bar {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .sort-label {
        display: none;
    }

    .sort-select {
        font-size: 12px;
    }

    .game-grid.list-view .card-image {
        width: 100px;
        min-width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .card-meta {
        flex-wrap: wrap;
        gap: 6px;
    }

    .retailer-btn {
        padding: 8px 10px;
        font-size: 12px;
    }

    .retailer-label {
        display: inline;
    }

    .view-toggles {
        display: none;
    }
}

/* Back to top button */
.back-to-top{display:none;position:fixed;bottom:16px;right:16px;z-index:90;width:44px;height:44px;border-radius:50%;background:var(--bg-tertiary,#1c1f2e);border:1px solid var(--border,#2a2d3e);color:var(--text-secondary,#9499b3);cursor:pointer;align-items:center;justify-content:center;transition:all 0.2s;box-shadow:0 2px 8px rgba(0,0,0,0.3)}
.back-to-top:hover{background:var(--bg-secondary,#161822);color:var(--accent,#f7c948);border-color:var(--accent,#f7c948)}
.back-to-top.visible{display:flex}
.back-to-top svg{width:20px;height:20px}
@media(max-width:768px){.back-to-top{bottom:72px;right:16px}}

/* Error state */
.error-state{text-align:center;padding:60px 24px;color:var(--text-secondary);grid-column:1/-1}
.error-state p{font-size:16px;margin-bottom:16px}
.error-retry{padding:10px 24px;background:var(--accent);color:var(--bg-primary);border:none;border-radius:8px;font-size:14px;font-weight:700;font-family:inherit;cursor:pointer}
.error-retry:hover{opacity:0.9}

/* Skeleton loading cards */
.game-card.skeleton{pointer-events:none}
.game-card.skeleton .skeleton-img{width:100%;aspect-ratio:1;background:var(--bg-tertiary,#1c1f2e);border-radius:8px}
.game-card.skeleton .card-body{padding:12px}
.skeleton-line{height:14px;border-radius:4px;background:var(--bg-tertiary,#1c1f2e);margin-bottom:10px;animation:shimmer 1.5s infinite}
.skeleton-line.w80{width:80%}
.skeleton-line.w60{width:60%}
.skeleton-line.w40{width:40%}
@keyframes shimmer{0%{opacity:0.4}50%{opacity:0.7}100%{opacity:0.4}}

/* ===== GOTY-Specific Components ===== */

/* --- Card pills (above title) --- */
.game-card .card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.game-card .pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.game-card .pill-awards {
    background: var(--accent);
    color: #0f1117;
    border: 1px solid var(--accent);
}

.game-card .pill-year {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* --- Card typography overrides (GOTY card uses larger title) --- */
.game-card .card-body .card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card .card-developer {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-card .card-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    margin-bottom: 8px;
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(247, 201, 72, 0.25);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.game-card .card-rating svg {
    flex-shrink: 0;
}

/* --- Platform + publication chip rows --- */
.game-card .card-platforms,
.game-card .card-publications {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.game-card .card-publications {
    margin-top: 8px;
}

/* --- Platform chips --- */
.platform-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    background: rgba(122, 127, 158, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(122, 127, 158, 0.4);
}

.platform-chip.chip-default {
    background: rgba(122, 127, 158, 0.15);
    color: var(--text-secondary);
    border-color: rgba(122, 127, 158, 0.4);
}

/* PlayStation family (blue) */
.platform-chip.chip-ps,
.platform-chip.chip-ps5,
.platform-chip.chip-ps4 {
    background: rgba(0, 111, 205, 0.15);
    color: #5aa8ff;
    border-color: rgba(0, 111, 205, 0.4);
}

/* Xbox family (green) */
.platform-chip.chip-xbox,
.platform-chip.chip-xsx,
.platform-chip.chip-xb1 {
    background: rgba(16, 124, 16, 0.18);
    color: #4ade80;
    border-color: rgba(16, 124, 16, 0.45);
}

/* Nintendo family (red) */
.platform-chip.chip-nintendo,
.platform-chip.chip-switch,
.platform-chip.chip-wiiu {
    background: rgba(230, 0, 18, 0.15);
    color: #ff6b6b;
    border-color: rgba(230, 0, 18, 0.4);
}

/* PC (slate/accent-ish) */
.platform-chip.chip-pc {
    background: rgba(148, 153, 179, 0.15);
    color: #c8cce0;
    border-color: rgba(148, 153, 179, 0.4);
}

/* Mobile (gray) */
.platform-chip.chip-mobile,
.platform-chip.chip-ios,
.platform-chip.chip-android {
    background: rgba(122, 127, 158, 0.12);
    color: var(--text-secondary);
    border-color: rgba(122, 127, 158, 0.35);
}

/* --- Publication pills --- */
.pub-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-secondary);
    background: rgba(28, 31, 46, 0.6);
    border: 1px solid var(--border);
    white-space: nowrap;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pub-pill-more {
    color: var(--text-muted);
    background: transparent;
    border-style: dashed;
}

/* --- Card share button (paired with existing .card-favorite) ---
   Lives in the top-LEFT corner of the card image; favorite stays in the
   top-right. Reason: game cover art typically has important artwork or
   publisher logos in the right-hand third, and overlapping a button there
   hid key detail. Top-left corners on cover art are usually empty space. */
.card-share {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 17, 23, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.card-share svg {
    width: 14px;
    height: 14px;
}

.card-share:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

/* Shrink the existing 36px .card-favorite on GOTY cards to match the 30px spec. */
.game-card .card-favorite {
    width: 30px;
    height: 30px;
}

.game-card .card-favorite svg {
    width: 15px;
    height: 15px;
}

/* --- Modal share button ---
   Fixed top-right of the modal, sitting to the left of the close button.
   Previously lived inside a flex header row next to the title, which
   made its position shift depending on title length — "inconsistent in
   its location on the modal popups". Pulling it out of the flow makes
   it land in the same pixel regardless of content. */
.modal-share-btn {
    position: absolute;
    top: 12px;
    right: 64px;              /* 12px gap + 40px close button */
    z-index: 10;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-share-btn svg {
    width: 16px;
    height: 16px;
}

.modal-name {
    font-size: 24px;
    margin-bottom: 6px;
}

/* --- Modal byline / release --- */
.modal-byline {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.modal-release {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Modal stats row: allow wrap so 4-6 cards fit responsively. Parent class
   `.modal-stats` already exists (flex + gap) but doesn't wrap on small
   viewports, so extend it for GOTY's 6-stat row. */
.modal-stats {
    flex-wrap: wrap;
    row-gap: 12px;
}

.modal-stat {
    min-width: 80px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* Modal platforms row (appears under stats) */
.modal-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

/* --- Modal sections (h3 dividers) --- */
.modal-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

.modal-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* --- Awards grid (modal only) ---
   All of these rules are scoped under `.modal-awards-grid` because the
   SSR game page at /game/{slug} uses a similar class naming convention
   (.awards-grid, .award-row, .award-pub-name) but a different layout
   (table-like rows with a 3-column grid). Letting these leak broke the
   SSR page: the margin-bottom:8px below made the pub name appear to
   float above its row's vertical center. */
.modal-awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.modal-awards-grid .award-group {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.modal-awards-grid .award-pub-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.modal-awards-grid .award-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
}

.modal-awards-grid .award-row:first-of-type {
    border-top: none;
}

.modal-awards-grid .award-row .award-year {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-awards-grid .award-row a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.modal-awards-grid .award-row a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* --- Tag chips (genres + themes) --- */
.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Screenshots carousel --- */
.modal-screenshots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.screenshot-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0d0f16;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screenshot-viewport img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.screenshot-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.screenshot-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition);
    padding: 0;
}

.screenshot-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.screenshot-idx {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 56px;
    text-align: center;
}

/* --- Similar games grid inside modal --- */
.modal-similar .similar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.similar-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
}

.similar-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.similar-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #0d0f16;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 8px;
    display: block;
}

.similar-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.similar-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.similar-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
}

/* --- Modal shopping row (extends existing .modal-retailers) --- */
.modal-shopping {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-shopping .retailer-btn {
    padding: 10px 16px;
    font-size: 13px;
}

/* --- Empty-state messages inside modal --- */
.modal-muted {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Modal loading + spinner --- */
.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 24px;
    color: var(--text-muted);
}

.modal-loading p {
    font-size: 14px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Single-thumb range slider (for #minAwards). The default dual-thumb
   rules still work, but the track shows fill from 0 to thumb via the
   CSS custom prop updated in updateMinAwardsLabel(). */
.range-slider.single .slider-track::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--slider-left, 0%);
    background: var(--accent);
    border-radius: 2px;
}

/* --- Utility: hidden filter option (paired with inline style in app.js) --- */
.hidden-filter {
    display: none;
}

/* --- Modal responsive: stack image + info under 680px --- */
@media (max-width: 680px) {
    .modal-top {
        flex-direction: column;
        gap: 16px;
    }

    .modal-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .modal-header-row .modal-name {
        font-size: 20px;
    }

    .modal-awards-grid {
        grid-template-columns: 1fr;
    }

    .modal-similar .similar-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* ===== Game detail card (shared by modal + /game/{slug} SSR) =====
   Both the modal body and the SSR page emit the same .game-layout /
   .game-info / .stats-row / .awards-grid DOM so design tweaks only
   need to live in one place. Class names mirror the SSR page's
   original inline CSS; duplicates moved here so the modal (which
   has no per-page style block) picks them up identically. */
.game-layout {
    display: flex;
    gap: 32px;
    margin-bottom: 32px;
    align-items: flex-start;
}

.game-cover {
    width: 320px;
    flex-shrink: 0;
    background: #0d0f16;
    border-radius: var(--radius);
    overflow: hidden;
}

.game-cover img {
    width: 100%;
    display: block;
}

.game-info {
    flex: 1;
    min-width: 0;
}

.game-developer {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

h1.game-name, h2.game-name {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.15;
}

.game-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    min-width: 110px;
    flex: 1 1 0;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.platform-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.tag-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
}

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

.summary {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.retailers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.retailer-price {
    font-weight: 600;
    opacity: 0.95;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 14px;
}

/* "Where to Buy" heading sits inside the info column next to the
   summary, so it wears a smaller uppercase treatment rather than the
   big page-level section-title used for Awards Won + Screenshots. */
.section-title-shop {
    font-size: 14px;
    margin: 18px 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.awards-grid {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.awards-grid .award-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.awards-grid .award-row:last-child {
    border-bottom: none;
}

.awards-grid .award-year a {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
}

.awards-grid .award-year a:hover {
    text-decoration: underline;
}

.awards-grid .award-pub {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.awards-grid .award-pub-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.awards-grid .award-notes {
    font-size: 12px;
    color: var(--text-muted);
}

.awards-grid .award-source a {
    color: var(--accent);
    font-size: 12px;
    text-decoration: underline;
}

.awards-grid .award-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    vertical-align: middle;
}

.awards-grid .award-badge-industry {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.awards-grid .award-badge-pub {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.screenshots {
    margin-bottom: 24px;
}

.screenshot-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
}

.screenshot-carousel img {
    width: 480px;
    max-width: 80vw;
    height: auto;
    border-radius: 8px;
    flex-shrink: 0;
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    .game-layout {
        flex-direction: column;
    }

    .game-cover {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    h1.game-name, h2.game-name {
        font-size: 24px;
    }

    .awards-grid .award-row {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
        gap: 8px;
        padding: 12px 16px;
    }

    .awards-grid .award-source {
        grid-column: 1 / span 2;
    }
}
