/* ==========================================================================
   StreamFlow — Claude Warm Minimalist Design System
   Anthropic-Inspired Warm Obsidian • Terracotta Accents • Editorial Typography
   ========================================================================== */

:root {
    /* Backgrounds & Surfaces (Warm Stone Obsidian) */
    --color-bg-base: #141311;
    --color-bg-surface: #1d1b19;
    --color-bg-elevated: #262421;
    --color-bg-hover: #312e2a;
    --color-bg-control: rgba(20, 19, 17, 0.88);
    
    /* Claude Signature Terracotta Palette */
    --color-accent: #d97757;
    --color-accent-hover: #e38668;
    --color-accent-subtle: rgba(217, 119, 87, 0.14);
    --color-accent-border: rgba(217, 119, 87, 0.35);
    --color-accent-glow: rgba(217, 119, 87, 0.25);
    
    /* Typography & Ink */
    --color-text-primary: #f5f2eb;
    --color-text-secondary: #b3aca0;
    --color-text-tertiary: #7d7568;
    
    /* Borders */
    --color-border-subtle: rgba(245, 242, 235, 0.08);
    --color-border-hover: rgba(245, 242, 235, 0.16);
    --color-border-focused: #d97757;
    
    /* Border Radii */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;
    
    /* Safe Area Insets */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    background: var(--color-bg-base);
    color: var(--color-text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
    overflow: hidden !important;
}

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
    background: radial-gradient(circle at 50% 0%, rgba(217, 119, 87, 0.04) 0%, transparent 60%);
}

/* ==========================================================================
   Header & Claude-Inspired Logo
   ========================================================================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border-subtle);
    background: rgba(20, 19, 17, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.logo:hover {
    background: var(--color-bg-surface);
}

.logo-spark {
    width: 22px;
    height: 22px;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo:hover .logo-spark {
    transform: rotate(45deg) scale(1.1);
}

.logo-spark svg {
    width: 20px;
    height: 20px;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-full);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    color: var(--color-text-secondary);
}

.stat-item {
    color: var(--color-accent);
    font-weight: 600;
}

.stat-dot {
    color: var(--color-text-tertiary);
}

.icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-btn svg {
    width: 17px;
    height: 17px;
}

.icon-btn:hover {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border-color: var(--color-border-hover);
    transform: translateY(-1px);
}

/* ==========================================================================
   Main Workspace & Editorial Hero
   ========================================================================== */
.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    max-width: 1040px;
    width: 100%;
    margin: 0 auto;
}

.url-view {
    width: 100%;
    max-width: 680px;
}

.url-view.hidden {
    display: none;
}

.hero-box {
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--color-accent-subtle);
    border: 1px solid var(--color-accent-border);
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 6px var(--color-accent);
}

.hero-title {
    font-family: 'Newsreader', Georgia, serif;
    font-size: clamp(2rem, 4.2vw, 2.75rem);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    color: var(--color-text-primary);
}

.hero-title em {
    font-style: italic;
    color: var(--color-accent);
    font-weight: 400;
}

.hero-sub {
    font-size: 0.96rem;
    color: var(--color-text-secondary);
    margin-bottom: 28px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   Input Card (Claude Stone Finish)
   ========================================================================== */
.input-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    margin-bottom: 24px;
    transition: border-color 0.2s ease;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-bg-base);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    padding: 6px 8px 6px 14px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-row:focus-within {
    border-color: var(--color-border-focused);
    box-shadow: 0 0 0 3px var(--color-accent-subtle);
}

.main-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    color: var(--color-text-primary);
    min-width: 0;
}

.main-input::placeholder {
    color: var(--color-text-tertiary);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.paste-btn {
    padding: 8px 14px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

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

.submit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #141311;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(217, 119, 87, 0.3);
}

.submit-btn svg {
    width: 15px;
    height: 15px;
}

.submit-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(217, 119, 87, 0.4);
}

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

/* Options Bar */
.options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-subtle);
}

.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-wrap input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 34px;
    height: 20px;
    background: var(--color-bg-base);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--color-text-secondary);
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toggle-wrap input:checked + .toggle-switch {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.toggle-wrap input:checked + .toggle-switch::after {
    left: 16px;
    background: #141311;
}

.toggle-text {
    font-size: 0.84rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.chip-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--color-bg-base);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip-btn svg {
    width: 14px;
    height: 14px;
}

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

/* ==========================================================================
   Recent Streams Section
   ========================================================================== */
.history-wrap {
    margin-top: 24px;
    text-align: left;
    border-top: 1px solid var(--color-border-subtle);
    padding-top: 20px;
}

.history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
}

.text-btn {
    background: none;
    border: none;
    color: var(--color-text-tertiary);
    font-size: 0.76rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.text-btn:hover {
    color: #f87171;
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.history-empty {
    padding: 16px;
    text-align: center;
    font-size: 0.84rem;
    color: var(--color-text-tertiary);
    background: rgba(245, 242, 235, 0.02);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--color-border-subtle);
}

.history-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-card:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-border-hover);
    transform: translateX(2px);
}

.history-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-name {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-url {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--color-text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.history-card-share,
.history-card-del {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-tertiary);
    border-radius: var(--radius-xs);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.history-card-share svg {
    width: 14px;
    height: 14px;
}

.history-card-share:hover {
    color: var(--color-accent);
    background: var(--color-accent-subtle);
}

.history-card-del:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

/* ==========================================================================
   Claude-Style Sidebar Drawer (Developer Details & Community)
   ========================================================================== */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14, 13, 11, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99990;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 340px;
    max-width: 86vw;
    height: 100vh;
    height: 100dvh;
    background: var(--color-bg-surface);
    border-right: 1px solid var(--color-border-subtle);
    z-index: 99995;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px;
    border-bottom: 1px solid var(--color-border-subtle);
    background: var(--color-bg-base);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.sidebar-badge {
    font-size: 0.68rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--color-accent);
    background: var(--color-accent-subtle);
    padding: 1px 6px;
    border-radius: var(--radius-xs);
    width: fit-content;
}

.sidebar-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    color: var(--color-text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-close-btn:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-elevated);
    border-color: var(--color-border-hover);
}

.sidebar-content {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* Developer Profile Card */
.dev-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.dev-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), #9a3412);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 0 14px var(--color-accent-glow);
    flex-shrink: 0;
}

.online-indicator {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid var(--color-bg-elevated);
}

.dev-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dev-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.dev-role {
    font-size: 0.75rem;
    color: var(--color-accent);
}

/* Sidebar Navigation Links */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-tertiary);
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--color-bg-base);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-link-item:hover {
    background: var(--color-bg-elevated);
    border-color: var(--color-accent-border);
    transform: translateX(3px);
}

.sidebar-link-item.highlight {
    border-color: var(--color-accent-border);
    background: var(--color-accent-subtle);
}

.sidebar-link-item.highlight:hover {
    background: rgba(217, 119, 87, 0.22);
}

.link-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.link-icon svg {
    width: 17px;
    height: 17px;
}

.telegram-icon {
    background: rgba(41, 167, 230, 0.15);
    color: #29b6f6;
}

.community-icon {
    background: rgba(217, 119, 87, 0.15);
    color: var(--color-accent);
}

.instagram-icon {
    background: rgba(225, 48, 108, 0.15);
    color: #f472b6;
}

.github-icon {
    background: rgba(245, 242, 235, 0.12);
    color: #f5f2eb;
}

.portfolio-icon {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.link-text-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.link-title {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.link-subtitle {
    font-size: 0.72rem;
    color: var(--color-text-tertiary);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-arrow {
    font-size: 0.95rem;
    color: var(--color-text-tertiary);
    transition: transform 0.15s ease, color 0.15s ease;
}

.sidebar-link-item:hover .link-arrow {
    transform: translate(2px, -2px);
    color: var(--color-accent);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-subtle);
    font-size: 0.74rem;
    color: var(--color-text-tertiary);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-copy {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   Video Player Section & Responsive Fit
   ========================================================================== */
.player-view {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
}

.player-view.active {
    display: flex;
}

.player-wrapper {
    position: relative;
    width: 100%;
    min-height: 360px;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
    user-select: none;
}

/* Universal Fullscreen Rules (Native & Pseudo-Fullscreen) */
.player-wrapper.fullscreen,
.player-wrapper.pseudo-fullscreen,
.player-wrapper:fullscreen,
.player-wrapper:-webkit-full-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 999999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000000 !important;
}

/* Auto-Landscape Mode for Fullscreen on Portrait Phones */
.player-wrapper.force-landscape {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    width: 100vh !important;
    width: 100dvh !important;
    height: 100vw !important;
    height: 100dvw !important;
    max-height: 100dvw !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    transform-origin: center center !important;
    z-index: 9999999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000000 !important;
}

.video-core {
    width: 100%;
    height: 100%;
    background: #000000;
}

.video-core.fit-contain { object-fit: contain; }
.video-core.fit-cover { object-fit: cover; }
.video-core.fit-16-9 { aspect-ratio: 16/9; object-fit: fill; }
.video-core.fit-21-9 { aspect-ratio: 21/9; object-fit: fill; }

/* Touch Gesture Overlay */
.touch-zones {
    position: absolute;
    inset: 0;
    display: flex;
    z-index: 10;
}

.zone {
    height: 100%;
    cursor: pointer;
}

.zone-left { width: 35%; }
.zone-center { width: 30%; }
.zone-right { width: 35%; }

/* Skip Ripple Indicators */
.ripple-box {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    padding: 10px 18px;
    background: rgba(20, 19, 17, 0.85);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-full);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-accent);
    z-index: 20;
    pointer-events: none;
}

.ripple-box.active {
    display: block;
    animation: rippleFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.ripple-left { left: 15%; }
.ripple-right { right: 15%; }

@keyframes rippleFade {
    0% { opacity: 0; transform: translateY(-50%) scale(0.8); }
    50% { opacity: 1; transform: translateY(-50%) scale(1.08); }
    100% { opacity: 0; transform: translateY(-50%) scale(1); }
}

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

.player-wrapper.show-controls .center-play:not(.hidden),
.player-wrapper:not(.playing) .center-play:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.center-play-btn {
    width: 64px;
    height: 64px;
    background: rgba(20, 19, 17, 0.85);
    border: 1px solid var(--color-border-hover);
    border-radius: 50%;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.center-play-btn svg {
    width: 30px;
    height: 30px;
    margin-left: 2px;
}

.center-play-btn:hover {
    background: var(--color-accent);
    color: #141311;
    transform: scale(1.1);
    border-color: var(--color-accent);
}

/* HUD Toast (Claude-Style Feedback Pill) */
.hud-pill {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 6px 14px;
    background: rgba(20, 19, 17, 0.94);
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-primary);
    z-index: 35;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.hud-pill.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   YouTube-Style Controls Bar (State-Controlled)
   ========================================================================== */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(to bottom, rgba(20, 19, 17, 0.9) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 25;
    pointer-events: none;
}

.player-wrapper.show-controls .top-bar {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(245, 242, 235, 0.1);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.nav-btn:hover {
    background: rgba(245, 242, 235, 0.18);
    border-color: var(--color-border-hover);
}

.nav-btn svg {
    width: 14px;
    height: 14px;
}

.video-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

.top-right-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 242, 235, 0.1);
    border: 1px solid var(--color-border-subtle);
    border-radius: 50%;
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-btn-sm svg {
    width: 16px;
    height: 16px;
}

.icon-btn-sm:hover {
    background: rgba(245, 242, 235, 0.2);
    border-color: var(--color-border-hover);
    color: var(--color-accent);
}

/* Bottom Controls */
.controls-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 16px 14px;
    background: linear-gradient(to top, rgba(20, 19, 17, 0.95) 0%, rgba(20, 19, 17, 0.5) 70%, transparent 100%);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 25;
    pointer-events: none;
}

.player-wrapper.show-controls .controls-panel {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Scrubber / Progress Bar */
.scrubber {
    position: relative;
    padding: 8px 0;
    cursor: pointer;
    margin-bottom: 8px;
}

.scrubber-track {
    position: relative;
    height: 4px;
    background: rgba(245, 242, 235, 0.18);
    border-radius: 2px;
    transition: height 0.15s ease;
}

.scrubber:hover .scrubber-track {
    height: 6px;
}

.track-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(245, 242, 235, 0.32);
    border-radius: inherit;
    width: 0%;
}

.track-played {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--color-accent);
    border-radius: inherit;
    width: 0%;
}

.track-thumb {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--color-text-primary);
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrubber:hover .track-thumb {
    transform: translate(-50%, -50%) scale(1);
}

.scrubber-tip {
    position: absolute;
    bottom: 100%;
    margin-bottom: 8px;
    padding: 3px 8px;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-hover);
    border-radius: var(--radius-xs);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--color-text-primary);
    opacity: 0;
    transform: translateX(-50%);
    pointer-events: none;
}

.scrubber:hover .scrubber-tip {
    opacity: 1;
}

/* Button Row */
.btn-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
}

.btn-group-left, .btn-group-right {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 3px;
    flex-shrink: 0;
}

.btn-ctrl {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-ctrl svg {
    width: 19px;
    height: 19px;
}

.btn-ctrl:hover {
    background: rgba(245, 242, 235, 0.12);
    color: var(--color-accent);
}

/* Play/Pause state toggles */
.btn-ctrl .icon-pause,
.player-wrapper.playing .btn-ctrl .icon-play {
    display: none;
}

.player-wrapper.playing .btn-ctrl .icon-pause {
    display: block;
}

/* Volume Slider */
.vol-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.icon-vol-off { display: none; }
.vol-wrap.muted .icon-vol-on { display: none; }
.vol-wrap.muted .icon-vol-off { display: block; }

.vol-slider-box {
    width: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}

.vol-wrap:hover .vol-slider-box,
.vol-wrap:focus-within .vol-slider-box {
    width: 58px;
}

.vol-range {
    width: 58px;
    height: 3px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(245, 242, 235, 0.2);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

.vol-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: var(--color-accent);
    border-radius: 50%;
}

/* Time Display */
.time-box {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    margin-left: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Text Buttons (Aspect, Speed) */
.btn-text {
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-xs);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.btn-text:hover {
    color: var(--color-text-primary);
    background: rgba(245, 242, 235, 0.1);
}

/* Fullscreen Icons */
.icon-compress { display: none; }
.player-wrapper.fullscreen .icon-expand,
.player-wrapper.pseudo-fullscreen .icon-expand,
.player-wrapper.force-landscape .icon-expand { display: none; }
.player-wrapper.fullscreen .icon-compress,
.player-wrapper.pseudo-fullscreen .icon-compress,
.player-wrapper.force-landscape .icon-compress { display: block; }

.player-wrapper.hide-cursor {
    cursor: none;
}

/* Loader */
.loader-wrap {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(20, 19, 17, 0.75);
    z-index: 20;
}

.loader-wrap.active {
    display: flex;
}

.spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(245, 242, 235, 0.1);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loader-text {
    font-size: 0.84rem;
    color: var(--color-text-secondary);
}

/* Error Screen */
.error-box {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(20, 19, 17, 0.96);
    z-index: 30;
    padding: 24px;
    text-align: center;
}

.error-box.active {
    display: flex;
}

.error-title {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.25rem;
    color: #f87171;
}

.error-msg {
    font-size: 0.84rem;
    color: var(--color-text-secondary);
    max-width: 380px;
}

.error-btns {
    display: flex;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary {
    padding: 7px 16px;
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #141311;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    padding: 7px 16px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: 0.84rem;
    cursor: pointer;
}

/* ==========================================================================
   Claude-Style Settings & Shortcuts Modal
   ========================================================================== */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(14, 13, 11, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000000;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: 22px;
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border-subtle);
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-spark {
    color: var(--color-accent);
    font-size: 1.1rem;
}

.modal-head h3 {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--color-text-tertiary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 0.15s ease;
}

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

.modal-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.setting-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-row.flex-between {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.setting-title {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

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

.pill-btn {
    flex: 1;
    min-width: 48px;
    padding: 7px 10px;
    background: var(--color-bg-base);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

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

.pill-btn.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #141311;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(217, 119, 87, 0.25);
}

.w-full {
    width: 100%;
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shortcuts-list .item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
    color: var(--color-text-secondary);
}

.shortcuts-list kbd {
    padding: 3px 8px;
    background: var(--color-bg-base);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-xs);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    color: var(--color-text-primary);
}

/* Mobile & Portrait Responsive Adjustments */
@media (max-width: 640px) {
    .header {
        padding: 12px 16px;
    }
    
    .main {
        padding: 16px 12px;
    }
    
    .hero-title {
        font-size: 1.85rem;
    }
    
    .input-card {
        padding: 14px;
    }
    
    .input-row {
        flex-wrap: wrap;
        padding: 6px;
    }
    
    .main-input {
        width: 100%;
        order: 1;
        padding: 6px 4px;
    }
    
    .paste-btn {
        order: 2;
    }
    
    .submit-btn {
        order: 3;
        flex: 1;
        justify-content: center;
    }
    
    .player-wrapper {
        min-height: 220px;
    }
    
    .vol-slider-box {
        display: none;
    }
    
    .time-box {
        font-size: 0.7rem;
    }
    
    .btn-ctrl {
        width: 32px;
        height: 32px;
    }
    
    .btn-ctrl svg {
        width: 17px;
        height: 17px;
    }
    
    .btn-text {
        font-size: 0.7rem;
        padding: 2px 4px;
    }
    
    .video-name {
        max-width: 150px;
    }
}
