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

:root {
    --bg: #000;
    --card: #111;
    --card-h: #191919;
    --border: #222;
    --t1: #fff;
    --t2: #888;
    --t3: #555;
    --r: 8px;
    --font: 'Poppins', sans-serif;
}

html {
    -webkit-font-smoothing: antialiased
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--t1);
    min-height: 100vh
}

a {
    color: inherit;
    text-decoration: none
}

button {
    cursor: pointer;
    font-family: var(--font);
    border: none;
    background: none;
    color: inherit
}

img {
    display: block;
    max-width: 100%
}

/* === layout === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 28px 0 20px;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.main {
    margin-left: 220px;
    min-height: 100vh
}

/* === sidebar === */
.logo {
    font-size: 1.05rem;
    font-weight: 500;
    padding: 0 20px 24px;
    letter-spacing: -.4px
}

.sidebar-section-label {
    font-size: .6rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--t3);
    padding: 0 20px;
    margin-bottom: 6px;
}

#sportsNav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 0 8px
}

.nav-btn {
    text-align: left;
    width: 100%;
    padding: 9px 14px;
    border-radius: var(--r);
    font-size: .8rem;
    font-weight: 300;
    color: var(--t2);
    transition: all .12s;
}

.nav-btn:hover {
    color: var(--t1);
    background: var(--card)
}

.nav-btn.active {
    color: #000;
    background: #fff;
    font-weight: 400
}

/* === topbar (mobile) === */
.topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: -.3px
}

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px
}

.hamburger span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--t1);
    border-radius: 1px
}

/* === content header === */
.content-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    padding: 30px 24px 18px;
}

.content-header h1 {
    font-size: 1.35rem;
    font-weight: 300;
    letter-spacing: -.4px
}

.count {
    font-size: .7rem;
    color: var(--t3);
    font-weight: 400
}

.spacer {
    flex: 1
}

.pill {
    font-size: .72rem;
    font-weight: 300;
    color: var(--t2);
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    transition: all .12s;
}

.pill:hover {
    border-color: #444;
    color: var(--t1)
}

/* === grid === */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 0 24px 40px;
}

.empty {
    grid-column: 1/-1;
    padding: 60px 20px;
    text-align: center;
    color: var(--t3);
    font-weight: 300;
    font-size: .82rem;
}

/* === card === */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px 18px;
    cursor: pointer;
    transition: all .2s;
    animation: fadeUp .35s ease both;
}

.card:hover {
    transform: translateY(-2px);
    border-color: #333;
    background: var(--card-h)
}

.card-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: .65rem
}

.live {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #f33;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .4px
}

.live-dot {
    width: 5px;
    height: 5px;
    background: #f33;
    border-radius: 50%;
    animation: pulse 1.4s infinite
}

.popular {
    background: transparent;
    color: var(--t2);
    border: 1px solid var(--border);
    padding: 1px 7px;
    border-radius: 3px;
    font-weight: 400;
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: .3px
}

.src-count {
    color: var(--t3);
    margin-left: auto;
    font-weight: 400
}

.teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0
}

.badge {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px
}

.badge-ph {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .8rem;
    color: var(--t3);
}

.team-name {
    font-size: .78rem;
    font-weight: 300;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%
}

.vs {
    font-size: .6rem;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0
}

.card-foot {
    font-size: .68rem;
    font-weight: 300;
    color: var(--t3);
    border-top: 1px solid var(--border);
    padding-top: 10px
}

/* stagger */
.card:nth-child(1) {
    animation-delay: .02s
}

.card:nth-child(2) {
    animation-delay: .04s
}

.card:nth-child(3) {
    animation-delay: .06s
}

.card:nth-child(4) {
    animation-delay: .08s
}

.card:nth-child(5) {
    animation-delay: .10s
}

.card:nth-child(6) {
    animation-delay: .12s
}

.card:nth-child(7) {
    animation-delay: .14s
}

.card:nth-child(8) {
    animation-delay: .16s
}

.card:nth-child(9) {
    animation-delay: .18s
}

/* === skeletons === */
.sk {
    pointer-events: none
}

.sk-line {
    height: 12px;
    width: 70%;
    border-radius: 4px;
    background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.sk-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1a1a1a
}

/* === player === */
.player {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.player.open {
    opacity: 1;
    pointer-events: auto
}

.player-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.player-title {
    font-size: .85rem;
    font-weight: 300
}

.player-actions {
    display: flex;
    gap: 6px
}

.icon-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--t2);
    font-size: .85rem;
    transition: all .12s;
}

.icon-btn:hover {
    border-color: #444;
    color: var(--t1)
}

.player-frame {
    flex: 1;
    position: relative;
    background: #000
}

.player-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none
}

.spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 2;
}

.spinner.hide {
    display: none
}

.dot-pulse {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--t1);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.sources {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    overflow-x: auto;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sources::-webkit-scrollbar {
    display: none
}

.src-btn {
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    font-size: .68rem;
    font-weight: 300;
    color: var(--t2);
    white-space: nowrap;
    transition: all .12s;
}

.src-btn:hover {
    border-color: #444;
    color: var(--t1)
}

.src-btn.active {
    background: #fff;
    color: #000;
    border-color: #fff;
    font-weight: 400
}

/* === modal === */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .88);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.modal.open {
    opacity: 1;
    pointer-events: auto
}

.modal-card {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    max-height: 85vh;
    overflow-y: auto;
    animation: scaleIn .25s ease;
}

.modal-card.wide {
    max-width: 460px
}

.modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-top h2 {
    font-size: .95rem;
    font-weight: 400
}

.modal-x {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--t2);
    font-size: .8rem;
    transition: all .12s;
}

.modal-x:hover {
    border-color: #444;
    color: var(--t1)
}

.modal-body {
    padding: 22px
}

.modal-body h3 {
    font-size: .82rem;
    font-weight: 400;
    margin: 18px 0 6px
}

.modal-body h3:first-of-type {
    margin-top: 14px
}

/* about */
.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 12px;
    border: 1px solid var(--border);
    object-fit: cover
}

.name {
    text-align: center;
    font-size: .9rem;
    font-weight: 400;
    margin-bottom: 4px
}

.bio {
    text-align: center;
    font-size: .75rem;
    font-weight: 300;
    color: var(--t2);
    margin-bottom: 16px
}

.subtle {
    font-size: .76rem;
    font-weight: 300;
    color: var(--t2);
    line-height: 1.55;
    margin-bottom: 10px
}

.link-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    font-size: .76rem;
    font-weight: 300;
    color: var(--t2);
    transition: all .12s;
    margin-bottom: 6px;
}

.link-row:hover {
    border-color: #444;
    color: var(--t1)
}

.link-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.link-group .link-row {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0
}

.tip {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    font-size: .74rem;
    font-weight: 300;
    color: var(--t3);
}

/* === overlay === */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 99;
}

.overlay.open {
    display: block
}

/* === keyframes === */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .35
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0
    }

    100% {
        background-position: 200% 0
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(.96)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

/* === gate === */
.gate {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gate.unlocked {
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
}

.gate-card {
    text-align: center;
    max-width: 380px;
    width: 100%;
    animation: scaleIn .35s ease;
}

.gate-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.gate-title {
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: -.3px;
    margin-bottom: 8px;
}

.gate-q {
    font-size: .78rem;
    font-weight: 300;
    color: var(--t2);
    line-height: 1.5;
    margin-bottom: 22px;
}

.gate-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--t1);
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 300;
    outline: none;
    transition: border-color .15s;
    margin-bottom: 10px;
}

.gate-input:focus {
    border-color: #444;
}

.gate-input.error {
    border-color: #f33;
    animation: shake .35s ease;
}

.gate-input.success {
    border-color: #4f4;
}

.gate-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #000;
    border-radius: var(--r);
    font-size: .82rem;
    font-weight: 400;
    transition: all .15s;
    cursor: pointer;
}

.gate-btn:hover {
    background: #ddd;
}

.gate-btn:disabled {
    opacity: .5;
    cursor: default;
}

.gate-msg {
    margin-top: 14px;
    font-size: .72rem;
    font-weight: 300;
    color: var(--t3);
    min-height: 1.2em;
}

.gate-msg.error {
    color: #f33;
}

.gate-msg.success {
    color: #4f4;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* === responsive === */
@media(max-width:768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease
    }

    .sidebar.open {
        transform: translateX(0)
    }

    .main {
        margin-left: 0
    }

    .topbar {
        display: flex
    }

    .content-header {
        padding: 20px 16px 14px
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 16px 32px
    }
}

@media(min-width:769px) and (max-width:1100px) {
    .sidebar {
        width: 200px
    }

    .main {
        margin-left: 200px
    }
}