/* ============================================
   8bitedge Top Games
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Electrolize&display=swap');

.top-games-main,
.top-games-container,
.top-games-card,
.platform-nav,
.platform-header,
.games-container,
.top-game-item {
    font-family: 'Electrolize', sans-serif;
}

/* Main Container */
.top-games-main {
    width: 100%;
    padding: 24px 0 0 0;
    margin: 0;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1d35 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.top-games-main::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 217, 255, 0.025) 0px,
        transparent 2px,
        transparent 4px,
        rgba(0, 217, 255, 0.025) 6px
    );
    pointer-events: none;
    z-index: 0;
}

.top-games-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
    position: relative;
    z-index: 1;
}

/* Console Filter -- matches /pricing filter bar */
.console-filter-section {
    padding-bottom: 10px;
    border-bottom: 2px solid #1a1a2e;
    margin-bottom: 20px;
}

.console-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px 10px;
    flex-wrap: wrap;
}

.console-filter-label {
    color: #00d9ff;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 6px rgba(0, 217, 255, 0.4);
    flex: 0 0 auto;
}

.console-filter-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.console-filter-action {
    background: transparent;
    border: none;
    padding: 0;
    color: #00ff41;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    text-shadow: 0 0 6px rgba(0, 255, 65, 0.4);
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.console-filter-action:hover {
    color: #00d9ff;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
    text-decoration: underline;
}

.console-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1 1 100%;
}

.console-filter-pill {
    font-family: 'Electrolize', sans-serif;
    background: #1a1a2e;
    border: 1px solid rgba(0, 217, 255, 0.35);
    color: rgba(0, 217, 255, 0.55);
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 0;
}

.console-filter-pill:hover {
    border-color: #00d9ff;
    color: #00d9ff;
    transform: translateY(-1px);
}

.console-filter-pill.active {
    background: #00d9ff;
    border-color: #00d9ff;
    color: #1a1a2e;
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.5);
}

.console-filter-pill.active:hover {
    background: #00ff41;
    border-color: #00ff41;
    color: #1a1a2e;
    box-shadow: 0 0 14px rgba(0, 255, 65, 0.5);
}

.console-filter-all {
    position: relative;
    margin-right: 11px;
}

.console-filter-all::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 65%;
    background: rgba(0, 217, 255, 0.3);
}

/* Platform Section */
.platform-section {
    margin-bottom: 20px;
    scroll-margin-top: 80px;
}

/* Platform Header */
.platform-header {
    background: rgba(10, 10, 20, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.25);
    border-bottom: none;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.platform-header h2 {
    color: #e8f6ff;
    font-size: 0.88rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Console name links to its /search results; inherit the heading look with a
   subtle cyan hover instead of default link styling. */
.platform-header-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}
.platform-header-link:hover {
    color: #00d9ff;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.4);
}

/* IGDB attribution line at the bottom of the page. */
.igdb-credit {
    margin: 28px 0 8px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    text-align: center;
    color: var(--console-muted, #B8B8C8);
}
.igdb-credit a {
    color: #00d9ff;
    text-decoration: none;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}
.igdb-credit a:hover {
    color: #00ff41;
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.35);
}


/* Games Container */
.games-container {
    background: rgba(10, 10, 20, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.25);
    overflow: hidden;
}

/* Game Item */
.top-game-item {
    padding: 14px 40px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.top-game-item:last-child {
    border-bottom: none;
}

.top-game-item:hover {
    background: rgba(0, 217, 255, 0.03);
}

/* Rank */
.game-rank {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.25);
    color: #00d9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    font-family: 'Electrolize', sans-serif;
}

/* Game Content */
.game-content {
    flex: 1;
    min-width: 0;
}

.game-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.game-cover {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid rgba(0, 217, 255, 0.25);
    flex: 0 0 auto;
}

.game-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #e8f6ff;
    margin: 0;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.game-title a {
    color: #fff;
    text-decoration: none;
}

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

.game-rating {
    flex: 0 0 auto;
    background: rgba(10, 10, 20, 0.65);
    border: 1px solid rgba(0, 217, 255, 0.25);
    color: #00d9ff;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 0.78rem;
    font-family: 'Electrolize', sans-serif;
    letter-spacing: 0.5px;
}

.game-summary {
    color: #b8b8c8;
    font-size: 0.82rem;
    line-height: 1.6;
    margin: 0;
}

/* Fixed back-to-top button */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: rgba(10, 10, 20, 0.85);
    border: 1px solid rgba(0, 217, 255, 0.5);
    color: #00d9ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    font-family: 'Electrolize', sans-serif;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top-btn:hover {
    border-color: rgba(0, 217, 255, 0.8);
}

/* Responsive */
@media (max-width: 768px) {
    .platform-nav,
    .platform-header,
    .top-game-item {
        padding-left: 20px;
        padding-right: 20px;
    }

    .game-header {
        flex-wrap: wrap;
    }

    .game-rating {
        margin-top: 4px;
    }
}

/* ── Console multi-select dropdown (same control as /search) ─────────────── */
.console-dropdown {
    position: relative;
    flex: 0 0 auto;
    font-family: 'Electrolize', sans-serif;
}
.console-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 220px;
    background: #1a1a2e;
    border: 1px solid rgba(0, 217, 255, 0.35);
    color: #00d9ff;
    padding: 6px 12px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.console-dropdown-trigger:hover,
.console-dropdown.open .console-dropdown-trigger {
    border-color: #00d9ff;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.35);
}
.console-dropdown-caret {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}
.console-dropdown.open .console-dropdown-caret {
    transform: rotate(180deg);
}

.console-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    width: 300px;
    max-width: 84vw;
    background: #12152b;
    border: 1px solid rgba(0, 217, 255, 0.4);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 14px rgba(0, 217, 255, 0.18);
    display: flex;
    flex-direction: column;
}
.console-dropdown-panel[hidden] {
    display: none;
}

.console-dropdown-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.18);
}
.console-dropdown-search-icon {
    color: rgba(0, 217, 255, 0.6);
    font-size: 0.95rem;
}
.console-dropdown-search-input {
    flex: 1 1 auto;
    min-width: 0;
    background: #1a1a2e;
    border: 1px solid rgba(0, 217, 255, 0.25);
    color: #cfeffd;
    padding: 5px 8px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.78rem;
    outline: none;
}

.console-dropdown-groups {
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 0;
}
.console-dropdown-group + .console-dropdown-group {
    border-top: 1px solid rgba(0, 217, 255, 0.1);
}
.console-dropdown-grouphead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 4px;
}
.console-dropdown-brand {
    color: #00ff41;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}
.console-dropdown-selectall {
    background: transparent;
    border: none;
    padding: 0;
    color: #00d9ff;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
}
.console-dropdown-selectall:hover {
    text-decoration: underline;
}
.console-dropdown-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    cursor: pointer;
    color: rgba(0, 217, 255, 0.85);
    font-size: 0.82rem;
    transition: background 0.15s ease;
}
.console-dropdown-option:hover {
    background: rgba(0, 217, 255, 0.08);
}
.console-dropdown-option.selected {
    background: rgba(0, 217, 255, 0.16);
    color: #00d9ff;
}
.console-dropdown-option input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #00d9ff;
    cursor: pointer;
    flex: 0 0 auto;
}
.console-dropdown-optname {
    line-height: 1.2;
}
.console-dropdown-empty {
    padding: 14px 12px;
    color: rgba(0, 217, 255, 0.45);
    font-size: 0.78rem;
}

.console-dropdown-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid rgba(0, 217, 255, 0.2);
}
.console-dropdown-clear {
    background: transparent;
    border: none;
    padding: 4px 2px;
    color: rgba(0, 217, 255, 0.75);
    font-family: 'Electrolize', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
}
.console-dropdown-clear:hover {
    color: #00d9ff;
    text-decoration: underline;
}
.console-dropdown-apply {
    background: #00d9ff;
    border: 1px solid #00d9ff;
    color: #0a0e27;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 16px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.console-dropdown-apply:hover {
    background: #00ff41;
    border-color: #00ff41;
    box-shadow: 0 0 12px rgba(0, 255, 65, 0.45);
}
