/* Browse games — catalog list (matches site glass theme) */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: clip;
}

body.browse-page-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #050505;
    color: #f5f5f5;
    padding: 0;
    min-height: 100vh;
    overflow-x: clip;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.browse-page-body .browse-page {
    position: relative;
    z-index: 1;
    max-width: min(1400px, 100%);
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 40px) 48px;
    box-sizing: border-box;
}

body.browse-page-body #headerContainer {
    width: 100%;
}

.browse-hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(16px, 3vw, 28px);
    margin: 0 0 clamp(20px, 3vw, 28px);
    padding: clamp(28px, 5vw, 44px) 0 clamp(20px, 3vw, 24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.browse-hero-main {
    flex: 1 1 260px;
    min-width: 0;
}

.browse-hero-title {
    margin: 0 0 10px;
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.1;
}

.browse-hero-lead {
    margin: 0;
    max-width: 36rem;
    font-size: clamp(15px, 2.2vw, 17px);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.52);
}

.browse-hero-count {
    margin: 10px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.38);
}

.browse-release-tracker {
    flex: 0 1 300px;
    width: 100%;
    max-width: 300px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(129, 140, 248, 0.22);
    background: linear-gradient(
        145deg,
        rgba(99, 102, 241, 0.12) 0%,
        rgba(255, 255, 255, 0.03) 55%,
        rgba(0, 0, 0, 0.2) 100%
    );
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

@media (max-width: 720px) {
    .browse-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .browse-release-tracker {
        flex: 1 1 auto;
        max-width: none;
    }
}

.browse-release-label {
    margin: 0 0 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.42);
}

.browse-release-elapsed {
    margin: 0 0 8px;
    font-size: clamp(15px, 2vw, 17px);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    color: #e8ecff;
    line-height: 1.35;
}

.browse-release-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.45);
}

.browse-release-link {
    color: #a5b4fc;
    font-weight: 600;
    text-decoration: none;
}

.browse-release-link:hover {
    color: #c7d2fe;
    text-decoration: underline;
}

.browse-release-note-text {
    color: rgba(255, 255, 255, 0.38);
}

/* Search + feature filters (matches site search / dashboard friends) */
.browse-toolbar {
    margin: 0 0 clamp(16px, 2.5vw, 24px);
}

.browse-head {
    padding: 0;
}

.browse-toolbar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}

.browse-search {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 10px 4px;
    border: none;
    border-radius: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    color: #fff;
    font: inherit;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: -0.01em;
    outline: none;
    caret-color: #667eea;
}

.browse-search::placeholder {
    color: rgba(255, 255, 255, 0.38);
    font-weight: 400;
}

.browse-search:focus {
    outline: none;
}

.browse-head:focus-within .browse-line {
    background: rgba(255, 255, 255, 0.32);
}

.browse-line {
    height: 1px;
    width: 100%;
    margin: 12px 0 0;
    background: rgba(255, 255, 255, 0.16);
}

.browse-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 0 4px;
}

.browse-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.12s ease,
        color 0.12s ease,
        border-color 0.12s ease;
}

.browse-chip:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
}

.browse-chip.is-active {
    background: #fff;
    color: #050505;
    border-color: #fff;
}

.browse-chip:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.browse-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.browse-chip-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

.browse-chip.is-active .browse-chip-icon {
    color: #4f46e5;
}

.browse-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 20px;
}

/* display:flex above beats [hidden] without !important — keep loader/list toggles reliable */
.browse-loading[hidden],
.browse-toolbar[hidden],
.browse-features-legend[hidden],
.browse-games-list[hidden],
.browse-empty[hidden],
.browse-error[hidden],
.browse-hero-count[hidden] {
    display: none !important;
}

.browse-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: browse-spin 0.85s linear infinite;
}

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

.browse-games-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.browse-game-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    margin: 0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}

a.browse-game-row:hover,
a.browse-game-row:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    outline: none;
}

.browse-game-row--static {
    cursor: default;
}

.browse-game-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.browse-game-thumb-slot {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.browse-game-thumb-slot .browse-game-thumb-fallback {
    position: absolute;
    inset: 0;
}

.browse-game-thumb-fallback {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #c7d2fe;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.browse-game-thumb-fallback.is-visible {
    display: inline-flex;
}

.browse-game-name {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.browse-game-features {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 12px;
}

.browse-feat {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: default;
    transition:
        color 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        opacity 0.15s ease;
}

.browse-feat--has-tip::after {
    content: attr(data-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    color: #fff;
    background: rgba(15, 15, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease, visibility 0.12s ease;
    z-index: 20;
}

.browse-feat--has-tip:hover::after,
.browse-feat--has-tip:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.browse-feat svg {
    width: 15px;
    height: 15px;
    pointer-events: none;
}

.browse-feat--on {
    color: #e0e7ff;
    background: rgba(99, 102, 241, 0.35);
    border-color: rgba(129, 140, 248, 0.45);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
    opacity: 1;
}

/* Match insignia.live/games: unsupported icons are hidden, not dimmed */
.browse-game-features .browse-feat--off {
    display: none;
}

.browse-feat--on:hover,
.browse-feat--on:focus-visible {
    color: #fff;
    background: rgba(99, 102, 241, 0.5);
    border-color: rgba(165, 180, 252, 0.65);
    box-shadow: 0 0 14px rgba(99, 102, 241, 0.45);
}

.browse-feat:focus-visible {
    outline: 2px solid #818cf8;
    outline-offset: 2px;
}

.browse-features-legend {
    margin: 0;
    padding: 10px 0 2px;
}

.browse-features-legend-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.browse-features-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.browse-features-legend-list li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.browse-feat--legend {
    opacity: 1;
}

.browse-empty,
.browse-error {
    margin: 0;
    padding: 32px 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 15px;
}

.browse-page-footer {
    margin-top: clamp(32px, 5vw, 48px);
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 640px) {
    .browse-search {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .browse-spinner {
        animation: none;
        border-top-color: rgba(255, 255, 255, 0.45);
    }
}
