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

:root {
    --primary-color: #1e3a8a;
    --primary-light: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --bg-dark: #0f172a;
    --bg-light: #f7fafc;
    --text-dark: #1e293b;
    --text-light: #718096;
    --border-color: #e2e8f0;
    --pangea-blue: #1e3a8a;
    --pangea-blue-light: #2563eb;
    --pangea-gradient: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
    --radius-lg: 16px;
    --shadow-soft: 0 8px 32px rgba(15, 23, 42, 0.12);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

html[dir="rtl"],
html[dir="rtl"] body {
    direction: rtl;
}

html[dir="ltr"],
html[dir="ltr"] body {
    direction: ltr;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(160deg, #0b1224 0%, #1e3a8a 45%, #172554 100%);
    color: var(--text-dark);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Navigation */
.top-nav {
    background: linear-gradient(90deg, #0f2557 0%, #1e40af 50%, #2563eb 100%);
    color: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    background: transparent;
}

.logo-img {
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: transparent;
    border: none;
    box-shadow: none;
}

.brand-name {
    font-size: 1.3rem;
    white-space: nowrap;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-pricing-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.2s;
}

.nav-pricing-link:hover {
    background: rgba(255, 255, 255, 0.22);
}

.upsell-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(4px);
}

.upsell-modal[hidden] {
    display: none !important;
}

.upsell-modal-card {
    position: relative;
    width: min(420px, 100%);
    padding: 28px 24px;
    border-radius: 16px;
    background: linear-gradient(160deg, #1e293b, #0f172a);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.upsell-modal-card h3 {
    margin: 0 0 10px;
    color: #f8fafc;
    font-size: 1.2rem;
}

.upsell-modal-card p {
    margin: 0 0 20px;
    color: #94a3b8;
    line-height: 1.5;
    font-size: 0.95rem;
}

.upsell-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upsell-close {
    position: absolute;
    top: 10px;
    inset-inline-end: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.btn-ghost {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.lang-select {
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-weight: 500;
}

.lang-select option {
    background: var(--pangea-blue);
    color: white;
}

.user-menu {
    position: relative;
}

.user-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    color: var(--text-dark);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    padding: 15px;
    z-index: 1000;
}

.user-info {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.user-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.watch-history-panel {
    margin-top: 8px;
}

.watch-history-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.watch-history-empty {
    font-size: 0.8rem;
    color: var(--text-light);
}

.watch-history-list {
    list-style: none;
    max-height: 180px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
}

.watch-history-list li + li {
    margin-top: 4px;
}

.history-link {
    width: 100%;
    text-align: right;
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 0;
    line-height: 1.3;
}

.history-link:hover {
    text-decoration: underline;
}

.logout-btn {
    width: 100%;
    padding: 8px 12px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.logout-btn:hover {
    opacity: 0.9;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--pangea-blue) 0%, var(--pangea-blue-light) 100%);
    color: white;
    padding: 40px 20px;
    margin-bottom: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    text-align: center;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.header-logo {
    max-height: 90px;
    width: auto;
    object-fit: contain;
    background: transparent;
    border: none;
    box-shadow: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.header-content h1 {
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin: 0;
}

.credits-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 50px;
    display: none;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    font-weight: bold;
    font-size: 1.1rem;
}

.credits-icon {
    font-size: 1.5rem;
}

.credits-count {
    font-size: 1.5rem;
    margin: 0 5px;
}

/* Main Content */
main {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

section {
    margin-bottom: 40px;
}

section:last-child {
    margin-bottom: 0;
}

section h2,
section h3 {
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 1.5rem;
}

section h3 {
    font-size: 1.2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

/* Input Section */
.input-section {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.video-url-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.video-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.upload-section {
    padding: 20px;
    background: white;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-section:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.torrent-hint {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    line-height: 1.4;
}

.dev-torrent-panel {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px dashed rgba(102, 126, 234, 0.45);
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.06);
}

.dev-torrent-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.dev-torrent-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #aaa);
    margin-inline-end: auto;
}

.dev-torrent-btn {
    padding: 8px 14px;
    font-size: 0.88rem;
}

.dev-torrent-clear {
    opacity: 0.85;
}

.dev-torrent-log {
    margin: 0;
    max-height: 220px;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    color: #b8e6ff;
    font-family: ui-monospace, Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    direction: ltr;
    text-align: left;
}

.dev-torrent-log:empty::before {
    content: 'Log will appear here…';
    color: #666;
}

.file-input {
    padding: 10px;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-dark);
}

.btn-timing {
    background: var(--warning-color);
    color: white;
    padding: 10px 16px;
    font-size: 0.9rem;
}

.btn-timing:hover {
    background: darken(var(--warning-color), 10%);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: darken(var(--success-color), 10%);
}

/* Video Player Section */
.player-section {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.video-container {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    background: #0f172a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: auto;
    min-height: 0;
}

.video-container.mode-youtube,
.video-container.mode-embed {
    height: auto;
    min-height: 0;
}

.video-container.mode-youtube #externalEmbedPlayer,
.video-container.mode-native #externalEmbedPlayer {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden;
}

.video-container.mode-youtube #youtubePlayer {
    display: block !important;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(92vh, calc(100vw * 9 / 16));
    min-height: 0;
    height: auto;
    flex: 0 0 auto;
    overflow: hidden;
}

.video-container.mode-youtube #youtubePlayer iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.video-container.mode-youtube .video-player {
    display: none !important;
}

.video-container.mode-embed #youtubePlayer {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden;
}

.video-container.mode-embed #externalEmbedPlayer {
    display: block !important;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(92vh, calc(100vw * 9 / 16));
    min-height: 0;
    flex: 0 0 auto;
}

.video-container.mode-embed .video-player {
    display: none !important;
}

.video-container.mode-native .video-player {
    display: block !important;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(92vh, calc(100vw * 9 / 16));
    min-height: 0;
    height: auto;
    flex: 0 0 auto;
    background: #000;
}

.video-container.mode-native #youtubePlayer {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden;
}

.partner-watch-panel {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(92vh, calc(100vw * 9 / 16));
    min-height: 220px;
    padding: 28px 24px;
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
    color: #e2e8f0;
    box-sizing: border-box;
}

.partner-watch-panel[hidden] {
    display: none !important;
}

.partner-watch-card h3 {
    margin: 0 0 12px;
    font-size: 1.15rem;
    color: #f8fafc;
}

.partner-watch-hint {
    margin: 0 0 14px;
    line-height: 1.5;
    font-size: 0.92rem;
    color: #cbd5e1;
}

.partner-watch-steps {
    margin: 0 0 18px;
    padding-right: 20px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #94a3b8;
}

.partner-watch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.partner-watch-actions .btn {
    text-decoration: none;
}

.content-preview-panel {
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.content-preview-panel[hidden] {
    display: none !important;
}

.content-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.content-preview-badge {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    padding: 4px 10px;
    border-radius: 999px;
}

.content-preview-confidence {
    font-size: 0.75rem;
    color: var(--text-light);
}

.content-preview-title {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 6px;
    line-height: 1.35;
}

.content-preview-meta {
    font-size: 0.88rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.content-preview-subs {
    font-size: 0.9rem;
    line-height: 1.45;
    padding: 8px 10px;
    border-radius: 10px;
}

.content-preview-subs.is-positive {
    background: rgba(72, 187, 120, 0.15);
    color: #166534;
}

.content-preview-subs.is-neutral {
    background: rgba(59, 130, 246, 0.12);
    color: #1e40af;
}

.content-preview-subs.is-fallback {
    background: rgba(237, 137, 54, 0.12);
    color: #9a3412;
}

.video-container .subtitles-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12%;
    z-index: 15;
    pointer-events: none;
}

.subtitles-overlay.subtitle-gap-hold #subtitleText {
    opacity: 0.82;
}

.subtitles-overlay.sync-flash {
    outline: 3px solid #22c55e;
    outline-offset: 4px;
    border-radius: 8px;
}

.video-container .player-timing-overlay {
    position: absolute;
    bottom: 52px;
    right: 12px;
}

.video-container:fullscreen,
.video-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #000;
}

.video-container:fullscreen .video-player,
.video-container:fullscreen #youtubePlayer,
.video-container:fullscreen .youtube-embed,
.video-container:-webkit-full-screen .video-player,
.video-container:-webkit-full-screen #youtubePlayer,
.video-container:-webkit-full-screen .youtube-embed {
    flex: 1 1 auto;
    width: 100%;
    max-height: none;
    height: 100%;
    min-height: 0;
    aspect-ratio: unset;
}

.video-container:fullscreen.mode-native .video-player,
.video-container:-webkit-full-screen.mode-native .video-player {
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    aspect-ratio: unset !important;
    object-fit: contain;
}

.video-container:fullscreen.mode-embed #externalEmbedPlayer,
.video-container:-webkit-full-screen.mode-embed #externalEmbedPlayer {
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    aspect-ratio: unset !important;
}

.video-container:fullscreen.mode-embed .external-embed-player iframe,
.video-container:-webkit-full-screen.mode-embed .external-embed-player iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    aspect-ratio: unset !important;
}

video.video-player:fullscreen,
video.video-player:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    object-fit: contain;
    background: #000;
}

.video-container:fullscreen .player-timing-overlay,
.video-container:-webkit-full-screen .player-timing-overlay {
    pointer-events: auto;
}

.video-container:fullscreen .player-fullscreen-btn,
.video-container:-webkit-full-screen .player-fullscreen-btn,
.video-container:fullscreen #preSubtitleGate,
.video-container:-webkit-full-screen #preSubtitleGate {
    display: none !important;
}

.video-container:fullscreen.mode-native,
.video-container:-webkit-full-screen.mode-native {
    min-height: 100vh !important;
    height: 100vh !important;
}

.video-container:fullscreen.mode-embed .external-embed-player,
.video-container:-webkit-full-screen.mode-embed .external-embed-player {
    position: relative !important;
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.video-container:fullscreen.mode-embed #externalEmbedPlayer,
.video-container:-webkit-full-screen.mode-embed #externalEmbedPlayer {
    display: flex !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
}

.video-container:fullscreen #youtubePlayer iframe,
.video-container:-webkit-full-screen #youtubePlayer iframe {
    position: absolute;
    inset: 0;
}

.video-container:fullscreen .subtitles-overlay,
.video-container:-webkit-full-screen .subtitles-overlay {
    bottom: 12%;
    z-index: 100;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    padding: 0 4vw;
    box-sizing: border-box;
}

.video-container:fullscreen #subtitleText,
.video-container:-webkit-full-screen #subtitleText {
    max-width: min(92vw, 1200px);
    font-size: clamp(22px, 4.2vmin, 52px) !important;
    line-height: 1.35;
    unicode-bidi: plaintext;
}

.video-container:fullscreen.mode-embed #externalEmbedPlayer,
.video-container:-webkit-full-screen.mode-embed #externalEmbedPlayer {
    flex: 1 1 auto;
    width: 100%;
    max-height: 100%;
    height: 100%;
    aspect-ratio: unset;
    overflow: hidden;
}

.video-container:fullscreen,
.video-container:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.video-container:fullscreen .video-player,
.video-container:fullscreen #youtubePlayer,
.video-container:fullscreen #externalEmbedPlayer,
.video-container:fullscreen .external-embed-player,
.video-container:-webkit-full-screen .video-player,
.video-container:-webkit-full-screen #youtubePlayer,
.video-container:-webkit-full-screen #externalEmbedPlayer,
.video-container:-webkit-full-screen .external-embed-player {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: unset;
}

.video-container.is-player-fullscreen,
.video-container.is-player-fullscreen.mode-youtube {
    width: 100vw;
    height: 100vh;
    max-height: 100vh !important;
}

.video-container.is-player-fullscreen #youtubePlayer,
.video-container.is-player-fullscreen.mode-youtube #youtubePlayer,
.video-container:fullscreen.mode-youtube #youtubePlayer,
.video-container:-webkit-full-screen.mode-youtube #youtubePlayer {
    display: block !important;
    position: relative;
    min-height: 0;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    aspect-ratio: unset !important;
}

.video-container:fullscreen.mode-youtube #youtubePlayer iframe,
.video-container:-webkit-full-screen.mode-youtube #youtubePlayer iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.video-container:fullscreen .external-embed-player iframe,
.video-container:-webkit-full-screen .external-embed-player iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: none;
    aspect-ratio: unset;
}

.video-container:fullscreen .player-status,
.video-container:fullscreen .embed-notice,
.video-container:-webkit-full-screen .player-status,
.video-container:-webkit-full-screen .embed-notice {
    display: none;
}

.video-container:fullscreen .subtitles-overlay,
.video-container:-webkit-full-screen .subtitles-overlay {
    bottom: 10%;
    z-index: 120;
}

.player-section:fullscreen,
.player-section:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.player-section:fullscreen .video-container,
.player-section:-webkit-full-screen .video-container {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.player-section:fullscreen .player-status,
.player-section:fullscreen .embed-notice,
.player-section:-webkit-full-screen .player-status,
.player-section:-webkit-full-screen .embed-notice {
    display: none;
}

.player-section:fullscreen .video-player,
.player-section:fullscreen #youtubePlayer,
.player-section:fullscreen #externalEmbedPlayer,
.player-section:fullscreen .external-embed-player,
.player-section:-webkit-full-screen .video-player,
.player-section:-webkit-full-screen #youtubePlayer,
.player-section:-webkit-full-screen #externalEmbedPlayer,
.player-section:-webkit-full-screen .external-embed-player {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: unset;
}

.player-section:fullscreen .external-embed-player,
.player-section:-webkit-full-screen .external-embed-player {
    position: relative;
}

.player-section:fullscreen .external-embed-player iframe,
.player-section:-webkit-full-screen .external-embed-player iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: none;
    aspect-ratio: unset;
}

.player-section:fullscreen .subtitles-overlay,
.player-section:-webkit-full-screen .subtitles-overlay {
    bottom: 10%;
    z-index: 120;
}

.player-fullscreen-btn {
    position: absolute;
    top: 52px;
    left: 12px;
    z-index: 12;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.player-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

.pangea-build-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 130;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: ui-monospace, Consolas, monospace;
    color: #9ef;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
    user-select: none;
}

.playback-mode-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 130;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    user-select: none;
}

.playback-mode-badge[data-mode="native"] {
    color: #86efac;
    background: rgba(22, 101, 52, 0.85);
}

.playback-mode-badge[data-mode="youtube"] {
    color: #fde68a;
    background: rgba(120, 53, 15, 0.85);
}

.playback-mode-badge[data-mode="embed"],
.playback-mode-badge[data-mode="partner"] {
    color: #fca5a5;
    background: rgba(127, 29, 29, 0.85);
}

.mkv-pipeline-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 131;
    max-width: min(420px, 92%);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.35);
    pointer-events: none;
    user-select: none;
    text-align: right;
    direction: rtl;
}

.mkv-pipeline-badge.is-ready {
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(20, 83, 45, 0.9);
}

.mkv-pipeline-badge.is-optimizing {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(120, 53, 15, 0.88);
}

.mkv-pipeline-badge.is-complete {
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(30, 58, 138, 0.88);
}

.timing-chip-transport {
    min-width: 36px;
    font-size: 1rem;
    line-height: 1;
}

.player-section.is-player-fullscreen,
.player-section:fullscreen,
.player-section:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: #000 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

.player-section.is-player-fullscreen .video-container,
.player-section:fullscreen .video-container,
.player-section:-webkit-full-screen .video-container {
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.player-section.is-player-fullscreen .player-timing-overlay,
.player-section:fullscreen .player-timing-overlay,
.player-section:-webkit-full-screen .player-timing-overlay {
    z-index: 200;
    pointer-events: auto;
}

.player-section.is-player-fullscreen .external-embed-player,
.player-section:fullscreen .external-embed-player,
.player-section:-webkit-full-screen .external-embed-player {
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    position: relative !important;
}

.player-section.is-player-fullscreen .external-embed-player iframe,
.player-section:fullscreen .external-embed-player iframe,
.player-section:-webkit-full-screen .external-embed-player iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

.subtitles-overlay.embed-active #subtitleText {
    font-size: clamp(14px, 2.2vmin, 22px);
    padding: 6px 14px;
    max-width: min(92%, 640px);
    opacity: 0.92;
}

.subtitles-overlay.embed-hint {
    pointer-events: none;
}

.subtitles-overlay.embed-hint #subtitleText {
    font-size: clamp(12px, 1.8vmin, 16px);
    padding: 4px 10px;
    opacity: 0.75;
}

.subtitle-buffer-overlay.during-video-resolve {
    z-index: 90;
}

.subtitle-buffer-overlay.during-video-resolve:not(.blocks-playback) {
    pointer-events: auto;
}

.subtitle-buffer-overlay.during-video-resolve .subtitle-buffer-card {
    pointer-events: auto;
}

body.player-fullscreen-active {
    overflow: hidden;
}

/* Viewport fullscreen — video only, no split controls panel */
body.player-viewport-fullscreen {
    overflow: hidden !important;
}

body.player-viewport-fullscreen .container > .top-nav,
body.player-viewport-fullscreen .container > header,
body.player-viewport-fullscreen main > .input-section,
body.player-viewport-fullscreen main > .editor-section,
body.player-viewport-fullscreen .site-footer,
body.player-viewport-fullscreen .player-section .controls-section,
body.player-viewport-fullscreen .player-section > .btn,
body.player-viewport-fullscreen .timing-section {
    display: none !important;
}

body.player-viewport-fullscreen .container {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

body.player-viewport-fullscreen main {
    margin: 0;
    padding: 0;
}

body.player-viewport-fullscreen .player-section {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    border-radius: 0 !important;
    background: #000 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

body.player-viewport-fullscreen .video-container,
body.player-viewport-fullscreen .video-container.is-player-fullscreen {
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

body.player-viewport-fullscreen .video-container.mode-embed #externalEmbedPlayer,
body.player-viewport-fullscreen .video-container.mode-native .video-player,
body.player-viewport-fullscreen .video-container.mode-youtube #youtubePlayer,
body.player-viewport-fullscreen .video-container .external-embed-player {
    flex: 1 1 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    aspect-ratio: unset !important;
}

body.player-viewport-fullscreen .external-embed-player {
    position: relative !important;
    display: block !important;
    overflow: hidden !important;
}

body.player-viewport-fullscreen .external-embed-player iframe,
body.player-viewport-fullscreen #youtubePlayer iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

body.player-viewport-fullscreen .video-container.mode-native .video-player {
    object-fit: contain;
    background: #000;
}

body.player-viewport-fullscreen .player-status,
body.player-viewport-fullscreen .embed-notice,
body.player-viewport-fullscreen .embed-placeholder {
    display: none !important;
}

body.player-viewport-fullscreen .player-fullscreen-btn {
    z-index: 2147483646;
}

body.player-viewport-fullscreen .subtitles-overlay {
    bottom: 10%;
    z-index: 2147483640;
}

/* If player-section ever enters native fullscreen — hide controls (was causing split view) */
.player-section:fullscreen .controls-section,
.player-section:fullscreen > .btn,
.player-section:-webkit-full-screen .controls-section,
.player-section:-webkit-full-screen > .btn {
    display: none !important;
}

/* === True fullscreen: video centered, max size, no top-stuck letterbox === */
.video-container.is-player-fullscreen,
.video-container:fullscreen,
.video-container:-webkit-full-screen,
body.player-viewport-fullscreen .video-container {
    position: relative !important;
    display: block !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100vh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #000 !important;
    flex: none !important;
}

.video-container.is-player-fullscreen > .video-player,
.video-container:fullscreen > .video-player,
.video-container:-webkit-full-screen > .video-player,
body.player-viewport-fullscreen .video-container > .video-player,
.video-container.is-player-fullscreen.mode-native .video-player,
.video-container:fullscreen.mode-native .video-player,
.video-container:-webkit-full-screen.mode-native .video-player,
body.player-viewport-fullscreen .video-container.mode-native .video-player {
    position: absolute !important;
    inset: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    flex: none !important;
    aspect-ratio: unset !important;
    object-fit: contain !important;
    object-position: center center !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1 !important;
    background: #000 !important;
}

.video-container.is-player-fullscreen #youtubePlayer,
.video-container:fullscreen #youtubePlayer,
.video-container:-webkit-full-screen #youtubePlayer,
body.player-viewport-fullscreen .video-container #youtubePlayer,
.video-container.is-player-fullscreen #externalEmbedPlayer,
.video-container:fullscreen #externalEmbedPlayer,
.video-container:-webkit-full-screen #externalEmbedPlayer,
body.player-viewport-fullscreen .video-container #externalEmbedPlayer,
.video-container.is-player-fullscreen .external-embed-player,
.video-container:fullscreen .external-embed-player,
.video-container:-webkit-full-screen .external-embed-player,
body.player-viewport-fullscreen .video-container .external-embed-player {
    position: absolute !important;
    inset: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    flex: none !important;
    aspect-ratio: unset !important;
    display: block !important;
    overflow: hidden !important;
    z-index: 1 !important;
    background: #000 !important;
}

.video-container.is-player-fullscreen .external-embed-player iframe,
.video-container:fullscreen .external-embed-player iframe,
.video-container:-webkit-full-screen .external-embed-player iframe,
body.player-viewport-fullscreen .external-embed-player iframe,
.video-container.is-player-fullscreen #externalEmbedPlayer iframe,
.video-container:fullscreen #externalEmbedPlayer iframe,
.video-container:-webkit-full-screen #externalEmbedPlayer iframe,
body.player-viewport-fullscreen #externalEmbedPlayer iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: unset !important;
    flex: none !important;
    display: block !important;
    border: 0 !important;
    z-index: 1 !important;
    background: #000 !important;
}

.video-container.is-player-fullscreen .embed-playback-shield:not([hidden]),
.video-container:fullscreen .embed-playback-shield:not([hidden]),
.video-container:-webkit-full-screen .embed-playback-shield:not([hidden]),
body.player-viewport-fullscreen .embed-playback-shield:not([hidden]) {
    position: absolute !important;
    inset: 0 !important;
    z-index: 15 !important;
}

.video-container.is-player-fullscreen .subtitles-overlay,
.video-container:fullscreen .subtitles-overlay,
.video-container:-webkit-full-screen .subtitles-overlay,
body.player-viewport-fullscreen .subtitles-overlay {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 9% !important;
    top: auto !important;
    z-index: 20 !important;
    pointer-events: none !important;
}

.video-container.is-player-fullscreen .player-timing-overlay,
.video-container:fullscreen .player-timing-overlay,
.video-container:-webkit-full-screen .player-timing-overlay,
body.player-viewport-fullscreen .player-timing-overlay {
    position: absolute !important;
    z-index: 30 !important;
    pointer-events: auto !important;
}

.video-container.is-player-fullscreen .player-status,
.video-container:fullscreen .player-status,
.video-container:-webkit-full-screen .player-status,
body.player-viewport-fullscreen .player-status,
.video-container.is-player-fullscreen .embed-notice,
.video-container:fullscreen .embed-notice,
.video-container:-webkit-full-screen .embed-notice,
body.player-viewport-fullscreen .embed-notice,
.video-container.is-player-fullscreen .embed-placeholder,
.video-container:fullscreen .embed-placeholder,
.video-container:-webkit-full-screen .embed-placeholder,
body.player-viewport-fullscreen .embed-placeholder {
    display: none !important;
}

.video-container.is-player-fullscreen .player-fullscreen-btn,
.video-container:fullscreen .player-fullscreen-btn,
.video-container:-webkit-full-screen .player-fullscreen-btn,
body.player-viewport-fullscreen .player-fullscreen-btn {
    position: absolute !important;
    z-index: 40 !important;
}

body.player-viewport-fullscreen .subtitle-buffer-overlay:not([data-mode="loading"]):not(.during-video-resolve) {
    display: none !important;
}

.video-container.is-player-fullscreen .pangea-build-badge,
.video-container.is-player-fullscreen .playback-mode-badge,
.video-container:fullscreen .pangea-build-badge,
.video-container:fullscreen .playback-mode-badge,
.video-container:-webkit-full-screen .pangea-build-badge,
.video-container:-webkit-full-screen .playback-mode-badge,
body.player-viewport-fullscreen .pangea-build-badge,
body.player-viewport-fullscreen .playback-mode-badge {
    z-index: 50 !important;
}

.youtube-embed {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(92vh, calc(100vw * 9 / 16));
    min-height: 0;
    height: auto;
    display: block;
    border: none;
    background: #000;
    overflow: hidden;
    flex: 0 0 auto;
}

.youtube-embed iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.external-embed-player {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: min(92vh, calc(100vw * 9 / 16));
    min-height: 0;
    background: #000;
}

.external-embed-player iframe {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    display: block;
    aspect-ratio: 16 / 9;
}

.video-container:fullscreen .external-embed-player,
.video-container:-webkit-full-screen .external-embed-player {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.video-player {
    width: 100%;
    height: auto;
    display: block;
    background: black;
}

.player-status {
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.player-status-success {
    background: #ecfdf5;
    color: #065f46;
}

.player-status-error {
    background: #fef2f2;
    color: #991b1b;
}

.player-status-loading {
    background: #eff6ff;
    color: #1e40af;
}

.subtitles-overlay {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 15px 20px;
    font-weight: 600;
    line-height: 1.4;
    pointer-events: none;
    z-index: 10;
}

.subtitles-overlay.embed-active {
    z-index: 30;
    bottom: 72px;
}

.embed-sync-group,
.manual-sync-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.manual-sync-input,
.embed-sync-seconds-input {
    width: 4.2em;
    min-width: 48px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    text-align: center;
}

.embed-sync-seconds-input {
    width: 3.6em;
}

.embed-sync-seconds-input.embed-sync-seconds-running {
    border-color: rgba(52, 211, 153, 0.85);
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.45);
    animation: embed-sync-tick-pulse 1.2s ease-in-out infinite;
}

@keyframes embed-sync-tick-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.45); }
    50% { box-shadow: 0 0 6px 2px rgba(52, 211, 153, 0.55); }
}

.embed-sync-seconds-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.85);
    margin-inline-end: -2px;
}

.timing-chip-embed {
    min-width: auto;
    font-size: inherit;
}

.timing-chip-sync {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
    padding: 4px 7px;
}

#subtitleText,
#pangeaGlobalSubtitleText {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    white-space: pre-line;
    line-height: 1.35;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
}

#subtitleText {
    font-size: 24px;
}

#pangeaGlobalSubtitleText {
    max-width: min(92vw, 1200px);
    font-size: clamp(1.15rem, 2.6vw, 2.1rem);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.82);
    padding: 12px 22px;
    border-radius: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Controls Section */
.controls-section {
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-control-group {
    align-items: flex-start;
}

.language-picker-wrap {
    flex: 1;
    min-width: 0;
}

.language-picker {
    position: relative;
    width: 100%;
}

.language-picker-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: right;
}

.language-picker-current {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.language-picker-chevron {
    color: var(--text-light);
    font-size: 0.85rem;
}

.language-picker-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    z-index: 50;
}

.language-picker-section-title {
    padding: 10px 14px 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

.language-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.language-picker-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.language-picker-item.is-selected .lang-select-btn {
    background: rgba(102, 126, 234, 0.08);
    font-weight: 700;
    color: var(--primary-color);
}

.lang-fav-btn {
    flex: 0 0 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.15rem;
    color: #9ca3af;
    transition: color 0.2s ease, transform 0.15s ease;
}

.lang-fav-btn:hover {
    color: #6b7280;
    transform: scale(1.08);
}

.lang-fav-btn.is-favorited {
    color: #f59e0b;
}

.lang-select-btn {
    flex: 1;
    border: none;
    background: transparent;
    text-align: right;
    padding: 12px 14px 12px 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.lang-select-btn:hover {
    background: rgba(102, 126, 234, 0.06);
}

.control-group label {
    font-weight: 600;
    white-space: nowrap;
    min-width: 100px;
}

.select-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.lang-select-highlight option.lang-option-recommended {
    font-weight: 700;
    color: var(--pangea-blue);
}

.subtitle-load-panel {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

.subtitle-source-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.subtitle-source-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.subtitle-source-select {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #fff;
    font-size: 0.92rem;
    color: var(--text-dark);
}

.subtitle-source-hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-light);
    line-height: 1.4;
}

.subtitle-source-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.subtitle-source-picker-status {
    font-size: 0.78rem;
    color: var(--text-light);
}

.subtitle-source-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
    gap: 10px;
}

.subtitle-source-group.is-loading-options .subtitle-source-cards {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
}

.subtitle-source-skeleton {
    height: 72px;
    border-radius: 10px;
    background: linear-gradient(90deg, #e2e8f0 0%, #f1f5f9 45%, #e2e8f0 90%);
    background-size: 200% 100%;
    animation: subtitle-source-shimmer 1.2s ease-in-out infinite;
}

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

.subtitle-source-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: right;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.25s ease;
    opacity: 0;
    transform: translateY(8px);
    min-width: 0;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.subtitle-source-group.is-revealed .subtitle-source-card {
    animation: subtitle-card-in 0.45s ease forwards;
    animation-delay: calc(var(--card-index, 0) * 70ms);
}

@keyframes subtitle-card-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtitle-source-card.is-selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.subtitle-source-card.is-recommended:not(.is-selected) {
    border-color: rgba(72, 187, 120, 0.55);
}

.subtitle-source-card.is-failed {
    border-color: rgba(239, 68, 68, 0.45);
    opacity: 0.72;
}

.subtitle-source-card.is-failed .subtitle-source-card-title::after {
    content: ' · נכשל';
    font-weight: 600;
    color: #b91c1c;
    font-size: 0.78rem;
}

.subtitle-source-card.is-switchable:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}

.subtitle-source-card-icon {
    font-size: 1.1rem;
}

.subtitle-source-card-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.35;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.subtitle-source-card-detail {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.35;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.torrent-fallback-panel {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    background: #fffbeb;
    color: #78350f;
    font-size: 0.88rem;
    line-height: 1.5;
}

.torrent-fallback-panel[hidden] {
    display: none !important;
}

.torrent-fallback-panel strong {
    display: block;
    margin-bottom: 6px;
    color: #92400e;
}

.torrent-fallback-panel ul {
    margin: 8px 0 10px;
    padding-right: 18px;
}

.torrent-fallback-panel li {
    margin-bottom: 4px;
}

.torrent-fallback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tab-audio-capture-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    margin: 8px 0 12px;
}

.tab-audio-capture-progress {
    font-weight: 600;
    color: var(--primary-color);
    margin: 8px 0;
}

.tab-audio-capture-modal {
    z-index: 2000;
}

.subtitles-overlay.embed-active {
    z-index: 55;
    pointer-events: none;
}

.btn-load-subtitles {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
}

.btn-load-subtitles.is-loading {
    opacity: 0.92;
    cursor: pointer;
}

.load-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    flex-shrink: 0;
}

.load-spinner.is-active {
    display: inline-block;
}

.player-status-info {
    background: #f8fafc;
    color: var(--text-dark);
}

.subtitle-load-status {
    font-size: 0.95rem;
    color: var(--text-light);
    text-align: center;
    min-height: 1.4em;
}

.subtitle-load-status.is-loading {
    color: var(--primary-color);
    font-weight: 600;
}

.subtitle-load-status.is-error {
    color: #b91c1c;
    font-weight: 600;
}

.subtitle-load-status.is-success {
    color: #047857;
    font-weight: 600;
}

.btn-report-issue {
    font-size: 0.9rem;
}

/* Formatting Section */
.formatting-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-item label {
    font-weight: 600;
    color: var(--text-dark);
}

.color-input-group,
.size-input-group,
.opacity-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input {
    width: 50px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
}

.color-value,
.size-value,
.opacity-value {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 60px;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.checkbox-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Timing Section */
.timing-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.timing-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.delay-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
}

.delay-label {
    color: var(--text-light);
}

.delay-value {
    color: var(--primary-color);
    font-size: 1.1rem;
    min-width: 80px;
}

/* Editor Section */
.editor-section {
    background: linear-gradient(135deg, #fef5e7 0%, #fdebd0 100%);
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--warning-color);
}

.editor-info {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.editor-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.textarea-input {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.textarea-input:focus {
    outline: none;
    border-color: var(--warning-color);
    box-shadow: 0 0 0 3px rgba(237, 137, 54, 0.1);
}

/* Footer */
footer {
    background: var(--bg-dark);
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    .header-content h1 {
        font-size: 1.8rem;
    }

    main {
        padding: 20px;
    }

    section h2 {
        font-size: 1.3rem;
    }

    .input-group {
        flex-direction: column;
    }

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

    .timing-controls {
        flex-direction: column;
        width: 100%;
    }

    .timing-controls .btn {
        width: 100%;
    }

    .video-player {
        max-height: 400px;
    }

    #subtitleText {
        font-size: 18px;
    }

    .delay-display {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: 1.5rem;
    }

    main {
        padding: 15px;
    }

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

    #subtitleText {
        font-size: 16px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Loading and Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.account-links {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.82rem;
}

.account-links a:hover {
    text-decoration: underline;
}

.subtitle-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
}

.subtitle-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    transition: width 0.4s ease;
}

.subtitle-buffer-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    padding: 20px;
}

.subtitle-buffer-dismiss {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 60;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.subtitle-buffer-dismiss:hover {
    background: #fff;
}

.flappy-dismiss-btn {
    margin-top: 8px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}

.flappy-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.subtitle-buffer-overlay.flappy-keep-playing-mode .subtitle-buffer-dismiss {
    display: block;
    pointer-events: auto;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100;
}

.subtitle-buffer-overlay[hidden] {
    display: none !important;
}

.subtitle-buffer-card {
    width: min(420px, 100%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 24px;
    color: #fff;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.subtitle-buffer-card h3 {
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.subtitle-buffer-card p {
    margin: 0 0 12px;
    color: #cbd5e1;
}

.subtitle-buffer-progress {
    height: 10px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0 8px;
}

.subtitle-buffer-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #38bdf8, #22c55e);
    transition: width 0.35s ease;
}

.subtitle-buffer-percent {
    font-size: 1.5rem;
    font-weight: 800;
    color: #38bdf8;
    margin-bottom: 16px !important;
}

.subtitle-buffer-ad-slot {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.subtitle-buffer-ad-label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8 !important;
    margin-bottom: 8px !important;
}

.subtitle-buffer-ad-placeholder {
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.subtitle-buffer-ad-placeholder span {
    font-size: 2rem;
    display: block;
    margin-bottom: 6px;
}

.subtitle-buffer-ad-placeholder p {
    margin: 0;
    font-size: 0.9rem;
}

.subtitle-buffer-skip-ad {
    width: 100%;
    margin-bottom: 8px;
}

.subtitle-buffer-ad-countdown {
    font-size: 2rem;
    font-weight: 800;
    color: #fbbf24;
    margin: 0 0 12px !important;
}

.subtitle-buffer-overlay[data-mode="pre-roll-ad"] .subtitle-buffer-progress,
.subtitle-buffer-overlay[data-mode="mid-roll-ad"] .subtitle-buffer-progress,
.subtitle-buffer-overlay[data-mode="rewarded-ad"] .subtitle-buffer-progress {
    display: none;
}

.progress-gear-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 120;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, background 0.15s ease;
}

.progress-gear-btn:hover {
    transform: scale(1.05);
    background: rgba(30, 41, 59, 0.98);
}

.progress-gear-btn.is-active {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.progress-floating-panel {
    position: fixed;
    right: 18px;
    bottom: 72px;
    z-index: 119;
    width: min(320px, calc(100vw - 36px));
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px 16px;
    color: #e2e8f0;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.progress-floating-panel[hidden],
.progress-gear-btn[hidden] {
    display: none !important;
}

.progress-floating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.progress-floating-header span {
    font-weight: 700;
    font-size: 0.95rem;
}

#progressFloatingClose {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

#progressFloatingMessage {
    margin: 0 0 10px;
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.35;
}

.progress-floating-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
}

.progress-floating-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    transition: width 0.35s ease;
}

.progress-floating-meta {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.subtitle-buffer-overlay[data-mode="loading"] {
    position: absolute;
    inset: 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    pointer-events: none;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 72px;
}

.subtitle-buffer-overlay.blocks-playback[data-mode="loading"],
.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] {
    pointer-events: auto !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    background: rgba(0, 0, 0, 0.72) !important;
}

.subtitle-buffer-overlay.blocks-playback[data-mode="loading"] .flappy-buffer-root,
.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] .flappy-buffer-root {
    order: 1;
    width: min(400px, 92vw);
    margin: 0 auto 12px;
    pointer-events: auto;
}

.subtitle-buffer-overlay.blocks-playback[data-mode="loading"] .subtitle-buffer-card,
.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] .subtitle-buffer-card {
    order: 2;
    margin-top: 0;
    pointer-events: auto;
}

.subtitle-buffer-overlay[data-mode="loading"] .subtitle-buffer-card {
    max-width: 340px;
    pointer-events: auto;
}

.subtitle-buffer-overlay[data-mode="loading"] .subtitle-buffer-ad-slot {
    display: none;
}

.subtitle-buffer-overlay.during-initial-load[data-mode="loading"] {
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.subtitle-buffer-overlay.during-initial-load[data-mode="loading"] .subtitle-buffer-card {
    position: relative;
    max-width: 380px;
    width: min(380px, 100%);
    margin-top: auto;
    z-index: 52;
}

.subtitle-buffer-overlay.during-initial-load[data-mode="loading"] .subtitle-buffer-ad-slot {
    display: block;
}

.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] .subtitle-buffer-ad-slot {
    display: none !important;
}

.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] .subtitle-buffer-card {
    margin-top: 8px;
}

.partial-load-choice-modal {
    position: absolute;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(6px);
    pointer-events: auto;
}

.partial-load-choice-modal[hidden] {
    display: none !important;
}

.partial-load-choice-card {
    width: min(360px, 100%);
    padding: 22px 20px;
    border-radius: 16px;
    background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.partial-load-choice-card p {
    margin: 0 0 18px;
    color: #f8fafc;
    font-size: 1rem;
    line-height: 1.5;
}

.partial-load-choice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] {
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] .flappy-buffer-root {
    order: 1;
    width: min(400px, 92vw);
    margin: 0 auto 12px;
}

.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] .subtitle-buffer-card {
    order: 2;
    margin-top: 0;
}

.subtitle-buffer-overlay.flappy-keep-playing-mode {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    align-items: stretch;
    justify-content: flex-end;
    padding: 0;
}

.subtitle-buffer-overlay.flappy-keep-playing-mode .subtitle-buffer-card {
    display: none !important;
}

.subtitle-buffer-overlay.flappy-keep-playing-mode .flappy-buffer-root {
    opacity: 1;
    pointer-events: auto;
}

.flappy-buffer-root.flappy-mini-mode {
    position: fixed;
    bottom: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 95;
    width: min(320px, 90vw);
    margin: 0;
    pointer-events: auto;
}

.flappy-buffer-root.flappy-mini-mode .flappy-buffer-header,
.flappy-buffer-root.flappy-mini-mode .flappy-buffer-hint {
    display: none;
}

.flappy-buffer-root.flappy-mini-mode .flappy-buffer-canvas-wrap {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.subtitle-buffer-overlay.flappy-keep-playing-mode .flappy-buffer-root {
    opacity: 1;
}

.subtitle-buffer-overlay.flappy-keep-playing-mode .partial-load-choice-modal {
    display: none !important;
}

.flappy-buffer-root,
.flappy-buffer-root canvas,
#flappyBufferCanvas {
    touch-action: manipulation;
}

.flappy-buffer-root {
    position: relative;
    z-index: 51;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    width: min(400px, 100%);
    margin: 0 auto 8px;
    transition: opacity 0.34s ease, transform 0.34s ease;
}

.flappy-buffer-root.is-fading-out {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
    pointer-events: none;
}

.flappy-buffer-header {
    margin: 0 0 12px;
    color: #f8fafc;
    font-size: 1.08rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    max-width: 340px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.flappy-buffer-canvas-wrap {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(56, 189, 248, 0.35);
}

.flappy-buffer-hint {
    margin: 10px 0 0;
    color: #94a3b8;
    font-size: 0.78rem;
    text-align: center;
}

#flappyBufferCanvas {
    display: block;
    width: 100%;
    height: auto;
    background: #0f172a;
    touch-action: manipulation;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.flappy-absorb-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
    overflow: hidden;
}

.flappy-absorb-token {
    position: fixed;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.85);
    pointer-events: none;
    z-index: 201;
    will-change: transform, opacity;
}

.subtitle-buffer-progress.flappy-progress-pulse,
#subtitleBufferProgressBar.flappy-progress-pulse {
    animation: flappyProgressPulse 0.45s ease;
}

#subtitleBufferProgressFill.flappy-progress-pulse {
    animation: flappyFillPulse 0.45s ease;
}

@keyframes flappyProgressPulse {
    0% { box-shadow: 0 0 0 rgba(56, 189, 248, 0); }
    40% { box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.45); }
    100% { box-shadow: 0 0 0 rgba(56, 189, 248, 0); }
}

@keyframes flappyFillPulse {
    0% { filter: brightness(1); }
    35% { filter: brightness(1.45); }
    100% { filter: brightness(1); }
}

.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] .subtitle-buffer-card {
    margin-top: 0;
    width: min(400px, 100%);
}

.subtitle-buffer-overlay.during-initial-load.pro-minigame[data-mode="loading"] .subtitle-buffer-card h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.subtitle-buffer-overlay.during-initial-load[data-mode="pre-roll-ad"] .subtitle-buffer-progress,
.subtitle-buffer-overlay.during-initial-load[data-mode="pre-roll-ad"] .subtitle-buffer-percent {
    display: block !important;
}

.video-container.is-subtitle-loading .video-player,
.video-container.is-subtitle-loading .external-embed-player,
.video-container.is-playback-blocked .video-player,
.video-container.is-playback-blocked .external-embed-player,
.video-container.is-playback-blocked #youtubePlayer,
.video-container.is-playback-blocked .video-controls {
    pointer-events: none !important;
}

.video-container.is-playback-blocked .video-player {
    filter: brightness(0.35);
}

.video-container.is-playback-blocked .external-embed-player,
.video-container.is-playback-blocked .external-embed-player iframe,
.video-container.is-playback-blocked #youtubePlayer,
.video-container.is-playback-blocked #youtubePlayer iframe {
    filter: none !important;
    pointer-events: auto !important;
}

.video-container:not(.is-playback-blocked) .external-embed-player,
.video-container:not(.is-playback-blocked) .external-embed-player iframe {
    pointer-events: auto !important;
    filter: none !important;
}

.video-container:fullscreen .player-timing-overlay,
.video-container:-webkit-full-screen .player-timing-overlay {
    display: flex;
    z-index: 120;
    bottom: 72px;
    right: 16px;
    left: auto;
    transform: none;
    gap: 8px;
    padding: 6px 10px;
}

.video-container:fullscreen .timing-chip,
.video-container:-webkit-full-screen .timing-chip {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.video-container:fullscreen .timing-chip-label,
.video-container:-webkit-full-screen .timing-chip-label {
    min-width: 52px;
}

.video-container:fullscreen .timing-chip-font,
.video-container:-webkit-full-screen .timing-chip-font {
    min-width: 40px;
    padding: 8px 10px;
}

.pre-subtitle-gate {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
    max-width: 92%;
    padding: 8px 14px;
    text-align: center;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
}

.pre-subtitle-gate[hidden] {
    display: none !important;
}

.subtitle-style-popover {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    width: 168px;
    max-width: 70vw;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.72rem;
    color: #e2e8f0;
    z-index: 30;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.subtitle-style-popover[hidden] {
    display: none !important;
}

.subtitle-style-popover label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.subtitle-style-popover input[type="color"] {
    width: 28px;
    height: 22px;
    padding: 0;
    border: none;
}

.subtitle-style-popover input[type="range"] {
    width: 72px;
}

.timing-chip-style {
    background: linear-gradient(135deg, #db2777, #be185d);
}

.flappy-game-overlay {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.flappy-game-overlay button {
    pointer-events: auto;
}

.flappy-start-btn,
.flappy-replay-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
}

.flappy-death-panel {
    text-align: center;
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.88);
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.flappy-death-score {
    margin: 0 0 10px;
    font-weight: 700;
    color: #f8fafc;
}

.player-timing-overlay {
    position: absolute;
    /* Sit above native video controls / timeline (~40–48px) */
    bottom: 52px;
    right: 12px;
    left: auto;
    transform: none;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 20;
    flex-wrap: nowrap;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-width: calc(100% - 24px);
}

.player-timing-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.player-timing-overlay[data-collapsed="true"] {
    padding: 3px 5px;
}

.player-timing-overlay[data-collapsed="true"] .player-timing-controls {
    display: none;
}

.timing-chip-toggle {
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.95);
    flex-shrink: 0;
}

.timing-chip-toggle:hover {
    background: rgba(59, 130, 246, 1);
}

.player-timing-overlay[data-collapsed="true"] .timing-chip-toggle {
    min-width: 38px;
    min-height: 38px;
    font-size: 1.5rem;
}

.timing-chip {
    border: none;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.timing-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}

.timing-chip-label {
    background: rgba(255, 255, 255, 0.12);
    min-width: 38px;
    text-align: center;
    cursor: default;
    padding: 4px 6px;
}

.timing-chip-font {
    min-width: 28px;
    padding: 4px 6px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.timing-divider {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.68rem;
    user-select: none;
}

.timing-section-compact {
    padding-top: 0;
}

.timing-hint {
    font-size: 0.85rem;
    color: var(--text-light);
}

.embed-placeholder {
    min-height: 180px;
    max-height: min(50vh, 400px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    text-align: center;
    background: #0f172a;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.external-embed-player {
    position: relative;
}

.embed-playback-shield {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    text-align: center;
    background: rgba(15, 23, 42, 0.88);
    color: #f1f5f9;
    pointer-events: auto;
}

.embed-playback-shield[hidden] {
    display: none !important;
}

.embed-playback-shield .embed-shield-msg {
    margin: 0;
    max-width: 420px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.embed-notice {
    background: rgba(15, 23, 42, 0.92);
    color: #e2e8f0;
    padding: 10px 14px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.embed-notice .btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.external-embed-player {
    display: flex;
    flex-direction: column;
}

.external-embed-player iframe {
    flex: 1;
    min-height: 0;
    aspect-ratio: 16 / 9;
}

.site-footer {
    margin-top: 40px;
    padding: 32px 24px 20px;
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    color: #cbd5e1;
    border-radius: 12px 12px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

.footer-brand p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 12px;
    max-width: 420px;
}

.footer-logo {
    max-height: 48px;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.footer-col a {
    display: block;
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.footer-col a:hover {
    text-decoration: underline;
}

.footer-copy {
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 16px;
}

.legal-page {
    background: white;
    border-radius: 12px;
    padding: 32px;
    margin: 24px 0;
    line-height: 1.7;
}

.legal-page h1 {
    color: var(--pangea-blue);
    margin-bottom: 16px;
}

.legal-page h2 {
    margin-top: 24px;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

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

    .player-timing-overlay {
        bottom: 48px;
        right: 8px;
        left: auto;
        gap: 3px;
        padding: 3px 5px;
    }

    .timing-chip {
        padding: 3px 6px;
        font-size: 0.62rem;
    }

    .timing-chip-label {
        min-width: 32px;
    }
}

/* Cinema mode — full black viewport, thin side ad rails, subtitles on top */
body.cinema-mode {
    overflow: hidden;
    background: #000 !important;
}

body.cinema-mode::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 10040;
    background: #000;
    pointer-events: none;
}

body.cinema-mode .page-outer {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
    background: #000;
}

body.cinema-mode .page-main {
    max-width: none;
    padding: 0;
}

body.cinema-mode .container > .top-nav,
body.cinema-mode main > .input-section,
body.cinema-mode main > .editor-section,
body.cinema-mode .site-footer,
body.cinema-mode .site-footer-full,
body.cinema-mode .timing-section,
body.cinema-mode .page-outer > .google-ad-rail {
    display: none !important;
}

body.cinema-mode .container {
    max-width: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

body.cinema-mode main {
    margin: 0;
    padding: 0;
}

body.cinema-mode .player-section {
    position: fixed;
    top: 0;
    bottom: 0;
    left: var(--ad-rail-width, 160px);
    right: var(--ad-rail-width, 160px);
    transform: none;
    z-index: 10050;
    margin: 0;
    padding: 0;
    border-radius: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    background: #000;
    border: none;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: none;
    overflow: hidden;
}

body.cinema-mode .player-section.dashboard-card {
    background: #000;
    border: none;
    box-shadow: none;
}

body.cinema-mode .player-section .controls-section,
body.cinema-mode .player-section > .btn {
    display: none !important;
}

body.cinema-mode .video-container {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    position: relative;
    background: #000;
}

body.cinema-mode .video-container.mode-youtube #youtubePlayer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: unset;
    object-fit: contain;
    display: block !important;
}

body.cinema-mode .video-container.mode-youtube #youtubePlayer iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: none;
    border: 0;
}

body.cinema-mode .video-container.mode-embed #externalEmbedPlayer,
body.cinema-mode .video-container.mode-native .video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    aspect-ratio: unset;
    object-fit: contain;
}

body.cinema-mode .external-embed-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    overflow: hidden;
    background: #000;
}

body.cinema-mode .external-embed-player iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: none;
    border: 0;
    z-index: 1;
    transform-origin: center center;
    transition: transform 0.15s ease-out;
}

body.cinema-mode .video-container.is-cinema-panning .external-embed-player iframe {
    transition: none;
    cursor: grabbing;
}

body.cinema-mode .video-container.is-cinema-mode.mode-embed {
    cursor: default;
}

body.cinema-mode .video-container.is-cinema-mode.mode-embed .external-embed-player {
    cursor: grab;
}

body.cinema-mode .video-container.mode-embed.is-cinema-mode .external-embed-player iframe {
    pointer-events: none;
}

body.cinema-mode .cinema-pan-layer {
    position: absolute;
    inset: 0;
    z-index: 4;
    cursor: default;
    background: transparent;
}

body.cinema-mode .video-container.is-cinema-panning .cinema-pan-layer {
    cursor: grabbing;
}

body.cinema-mode .video-player,
body.cinema-mode .youtube-embed {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
    background: #000;
}

body.cinema-mode .subtitles-overlay {
    bottom: 8%;
    z-index: 10080;
    pointer-events: none;
}

body.cinema-mode #subtitleText {
    font-size: clamp(1.1rem, 2.4vw, 2rem);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95), 0 0 2px #000;
}

body.cinema-mode .player-timing-overlay {
    z-index: 10090;
    bottom: 56px;
}

body.cinema-mode .player-status,
body.cinema-mode .embed-notice,
body.cinema-mode .embed-placeholder {
    display: none !important;
}

body.cinema-mode .player-fullscreen-btn {
    display: none;
}

.cinema-toolbar {
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    z-index: 10070;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    pointer-events: auto;
}

.cinema-toolbar[hidden] {
    display: none !important;
}

.cinema-toolbar-btn {
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    line-height: 1.2;
}

.cinema-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.cinema-exit-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.cinema-embed-zoom {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
}

.cinema-zoom-label {
    color: #e2e8f0;
    font-size: 0.85rem;
    min-width: 3.2rem;
    text-align: center;
}

.cinema-embed-hint {
    flex: 1 1 100%;
    margin: 0;
    color: #cbd5e1;
    font-size: 0.78rem;
    line-height: 1.35;
}

.video-container.is-cinema-mode .player-fullscreen-btn {
    display: none;
}

/* Global subtitle portal — fixed on viewport, above iframe/HLS/cinema (not inside video stack) */
#pangeaGlobalSubtitleLayer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: clamp(48px, 8vh, 120px);
    z-index: 2147483000;
    pointer-events: none;
    text-align: center;
    padding: 0 clamp(12px, 4vw, 48px);
    box-sizing: border-box;
}

#pangeaGlobalSubtitleLayer[hidden] {
    display: none !important;
}

#pangeaGlobalSubtitleLayer.embed-active #pangeaGlobalSubtitleText {
    background: rgba(0, 0, 0, 0.88);
}

#pangeaGlobalSubtitleLayer.sync-flash #pangeaGlobalSubtitleText {
    outline: 3px solid #22c55e;
    outline-offset: 4px;
}

body.cinema-mode .video-container .subtitles-overlay {
    visibility: hidden !important;
}

body.cinema-mode .video-container .player-timing-overlay {
    position: fixed;
    left: 50%;
    bottom: clamp(52px, 8vh, 72px);
    right: auto;
    transform: translateX(-50%);
    z-index: 2147483010;
    pointer-events: auto;
    max-width: min(96vw, 720px);
    flex-wrap: wrap;
    justify-content: center;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Pangea v2 — reference mockup theme ===== */
body.pangea-v2 {
    --ad-rail-width: 160px;
    background: linear-gradient(180deg, #dbeafe 0%, #eff6ff 220px, #f1f5f9 220px, #f8fafc 100%);
    color: var(--text-dark);
}

body.pangea-v2 .page-outer {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    max-width: 1760px;
    margin: 0 auto;
    padding: 12px 24px 32px;
}

body.pangea-v2 .page-main {
    flex: 1 1 880px;
    max-width: 960px;
    min-width: 0;
    padding: 0 8px 24px;
}

body.pangea-v2 .top-nav {
    background: #fff;
    color: #0f172a;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 0;
}

body.pangea-v2 .nav-center {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

body.pangea-v2 .nav-mobile-links {
    display: none;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

body.pangea-v2 .nav-link {
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}

body.pangea-v2 .nav-link:hover {
    color: #2563eb;
}

body.pangea-v2 .nav-link-active {
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 6px 14px;
}

body.pangea-v2 .nav-pricing-link {
    background: transparent;
    color: #334155;
    border: none;
    padding: 0;
}

body.pangea-v2 .nav-pricing-link.nav-link-active {
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 6px 14px;
}

body.pangea-v2 .nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    min-width: 0;
}

body.pangea-v2 .language-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

body.pangea-v2 .language-switcher label {
    white-space: nowrap;
}

body.pangea-v2 .user-menu {
    flex-shrink: 0;
}

body.pangea-v2 .hero-header {
    text-align: center;
    padding: 28px 16px 20px;
    background: transparent;
}

body.pangea-v2 .hero-logo {
    max-height: 88px;
    width: auto;
    margin-bottom: 12px;
    filter: none;
}

body.pangea-v2 .hero-title {
    font-size: clamp(1.15rem, 2.4vw, 1.65rem);
    font-weight: 800;
    color: #1e3a8a;
    margin: 0;
    line-height: 1.35;
}

body.pangea-v2 .dashboard-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e8eef7;
    padding: 22px 24px;
    margin-bottom: 20px;
}

body.pangea-v2 .section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px;
}

body.pangea-v2 .input-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

body.pangea-v2 .input-box {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 20px 18px 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

body.pangea-v2 .input-box-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    padding: 8px 4px 0;
}

body.pangea-v2 .input-box-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

body.pangea-v2 .input-box-icon-link {
    background: linear-gradient(145deg, #fee2e2, #fecaca);
    color: #dc2626;
}

body.pangea-v2 .input-box-icon-upload {
    background: linear-gradient(145deg, #ede9fe, #ddd6fe);
    color: #7c3aed;
}

body.pangea-v2 .input-box-label {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
    margin: 0;
}

body.pangea-v2 .input-box-hint {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.4;
}

body.pangea-v2 .input-box .input-group {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    text-align: right;
}

body.pangea-v2 .drop-zone {
    cursor: pointer;
    border-style: dashed;
    border-width: 2px;
}

body.pangea-v2 .drop-zone.is-dragover {
    border-color: #7c3aed;
    background: #f5f3ff;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

body.pangea-v2 .input-box-upload {
    position: relative;
}

.file-input-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.upload-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-sizing: border-box;
}

.upload-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.88rem;
    color: #64748b;
    text-align: start;
}

.upload-file-browse {
    flex-shrink: 0;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.upload-file-browse:hover {
    filter: brightness(1.05);
}

.upload-file-browse:active {
    transform: translateY(1px);
}

body.pangea-v2 .upload-section-compact {
    display: none;
    margin-top: 0;
    padding-top: 0;
    border: none;
    background: transparent;
}

body.pangea-v2 .upload-section-compact:has(#torrentFallbackPanel:not([hidden])) {
    display: block;
    margin-top: 12px;
}

body.pangea-v2 .upload-section-compact > p:first-child,
body.pangea-v2 .upload-section-compact .torrent-hint {
    display: none;
}

body.pangea-v2 .btn-upload-trigger {
    align-self: center;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 22px;
    font-weight: 700;
    cursor: pointer;
}

body.pangea-v2 .google-ad-rail {
    flex: 0 0 var(--ad-rail-width, 160px);
    width: var(--ad-rail-width, 160px);
    min-height: auto;
    position: sticky;
    top: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8px 4px;
    margin-top: 72px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.google-ad-grid {
    display: grid;
    grid-template-columns: repeat(var(--ad-grid-cols, 2), 1fr);
    grid-template-rows: repeat(var(--ad-grid-rows, 2), auto);
    gap: 8px;
    align-content: start;
}

.google-ad-rail .google-ad-grid {
    width: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(var(--ad-grid-rows, 4), auto);
}

.google-ad-rail .google-ad-unit--sidebarStack {
    width: 100% !important;
    height: 300px;
}

.google-ad-unit {
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.google-ad-rotate {
    position: relative;
    width: 100%;
    height: 100%;
}

.google-ad-creative {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.65s ease;
    pointer-events: none;
}

.google-ad-creative.is-active {
    opacity: 1;
    pointer-events: auto;
}

.google-ad-placeholder-inner,
body.pangea-v2 .google-ad-placeholder {
    width: 100%;
    height: 100%;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #64748b;
    font-size: 0.78rem;
    text-align: center;
    padding: 12px 8px;
    box-sizing: border-box;
}

.google-ad-size {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

.google-ad-sponsor {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.google-ad-unit--half .google-ad-placeholder-inner {
    font-size: 0.62rem;
    gap: 4px;
    padding: 8px 4px;
}

.google-ad-unit--half .google-ad-size {
    font-size: 0.58rem;
}

.google-ad-unit--half .google-ad-sponsor {
    font-size: 0.55rem;
}

.google-ad-unit--half .google-ad-label {
    font-size: 0.62rem;
}

.cinema-side-ad {
    position: fixed;
    top: 0;
    bottom: 0;
    width: var(--ad-rail-width, 160px);
    z-index: 10048;
    background: #050505;
    border-inline: 1px solid #1e293b;
    display: none;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    padding: 4px 2px;
    box-sizing: border-box;
}

.cinema-side-ad[hidden] {
    display: none !important;
}

body.cinema-mode .cinema-side-ad:not([hidden]) {
    display: flex;
}

.cinema-side-ad .google-ad-grid {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    align-self: stretch;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
    align-content: stretch;
    gap: 4px;
    min-height: 0;
}

.cinema-side-ad .google-ad-unit {
    width: 100% !important;
    height: 100%;
    min-height: 0;
    border-color: #1e293b;
    background: #0a0f1a;
}

.cinema-side-ad .google-ad-placeholder-inner {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
    border-color: #334155;
    color: #64748b;
}

.cinema-side-ad-start {
    right: 0;
}

.cinema-side-ad-end {
    left: 0;
}

body.cinema-mode .external-embed-player iframe {
    object-fit: contain;
}

body.cinema-mode .video-container.mode-embed .external-embed-player iframe {
    min-height: 100%;
}

body.pangea-v2 .btn-primary {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 12px;
}

body.pangea-v2 .player-section.dashboard-card {
    padding: 16px;
}

body.pangea-v2 .site-footer {
    background: #0f172a;
    color: #e2e8f0;
    margin-top: 0;
    padding: 40px 24px 24px;
}

body.pangea-v2 .google-ad-label {
    font-weight: 700;
    color: #475569;
}

body.pangea-v2 .cinema-side-ad .google-ad-label {
    color: #94a3b8;
}

body.pangea-v2 .language-switcher {
    color: #334155;
    font-weight: 600;
}

body.pangea-v2 .language-switcher label {
    color: #475569;
    white-space: nowrap;
}

body.pangea-v2 .lang-select {
    background: #fff;
    color: #0f172a;
    border: 2px solid #2563eb;
    border-radius: 10px;
    padding: 8px 36px 8px 12px;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 148px;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.18);
    cursor: pointer;
}

body.pangea-v2 .lang-select:hover,
body.pangea-v2 .lang-select:focus {
    border-color: #1d4ed8;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body.pangea-v2 .lang-select option {
    background: #fff;
    color: #0f172a;
    font-weight: 600;
}

body.pangea-v2 .user-btn {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-weight: 600;
}

body.pangea-v2 .user-btn:hover {
    background: #dbeafe;
}

body.pangea-v2 a.user-btn {
    display: inline-block;
    text-decoration: none;
}

body.pangea-v2 .user-btn.nav-link-active {
    background: #dbeafe;
    color: #1e40af;
    box-shadow: inset 0 0 0 1px #93c5fd;
}

body.pangea-v2 .user-btn.user-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    font-size: 1.15rem;
    line-height: 1;
    border-radius: 10px;
    flex-shrink: 0;
}

body.pangea-v2 a.user-btn.user-btn-icon {
    text-decoration: none;
}

.site-footer-full {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    border-radius: 0;
    position: relative;
    overflow: hidden;
    margin-top: 32px;
}

.footer-wave {
    position: absolute;
    top: -46px;
    left: 0;
    right: 0;
    height: 48px;
    pointer-events: none;
    z-index: 1;
}

.footer-wave-svg {
    width: 200%;
    height: 100%;
    display: block;
    animation: footerWaveSlide 22s linear infinite;
}

.footer-wave-path-1 {
    fill: rgba(59, 130, 246, 0.28);
}

.footer-wave-path-2 {
    fill: rgba(37, 99, 235, 0.16);
}

@keyframes footerWaveSlide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.footer-inner {
    position: relative;
    z-index: 2;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* v2 subpages (pricing, checkout, support, legal) */
body.pangea-v2.v2-subpage .page-sub-outer {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 16px 0;
}

body.pangea-v2.v2-subpage .container.page-sub-main {
    max-width: 100%;
    padding: 0;
}

body.pangea-v2.v2-subpage .top-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

body.pangea-v2.v2-subpage .nav-left {
    flex: 0 0 auto;
    min-width: 0;
}

body.pangea-v2.v2-subpage .nav-center {
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 8px 10px;
    justify-content: center;
}

body.pangea-v2.v2-subpage .nav-right {
    flex: 0 0 auto;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
    margin-inline-start: auto;
}

body.pangea-v2.v2-subpage .language-switcher {
    flex-wrap: nowrap;
    flex-shrink: 0;
}

body.pangea-v2.v2-subpage .language-switcher label {
    font-size: 0.82rem;
}

body.pangea-v2.v2-subpage .lang-select {
    min-width: 0;
    width: auto;
    max-width: 148px;
    font-size: 0.82rem;
    padding: 6px 28px 6px 10px;
}

body.pangea-v2.v2-subpage .user-menu {
    flex-shrink: 0;
}

body.pangea-v2.v2-subpage .page-sub-main {
    padding-bottom: 8px;
}

body.pangea-v2 .v2-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid #e8eef7;
    padding: 28px 28px 32px;
    margin-bottom: 20px;
}

body.pangea-v2 .v2-hero {
    text-align: center;
    padding: 28px 16px 24px;
}

body.pangea-v2 .v2-hero h1 {
    color: #1e3a8a;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin: 0 0 10px;
    font-weight: 800;
}

body.pangea-v2 .v2-hero p {
    color: #64748b;
    margin: 0;
    font-size: 1rem;
}

body.pangea-v2 .v2-hero-banner {
    background: var(--pangea-gradient);
    border-radius: 20px;
    padding: 28px 24px;
    margin-bottom: 20px;
}

body.pangea-v2 .v2-hero-banner h1,
body.pangea-v2 .v2-hero-banner p {
    color: #fff;
}

body.pangea-v2 .v2-hero-banner p {
    opacity: 0.92;
}

body.pangea-v2 .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

body.pangea-v2 .product-card h2 {
    color: #1e3a8a;
    font-size: 1.15rem;
    margin: 0 0 12px;
    font-weight: 800;
}

body.pangea-v2 .product-card p {
    color: #475569;
    margin: 0 0 16px;
    line-height: 1.55;
    flex: 1;
}

body.pangea-v2 .product-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

body.pangea-v2 .product-card-pro {
    border-color: #c4b5fd;
    background: linear-gradient(180deg, #faf5ff 0%, #fff 50%);
}

body.pangea-v2 .products-cta-card {
    text-align: center;
    padding: 32px 24px;
    margin-bottom: 24px;
}

body.pangea-v2 .products-cta-card h2 {
    color: #1e3a8a;
    margin: 0 0 10px;
    font-size: 1.35rem;
}

body.pangea-v2 .products-cta-card p {
    color: #64748b;
    margin: 0 0 18px;
}

body.pangea-v2 .pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 0 auto;
    max-width: 1200px;
}

body.pangea-v2 .pricing-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 2px solid #e2e8f0;
    position: relative;
    display: flex;
    flex-direction: column;
}

body.pangea-v2 .pricing-card.featured {
    border-color: #2563eb;
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(37, 99, 235, 0.18);
}

body.pangea-v2 .pricing-card.pro-tier {
    border-color: #7c3aed;
    background: linear-gradient(180deg, #faf5ff 0%, #fff 40%);
}

body.pangea-v2 .launch-badge {
    display: inline-block;
    margin-top: 14px;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

body.pangea-v2 .popular-tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #2563eb;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

body.pangea-v2 .pricing-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 12px 0 4px;
}

body.pangea-v2 .pricing-period {
    color: #64748b;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

body.pangea-v2 .pricing-desc {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

body.pangea-v2 .pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}

body.pangea-v2 .pricing-features li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
}

body.pangea-v2 .pricing-features li::before {
    content: '✓ ';
    color: #22c55e;
    font-weight: 700;
}

body.pangea-v2 .pricing-cta {
    width: 100%;
    text-align: center;
    margin-top: auto;
    flex-shrink: 0;
}

body.pangea-v2 .account-section h2,
body.pangea-v2 .account-list-card h2,
body.pangea-v2 .account-legal-card h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: #0f172a;
    font-weight: 800;
}

body.pangea-v2 .account-section-meta {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0 0 20px;
}

body.pangea-v2 .account-section-meta a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

body.pangea-v2 .account-section-meta a:hover {
    text-decoration: underline;
}

body.pangea-v2 .account-plans-grid {
    margin-bottom: 0;
}

body.pangea-v2 .pricing-card.account-plan-current {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

body.pangea-v2 .account-plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #22c55e;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

body.pangea-v2 .account-lists-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

body.pangea-v2 .account-list-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0 0 14px;
}

body.pangea-v2 .account-list-input {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

body.pangea-v2 .account-list-input input {
    flex: 1 1 180px;
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
}

body.pangea-v2 .account-list-input .btn {
    flex-shrink: 0;
}

body.pangea-v2 .account-saved-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.pangea-v2 .account-saved-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
}

body.pangea-v2 .account-saved-list li:last-child {
    border-bottom: none;
}

body.pangea-v2 .account-saved-list a {
    color: #2563eb;
    text-decoration: none;
    word-break: break-word;
}

body.pangea-v2 .account-saved-list a:hover {
    text-decoration: underline;
}

body.pangea-v2 .account-saved-list .account-empty-item {
    color: #94a3b8;
    justify-content: flex-start;
}

body.pangea-v2 .account-legal-card p {
    color: #475569;
    margin: 0;
    line-height: 1.6;
}

body.pangea-v2 .account-legal-card a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

body.pangea-v2 .account-legal-card a:hover {
    text-decoration: underline;
}

body.pangea-v2 .account-subscription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e8eef7;
}

body.pangea-v2 .account-subscription-status {
    text-align: center;
    margin-top: 14px;
    font-size: 0.9rem;
    color: #64748b;
    min-height: 1.25rem;
}

body.pangea-v2 .account-subscription-status.success {
    color: #166534;
}

body.pangea-v2 .account-subscription-status.error {
    color: #b91c1c;
}

body.pangea-v2 .account-billing-notice {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.9rem;
    line-height: 1.5;
}

body.pangea-v2 .account-cancel-btn {
    background: #fff;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

body.pangea-v2 .account-cancel-btn:hover {
    background: #fef2f2;
}

body.pangea-v2 .subscription-modal[hidden] {
    display: none !important;
}

body.pangea-v2 .subscription-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

body.pangea-v2 .subscription-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

body.pangea-v2 .subscription-modal-card {
    position: relative;
    width: min(480px, 100%);
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    border: 1px solid #e2e8f0;
}

body.pangea-v2 .subscription-modal-card h3 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 1.2rem;
}

body.pangea-v2 .subscription-modal-card p {
    margin: 0 0 10px;
    color: #475569;
    line-height: 1.55;
}

body.pangea-v2 .subscription-modal-details {
    list-style: none;
    margin: 14px 0 20px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

body.pangea-v2 .subscription-modal-details li {
    color: #334155;
    font-size: 0.92rem;
    padding: 4px 0;
}

body.pangea-v2 .subscription-modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.pangea-v2 .account-history-item {
    flex: 1;
    min-width: 0;
}

body.pangea-v2 .account-history-meta {
    display: block;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 2px;
}

body.pangea-v2 .account-saved-list .account-history-play {
    flex-shrink: 0;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff !important;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

body.pangea-v2 .account-saved-list .account-history-play:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff !important;
    text-decoration: none;
}

body.pangea-v2 .support-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

body.pangea-v2 .support-form-card h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: #0f172a;
}

body.pangea-v2 .support-form-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0 0 16px;
}

body.pangea-v2 .support-form-card label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: #334155;
    margin-bottom: 6px;
}

body.pangea-v2 .support-form-card input,
body.pangea-v2 .support-form-card select,
body.pangea-v2 .support-form-card textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.95rem;
    margin-bottom: 12px;
    font-family: inherit;
}

body.pangea-v2 .support-form-card textarea {
    min-height: 110px;
    resize: vertical;
}

body.pangea-v2 .form-status {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-top: 8px;
    display: none;
}

body.pangea-v2 .form-status.is-visible.info {
    display: block;
    background: #eff6ff;
    color: #1e40af;
}

body.pangea-v2 .form-status.success {
    background: #dcfce7;
    color: #166534;
}

body.pangea-v2 .form-status.error {
    background: #fee2e2;
    color: #991b1b;
}

body.pangea-v2 .legal-page {
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e8eef7;
    box-shadow: var(--shadow-soft);
}

body.pangea-v2 .dev-torrent-panel {
    display: none !important;
}

@media (max-width: 1100px) {
    body.pangea-v2 .google-ad-rail {
        display: none;
    }
}

@media (max-width: 900px) {
    body.pangea-v2 .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin: 0 auto;
    }

    body.pangea-v2 .pricing-card.featured {
        transform: none;
    }

    body.pangea-v2 .support-form-grid {
        grid-template-columns: 1fr;
    }

    body.pangea-v2 .account-lists-grid {
        grid-template-columns: 1fr;
    }

    body.cinema-mode .player-section {
        left: 0;
        right: 0;
    }

    body.cinema-mode .cinema-side-ad {
        display: none !important;
    }
}

@media (max-width: 820px) {
    body.pangea-v2 .input-dual-grid {
        grid-template-columns: 1fr;
    }

    body.pangea-v2 .nav-center {
        display: none;
    }

    body.pangea-v2 .top-nav {
        flex-wrap: wrap;
        gap: 10px 14px;
        padding: 10px 14px;
    }

    body.pangea-v2 .nav-mobile-links {
        display: flex;
        flex: 1 1 100%;
        order: 3;
        padding-top: 2px;
    }

    body.pangea-v2 .nav-left {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.pangea-v2 .nav-right {
        flex: 0 0 auto;
        min-width: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }
}

@media (max-width: 768px) {
    body.pangea-v2 .page-outer {
        padding: 8px 10px 20px;
        gap: 12px;
    }

    body.pangea-v2 .page-main {
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
        padding: 0 0 16px;
    }

    body.pangea-v2 .hero-header {
        padding: 16px 8px 12px;
    }

    body.pangea-v2 .hero-logo {
        max-height: 64px;
    }

    body.pangea-v2 .hero-title {
        font-size: clamp(0.95rem, 4.2vw, 1.25rem);
    }

    body.pangea-v2 .dashboard-card {
        padding: 14px 14px;
        border-radius: 16px;
        margin-bottom: 14px;
    }

    body.pangea-v2 .input-box {
        min-height: auto;
        padding: 16px 12px 12px;
    }

    body.pangea-v2 .input-box .input-group {
        flex-direction: column;
        gap: 10px;
    }

    body.pangea-v2 .input-box .input-group .btn,
    body.pangea-v2 .input-box .upload-file-browse {
        width: 100%;
        min-height: 44px;
    }

    body.pangea-v2 .upload-file-row {
        flex-direction: column;
        align-items: stretch;
    }

    body.pangea-v2 .upload-file-name {
        text-align: center;
    }

    body.pangea-v2 .video-url-input {
        width: 100%;
        min-height: 44px;
        box-sizing: border-box;
    }

    body.pangea-v2 .player-section.dashboard-card {
        padding: 12px;
    }

    body.pangea-v2 .video-container {
        max-width: 100%;
        width: 100%;
    }

    body.pangea-v2 .controls-section {
        padding: 12px;
    }

    body.pangea-v2 .controls-section .control-group {
        flex-wrap: wrap;
        gap: 10px;
    }

    body.pangea-v2 .btn,
    body.pangea-v2 .user-btn,
    body.pangea-v2 .lang-select {
        min-height: 44px;
    }

    body.pangea-v2 .site-footer,
    body.pangea-v2 .site-footer-full {
        padding: 28px 16px 20px;
    }

    body.pangea-v2 .footer-inner {
        padding: 0 12px;
    }

    body.pangea-v2 .footer-grid {
        gap: 20px;
    }

    body.pangea-v2 .logo-img {
        max-height: 44px;
    }
}

@media (max-width: 480px) {
    body.pangea-v2 .page-outer {
        padding: 6px 8px 16px;
    }

    body.pangea-v2 .hero-title {
        font-size: 0.92rem;
        line-height: 1.3;
    }

    body.pangea-v2 .section-title {
        font-size: 1rem;
    }

    body.pangea-v2 .dashboard-card {
        padding: 12px 10px;
    }

    body.pangea-v2 .input-box-label {
        font-size: 0.88rem;
    }

    body.pangea-v2 .nav-mobile-links {
        gap: 8px;
    }

    body.pangea-v2 .nav-mobile-links .nav-link,
    body.pangea-v2 .nav-mobile-links .nav-pricing-link {
        font-size: 0.82rem;
        padding: 6px 10px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    body.pangea-v2 .language-switcher {
        font-size: 0.82rem;
    }

    body.pangea-v2 .lang-select {
        font-size: 0.85rem;
        padding: 8px 32px 8px 10px;
    }

    body.pangea-v2 .controls-section {
        padding: 10px;
    }

    body.pangea-v2 .btn {
        padding: 10px 14px;
        font-size: 0.88rem;
    }
}

.pricing-card.extreme-tier,
.product-card-extreme {
    border: 2px solid #7c3aed;
    background: linear-gradient(180deg, #f5f3ff 0%, #fff 40%);
}

.pricing-card.extreme-tier .popular-tag {
    background: #7c3aed;
}

.pricing-card.ultra-tier {
    border: 2px solid #0f766e;
    background: linear-gradient(180deg, #f0fdfa 0%, #fff 40%);
}

.pricing-card.ultra-tier .popular-tag {
    background: #0f766e;
}

.product-card-extreme .btn {
    margin-top: 8px;
    margin-left: 8px;
}
