:root {
    --bg: #0b0b0b;
    --card: #161616;
    --card-hover: #1e1e1e;
    --border: #2a2a2a;
    --accent: #00e676;
    --accent-dim: #00c853;
    --text: #e8e8e8;
    --muted: #888
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

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

.header {
    background: linear-gradient(180deg, #111 0%, #0d0d0d 100%);
    padding: 22px 20px;
    text-align: center;
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px #000b
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    display: inline-flex;
    align-items: center;
    gap: 10px
}

.version {
    font-size: 13px;
    background: var(--accent);
    color: #000;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 700
}

.controls {
    background: #111;
    padding: 14px 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    border-bottom: 1px solid var(--border)
}

.search-box {
    flex: 1;
    min-width: 260px;
    position: relative
}

.search-box input {
    width: 100%;
    padding: 11px 16px 11px 42px;
    background: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    outline: none
}

.search-box input:focus {
    border-color: var(--accent)
}

.search-box:before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    opacity: .7
}

.btn {
    background: #222;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

.btn:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent)
}

.btn-primary {
    background: var(--accent-dim);
    color: #000;
    border-color: var(--accent-dim)
}

.section {
    padding: 28px 20px 10px
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 4px solid var(--accent);
    display: flex;
    align-items: center;
    gap: 10px
}

.count {
    background: #222;
    color: var(--muted);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 20px
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    transition: .25s;
    display: flex;
    flex-direction: column;
    gap: 14px
}

.card:hover {
    background: var(--card-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 28px #00e6761f
}

.card h3 {
    font-size: 16px;
    font-weight: 600
}

.meta {
    font-size: 12px;
    color: var(--muted)
}

.actions {
    margin-top: auto
}

.card button {
    width: 100%;
    padding: 10px;
    background: #222;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer
}

.card button:hover {
    background: var(--accent);
    color: #000
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: #000f;
    z-index: 9000;
    overflow-y: auto
}

.modal-content {
    padding: 18px;
    max-width: 1700px;
    margin: 0 auto
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    /* background: #0b0bf0; */
    padding: 12px 0;
    z-index: 10;
    backdrop-filter: blur(8px)
}

#viewerTitle {
    font-size: 22px;
    color: var(--accent);
    flex: 1
}

.grid {
    display: grid;
    gap: 14px
}

.grid.gd {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr))
}

.grid.infinity {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr))
}

.player {
    position: relative;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border)
}

.player:hover {
    border-color: var(--accent)
}

.player-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(#000d, #0006);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    z-index: 5;
    pointer-events: none;
    font-size: 13px;
    font-weight: 600
}

.live-indicator {
    color: var(--accent);
    font-size: 12px;
    animation: pulse 1.4s infinite
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .35
    }
}

.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    cursor: pointer
}

.stream-url {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000d;
    color: var(--accent);
    font-size: 11px;
    padding: 7px 10px;
    opacity: 0;
    z-index: 3
}

.player:hover .stream-url {
    opacity: 1
}

iframe {
    width: 100%;
    height: 230px;
    border: none;
    display: block;
    background: #000
}

.single-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: #000f;
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 16px
}

.single-modal-container {
    background: #141414;
    width: 100%;
    max-width: 1100px;
    border-radius: 14px;
    border: 1px solid #333;
    overflow: hidden;
    box-shadow: 0 25px 60px #000c
}

.single-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #111;
    border-bottom: 1px solid #2a2a2a
}

.single-topbar h3 {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px
}

.close-btn {
    background: transparent;
    border: 0;
    color: #999;
    font-size: 24px;
    cursor: pointer
}

.single-iframe-wrapper {
    width: 100%;
    height: 68vh;
    background: #000
}

.single-iframe-wrapper iframe {
    height: 100%
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
    font-size: 16px
}

@media(max-width:1100px) {

    .grid.gd,
    .grid.infinity {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr))
    }
}

@media(max-width:768px) {
    .header h1 {
        font-size: 22px;
        letter-spacing: 1px
    }

    .grid.gd,
    .grid.infinity {
        grid-template-columns: 1fr
    }

    .single-iframe-wrapper {
        height: 48vh
    }

    .cards {
        grid-template-columns: 1fr
    }

    .controls {
        flex-direction: column;
        align-items: stretch
    }

    .search-box {
        min-width: 100%
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px
}

::-webkit-scrollbar-track {
    background: #111
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px
}