/* Search discovery, personal lists and verified game reporting. */
.editorial-collections {
    margin-bottom: 28px;
}

.editorial-collection-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.editorial-collection-card {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 92px;
    padding: 16px;
    color: var(--text-light);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.editorial-collection-card:hover {
    border-color: rgba(0, 234, 255, .55);
    background: rgba(255, 255, 255, .065);
    transform: translateY(-2px);
}

.editorial-collection-card > i {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    color: var(--neon-blue);
    background: rgba(0, 234, 255, .1);
    border-radius: 8px;
}

.editorial-collection-card span,
.near-game-list span {
    min-width: 0;
}

.editorial-collection-card strong,
.editorial-collection-card small {
    display: block;
}

.editorial-collection-card strong {
    margin-bottom: 4px;
    font-size: .92rem;
}

.editorial-collection-card small {
    color: var(--text-muted);
    font-size: .76rem;
    line-height: 1.45;
}

.near-search-suggestions {
    max-width: 900px;
    margin: 24px auto 0;
    padding: 18px;
    text-align: left;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.near-search-suggestions h4 {
    margin: 0 0 12px;
    color: var(--text-light);
    font-size: 1rem;
}

.near-game-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.near-game-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px;
    color: var(--text-light);
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: 7px;
}

.near-game-list a:hover {
    border-color: rgba(0, 234, 255, .45);
}

.near-game-list img {
    flex: 0 0 72px;
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 5px;
}

.near-game-list strong,
.near-game-list small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.near-game-list strong { font-size: .82rem; }
.near-game-list small { margin-top: 4px; color: var(--text-muted); font-size: .7rem; }

.near-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.near-category-list a {
    padding: 7px 10px;
    color: var(--neon-blue);
    background: rgba(0, 234, 255, .08);
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 700;
}

.play-later-btn.saved-for-later {
    color: var(--neon-blue);
    border-color: rgba(0, 234, 255, .55);
    background: rgba(0, 234, 255, .09);
}

.my-games-tabs {
    overflow-x: auto;
    scrollbar-width: thin;
}

.my-games-tab {
    flex: 0 0 auto;
    white-space: nowrap;
}

.game-report-modal[hidden] { display: none; }
.game-report-modal { position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center; padding: 18px; }
.game-report-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 18, .82); backdrop-filter: blur(4px); }
.game-report-dialog {
    position: relative;
    width: min(520px, 100%);
    padding: 24px;
    color: var(--text-light);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .48);
}
.game-report-dialog h2 { margin: 0 36px 8px 0; font-size: 1.18rem; }
.game-report-dialog h2 i { margin-right: 8px; color: var(--neon-blue); }
.game-report-dialog > p { margin: 0 0 18px; color: var(--text-muted); line-height: 1.6; }
.game-report-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; color: var(--text-muted); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.game-report-close:hover { color: var(--text-light); background: rgba(255,255,255,.08); }
.game-report-dialog label { display: block; margin: 13px 0 6px; font-size: .78rem; font-weight: 800; }
.game-report-dialog select,
.game-report-dialog textarea { width: 100%; padding: 11px 12px; color: var(--text-light); background: var(--bg-dark); border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.game-report-dialog textarea { resize: vertical; min-height: 110px; }
.game-report-feedback { min-height: 22px; margin: 10px 0; color: var(--text-muted); font-size: .8rem; }
.game-report-feedback.success { color: #4ade80; }
.game-report-feedback.error { color: #fb7185; }
body.game-report-open { overflow: hidden; }

@media (max-width: 980px) {
    .editorial-collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .near-game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .editorial-collection-grid,
    .near-game-list { grid-template-columns: 1fr; }
    .editorial-collection-card { min-height: 80px; }
    .game-report-dialog { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .editorial-collection-card { transition: none; }
}

/* Search suggestions stay attached to the header field, like a wide listbox. */
body.search-discovery-open {
    overflow: auto;
}

.search-discovery {
    inset: var(--header-height) 0 auto;
    height: auto;
    pointer-events: none;
}

.search-discovery-backdrop,
.search-discovery-bar {
    display: none;
}

.search-discovery-dialog {
    width: min(940px, calc(100% - var(--sidebar-width) - 32px));
    max-height: min(520px, calc(100vh - var(--header-height) - 18px));
    margin: 18px auto 0;
    overflow: hidden auto;
    border: 0;
    background: rgba(11, 13, 20, 0.97);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
    pointer-events: auto;
}

.search-discovery-content {
    padding: 0;
}

.search-discovery-content h2 {
    display: none;
}

.web-research-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.web-research-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(108, 120, 255, .55);
    border-radius: 6px;
    color: #f4f6ff;
    background: #252a42;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.web-research-button:hover,
.web-research-button:focus-visible {
    border-color: #8f9aff;
    background: #303654;
}

.web-research-button:disabled {
    cursor: wait;
    opacity: .65;
}

.web-research-result {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid rgba(108, 120, 255, .38);
    border-radius: 6px;
    background: #171b2d;
    color: #e9ecf8;
    line-height: 1.65;
}

.web-research-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #aab2ff;
}

.web-research-result p {
    margin: 0;
}

.web-research-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.web-research-sources a {
    color: #bfc6ff;
    font-size: .86rem;
}

.web-research-error {
    color: #ffb9bd;
}

.search-intent-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.search-intent-card,
.intent-brain,
.intent-action,
.intent-friends,
.intent-quick,
.intent-racing,
.intent-classic,
.intent-strategy,
.intent-adventure {
    min-height: 120px;
    border-color: transparent;
    border-radius: 8px;
}

.intent-brain { color: #64ddff; background: rgba(37, 174, 218, 0.18); }
.intent-action { color: #ff72bd; background: rgba(224, 54, 147, 0.18); }
.intent-friends { color: #6ee7b7; background: rgba(30, 177, 132, 0.18); }
.intent-quick { color: #ffe169; background: rgba(214, 168, 35, 0.18); }
.intent-racing { color: #a7f36b; background: rgba(107, 190, 64, 0.18); }
.intent-classic { color: #c993ff; background: rgba(151, 83, 224, 0.18); }
.intent-strategy { color: #63e6d5; background: rgba(35, 184, 171, 0.18); }
.intent-adventure { color: #7da2ff; background: rgba(72, 105, 220, 0.2); }

.search-intent-card:hover,
.search-intent-card:focus-visible {
    background-color: color-mix(in srgb, currentColor 25%, rgba(17, 20, 31, 0.92));
    border-color: rgba(155, 164, 255, 0.28);
    filter: none;
}

.search-intent-card i {
    color: currentColor;
    filter: drop-shadow(0 4px 10px color-mix(in srgb, currentColor 42%, transparent));
}

.search-result-card {
    background: rgba(255, 255, 255, 0.025);
    border-color: transparent;
}

.search-result-card:hover,
.search-result-card:focus-visible {
    background: rgba(255, 255, 255, 0.075);
    border-color: rgba(155, 164, 255, 0.3);
}

@media (max-width: 700px) {
    .search-discovery {
        inset: calc(var(--header-height) + 54px) 0 auto;
    }

    .search-discovery-dialog {
        width: calc(100% - 16px);
        margin-top: 8px;
    }

    .search-discovery-content {
        padding: 0;
    }

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

    .search-intent-card {
        min-height: 104px;
    }
}

/* One-piece left navigation; the header button controls the whole panel. */
.sidebar-nav-divider {
    height: 1px;
    margin: 8px 8px;
    background: rgba(255, 255, 255, 0.12);
}

.category-list li a {
    min-height: 34px;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 0.76rem;
    letter-spacing: 0;
    text-transform: none;
}

@media (min-width: 1025px) {
    body {
        --sidebar-width: 0px;
    }

    body.sidebar-expanded {
        --sidebar-width: 214px;
    }

    .sidebar {
        width: 214px;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition:
            transform 0.22s ease,
            opacity 0.18s ease,
            visibility 0.22s ease,
            box-shadow 0.22s ease;
    }

    body.sidebar-expanded .sidebar {
        width: 214px;
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.sidebar-expanded .category-list li a {
        min-height: 34px;
        margin-top: 1px;
        margin-bottom: 1px;
        padding: 5px 9px;
        gap: 9px;
    }

    body:not(.sidebar-expanded) .sidebar-nav-divider {
        margin-right: 5px;
        margin-left: 5px;
    }
}

@media (max-width: 1024px) {
    .category-list li a {
        min-height: 40px;
        margin-top: 2px;
        margin-bottom: 2px;
        padding: 7px 10px;
    }
}

.site-header .search-form input,
.mobile-quick-search input {
    font-size: 0.8rem;
}

.site-header .search-form input::placeholder,
.mobile-quick-search input::placeholder {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
