:root {
    --bg-color: #0d1117;
    --surface: #161b22;
    --surface-glass: rgba(22, 27, 34, 0.7);
    --border: #30363d;
    --text-main: #c9d1d9;
    --text-muted: #8b949e;
    --primary: #2ea043;
    --primary-hover: #2c974b;
    --accent: #58a6ff;
    --radius: 8px;
    --font: 'Inter', sans-serif;
}

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

html,
body {
    touch-action: manipulation;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--surface-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    user-select: none;
}

.logo .logo-img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 2px 10px rgba(0, 240, 255, 0.25));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.logo:hover .logo-img {
    transform: scale(1.04);
    filter: drop-shadow(0 3px 14px rgba(0, 240, 255, 0.45));
}

.hero-logo {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.5rem;
    display: block;
    filter: drop-shadow(0 6px 24px rgba(0, 240, 255, 0.35));
    animation: heroFloat 3.5s ease-in-out infinite alternate;
}

@keyframes heroFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-7px); }
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    color: #fff;
}

.container {
    max-width: 1680px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

.center-view {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

h1, h2, h3 {
    color: #fff;
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: var(--font);
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-steam-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #171a21 0%, #253347 100%);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 15px 30px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-steam-login:hover {
    background: linear-gradient(135deg, #1b2838 0%, #2a475e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.25);
}

.steam-logo {
    height: 42px;
    margin-right: 20px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.1));
}


.glass-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: #fff;
    font-family: var(--font);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
}

.mt-4 {
    margin-top: 2rem;
}

/* Match list */
.header-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.match-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.match-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.match-header {
    padding: 1.25rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    cursor: pointer;
}

.match-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-muted);
}

.match-details h4 {
    color: #fff;
    margin-bottom: 4px;
}

.match-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.match-meta span {
    margin-right: 15px;
}

.match-status {
    text-align: right;
}

.match-score {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.premier { background: rgba(212, 175, 55, 0.2); color: #d4af37; border: 1px solid #d4af37; }
.badge.competitive { background: rgba(88, 166, 255, 0.2); color: var(--accent); border: 1px solid var(--accent); }
.badge.wingman { background: rgba(163, 113, 247, 0.2); color: #a371f7; border: 1px solid #a371f7; }

/* Expanded stats */
.match-stats {
    display: none;
    padding: 1.5rem;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--border);
    animation: slideDown 0.3s ease-out;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.stats-table th, .stats-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.stats-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.stats-table tbody tr:last-child td {
    border-bottom: none;
}

.stats-table .stat-val {
    text-align: center;
}

.team-row {
    background: rgba(255,255,255,0.02);
}

.terminal-text {
    font-family: monospace;
    color: var(--primary);
    background: #000;
    padding: 15px;
    border-radius: var(--radius);
    white-space: pre-wrap;
    font-size: 0.85rem;
}

.clip-render-placeholder {
    border-style: dashed;
}

.clip-render-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #58a6ff;
    border-radius: 50%;
    display: inline-block;
    animation: clipSpin 0.9s linear infinite;
}

@keyframes clipSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* Mobile hamburger button (hidden on desktop) */
.nav-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .navbar {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .logo .logo-img {
        height: 30px;
    }

    .nav-toggle-btn {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding-top: 0.75rem;
        margin-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    .navbar.nav-open .nav-links {
        display: flex;
    }

    .nav-links .nav-link {
        padding: 10px 12px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.04);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .nav-links .nav-link.active {
        background: rgba(88, 166, 255, 0.14);
    }

    .container {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }

    .glass-card {
        padding: 1rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .header-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    #matches-filters,
    #clips-filters {
        justify-content: flex-start !important;
        width: 100%;
    }

    .match-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .match-header img {
        width: 42px !important;
        height: 42px !important;
        margin-right: 10px !important;
    }

    .match-stats {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .btn-steam-login {
        font-size: 1.05rem;
        padding: 12px 18px;
    }

    .steam-logo {
        height: 32px;
        margin-right: 12px;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
}


/* Feed, Profiles & Notifications */
.nav-mobile-right {
    display: none;
    align-items: center;
    gap: 8px;
}

.feed-sort-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sort-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-pill.active,
.sort-pill:hover {
    background: rgba(88, 166, 255, 0.16);
    border-color: var(--accent);
    color: #fff;
}

.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr));
    gap: 1.25rem;
}

.feed-card {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    max-width: 100%;
}

.feed-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.feed-author {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #fff;
    text-decoration: none;
}

.feed-author:hover .feed-author-name {
    color: var(--accent);
    text-decoration: underline;
}

.feed-author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

.feed-author-name {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.2;
}

.feed-meta-time {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.feed-video {
    width: 100%;
    border-radius: 8px;
    background: #000;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

.feed-video-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

.feed-video-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.feed-play-btn {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.85);
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.feed-video-poster:hover .feed-play-btn {
    transform: scale(1.08);
    background: rgba(37, 99, 235, 0.88);
}

.feed-title {
    margin: 0;
    font-size: 1rem;
    color: #fff;
}

.feed-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feed-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.feed-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.feed-action-btn.liked {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
    color: #fca5a5;
}

.feed-comments-box {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.feed-comments-box.open {
    display: flex;
}

.feed-comments-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.83rem;
}

.comment-item.highlighted {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.65);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.feed-comment-form {
    display: flex;
    gap: 6px;
}

.feed-comment-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.84rem;
    font-family: inherit;
}

.profile-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.profile-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
}

.profile-stats-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.notif-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notif-bell-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    color: #fff;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    display: none;
    align-items: center;
    justify-content: center;
}

.notif-badge.visible {
    display: inline-flex;
}

.notif-dropdown {
    display: none;
    position: fixed;
    top: 64px;
    right: 20px;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #141824;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
    z-index: 500;
    overflow: hidden;
}

.notif-dropdown.open {
    display: block;
}

.push-offer {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 600;
    width: 340px;
    max-width: calc(100vw - 40px);
    padding: 14px;
    background: #141824;
    font-size: 0.88rem;
}

.push-offer-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.push-offer-hint {
    display: block;
    margin-top: 8px;
    color: #94a3b8;
    font-size: 0.78rem;
}

.notif-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    font-size: 0.88rem;
}

.notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.15s;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.notif-item.unread {
    background: rgba(88, 166, 255, 0.1);
    border-left: 3px solid var(--accent);
}

@media (max-width: 768px) {
    .nav-mobile-right {
        display: inline-flex;
    }

    #notif-wrapper-desktop {
        display: none !important;
    }

    .feed-grid {
        grid-template-columns: 1fr;
    }

    .notif-dropdown {
        position: fixed;
        top: 60px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}


/* Leetify Match Pill & Profile Stats (CS2 Clips Dark-Glass Style) */
.match-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leetify-match-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.15s ease, filter 0.15s ease;
    white-space: nowrap;
}

.leetify-match-pill:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
}

.leetify-match-pill svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.leetify-match-pill.rating-pos {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.38);
    color: #4ade80;
}

.leetify-match-pill.rating-neutral {
    background: rgba(148, 163, 184, 0.14);
    border-color: rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

.leetify-match-pill.rating-warn {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.38);
    color: #fbbf24;
}

.leetify-match-pill.rating-neg {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.leetify-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 8px;
    background: rgba(248, 73, 130, 0.12);
    border: 1px solid rgba(248, 73, 130, 0.35);
    color: #fda4af;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
}

.leetify-profile-btn:hover {
    background: rgba(248, 73, 130, 0.22);
    color: #fff;
}

.leetify-profile-btn svg {
    width: 16px;
    height: 16px;
}

.leetify-attribution-footer {
    position: fixed;
    right: 16px;
    bottom: 14px;
    z-index: 40;
    padding: clamp(6px, 0.7vw, 10px) clamp(10px, 1vw, 14px);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.leetify-attribution-footer:hover {
    opacity: 1;
}

.leetify-attribution-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-weight: 600;
}

.leetify-attribution-link:hover {
    color: #F84982;
    text-decoration: underline;
}

.leetify-badge-img {
    height: clamp(24px, 2.2vw, 38px);
    width: auto;
    display: block;
}

.leetify-stats-panel {
    padding: 1.25rem;
}

.leetify-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.leetify-rank-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.leetify-rank-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
}

.leetify-metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.leetify-metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.leetify-metric-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
}

.leetify-metric-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.leetify-bar-track {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.leetify-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.35s ease;
}

@media (max-width: 900px) {
    .leetify-metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .leetify-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .match-status {
        gap: 8px;
    }
}

/* Clip <-> Match & Leetify linking */
.clip-match-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    padding: clamp(6px, 0.7vw, 10px) clamp(10px, 1vw, 14px);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.76rem;
    margin-top: 2px;
    overflow: hidden;
}

.clip-match-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #cbd5e1;
    text-decoration: none;
    cursor: pointer;
}

.clip-match-link:hover {
    color: #fff;
}

.clip-match-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.clip-match-score.win { color: #4ade80; }
.clip-match-score.loss { color: #f87171; }
.clip-match-score.tie { color: #fbbf24; }

.clip-match-date {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.match-clips-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(88, 166, 255, 0.14);
    border: 1px solid rgba(88, 166, 255, 0.35);
    color: #93c5fd;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.match-inline-clips {
    margin-bottom: 14px;
}

.match-inline-clips-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.match-inline-clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.match-inline-clip-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.match-inline-clip-card video {
    width: 100%;
    border-radius: 6px;
    background: #000;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.kill-flag-icon {
    height: 15px;
    width: auto;
    vertical-align: -2px;
    display: inline-block;
    margin-left: 3px;
}

.filter-flag-icon {
    height: 14px;
    width: auto;
    vertical-align: -2px;
    display: inline-block;
}

.credits-badge-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 38px;
    padding: 0 12px;
    line-height: 1;
    margin-left: 0;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.35);
    border-radius: 8px;
    color: #9cdcfe;
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.credits-badge-btn:hover {
    background: rgba(88, 166, 255, 0.2);
    border-color: var(--accent);
    color: #fff;
}

.credits-dropdown {
    display: none;
    position: fixed;
    top: 64px;
    right: 20px;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #141824;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
    z-index: 510;
    overflow: hidden;
    padding: 12px 14px;
    color: #e2e8f0;
    font-size: 0.82rem;
}

.credits-dropdown.open {
    display: block;
}

.credits-dd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    font-size: 0.92rem;
}

.credits-dd-summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.credits-dd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.credits-dd-grants {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.credits-grant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.76rem;
}

.credits-dd-next {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    font-size: 0.77rem;
}

@media (max-width: 768px) {
    .credits-dropdown {
        top: 60px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

@media (max-width: 460px) {
    .clip-match-strip {
        flex-wrap: nowrap;
        gap: 6px;
        padding: 6px 8px;
    }

    .clip-match-date {
        display: none;
    }
}

@media (max-width: 640px) {
    .match-header {
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
    }

    .match-header > img,
    .match-header .match-icon {
        width: 42px !important;
        height: 42px !important;
        margin-right: 0 !important;
        flex-shrink: 0;
    }

    .match-details {
        flex: 1 1 0;
        min-width: 0;
    }

    .match-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 8px;
        font-size: 0.76rem;
        margin-top: 3px;
    }

    .match-status {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .match-score {
        margin-left: auto;
        font-size: 1.2rem !important;
    }
}

.admin-credits-table-wrap {
    overflow-x: auto;
    margin-top: 10px;
}

.admin-credits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.admin-credits-table th,
.admin-credits-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    vertical-align: top;
}

.admin-credits-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.admin-credits-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
}

.admin-credits-user img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.admin-credits-total {
    font-weight: 700;
    color: #9cdcfe;
    white-space: nowrap;
}

.admin-credits-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.admin-credit-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    white-space: nowrap;
}

.admin-credit-exp-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
}

.admin-credit-exp-item {
    white-space: nowrap;
    color: #cbd5e1;
}

.buy-credits-modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.buy-credits-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.buy-credits-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    background: #141824;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.buy-credits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.buy-credits-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
}

.buy-credits-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.buy-preset-btn {
    padding: 10px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.buy-preset-btn.active,
.buy-preset-btn:hover {
    border-color: var(--accent);
    background: rgba(88, 166, 255, 0.16);
    color: #fff;
}

.buy-credits-summary {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    font-size: 0.9rem;
    text-align: center;
}

select {
    color-scheme: dark;
}

select option {
    background-color: #161b22;
    color: #e2e8f0;
}

/* Filter bar: toggle chips + min-kills segmented control */
.fbar { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,0.03); color: var(--text-muted); font: inherit; font-size: 0.8rem; cursor: pointer; transition: all .15s; user-select: none; }
.fchip:hover { border-color: #8b949e; color: var(--text-main); }
.fchip.on { border-color: var(--primary); background: rgba(46,160,67,0.16); color: #fff; }
.fchip .filter-flag-icon { opacity: .7; }
.fchip.on .filter-flag-icon { opacity: 1; }
.fchip-emoji { font-size: 0.85rem; line-height: 1; }
.fseg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.fseg button { background: rgba(255,255,255,0.03); color: var(--text-muted); border: 0; border-right: 1px solid var(--border); padding: 6px 11px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.fseg button:last-child { border-right: 0; }
.fseg button:hover { color: var(--text-main); }
.fseg button.on { background: var(--accent); color: #0d1117; font-weight: 700; }

/* ---- Auto-render rule editor ---- */
.ar-editor { display: flex; flex-direction: column; gap: 10px; }
.ar-enable { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.ar-enable input { width: 17px; height: 17px; accent-color: #3b82f6; }
.ar-help { color: var(--text-muted); font-size: 0.8rem; margin: 0; }
.ar-and-text { color: var(--accent); }
.ar-or-text { color: #d29922; }
.ar-notice { font-size: 0.8rem; border: 1px solid #d2992266; background: rgba(210, 153, 34, 0.08); color: var(--text-main); border-radius: var(--radius); padding: 8px 10px; }
.ar-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.06em; }
.ar-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.ar-blk { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 8px; background: #21262d; cursor: grab; user-select: none; font-size: 0.8rem; white-space: nowrap; color: var(--text-main); }
.ar-blk:active { cursor: grabbing; }
.ar-blk img { height: 15px; width: auto; }
.ar-blk select { background: var(--bg-color); color: var(--text-main); border: 1px solid var(--border); border-radius: 5px; font-size: 0.78rem; padding: 1px 3px; cursor: pointer; }
.ar-g-kill { border-color: #58a6ff66; }
.ar-g-mod { border-color: #2ea04366; }
.ar-g-wpn { border-color: #a371f766; }
.ar-g-misc { border-color: #d2992266; }
.ar-palette .ar-blk:hover { border-color: var(--text-muted); }
.ar-blk.ar-dragging { opacity: 0.4; }
.ar-x { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.85rem; padding: 0 0 0 2px; line-height: 1; }
.ar-x:hover { color: #f85149; }
.ar-rules-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ar-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.ar-btn { background: #21262d; border: 1px solid var(--border); color: var(--text-main); border-radius: 8px; padding: 6px 11px; cursor: pointer; font-size: 0.8rem; }
.ar-btn:hover { border-color: var(--text-muted); }
.ar-btn.ar-pri { background: var(--primary); border-color: var(--primary); color: #fff; }
.ar-btn.ar-pri:hover { background: var(--primary-hover); }
.ar-btn:disabled { opacity: 0.5; cursor: default; }
.ar-rows { display: flex; flex-direction: column; }
.ar-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 48px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 10px; background: rgba(255, 255, 255, 0.02); cursor: pointer; }
.ar-row.ar-selected { border-color: #58a6ff88; }
.ar-row.ar-over, .ar-newrow.ar-over { border-color: var(--accent); background: rgba(88, 166, 255, 0.07); }
.ar-and { color: var(--accent); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; }
.ar-ph { color: var(--text-muted); font-size: 0.8rem; }
.ar-rowx { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.78rem; }
.ar-rowx:hover { color: #f85149; }
.ar-or { display: flex; align-items: center; gap: 10px; color: #d29922; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; margin: 6px 0; }
.ar-or::before, .ar-or::after { content: ""; flex: 1; height: 1px; background: #d2992244; }
.ar-newrow { border: 1px dashed var(--border); border-radius: 10px; padding: 11px; text-align: center; color: var(--text-muted); font-size: 0.82rem; background: none; cursor: pointer; width: 100%; }
.ar-newrow:hover { border-color: var(--text-muted); }
.ar-summary { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; color: var(--text-muted); background: var(--bg-color); border: 1px solid var(--border); border-radius: 8px; padding: 10px; white-space: pre-wrap; word-break: break-word; }
.ar-footer { display: flex; justify-content: flex-end; }
@media (max-width: 600px) {
    .ar-blk { white-space: normal; }
}

.referral-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0;
    padding: 12px 14px;
    border: 1px solid rgba(88, 166, 255, 0.35);
    border-radius: 8px;
    background: rgba(88, 166, 255, 0.1);
    text-align: left;
    font-size: 0.88rem;
}

.referral-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.referral-link-row input {
    flex: 1 1 240px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.95rem;
}

.referral-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.referral-stats strong {
    display: block;
    color: #fff;
    font-size: 1.5rem;
}

.referral-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.referral-row img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.referral-row .referral-state {
    margin-left: auto;
    color: var(--text-muted);
}

.referral-settings {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    font-size: 0.82rem;
}

.referral-settings input[type="number"] {
    display: block;
    width: 110px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Montage (beta) */
.beta-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    background: rgba(249, 115, 22, 0.18);
    color: #fdba74;
    font-size: 0.62rem;
    font-weight: 700;
    vertical-align: middle;
}

.music-credit { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; overflow-wrap: anywhere; }
#montage-player video { width: 100%; max-height: 75vh; border-radius: 8px; background: #000; }
.feed-kind-btn {
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 6px 4px;
    margin-right: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.feed-kind-btn.active, .feed-kind-btn:hover { color: #fff; }
.feed-kind-btn.active { border-bottom-color: var(--accent); }
@media (max-width: 640px) {
    #view-feed .header-action { flex-wrap: wrap; gap: 10px; }
}
.montage-intro { color: var(--text-muted); margin-bottom: 14px; }
.montage-muted { color: var(--text-muted); font-size: 0.82rem; }
.montage-error { color: #f87171; }
.montage-card { text-align: left; margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.montage-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.montage-card .btn, .montage-job .btn { padding: 6px 14px; font-size: 0.82rem; color: #fff; background: rgba(255, 255, 255, 0.1); }
.montage-card .btn-primary, .montage-job .btn-primary { background: var(--primary); }
.montage-card .btn:disabled, .montage-job .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.montage-card select, .montage-card input[type="text"], .montage-upload input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #161b22;
    color: #fff;
    color-scheme: dark;
    font-family: inherit;
}
.montage-card input[type="range"] { width: 100%; accent-color: var(--accent); }
.montage-wave { display: block; width: 100%; height: 110px; border-radius: 6px; background: rgba(0, 0, 0, 0.3); cursor: pointer; touch-action: none; }
.montage-styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.montage-style {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.montage-style span { display: block; color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }
.montage-style.active { border-color: var(--accent); background: rgba(88, 166, 255, 0.12); }
.montage-kills { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; max-height: 420px; overflow-y: auto; }
.montage-kill { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.82rem; }
.montage-kill.used { border-color: rgba(46, 160, 67, 0.7); background: rgba(46, 160, 67, 0.08); }
.montage-kill label { flex: 1; min-width: 0; cursor: pointer; }
.montage-kill .montage-muted { margin-left: 4px; }
.montage-pin, .montage-watch { border: none; background: none; color: #fff; cursor: pointer; padding: 6px; opacity: 0.45; filter: grayscale(1); }
.montage-pin.active { opacity: 1; filter: none; }
.montage-pin:hover, .montage-watch:hover { opacity: 1; }
.montage-job { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 10px; text-align: left; }
.montage-upload { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; gap: 12px; font-size: 0.82rem; margin: 10px 0; }

/* Advent calendar (public/advent.js) */
.advent-banner {
    border-color: rgba(248, 113, 113, 0.45);
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.14), rgba(74, 222, 128, 0.12));
}

.advent-dialog {
    max-width: 520px;
    overflow: hidden;
}

.advent-info {
    font-size: 0.85rem;
    margin-bottom: 12px;
    min-height: 2.4em;
}

.advent-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.advent-window {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    aspect-ratio: 1;
    min-width: 0;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
    font: inherit;
    cursor: default;
}

.advent-window.big { border-color: rgba(250, 204, 21, 0.5); }

.advent-day {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
}

.advent-note {
    font-size: 0.62rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.advent-amount {
    font-size: 0.8rem;
    font-weight: 700;
    color: #4ade80;
}

.advent-window.missed { opacity: 0.35; }
.advent-window.locked { opacity: 0.6; }
.advent-window.opened { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.35); }

.advent-window.today {
    cursor: pointer;
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.18);
    animation: advent-pulse 1.6s ease-in-out infinite;
}

.advent-window.today .advent-note { color: #fecaca; }
.advent-window.today:hover { background: rgba(248, 113, 113, 0.3); }
.advent-window.today:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.advent-window.opening { animation: none; opacity: 0.7; }
.advent-window.just-opened { animation: advent-pop 0.5s ease-out; }

@keyframes advent-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(248, 113, 113, 0); }
}

@keyframes advent-pop {
    0% { transform: scale(0.8) rotateY(90deg); }
    70% { transform: scale(1.12) rotateY(0); }
    100% { transform: scale(1); }
}

.advent-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.advent-confetti i {
    position: absolute;
    top: -10px;
    width: 7px;
    height: 11px;
    border-radius: 2px;
    animation: advent-fall 1.6s ease-in forwards;
}

@keyframes advent-fall {
    to { transform: translateY(520px) rotate(540deg); opacity: 0; }
}

@media (max-width: 480px) {
    .advent-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .advent-window.today, .advent-window.just-opened { animation: none; }
}

/* Clip limit and Clips+ (library view) */
.clip-plan-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
    margin: -0.75rem 0 1.25rem;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-glass);
    font-size: 0.85rem;
}
.clip-plan-bar[hidden] { display: none; }
.clip-plan-usage {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    min-width: 0;
}
.clip-plan-meter {
    width: 160px;
    max-width: 40vw;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.clip-plan-meter > span {
    display: block;
    height: 100%;
    background: var(--accent);
}
.clip-plan-meter.full > span { background: #f87171; }
.clip-plan-full { color: #fca5a5; }
.clip-plan-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.clip-plan-note { color: var(--text-muted); }
.clip-plan-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
}

/* Clip of the Month (public/clip_month.js) */
.cotm-banner {
    border-color: rgba(251, 191, 36, 0.45);
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.14), rgba(88, 166, 255, 0.1));
}
.cotm-banner-actions { display: flex; align-items: center; gap: 8px; }
.cotm-banner-close {
    background: none; border: none; color: #94a3b8; font-size: 1rem; cursor: pointer; padding: 4px 6px;
}
.cotm-hero { padding: 1.1rem 1.25rem; margin-bottom: 18px; }
.cotm-hero-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.cotm-month { font-size: 1.35rem; font-weight: 800; color: #fff; }
.cotm-prizes { display: flex; flex-wrap: wrap; gap: 8px; }
.cotm-prize-chip {
    padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
}
.cotm-prize-chip.cotm-place-1, .cotm-entry.cotm-place-1 { border-color: rgba(251, 191, 36, 0.55); }
.cotm-prize-chip.cotm-place-2, .cotm-entry.cotm-place-2 { border-color: rgba(203, 213, 225, 0.5); }
.cotm-prize-chip.cotm-place-3, .cotm-entry.cotm-place-3 { border-color: rgba(217, 119, 6, 0.5); }
.cotm-rules { margin-top: 12px; font-size: 0.85rem; color: #cbd5e1; }
.cotm-rules summary { cursor: pointer; color: #58a6ff; font-weight: 600; }
.cotm-rules ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.55; }
.cotm-heading { margin: 18px 0 10px; }
.cotm-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.cotm-entry {
    display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.03); min-width: 0;
}
.cotm-entry[data-cotm-clip] { cursor: pointer; }
.cotm-entry[data-cotm-clip]:hover { background: rgba(255, 255, 255, 0.07); }
.cotm-entry.cotm-top { background: rgba(251, 191, 36, 0.06); }
.cotm-entry.cotm-gone { opacity: 0.6; }
.cotm-rank { width: 34px; flex: none; text-align: center; font-size: 1.2rem; font-weight: 800; color: #94a3b8; }
.cotm-thumb {
    width: 96px; height: 54px; flex: none; object-fit: cover; border-radius: 6px; background: rgba(255, 255, 255, 0.05);
}
.cotm-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.cotm-title { font-weight: 700; color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cotm-author { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; color: #94a3b8; text-decoration: none; }
.cotm-author img { border-radius: 50%; }
.cotm-likes { flex: none; font-weight: 700; color: #e2e8f0; }
.cotm-prize { flex: none; font-weight: 700; color: #fbbf24; }
.cotm-past-month h4 { margin: 6px 0 8px; color: #cbd5e1; }
.cotm-past-month + .cotm-past-month { margin-top: 10px; }
.cotm-badge {
    display: inline-block; margin-bottom: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
    color: #fde68a; text-decoration: none; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.4);
}
.cotm-badge.cotm-place-2 { color: #e2e8f0; background: rgba(203, 213, 225, 0.1); border-color: rgba(203, 213, 225, 0.4); }
.cotm-badge.cotm-place-3 { color: #fdba74; background: rgba(217, 119, 6, 0.12); border-color: rgba(217, 119, 6, 0.45); }
@media (max-width: 600px) {
    .cotm-thumb { width: 64px; height: 36px; }
    .cotm-entry { gap: 8px; padding: 8px; }
    .cotm-rank { width: 26px; font-size: 1rem; }
}
