/* ============================================
   COMMUTUBE - The People's Video Platform
   A glorious design for the proletariat
   ============================================ */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-card: #141414;
    --bg-hover: #1f1f1f;
    --bg-elevated: #1c1c1c;
    --red-primary: #d32f2f;
    --red-light: #ef5350;
    --red-bright: #ff1744;
    --red-dark: #7f0000;
    --red-deep: #4a0000;
    --red-glow: rgba(211, 47, 47, 0.25);
    --red-glow-strong: rgba(211, 47, 47, 0.5);
    --gold: #ffca28;
    --gold-dim: #c49000;
    --gold-glow: rgba(255, 202, 40, 0.15);
    --text-primary: #eaeaea;
    --text-secondary: #999999;
    --text-muted: #5c5c5c;
    --border-color: #222222;
    --border-light: #2a2a2a;
    --sidebar-width: 240px;
    --header-height: 56px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px var(--red-glow);
    --transition-fast: 0.15s ease;
    --transition-med: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

::selection {
    background: var(--red-primary);
    color: white;
}

/* ===== HEADER ===== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 200px;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: var(--transition-fast);
}

.sidebar-toggle:hover span {
    background: var(--text-primary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--text-primary);
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.85;
}

.logo-icon {
    font-size: 26px;
    color: var(--red-light);
    filter: drop-shadow(0 0 8px var(--red-glow));
}

.logo-text {
    background: linear-gradient(135deg, var(--red-light) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== SEARCH ===== */
.header-center {
    flex: 1;
    max-width: 600px;
    margin: 0 32px;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 9px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-med);
}

.search-input:focus {
    background: var(--bg-hover);
    border-color: var(--red-primary);
    box-shadow: inset 0 0 0 1px var(--red-glow);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    padding: 9px 22px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-btn:hover {
    background: var(--red-primary);
    border-color: var(--red-primary);
    color: white;
}

/* ===== HEADER RIGHT ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 18px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all var(--transition-med);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-upload {
    background: var(--red-primary);
    color: white;
    font-weight: 500;
}

.btn-upload:hover {
    background: var(--red-light);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-login {
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    background: transparent;
    font-weight: 500;
}

.btn-login:hover {
    background: var(--red-primary);
    border-color: var(--red-primary);
    color: white;
}

.btn-primary {
    background: var(--red-primary);
    color: white;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.btn-primary:hover {
    background: var(--red-light);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    padding: 12px 28px;
    font-size: 15px;
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

/* ===== USER MENU ===== */
.user-menu {
    position: relative;
}

.user-avatar-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: box-shadow var(--transition-fast);
}

.user-avatar-btn:hover {
    box-shadow: 0 0 0 2px var(--red-glow);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    border: none;
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 20px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    min-width: 260px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 1001;
    animation: dropdownIn 0.2s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-dropdown.show {
    display: block;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(211, 47, 47, 0.03);
}

.dropdown-header strong {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
}

.dropdown-header small {
    color: var(--text-muted);
    font-size: 12px;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.logout-link:hover {
    color: var(--red-light) !important;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 12px 0;
    z-index: 999;
    transition: transform var(--transition-slow);
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 24px;
    margin: 1px 8px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(211, 47, 47, 0.1);
    color: var(--red-light);
}

.nav-icon {
    font-size: 17px;
    width: 24px;
    text-align: center;
    opacity: 0.8;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 20px;
}

.nav-section-title {
    padding: 12px 32px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.sidebar-footer {
    padding: 20px 24px;
}

.slogan {
    font-style: italic;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.7;
    border-left: 2px solid var(--red-dark);
    padding-left: 12px;
    margin-bottom: 16px;
}

.copyright {
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: 0.3px;
}

.copyright a {
    color: var(--text-muted);
    text-decoration: none;
}

.copyright a:hover {
    color: var(--text-secondary);
}

/* ===== MAIN CONTENT ===== */
.content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 28px 32px;
    min-height: calc(100vh - var(--header-height));
}

.site-footer {
    margin-left: var(--sidebar-width);
    padding: 20px 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.site-footer .footer-links {
    display: flex;
    gap: 20px;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

@media (max-width: 768px) {
    .site-footer {
        margin-left: 0;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

.content.full-width {
    margin-left: 0;
    padding: 24px;
}

.sidebar.hidden ~ .content,
.sidebar.hidden + .content {
    margin-left: 0;
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
    animation: slideDown 0.3s ease;
}

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

.alert-success {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4caf50;
    color: #66bb6a;
}

.alert-error {
    background: rgba(211, 47, 47, 0.1);
    border-color: var(--red-primary);
    color: var(--red-light);
}

.alert-info {
    background: var(--gold-glow);
    border-color: var(--gold);
    color: var(--gold);
}

/* ===== VIDEO GRID ===== */
.section-title {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.3px;
}

.section-title .icon {
    color: var(--red-light);
    font-size: 22px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.video-card {
    display: block;
    transition: transform var(--transition-med);
    border-radius: var(--radius-lg);
}

.video-card:hover {
    transform: translateY(-4px);
}

.video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-tertiary);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-med);
}

.video-card:hover .video-thumb {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(211, 47, 47, 0.15);
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.video-card:hover .video-thumb img {
    transform: scale(1.04);
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--bg-tertiary) 0%, var(--red-deep) 100%);
}

.thumb-icon {
    font-size: 40px;
    color: var(--red-primary);
    opacity: 0.35;
    margin-bottom: 6px;
}

.thumb-text {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    padding: 0 20px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
}

.video-info {
    display: flex;
    gap: 12px;
    padding: 14px 4px 4px;
}

.video-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex-shrink: 0;
}

.video-meta {
    flex: 1;
    min-width: 0;
}

.video-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    transition: color var(--transition-fast);
}

.video-card:hover .video-title {
    color: var(--red-light);
}

.video-channel {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 2px;
    transition: color var(--transition-fast);
}

.video-card:hover .video-channel {
    color: var(--text-primary);
}

.video-stats {
    font-size: 12px;
    color: var(--text-muted);
}

/* ===== HERO BANNER ===== */
.hero-banner {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--red-deep) 40%, var(--bg-secondary) 100%);
    border: 1px solid rgba(211, 47, 47, 0.12);
    border-radius: var(--radius-xl);
    padding: 56px 40px;
    margin-bottom: 36px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.hero-banner::before {
    content: '\2625';
    position: absolute;
    font-size: 260px;
    opacity: 0.025;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(211, 47, 47, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-banner h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 38px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

.hero-banner h1 span {
    color: var(--red-light);
}

.hero-banner p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* ===== WATCH PAGE ===== */
.watch-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 28px;
    max-width: 1600px;
}

.video-player-container {
    width: 100%;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-player-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #050505, #150505);
}

.video-player-placeholder .big-icon {
    font-size: 72px;
    color: var(--red-primary);
    opacity: 0.4;
    margin-bottom: 16px;
}

.video-player-placeholder p {
    color: var(--text-muted);
    font-size: 14px;
}

.video-details {
    padding: 20px 0;
}

.video-details h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.4;
    letter-spacing: -0.2px;
}

.video-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.video-view-count {
    color: var(--text-secondary);
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.action-btn.active {
    background: rgba(211, 47, 47, 0.12);
    color: var(--red-light);
    border-color: rgba(211, 47, 47, 0.3);
}

.channel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 16px;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity var(--transition-fast);
}

.channel-info:hover {
    opacity: 0.85;
}

.channel-info .avatar-circle {
    width: 42px;
    height: 42px;
    font-size: 16px;
}

.channel-name {
    font-weight: 500;
    font-size: 15px;
}

.channel-subs {
    font-size: 13px;
    color: var(--text-muted);
}

.subscribe-btn {
    background: var(--red-primary);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-med);
}

.subscribe-btn:hover {
    background: var(--red-light);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.subscribe-btn.subscribed {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

.subscribe-btn.subscribed:hover {
    background: var(--bg-hover);
    box-shadow: none;
    transform: none;
}

.video-description {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    white-space: pre-wrap;
    border: 1px solid var(--border-color);
}

/* ===== COMMENTS ===== */
.comments-section {
    margin-top: 32px;
}

.comments-header {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 28px;
    color: var(--text-primary);
}

.comment-form {
    display: flex;
    gap: 14px;
    margin-bottom: 36px;
    align-items: flex-start;
}

.comment-input {
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    padding: 10px 0;
    outline: none;
    resize: none;
    font-family: inherit;
    transition: border-color var(--transition-med);
}

.comment-input:focus {
    border-color: var(--red-primary);
}

.comment-submit {
    padding: 10px 20px;
    background: var(--red-primary);
    color: white;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.comment-submit:hover {
    background: var(--red-light);
    transform: translateY(-1px);
}

.comment-item {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-body {
    flex: 1;
}

.comment-author {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
}

.comment-author span {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 8px;
    font-size: 12px;
}

.comment-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 4px;
}

/* ===== SIDEBAR RECOMMENDATIONS ===== */
.sidebar-videos h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.sidebar-video-card {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.sidebar-video-card:hover {
    background: var(--bg-hover);
}

.sidebar-thumb {
    width: 168px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.sidebar-thumb .thumb-placeholder {
    border-radius: var(--radius-sm);
}

.sidebar-thumb .thumb-icon {
    font-size: 24px;
}

.sidebar-thumb .thumb-text {
    font-size: 9px;
}

.sidebar-video-meta {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.sidebar-video-meta .video-title {
    font-size: 13px;
    -webkit-line-clamp: 2;
    margin-bottom: 6px;
    line-height: 1.4;
}

.sidebar-video-meta .video-channel {
    font-size: 12px;
}

.sidebar-video-meta .video-stats {
    font-size: 11px;
}

/* ===== FORMS ===== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height) - 100px);
}

.auth-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 44px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-form h2 {
    font-family: 'Oswald', sans-serif;
    text-align: center;
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.auth-form .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-check {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    transition: border-color var(--transition-fast);
}

.form-check:has(input:checked) {
    border-color: var(--red-primary);
    background: rgba(211, 47, 47, 0.05);
}

.form-check .check-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    margin: 0;
}

.form-check .check-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    accent-color: var(--red-primary);
    cursor: pointer;
}

.form-check .check-label a {
    color: var(--red-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: all var(--transition-med);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--red-primary);
    box-shadow: 0 0 0 3px var(--red-glow);
    background: var(--bg-tertiary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group select option {
    background: var(--bg-primary);
}

.form-actions {
    margin-top: 28px;
}

.form-actions .btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    justify-content: center;
    letter-spacing: 0.3px;
}

.form-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.form-footer a {
    color: var(--red-light);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.form-footer a:hover {
    color: var(--red-bright);
    text-decoration: underline;
}

/* ===== OAUTH BUTTONS ===== */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-med);
    font-family: inherit;
}

.oauth-google {
    background: #fff;
    color: #3c4043;
}

.oauth-google:hover {
    background: #f5f5f5;
    border-color: #4285F4;
    box-shadow: 0 2px 12px rgba(66, 133, 244, 0.15);
    transform: translateY(-1px);
}

.oauth-apple {
    background: #000;
    color: #fff;
    border-color: #333;
}

.oauth-apple:hover {
    background: #111;
    border-color: #555;
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.oauth-discord {
    background: #5865F2;
    color: #fff;
    border-color: #4752c4;
    text-decoration: none;
}

.oauth-discord:hover {
    background: #4752c4;
    border-color: #3c45a5;
    box-shadow: 0 2px 12px rgba(88, 101, 242, 0.35);
    transform: translateY(-1px);
}

.oauth-divider {
    display: flex;
    align-items: center;
    margin: 22px 0;
    gap: 16px;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.oauth-divider span {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ===== TURNSTILE ===== */
.turnstile-wrapper {
    display: flex;
    justify-content: center;
    margin: 24px 0 4px;
}

/* ===== UPLOAD PAGE ===== */
.upload-container {
    max-width: 780px;
    margin: 0 auto;
}

.upload-dropzone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-xl);
    padding: 64px 40px;
    text-align: center;
    margin-bottom: 28px;
    transition: all var(--transition-med);
    cursor: pointer;
    background: var(--bg-secondary);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--red-primary);
    background: rgba(211, 47, 47, 0.03);
    box-shadow: inset 0 0 40px rgba(211, 47, 47, 0.02);
}

.upload-dropzone .upload-icon {
    font-size: 56px;
    color: var(--red-primary);
    opacity: 0.5;
    margin-bottom: 16px;
}

.upload-dropzone h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

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

.upload-progress {
    display: none;
    margin: 24px 0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--red-primary), var(--red-light), var(--gold));
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
    animation: shimmer 2s linear infinite;
}

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

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== CHANNEL PAGE ===== */
.channel-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--red-deep) 50%, var(--bg-secondary) 100%);
    border-radius: var(--radius-xl);
    padding: 36px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 24px;
    border: 1px solid rgba(211, 47, 47, 0.1);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.channel-header .avatar-circle {
    width: 80px;
    height: 80px;
    font-size: 32px;
    box-shadow: var(--shadow-md);
}

.channel-header-info h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 4px;
}

.channel-header-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.channel-stats {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 6px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 56px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 15px;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ===== CATEGORY CHIPS ===== */
.category-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    overflow-x: auto;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.category-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 8px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.chip.active {
    background: var(--red-primary);
    border-color: var(--red-primary);
    color: white;
}

/* ===== UPLOAD HELPERS ===== */
.upload-file-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 10px;
    flex-wrap: wrap;
}

.file-info {
    color: var(--text-muted);
    font-size: 13px;
}

.btn-sm {
    padding: 6px 14px !important;
    font-size: 13px !important;
}

.upload-thumb-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.thumb-preview-img {
    height: 80px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 998;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.sidebar-overlay.show {
    display: block;
}

/* Ensure all interactive elements have decent tap targets */
a, button {
    -webkit-tap-highlight-color: transparent;
}

/* ===== TOUCH TARGETS — coarse pointer (touchscreens) ===== */
@media (pointer: coarse) {
    .sidebar-toggle {
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
        align-items: center;
        display: flex;
    }

    .user-avatar-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .action-btn {
        min-height: 44px;
        padding: 10px 18px;
    }

    .subscribe-btn {
        min-height: 44px;
    }

    .short-action-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .short-mute-btn {
        width: 44px;
        height: 44px;
    }

    .nav-item {
        padding: 12px 24px;
    }

    .comment-submit {
        min-height: 44px;
    }

    .oauth-btn {
        min-height: 48px;
    }
}

/* ===== RESPONSIVE ===== */

/* ── 900px: watch layout collapses (better for tablets) ── */
@media (max-width: 900px) {
    .watch-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-videos {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 14px;
    }

    .sidebar-videos h3 {
        grid-column: 1 / -1;
    }

    .sidebar-video-card {
        flex-direction: column;
        padding: 0;
    }

    .sidebar-thumb {
        width: 100%;
    }
}

/* ── 768px: main mobile breakpoint ── */
@media (max-width: 768px) {
    /* ─ Sidebar: slide off-canvas ─ */
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
        transition: transform var(--transition-slow);
        width: min(280px, 80vw);
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    /* ─ Content ─ */
    .content {
        margin-left: 0;
        padding: 12px 14px;
    }

    /* ─ Header search ─ */
    .header-center {
        margin: 0 4px;
    }

    /* ─ Video grid: 2 columns ─ */
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* ─ Hero banner ─ */
    .hero-banner {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }

    .hero-banner h1 { font-size: 24px; }
    .hero-banner p  { font-size: 14px; }

    /* ─ Channel page ─ */
    .channel-header {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
        gap: 14px;
    }

    .channel-header > div[style*="margin-left"] {
        margin-left: 0 !important;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    /* ─ Watch page ─ */
    .video-details h1 {
        font-size: 18px;
    }

    .video-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .channel-bar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .channel-bar .subscribe-btn {
        width: 100%;
        text-align: center;
    }

    /* ─ Comments ─ */
    .comment-form {
        flex-wrap: wrap;
        gap: 10px;
    }

    .comment-submit {
        width: 100%;
    }

    /* ─ Auth forms ─ */
    .auth-page {
        padding: 24px 14px 40px;
        align-items: flex-start;
    }

    .auth-form {
        padding: 24px 18px;
        border-radius: var(--radius-lg);
        max-width: 100%;
    }

    /* ─ Turnstile: clip overflow, scale down for tiny screens ─ */
    .turnstile-wrapper {
        overflow: hidden;
        display: flex;
        justify-content: flex-start;
    }

    /* ─ Upload ─ */
    .upload-dropzone {
        padding: 36px 16px;
    }

    .upload-thumb-row {
        flex-direction: column;
    }

    /* ─ Settings ─ */
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-nav {
        flex-direction: row;
        position: static;
        overflow-x: auto;
        gap: 4px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ── 560px: compact header ── */
@media (max-width: 560px) {
    /* Header: icon-only buttons */
    .btn-label {
        display: none;
    }

    .btn-upload,
    .btn-login {
        padding: 8px 12px;
        font-size: 17px;
    }

    /* Search input */
    .search-input {
        font-size: 13px;
        padding: 8px 10px;
    }

    .search-btn {
        padding: 8px 14px;
    }

    /* Header padding tighter */
    .main-header {
        padding: 0 10px;
    }

    /* Hero */
    .hero-banner {
        padding: 22px 14px;
    }

    .hero-banner h1 {
        font-size: 20px;
    }

    /* Auth */
    .auth-form {
        padding: 20px 14px;
    }

    .oauth-buttons {
        gap: 8px;
    }

    /* Upload dropzone */
    .upload-dropzone {
        padding: 28px 14px;
    }

    .upload-dropzone h3 {
        font-size: 16px;
    }
}

/* ── 480px: small phones ── */
@media (max-width: 480px) {
    /* Logo: icon only */
    .logo-text {
        display: none;
    }

    /* Single-column grid */
    .video-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Auth: full-bleed */
    .auth-form {
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 20px 14px;
        background: transparent;
    }

    .auth-page {
        padding: 12px 0 40px;
        background: var(--bg-secondary);
        min-height: 100dvh;
    }

    /* Channel */
    .channel-header {
        padding: 18px 14px;
    }

    .channel-header .avatar-circle {
        width: 64px !important;
        height: 64px !important;
        font-size: 24px !important;
    }

    /* Upload */
    .upload-file-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Settings */
    .settings-card {
        padding: 18px 14px;
    }

    .twofa-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Empty state */
    .empty-state {
        padding: 48px 16px;
    }

    /* Section title */
    .section-title {
        font-size: 17px;
    }
}

/* ── 360px: very small phones (Galaxy A series, older Androids) ── */
@media (max-width: 360px) {
    /* Scale down Turnstile (300px min-width can't be resized) */
    .cf-turnstile {
        transform: scale(0.82);
        transform-origin: left center;
        margin-bottom: -10px;
    }

    /* Search: drop placeholder text to bare minimum */
    .search-input::placeholder {
        font-size: 0; /* hide long placeholder */
    }

    .content {
        padding: 10px;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-card {
    animation: fadeInUp 0.5s ease both;
}

.video-card:nth-child(1) { animation-delay: 0s; }
.video-card:nth-child(2) { animation-delay: 0.06s; }
.video-card:nth-child(3) { animation-delay: 0.12s; }
.video-card:nth-child(4) { animation-delay: 0.18s; }
.video-card:nth-child(5) { animation-delay: 0.24s; }
.video-card:nth-child(6) { animation-delay: 0.3s; }
.video-card:nth-child(7) { animation-delay: 0.36s; }
.video-card:nth-child(8) { animation-delay: 0.42s; }

.hero-banner {
    animation: fadeInUp 0.6s ease both;
}

.section-title {
    animation: fadeInUp 0.5s ease both;
    animation-delay: 0.1s;
}

.auth-form {
    animation: fadeInUp 0.5s ease both;
}

/* ===== SETTINGS PAGE ===== */
.settings-page {
    max-width: 900px;
    margin: 0 auto;
}

.settings-header {
    margin-bottom: 32px;
}

.settings-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

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

.settings-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 28px;
    align-items: start;
}

/* Settings sidebar nav */
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: calc(var(--header-height) + 28px);
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.settings-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.settings-nav-item.active {
    background: rgba(211, 47, 47, 0.12);
    color: var(--red-light);
}

/* Settings content cards */
.settings-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.settings-card-title {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

.form-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

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

/* 2FA */
.twofa-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.twofa-header .settings-card-title {
    margin-bottom: 4px;
    padding-bottom: 0;
    border-bottom: none;
}

.twofa-badge {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.twofa-on {
    background: rgba(76, 175, 80, 0.12);
    color: #66bb6a;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.twofa-off {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.twofa-form {
    margin-top: 8px;
}

.twofa-info {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.totp-input {
    max-width: 180px;
    text-align: center;
    font-size: 22px !important;
    font-weight: 600;
    letter-spacing: 8px;
    padding: 12px 16px !important;
}

.twofa-setup {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.twofa-step {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 12px;
}

.qr-container {
    display: inline-flex;
    background: #fff;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.twofa-secret-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.twofa-secret {
    display: inline-block;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-family: monospace;
    font-size: 15px;
    letter-spacing: 3px;
    color: var(--gold);
    user-select: all;
}

.btn-danger {
    background: rgba(211, 47, 47, 0.15);
    color: var(--red-light);
    border: 1px solid var(--red-primary);
    padding: 12px 28px;
    font-size: 15px;
}

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


/* ===== SHORTS MODE — hide normal chrome ===== */
body.shorts-mode {
    overflow: hidden;
}

body.shorts-mode .content {
    margin: 0;
    padding: 0;
    min-height: 100dvh;
}

/* ===== SHORTS TOPBAR ===== */
.shorts-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    pointer-events: none;
}

.shorts-topbar > * {
    pointer-events: auto;
}

.shorts-back,
.shorts-upload-link {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    padding: 6px 12px;
    border-radius: var(--radius-xl);
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    transition: background var(--transition-fast);
}

.shorts-back:hover,
.shorts-upload-link:hover {
    background: rgba(211,47,47,0.5);
}

.shorts-topbar-title {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    letter-spacing: 1px;
}

/* ===== SHORTS EMPTY STATE ===== */
.shorts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px 20px;
}

.shorts-empty-icon {
    font-size: 72px;
    color: var(--red-primary);
    opacity: 0.35;
    margin-bottom: 20px;
}

.shorts-empty h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    margin-bottom: 12px;
}

.shorts-empty p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ===== SHORTS FEED ===== */
.shorts-feed {
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #000;
}

.shorts-feed::-webkit-scrollbar {
    display: none;
}

/* ===== INDIVIDUAL SLIDE ===== */
.short-slide {
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: #000;
    position: relative;
}

/* ===== VIDEO WRAPPER ===== */
.short-video-wrap {
    position: relative;
    width: min(420px, 56.25dvh); /* keep 9:16 at most */
    height: 100dvh;
    background: #000;
    flex-shrink: 0;
    overflow: hidden;
}

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

/* ===== PROGRESS BAR ===== */
.short-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.2);
    z-index: 20;
}

.short-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--red-primary), var(--gold));
    transition: width 0.25s linear;
    border-radius: 0 2px 2px 0;
}

/* ===== MUTE BUTTON ===== */
.short-mute-btn {
    position: absolute;
    top: 52px;
    right: 12px;
    z-index: 30;
    background: rgba(0,0,0,0.45);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background var(--transition-fast);
}

.short-mute-btn:hover {
    background: rgba(211,47,47,0.55);
}

/* ===== TAP OVERLAY (covers video for click-to-mute) ===== */
.short-tap-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
}

/* ===== MOBILE CAPTION (shown on mobile, hidden on desktop) ===== */
.short-video-caption {
    position: absolute;
    bottom: 56px;
    left: 14px;
    right: 72px;
    z-index: 25;
    display: none; /* shown in mobile media query */
}

.short-caption-channel {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.85);
    margin-bottom: 5px;
}

.short-caption-title {
    font-size: 13px;
    color: rgba(255,255,255,0.88);
    text-shadow: 0 1px 4px rgba(0,0,0,0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}

/* ===== DESKTOP ACTION PANEL ===== */
.short-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    padding-bottom: 20px;
    flex-shrink: 0;
    width: 72px;
}

.short-actions-channel {
    margin-bottom: 4px;
}

.short-creator-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    text-align: center;
    max-width: 72px;
    word-break: break-word;
    transition: color var(--transition-fast);
}

.short-creator-link:hover {
    color: var(--text-primary);
}

.short-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red-dark), var(--red-primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    border: 2px solid var(--gold);
    flex-shrink: 0;
}

.short-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform var(--transition-fast), color var(--transition-fast);
    padding: 4px;
}

.short-action-btn:hover {
    transform: scale(1.15);
    color: var(--gold);
}

.short-action-btn.active {
    color: var(--red-light);
}

.short-action-btn.active .short-action-icon {
    filter: drop-shadow(0 0 8px var(--red-glow-strong));
}

.short-subscribe-btn.subscribed,
.short-subscribe-btn.subscribed .short-action-icon {
    color: var(--gold);
}

.short-action-icon {
    font-size: 30px;
    line-height: 1;
}

.short-action-count,
.short-action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.short-actions-title {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    max-width: 72px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    margin-top: 4px;
}

/* ===== LOAD SENTINEL ===== */
.shorts-load-sentinel {
    height: 1px;
    scroll-snap-align: none;
    background: transparent;
}

/* ===== UPLOAD PAGE — CommieClip toggle ===== */
.short-toggle-group {
    margin-bottom: 20px;
}

.short-toggle-label {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    padding: 16px 20px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.short-toggle-label:hover {
    border-color: var(--red-primary);
    background: rgba(211,47,47,0.04);
}

.short-toggle-input {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--red-primary);
    cursor: pointer;
}

.short-toggle-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.short-toggle-text small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 3px;
}

/* ===== SHORTS MOBILE ===== */
@media (max-width: 768px) {
    .short-slide {
        gap: 0;
    }

    .short-video-wrap {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
    }

    /* Show overlay caption */
    .short-video-caption {
        display: block;
    }

    /* Overlay the action panel on the right side of the video */
    .short-actions {
        position: absolute;
        right: 10px;
        bottom: 70px;
        z-index: 30;
        width: 54px;
        gap: 18px;
        background: none;
        padding-bottom: 0;
    }

    /* Hide desktop-only elements */
    .short-actions-channel,
    .short-actions-title {
        display: none;
    }

    .short-avatar {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .short-action-icon {
        font-size: 26px;
    }

    /* White text on dark video */
    .short-action-btn {
        color: #fff;
        filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
    }

    .short-action-count,
    .short-action-label {
        color: rgba(255,255,255,0.9);
    }

    .short-action-btn.active {
        color: var(--red-light);
        filter: drop-shadow(0 0 6px rgba(239,83,80,0.7));
    }
}

/* ===== SHARE MODAL ===== */
.share-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.share-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    width: 100%;
    max-width: 520px;
    padding: 24px;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.share-modal-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.share-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}

.share-modal-close:hover { color: var(--text-primary); }

.share-section { margin-bottom: 18px; }

.share-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.share-row {
    display: flex;
    gap: 8px;
}

.share-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 10px;
    font-family: monospace;
    min-width: 0;
}

.share-input:focus { outline: none; border-color: var(--red-light); }

.share-copy-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.share-copy-btn:hover { background: var(--border-light); }

.share-embed-preview {
    margin-top: 12px;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-color);
}

/* ============================================
   LIVESTREAMING STYLES
   ============================================ */

/* ── Live dot / pulse animation ── */
@keyframes livePulse {
    0%   { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(211,47,47,0.7); }
    70%  { opacity: 0.9; transform: scale(1.15); box-shadow: 0 0 0 8px rgba(211,47,47,0); }
    100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(211,47,47,0); }
}

.live-dot-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--red-light);
    animation: livePulse 1.6s infinite;
    flex-shrink: 0;
}

/* Sidebar nav live dot */
.nav-live-dot {
    color: var(--red-light);
    animation: livePulse 1.6s infinite;
}

/* ── Live badge on video cards ── */
.live-badge-card {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--red-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* ── Live-now section on index ── */
.live-now-section {
    margin-bottom: 8px;
}

.live-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Inline LIVE badge (in live.php info bar) ── */
.live-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--red-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ── live.php layout ── */
.live-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4px;
}

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

.live-player-col {
    min-width: 0;
}

/* ── HLS Video player ── */
.live-player-wrapper {
    width: 100%;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 16/9;
    position: relative;
}

.live-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.live-offline-screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-muted);
    gap: 8px;
    padding: 20px;
    text-align: center;
}

.live-offline-icon {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 8px;
}

.live-offline-screen h3 {
    color: var(--text-secondary);
    font-size: 18px;
}

/* ── Stream info bar below player ── */
.live-info-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.live-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.live-title {
    font-family: 'Oswald', sans-serif;
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-info-right {
    flex-shrink: 0;
}

.live-viewer-badge {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ── Channel bar on live.php ── */
.live-channel-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

/* ── Live description ── */
.live-description {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ── Chat column ── */
.live-chat-col {
    display: flex;
    flex-direction: column;
    height: 600px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-height) + 12px);
}

@media (max-width: 900px) {
    .live-chat-col {
        position: static;
        height: 400px;
    }
}

.live-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.chat-live-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--red-light);
    font-weight: 700;
    font-family: 'Oswald', sans-serif;
    letter-spacing: 0.5px;
}

.live-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scroll-behavior: smooth;
}

.live-chat-messages::-webkit-scrollbar { width: 4px; }
.live-chat-messages::-webkit-scrollbar-track { background: transparent; }
.live-chat-messages::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.chat-msg {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
    padding: 4px 0;
    word-break: break-word;
}

.chat-author {
    font-weight: 600;
    color: var(--red-light);
    margin-right: 6px;
}

.chat-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 6px;
}

.chat-text {
    color: var(--text-primary);
}

.chat-offline-msg {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* ── Chat input ── */
.live-chat-input-area {
    flex-shrink: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

.chat-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    transition: border-color var(--transition-fast);
    min-width: 0;
}

.chat-input:focus {
    border-color: var(--red-light);
}

.chat-send-btn {
    background: var(--red-primary);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.chat-send-btn:hover { background: var(--red-light); }

.chat-login-prompt {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 4px 0;
}

.chat-login-prompt a {
    color: var(--red-light);
}

/* ── go-live.php ── */
.golive-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 4px 40px;
}

.golive-header {
    margin-bottom: 28px;
}

.golive-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    color: var(--red-light);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.golive-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 860px) {
    .golive-layout {
        grid-template-columns: 1fr;
    }
}

.golive-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.golive-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: calc(var(--header-height) + 16px);
}

.golive-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.golive-card-title {
    font-family: 'Oswald', sans-serif;
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.golive-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* ── Stream key input row ── */
.stream-key-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.stream-key-input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: monospace;
    padding: 9px 12px;
    outline: none;
    min-width: 120px;
    transition: border-color var(--transition-fast);
}

.stream-key-input:focus {
    border-color: var(--red-light);
}

/* ── Live status banner ── */
.live-status-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(211, 47, 47, 0.12);
    border: 1px solid var(--red-primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    flex-wrap: wrap;
}

.live-badge-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--red-light);
    animation: livePulse 1.4s infinite;
    flex-shrink: 0;
}

.live-badge-text {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--red-light);
    letter-spacing: 1px;
}

.live-viewer-count {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

/* ── Past streams ── */
.past-streams-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.past-stream-item {
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.past-stream-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.past-stream-title {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

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

/* ── OBS guide ── */
.obs-guide { }

.obs-steps {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.obs-steps li strong { color: var(--text-primary); }
.obs-steps li em { color: var(--gold); font-style: normal; }
.obs-steps code {
    display: inline-block;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 12px;
    font-family: monospace;
    color: var(--gold);
    word-break: break-all;
}

.obs-tip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.obs-tip strong { color: var(--text-primary); }

.obs-tip ul {
    padding-left: 16px;
    margin-top: 6px;
}

/* ── Small button variant ── */
.btn-sm {
    font-size: 12px;
    padding: 6px 12px;
}

/* ===== LINKED ACCOUNTS ===== */
.linked-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
}

.linked-account-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.linked-account-icon {
    font-size: 22px;
    line-height: 1;
}

.linked-account-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.linked-account-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.linked-account-id {
    opacity: 0.6;
    font-size: 11px;
    margin-left: 4px;
}

/* ===== AVATAR IMAGE SUPPORT ===== */
.avatar-circle {
    flex-shrink: 0;
}

.avatar-channel {
    width: 80px;
    height: 80px;
    font-size: 32px;
    box-shadow: var(--shadow-md);
}

/* ===== AVATAR SETTINGS ===== */
.avatar-settings-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.avatar-settings-preview {
    width: 80px;
    height: 80px;
    font-size: 32px;
    flex-shrink: 0;
}

.avatar-settings-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.avatar-upload-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ===== CUSTOM VIDEO PLAYER ===== */
#customPlayer {
    position: relative;
    background: #000;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

#customPlayer #mainVideo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Big play overlay */
.cp-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.cp-play-overlay.cp-show-overlay {
    opacity: 1;
    pointer-events: auto;
}

.cp-big-play-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(211, 47, 47, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    transition: transform 0.15s ease, background 0.15s ease;
    padding-left: 4px;
}

.cp-play-overlay:hover .cp-big-play-btn {
    transform: scale(1.1);
    background: var(--red-light);
}

/* Loading spinner */
.cp-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
}

.cp-spin::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--red-light);
    border-radius: 50%;
    animation: cpSpin 0.7s linear infinite;
}

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

/* Controls bar */
.cp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 40px 14px 10px;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 4;
}

.cp-controls-visible {
    opacity: 1;
}

#customPlayer:hover .cp-controls,
#customPlayer.cp-paused .cp-controls {
    opacity: 1;
}

/* Progress bar */
.cp-progress-wrap {
    position: relative;
    padding: 8px 0;
    cursor: pointer;
    margin-bottom: 4px;
}

.cp-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
    transition: height 0.15s ease;
}

.cp-progress-wrap:hover .cp-progress-bar {
    height: 6px;
}

.cp-buffered {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: rgba(255,255,255,0.35);
    border-radius: 2px;
    width: 0;
    transition: width 0.3s;
}

.cp-played {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: var(--red-light);
    border-radius: 2px;
    width: 0;
}

.cp-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--red-light);
    left: 0;
    transition: transform 0.15s ease;
    box-shadow: 0 0 6px rgba(239,83,80,0.6);
}

.cp-progress-wrap:hover .cp-thumb {
    transform: translate(-50%, -50%) scale(1);
}

.cp-tooltip {
    position: absolute;
    top: -28px;
    left: 0;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 12px;
    padding: 3px 7px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
    white-space: nowrap;
}

/* Bottom controls row */
.cp-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cp-left, .cp-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cp-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    font-size: 15px;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    line-height: 1;
}

.cp-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.cp-time {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding: 0 4px;
}

/* Volume */
.cp-volume-wrap {
    display: flex;
    align-items: center;
}

.cp-volume-slider-wrap {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}

.cp-volume-wrap:hover .cp-volume-slider-wrap,
.cp-volume-slider-wrap:hover {
    width: 70px;
}

.cp-volume-bar {
    position: relative;
    height: 4px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
    width: 60px;
    margin: 0 6px;
    cursor: pointer;
}

.cp-volume-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: var(--red-light);
    border-radius: 2px;
    width: 100%;
}

.cp-volume-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: white;
    left: 100%;
    pointer-events: none;
}

/* Speed menu */
.cp-speed-menu {
    position: absolute;
    bottom: 54px;
    right: 40px;
    background: rgba(20,20,20,0.95);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 10;
    min-width: 80px;
    box-shadow: var(--shadow-lg);
}

.cp-speed-menu.cp-speed-open {
    display: flex;
}

.cp-speed-opt {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 9px 16px;
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: background 0.1s, color 0.1s;
}

.cp-speed-opt:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.cp-speed-opt.active {
    color: var(--red-light);
    font-weight: 600;
}

/* Fullscreen adjustments */
#customPlayer:fullscreen {
    border-radius: 0;
}

#customPlayer:-webkit-full-screen {
    border-radius: 0;
}

@media (max-width: 600px) {
    .cp-bottom {
        gap: 2px;
    }
    .cp-btn {
        font-size: 13px;
        padding: 5px 6px;
    }
    .cp-time {
        font-size: 11px;
    }
    #cpSkipBack, #cpSkipFwd {
        display: none;
    }
}

/* ===== CROP MODAL ===== */
.crop-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.crop-modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - 40px);
}

.crop-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.crop-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.crop-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color var(--transition-fast), background var(--transition-fast);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.crop-area {
    background: #000;
    width: 100%;
    height: 380px;
    flex: 1 1 auto;
    overflow: hidden;
    touch-action: none;
}

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

.crop-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.crop-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* ── Mobile: full-screen bottom sheet ── */
@media (max-width: 600px) {
    .crop-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .crop-modal {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 95dvh;
    }

    .crop-area {
        height: auto;
        min-height: 260px;
        /* Fill all space between header/hint/footer */
        flex: 1 1 0;
    }

    .crop-hint {
        font-size: 13px;
        padding: 10px 20px;
    }

    .crop-modal-footer {
        padding: 12px 16px 24px; /* extra bottom padding for safe area */
        gap: 12px;
    }

    .crop-modal-footer .btn {
        flex: 1;
        padding: 14px 10px;
        font-size: 16px;
        justify-content: center;
    }
}

/* Cropper.js overrides to match site theme */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}

.cropper-view-box {
    outline: 3px solid var(--red-light);
    outline-color: var(--red-light);
}

.cropper-line,
.cropper-point {
    background-color: var(--red-light);
}

/* Hide corner handles on mobile — they're too fiddly */
@media (max-width: 600px) {
    .cropper-point {
        display: none;
    }
}

/* ============================================
   STATIC PAGES (Privacy, ToS)
   ============================================ */

.static-page {
    max-width: 800px;
    margin: 48px auto;
    padding: 0 24px 80px;
}

.static-page-header {
    margin-bottom: 40px;
    padding: 40px 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}

.static-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--red-primary), var(--red-light));
}

.static-page-header h1 {
    font-family: 'Oswald', sans-serif;
    font-size: 40px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.static-page-header .effective-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.static-page-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.static-page-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.static-page-nav a:hover {
    border-color: var(--red-primary);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.static-page-nav a.active {
    background: rgba(211, 47, 47, 0.12);
    border-color: var(--red-primary);
    color: var(--red-light);
}

.static-page section {
    margin-bottom: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 36px;
    transition: border-color var(--transition-fast);
}

.static-page section:hover {
    border-color: var(--border-light);
}

.static-page h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.static-page h2 .section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(211, 47, 47, 0.15);
    border: 1px solid rgba(211, 47, 47, 0.3);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: var(--red-light);
    flex-shrink: 0;
}

.static-page p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.static-page p:last-child {
    margin-bottom: 0;
}

.static-page ul {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    padding-left: 0;
    margin-bottom: 10px;
    list-style: none;
}

.static-page ul li {
    padding-left: 18px;
    margin-bottom: 6px;
    position: relative;
}

.static-page ul li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--red-light);
    font-weight: 700;
}

.static-page ul li:last-child {
    margin-bottom: 0;
}

.static-page a {
    color: var(--red-light);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.static-page a:hover {
    color: var(--text-primary);
}
