:root {
    --bg: #0d0b12;
    --bg-elevated: #18141f;
    --border: #2c2536;
    --text: #f1eef7;
    --text-muted: #9d94ad;
    /* Gold = "interact with this" (brand, links, CTAs). Kept deliberately apart from
       --live below: two different meanings were sharing one near-identical hue before,
       which muddied both. */
    --accent: #f0b429;
    --accent-hover: #ffc94d;
    /* Red = "this is happening right now" — reserved for live status and danger states,
       never used as a general interactive/brand color. */
    --live: #ff3860;
    --danger: #ff3860;
    --radius: 14px;
    --radius-sm: 6px;
    --font-display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.4;
}

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: 1.15;
}

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

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

/* Header */
.site-header {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header__bar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.site-header__logo img {
    height: 36px;
}

.site-header__search {
    display: flex;
    flex: 1 1 240px;
    max-width: 420px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.site-header__search input {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
}

.site-header__search button {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 0 14px;
    cursor: pointer;
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    font-weight: 500;
    margin-left: auto;
}

.site-header__nav a:hover {
    color: var(--accent-hover);
}

.site-header__cta {
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
}

.site-header__cta:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* Layout */
.page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.section {
    margin-bottom: 40px;
}

.section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section__head h1,
.section__head h2 {
    font-size: 1.6rem;
    margin: 0;
}

.breadcrumbs {
    margin-bottom: 16px;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 6px;
    color: var(--border);
}

.breadcrumbs a:hover {
    color: var(--accent-hover);
}

.page-intro {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 20px;
}

.section__more {
    font-size: 14px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 999px;
}

.section__more:hover {
    color: var(--text);
    border-color: var(--accent);
}

.tabs {
    display: flex;
    gap: 8px;
}

.tabs__link {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-muted);
}

.tabs__link.is-active,
.tabs__link:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* Grid + cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 10px;
}

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-3px) scale(1.015);
    border-color: var(--accent);
    box-shadow: 0 8px 24px -8px rgba(240, 180, 41, 0.35);
}

.card__thumb {
    display: block;
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card__badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}

.card__badge--live {
    left: 6px;
    right: auto;
    top: 6px;
    bottom: auto;
    background: var(--live);
    font-weight: 700;
    letter-spacing: 0.03em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card__badge--live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
    .card__badge--live::before {
        animation: none;
    }
}

.card__body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__title:hover {
    color: var(--accent-hover);
}

.card__meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.card__meta a:hover {
    color: var(--accent-hover);
}

.empty {
    color: var(--text-muted);
    font-size: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.pagination__link {
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
}

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

/* Notices */
.notice {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 14px;
}

.notice--success {
    background: rgba(46, 204, 113, 0.12);
    color: #4ade80;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.notice--danger {
    background: rgba(255, 56, 96, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 56, 96, 0.3);
}

.notice--danger a {
    text-decoration: underline;
}

/* Profile page */
.profile {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

.profile__card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
}

.profile__avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
}

.profile__name {
    font-size: 1.25rem;
    margin: 0 0 12px;
}

.profile__stats {
    text-align: left;
    margin: 16px 0 0;
    font-size: 14px;
}

.profile__stats dt {
    color: var(--text-muted);
    margin-top: 10px;
}

.profile__stats dd {
    margin: 2px 0 0;
    font-weight: 600;
}

.profile__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
    text-align: left;
}

.tag {
    font-size: 12px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 999px;
}

.tag:hover {
    color: var(--text);
    border-color: var(--accent);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: baseline;
}

.tag-cloud__item {
    color: var(--text-muted);
    font-weight: 600;
    line-height: 1;
}

.tag-cloud__item:hover {
    color: var(--accent);
}

.profile__scores {
    text-align: left;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .profile {
        grid-template-columns: 1fr;
    }
}

.profile__stats dd.is-up {
    color: #4ade80;
}

.profile__stats dd.is-down {
    color: var(--accent-hover);
}

/* Activity stats */
.activity {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.activity__col h3 {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 8px;
    font-weight: 600;
}

.activity__col .profile__stats {
    margin: 0;
}

.activity__best {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.activity__summary {
    margin: 0 0 16px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

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

.video-info {
    display: flex;
    gap: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.video-info__avatar {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.video-info__body h1 {
    /* This h1 holds the video's actual (long, dynamic) title, not a short structural
       heading — keep it in the legible body face rather than the caps display font. */
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 6px;
}

.video-info__meta {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 10px;
}

@media (max-width: 600px) {
    .video-info {
        flex-direction: column;
    }
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
}

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

.form-error {
    color: var(--danger);
    font-size: 12px;
    margin: 6px 0 0;
}

button.pagination__link {
    background: var(--accent);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-size: 14px;
}

button.pagination__link:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* Popup */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.popup-overlay[hidden] {
    display: none;
}

.popup-modal {
    position: relative;
    max-width: 90vw;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
}

.popup-modal img {
    max-width: 100%;
    border-radius: 6px;
}

.popup-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.popup-close:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

/* Charts */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.chart-card {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.chart-card h3 {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 12px;
    font-weight: 600;
}

.chart-card svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.chart-grid-line {
    stroke: var(--border);
    stroke-width: 1;
}

.chart-axis-label {
    fill: var(--text-muted);
    font-size: 10px;
}

.chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.chart-area {
    fill: var(--accent);
    opacity: 0.1;
}

.chart-dot {
    fill: var(--accent);
    stroke: var(--bg-elevated);
    stroke-width: 2;
}

.chart-hit {
    fill: transparent;
    cursor: pointer;
}

.chart-hit:focus {
    outline: none;
}

.chart-hit:hover + .chart-dot,
.chart-hit:focus + .chart-dot {
    fill: var(--accent-hover);
}

.chart-end-label {
    fill: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.chart-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
    z-index: 5;
    transform: translateX(-50%);
}

.show-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.show-list__item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    background: var(--bg-elevated);
    padding: 10px 14px;
    font-size: 13px;
}

.show-list__date {
    flex: 0 0 auto;
    color: var(--text-muted);
    width: 80px;
}

.show-list__title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.show-list__meta {
    flex: 0 0 auto;
    color: var(--text-muted);
    white-space: nowrap;
}

@media (max-width: 640px) {
    .show-list__item {
        flex-wrap: wrap;
    }

    .show-list__title {
        white-space: normal;
        order: 3;
        flex-basis: 100%;
    }
}

.chart-bar {
    fill: var(--accent);
    pointer-events: none;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

.site-footer a:hover {
    color: var(--accent-hover);
}

@media (max-width: 640px) {
    .site-header__nav {
        display: none;
    }
}
