/**
 * Script2Shorts - Modern Light Theme
 * Minimal/Clean design with Indigo accents
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Backgrounds */
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-light: #f1f5f9;

    /* Indigo Accent */
    --accent-primary: #4F46E5;
    --accent-primary-hover: #4338CA;
    --accent-primary-light: rgba(79, 70, 229, 0.08);
    --accent-primary-border: rgba(79, 70, 229, 0.3);

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Status */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Shadows - subtle */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --transition: 0.15s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* ============ HEADER ============ */

.app-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 56px;
}

.app-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    letter-spacing: -0.5px;
}

.app-logo span {
    color: var(--accent-primary);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.best-practices-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f97316;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.813rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.best-practices-btn:hover {
    background: #ea580c;
}

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

/* Discord Button */
.discord-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #5865F2;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.813rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.discord-btn:hover {
    background: #4752C4;
}

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

/* Ideas & Bugs Button */
.ideas-bugs-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.813rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition);
}

.ideas-bugs-btn:hover {
    background: #059669;
}

.ideas-bugs-btn svg {
    width: 16px;
    height: 16px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.current-game {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-game-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
}

.current-game-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Admin Button */
.admin-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 1rem;
    transition: all var(--transition);
}

.admin-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

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

.app-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.app-user:hover .user-btn {
    background: var(--bg-white);
    border-color: var(--accent-primary-border);
}

.dropdown-arrow {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.app-user:hover .dropdown-arrow {
    color: var(--text-secondary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
}

.user-name {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition);
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background var(--transition);
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.user-dropdown .dropdown-item:hover {
    background: var(--bg-light);
}

.user-dropdown .dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.user-dropdown .dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: 1px solid var(--border-color);
    color: var(--error);
}

.user-dropdown .dropdown-item svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* ============ APP LAYOUT ============ */

.app-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 56px;
}

/* ============ SIDEBAR ============ */

.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 50;
}

.sidebar-section {
    padding: 1rem;
    flex: 1;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-icon {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.sidebar-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    margin-left: auto;
}

.games-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 0.75rem;
}

.game-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.game-item:hover {
    background: var(--bg-main);
}

.game-item.active {
    background: var(--accent-primary-light);
    border-color: transparent;
    color: var(--accent-primary);
}

.game-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--border-light);
}

.game-icon-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--accent-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.game-name {
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.game-edit-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.game-item:hover .game-edit-btn {
    display: flex;
}

.game-edit-btn:hover {
    background: var(--bg-main);
    color: var(--accent-primary);
}

.add-game-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.add-game-btn:hover {
    background: var(--accent-primary-light);
}

.add-game-btn svg {
    width: 16px;
    height: 16px;
}

/* ============ SUBSCRIPTION WIDGET ============ */

.subscription-widget {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-main);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.subscription-tier {
    flex-shrink: 0;
}

.tier-badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-badge.tier-free,
.tier-badge.tier-free-trial {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tier-badge.tier-pro {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
}

.tier-badge.tier-business {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

.all-plans-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-primary);
    text-decoration: none;
    transition: all var(--transition);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.all-plans-btn:hover {
    background: var(--accent-primary-light);
}

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

.subscription-usage {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.usage-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.usage-label-group {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.usage-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.usage-date {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
}

.usage-bar {
    flex: 1;
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.usage-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease, background 0.3s ease;
}

.usage-text {
    font-size: 0.65rem;
    color: var(--text-secondary);
    width: 35px;
    text-align: right;
    flex-shrink: 0;
}

.unlimited-text {
    font-size: 0.75rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin: 0;
    padding: 0.5rem 0;
}

.usage-unlimited {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.25rem 0;
}

.usage-text-unlimited {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
    letter-spacing: 0.02em;
}

.btn-upgrade {
    width: 100%;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    color: white;
}

.btn-upgrade:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-upgrade.btn-manage {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-upgrade.btn-manage:hover {
    background: var(--bg-main);
    box-shadow: none;
    transform: none;
}

/* Cancel Subscription */
.subscription-manage {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.manage-subscription-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.manage-subscription-btn:hover {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary-border);
    color: var(--accent-primary);
}

.tier-badge.tier-pro-canceled {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

/* Sync Subscription Button */
.subscription-sync {
    margin-top: 0.5rem;
}

.sync-subscription-btn {
    width: 100%;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.sync-subscription-btn:hover {
    background: var(--bg-light);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.sync-subscription-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Danger Button */
.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Modal Small */
.modal-content.modal-small {
    max-width: 400px;
}

.modal-text {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Usage Warning States */
.usage-item.usage-warning .usage-label {
    color: #f59e0b;
}

.usage-item.usage-critical .usage-label {
    color: #ef4444;
    font-weight: 600;
}

.usage-item.usage-critical .usage-text {
    color: #ef4444;
    font-weight: 600;
}

.usage-fill.usage-warning {
    animation: pulse-warning 2s ease-in-out infinite;
}

.usage-fill.usage-critical {
    animation: pulse-critical 1.5s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-critical {
    0%, 100% { opacity: 1; transform: scaleX(1); }
    50% { opacity: 0.8; }
}

/* Usage Toast */
.usage-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.usage-toast-warning {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.usage-toast-warning span {
    color: #92400e;
}

.usage-toast-error {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
}

.usage-toast-error span {
    color: #991b1b;
}

.usage-toast-success {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
}

.usage-toast-success span {
    color: #065f46;
}

.usage-toast-info {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.usage-toast-info span {
    color: #1e40af;
}

.usage-toast button {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    line-height: 1;
}

.usage-toast button:hover {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.powered-by {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.powered-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6rem;
    color: white;
}

.powered-text {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    line-height: 1.3;
}

.powered-text span {
    color: var(--text-muted);
}

.powered-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
    text-align: center;
}

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

/* ============ MAIN CONTENT ============ */

.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 56px);
}

/* ============ NO GAME STATE ============ */

.no-game-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.no-game-content {
    text-align: center;
    max-width: 360px;
}

.no-game-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: var(--accent-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-game-icon svg {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
}

.no-game-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.no-game-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* ============ GAME WORKSPACE ============ */

.game-workspace {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--accent-primary);
    padding: 0.375rem 0.875rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
}

.badge-icon {
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
    opacity: 0.9;
}

.badge-text {
    font-weight: 600;
    font-size: 0.75rem;
    color: white;
    letter-spacing: 0.5px;
}

.workspace-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 2.5rem;
    letter-spacing: -0.025em;
}

/* ============ UPLOAD SECTION ============ */

.upload-section {
    width: 100%;
    margin-bottom: 1.5rem;
}

.main-dropzone {
    border: 2px dashed var(--accent-primary-border);
    border-radius: var(--radius-lg);
    background: var(--accent-primary-light);
    padding: 4rem 3rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.main-dropzone:hover,
.main-dropzone.dragover {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.main-dropzone .dropzone-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    background: var(--accent-primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.main-dropzone .dropzone-icon > svg {
    width: 36px;
    height: 36px;
    color: var(--accent-primary);
}

.upload-arrow {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.upload-arrow svg {
    width: 10px;
    height: 10px;
    color: white;
}

.dropzone-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.dropzone-hint-highlight {
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.upload-info {
    text-align: center;
    margin-top: 0.75rem;
}

.upload-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0.125rem 0;
}

/* ============ UPLOADED VIDEOS ============ */

.uploaded-videos {
    width: 100%;
    margin-bottom: 1.5rem;
}

.section-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

.video-thumb-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.video-thumb-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.video-thumb-card img,
.video-thumb-card video {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
}

.video-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    opacity: 0;
    transition: var(--transition);
}

.video-thumb-card:hover .video-thumb-remove {
    opacity: 1;
}

.video-thumb-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.65rem;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 500;
}

/* ============ SPICE INPUT ============ */

.spice-section {
    width: 100%;
    margin-bottom: 1.5rem;
}

.spice-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 500;
}

.spice-label em {
    color: var(--text-muted);
    font-style: normal;
    font-weight: 400;
}

.spice-input-wrapper {
    position: relative;
    max-width: 480px;
    margin: 0 auto;
}

.spice-input {
    width: 100%;
    padding: 0.75rem 3.5rem 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: var(--transition);
    font-family: inherit;
}

.spice-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

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

.char-count {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============ ACTION SECTION ============ */

.action-section {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

/* ============ BUTTONS ============ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    text-decoration: none;
    font-family: inherit;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-primary-hover);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

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

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
}

/* ============ MODAL ============ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 1.5rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-content.modal-large {
    max-width: 600px;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-main);
    border-radius: 50%;
    font-size: 1.125rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    padding-right: 2rem;
    letter-spacing: -0.025em;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
}

/* Best Practices Modal */
.best-practices-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.practice-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.practice-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
}

.practice-content h3 {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.practice-content p {
    font-size: 0.813rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.practice-tips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tip-tag {
    padding: 0.25rem 0.625rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.688rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Feedback Modal */
.feedback-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.feedback-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.feedback-tab:hover {
    background: var(--bg-main);
    color: var(--text-primary);
}

.feedback-tab.active {
    background: var(--accent-primary);
    color: white;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-tag-selector {
    display: flex;
    gap: 0.5rem;
}

.feedback-tag-option {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.feedback-tag-option:hover {
    border-color: var(--accent-primary-border);
}

.feedback-tag-option.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.feedback-tag-option.idea.active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.feedback-tag-option.bug.active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.feedback-item {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.feedback-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.feedback-item-title {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.feedback-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
    font-size: 0.688rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.feedback-tag.idea {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.feedback-tag.bug {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.feedback-item-description {
    font-size: 0.813rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.feedback-item-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.feedback-status {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 100px;
    font-size: 0.688rem;
    font-weight: 500;
    text-transform: capitalize;
}

.feedback-status.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.feedback-status.reviewed {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.feedback-status.in_progress {
    background: rgba(168, 85, 247, 0.15);
    color: #7c3aed;
}

.feedback-status.completed {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.feedback-status.declined {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
}

.feedback-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.feedback-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* ============ FORM STYLES ============ */

.game-form {
    margin-top: 0.25rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-label .required {
    color: var(--error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--text-muted);
}

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

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    padding-right: 2.25rem;
}

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

/* Audience Labels - Clickable Tags */
.audience-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.audience-label {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.audience-label:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.audience-label.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.audience-label input {
    display: none;
}

/* Icon Upload */
.icon-upload {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
}

.icon-preview {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px dashed var(--border-color);
    transition: var(--transition);
}

.icon-preview:hover {
    border-color: var(--accent-primary);
}

.icon-preview svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

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

.icon-upload span {
    font-size: 0.8rem;
    color: var(--accent-primary);
    font-weight: 500;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* ============ ALERTS ============ */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.2s ease;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
}

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

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-info {
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #3730a3;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    opacity: 1;
}

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

@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 1rem;
    }

    .header-center {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

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

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .workspace-title {
        font-size: 1.375rem;
    }

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

    .form-group.full-width {
        grid-column: 1;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .audience-labels {
        justify-content: center;
    }
}

/* ============ LOADING STATE ============ */

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============ STEP 2 & 3 UI ============ */

.step-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.tagging-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.clips-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.clip-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.clip-row:hover {
    border-color: var(--accent-primary-border);
}

.clip-row.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.clip-thumb {
    position: relative;
    width: 60px;
    flex-shrink: 0;
}

.clip-thumb img {
    width: 60px;
    height: 107px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.clip-thumb .clip-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.65rem;
    padding: 2px 4px;
    border-radius: 3px;
}

.clip-info {
    flex: 1;
    min-width: 0;
}

.clip-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.clip-tags .tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.clip-tags .tag:hover {
    background: var(--error);
    transform: scale(0.95);
}

.clip-tags .no-tags {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.btn-edit-tags {
    padding: 0.4rem 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-edit-tags:hover {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.suggested-tags {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 2rem;
}

.suggested-tags h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.tags-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.suggested-tag {
    padding: 0.4rem 0.75rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.suggested-tag:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.step-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* Categories (Step 3) */
.categories-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.category-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clip-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.category-clips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 60px;
    padding: 0.5rem;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
}

.mini-clip {
    position: relative;
    width: 48px;
}

.mini-clip img {
    width: 48px;
    height: 85px;
    object-fit: cover;
    border-radius: 4px;
}

.mini-clip .remove-from-cat {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.mini-clip:hover .remove-from-cat {
    opacity: 1;
}

.empty-cat {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
    padding: 1rem;
}

.permutation-info {
    text-align: center;
    padding: 1rem;
    background: var(--accent-primary-light);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.perm-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* ============ WIZARD GAME HEADER ============ */

.wizard-game-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.wizard-game-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.wizard-game-icon-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
}

.wizard-game-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============ STEP INDICATOR ============ */

.step-indicator {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: color 0.2s ease;
}

.step-item.active .step-label {
    color: var(--accent-primary);
    font-weight: 600;
}

.step-item.completed .step-label {
    color: var(--accent-primary);
}

/* Clickable steps (can navigate back) */
.step-item.clickable {
    cursor: pointer;
}

.step-item.clickable:hover .step-circle {
    transform: scale(1.1);
    box-shadow: 0 0 0 4px var(--accent-primary-light);
}

.step-item.clickable:hover .step-label {
    color: var(--accent-primary);
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.step-circle.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 0 4px var(--accent-primary-light);
}

.step-circle.completed {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.step-circle svg {
    width: 18px;
    height: 18px;
}

.step-line {
    width: 32px;
    height: 2px;
    background: var(--border-color);
    transition: background 0.3s ease;
    margin-top: 17px; /* Align with center of step circles */
    flex-shrink: 0;
}

.step-item.completed + .step-line,
.step-line:has(+ .step-item.completed),
.step-line:has(+ .step-item.active) {
    background: var(--accent-primary);
}

/* ============ STEP CONTENT ============ */

.step-content {
    width: 100%;
    max-width: 900px;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.step-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.success-title {
    color: var(--accent-primary);
}

/* ============ SUGGESTED TAGS BAR ============ */

.suggested-tags-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.suggested-tag-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.suggested-tag-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.suggested-tag-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* ============ CLIPS CARD GRID ============ */

.clips-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.clip-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clip-card:hover {
    border-color: var(--accent-primary-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.clip-card.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.clip-card-thumb {
    position: relative;
    aspect-ratio: 9/16;
    background: var(--bg-main);
}

.clip-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clip-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.clip-card:hover .clip-play-btn {
    opacity: 1;
}

.clip-play-btn svg {
    width: 20px;
    height: 20px;
}

.clip-card-info {
    padding: 0.5rem;
}

.clip-card-duration {
    display: inline-block;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.clip-card-name {
    display: block;
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
}

.clip-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.clip-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    border-radius: 10px;
}

.clip-tag .tag-remove {
    cursor: pointer;
    opacity: 0.8;
}

.clip-tag .tag-remove:hover {
    opacity: 1;
}

.add-tag-input {
    flex: 1;
    min-width: 60px;
    padding: 0.2rem 0.4rem;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    font-size: 0.7rem;
    background: transparent;
    color: var(--text-primary);
}

.add-tag-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* ============ CATEGORIES GRID ============ */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.category-box {
    background: var(--bg-main);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: 140px;
}

.category-box.has-clips {
    border-style: solid;
    border-color: var(--accent-primary);
}

.category-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

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

.category-count {
    width: 22px;
    height: 22px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-box-clips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.category-clip {
    position: relative;
    width: 50px;
    cursor: pointer;
}

.category-clip img {
    width: 50px;
    height: 89px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--accent-primary);
}

.category-clip .clip-duration-badge {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.65rem;
    text-align: center;
    padding: 1px 2px;
    border-radius: 0 0 2px 2px;
}

.category-clip.exceeds-duration img {
    border-color: var(--error);
}

.category-clip.exceeds-duration .clip-duration-badge {
    background: var(--error);
}

.category-max-duration {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.25rem;
}

/* Duration Warnings */
.duration-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.duration-warning.duration-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
}

.duration-warning strong {
    color: var(--warning);
}

.duration-warning.duration-error strong {
    color: var(--error);
}

.violation-item {
    display: inline-block;
    background: rgba(239, 68, 68, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin: 2px;
    font-size: 0.8rem;
}

.duration-error-text {
    color: var(--error) !important;
}

.add-clip-btn {
    width: 50px;
    height: 89px;
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.add-clip-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.add-category-btn {
    width: 100%;
    padding: 1rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.add-category-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* ============ PERMUTATION BOX ============ */

.permutation-box {
    background: var(--accent-primary-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.permutation-box .perm-count {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.video-slider-section {
    margin-top: 1rem;
}

.video-slider-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.video-slider-section strong {
    color: var(--accent-primary);
    font-size: 1.2rem;
}

#videoSlider {
    width: 100%;
    max-width: 400px;
    height: 8px;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: 4px;
    outline: none;
}

#videoSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.slider-limit {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.25rem;
}

.limit-reached-warning {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-top: 1rem;
}

.limit-reached-warning p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* ============ SETTINGS PREVIEW PANELS ============ */

.settings-with-preview {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.settings-with-preview .settings-controls {
    flex: 1;
    min-width: 0;
}

.settings-preview {
    width: 100px;
    flex-shrink: 0;
    text-align: center;
}

.caption-preview-sticky {
    position: sticky;
    top: 80px;
}

.preview-phone {
    width: 100%;
    aspect-ratio: 9/16;
    background: #1a1a2e;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.preview-video-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
}

.preview-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Game Label Preview Animations */
.game-label-preview-overlay {
    position: absolute;
    bottom: 30%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    font-size: 8px;
    color: white;
    white-space: nowrap;
}

.game-icon-preview {
    font-size: 10px;
}

.game-name-preview {
    font-weight: 600;
}

.game-label-preview-overlay.slide_in {
    animation: glpSlideIn 2s ease-in-out infinite;
}

.game-label-preview-overlay.pop_bounce {
    animation: glpPopBounce 2s ease-in-out infinite;
}

.game-label-preview-overlay.neon {
    animation: glpNeon 2s ease-in-out infinite;
    text-shadow: 0 0 5px #0ff, 0 0 10px #0ff;
}

.game-label-preview-overlay.typewriter {
    animation: glpTypewriter 3s steps(12) infinite;
    overflow: hidden;
    width: 0;
}

.game-label-preview-overlay.signboard {
    animation: glpSignboard 2s ease-in-out infinite;
    background: #8B4513;
    border: 2px solid #654321;
}

.game-label-preview-overlay.paper_rollout {
    animation: glpPaperRoll 2s ease-in-out infinite;
    background: #f5f5dc;
    color: #333;
}

@keyframes glpSlideIn {
    0%, 100% { transform: translateX(-150%); opacity: 0; }
    20%, 80% { transform: translateX(-50%); opacity: 1; }
}

@keyframes glpPopBounce {
    0%, 100% { transform: translateX(-50%) scale(0); opacity: 0; }
    20% { transform: translateX(-50%) scale(1.2); opacity: 1; }
    30%, 80% { transform: translateX(-50%) scale(1); opacity: 1; }
}

@keyframes glpNeon {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
    25%, 75% { text-shadow: 0 0 5px #0ff, 0 0 10px #0ff, 0 0 15px #0ff; }
    50% { text-shadow: 0 0 2px #0ff, 0 0 5px #0ff; }
}

@keyframes glpTypewriter {
    0%, 10% { width: 0; opacity: 1; }
    50%, 90% { width: 80px; opacity: 1; }
    100% { width: 80px; opacity: 0; }
}

@keyframes glpSignboard {
    0%, 100% { transform: translateX(-50%) rotateX(90deg); opacity: 0; }
    20%, 80% { transform: translateX(-50%) rotateX(0deg); opacity: 1; }
}

@keyframes glpPaperRoll {
    0%, 100% { transform: translateX(-50%) scaleY(0); opacity: 0; }
    20%, 80% { transform: translateX(-50%) scaleY(1); opacity: 1; }
}

/* End Card Preview */
.endcard-preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: endcardFadeIn 2s ease-in-out infinite;
}

.endcard-preview-overlay.theme-gradient_dark {
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.9));
}

.endcard-preview-overlay.theme-blur_bg {
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
}

.endcard-preview-overlay.theme-game_themed {
    background: linear-gradient(135deg, var(--accent-primary-light), rgba(26, 26, 46, 0.9));
}

.endcard-content {
    text-align: center;
    padding: 8px;
}

.endcard-logo-preview {
    font-size: 16px;
    margin-bottom: 4px;
}

.endcard-cta-preview {
    font-size: 6px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.endcard-badges-preview {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.endcard-badges-preview span {
    font-size: 4px;
    background: #333;
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
}

.endcard-preview-overlay.layout-bottom_bar .endcard-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    padding: 6px;
}

.endcard-preview-overlay.layout-minimalist .endcard-content {
    opacity: 0.7;
}

.endcard-preview-overlay.layout-minimalist .endcard-badges-preview {
    display: none;
}

@keyframes endcardFadeIn {
    0%, 10%, 90%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

/* Caption Style Preview */
.caption-preview-overlay {
    position: absolute;
    bottom: 25%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 3px;
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
}

.caption-word {
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.caption-word.active {
    color: #FFE600;
}

/* Caption Style Variations */
.caption-preview-overlay.style-single_word .caption-word:not(.active) {
    display: none;
}

.caption-preview-overlay.style-single_word .caption-word.active {
    font-size: 10px;
    animation: captionPop 0.5s ease-out;
}

.caption-preview-overlay.style-karaoke .caption-word.active {
    color: #FFE600;
    animation: captionFill 0.3s ease-out;
}

.caption-preview-overlay.style-mrbeast .caption-word {
    -webkit-text-stroke: 1px black;
}

.caption-preview-overlay.style-mrbeast .caption-word.active {
    animation: captionBounce 0.3s ease-out;
}

.caption-preview-overlay.style-glow .caption-word.active {
    text-shadow: 0 0 5px #FFE600, 0 0 10px #FFE600;
}

.caption-preview-overlay.style-boxed .caption-word.active {
    background: #FFE600;
    color: black;
    padding: 1px 3px;
    border-radius: 2px;
}

.caption-preview-overlay.style-outline .caption-word {
    color: transparent;
    -webkit-text-stroke: 1px white;
}

.caption-preview-overlay.style-outline .caption-word.active {
    -webkit-text-stroke: 1px #FFE600;
}

/* Caption Preset Colors */
.caption-preview-overlay.preset-red .caption-word.active {
    color: #FF4444;
}

.caption-preview-overlay.preset-red.style-glow .caption-word.active {
    text-shadow: 0 0 5px #FF4444, 0 0 10px #FF4444;
}

.caption-preview-overlay.preset-blue .caption-word.active {
    color: #44AAFF;
}

.caption-preview-overlay.preset-blue.style-glow .caption-word.active {
    text-shadow: 0 0 5px #44AAFF, 0 0 10px #44AAFF;
}

.caption-preview-overlay.preset-green .caption-word.active {
    color: #44FF44;
}

.caption-preview-overlay.preset-green.style-glow .caption-word.active {
    text-shadow: 0 0 5px #44FF44, 0 0 10px #44FF44;
}

@keyframes captionPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes captionBounce {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes captionFill {
    0% { color: white; }
    100% { color: #FFE600; }
}

/* ============ SETTINGS CARD ============ */

.settings-card {
    background: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.settings-group {
    margin-bottom: 1rem;
}

.settings-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.settings-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent-primary);
}

.info-box {
    background: var(--accent-primary-light);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.info-box h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.info-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============ SCRIPT PROMPT SECTION ============ */

.script-prompt-section {
    max-width: 600px;
    margin: 0 auto;
}

.script-prompt-section .form-group {
    margin-bottom: 1.5rem;
}

.script-prompt-input {
    min-height: 100px;
    font-size: 0.9rem;
}

.optional-label {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.generate-btn-section {
    text-align: center;
    margin: 1.5rem 0;
}

.script-progress {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ============ SCRIPTS TABLE ============ */

.scripts-table {
    width: 100%;
    margin-bottom: 1.5rem;
}

.scripts-header {
    display: grid;
    grid-template-columns: 40px 150px 1fr 80px;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.script-row {
    display: grid;
    grid-template-columns: 40px 150px 1fr 80px;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    align-items: start;
}

.script-num {
    font-weight: 600;
    color: var(--text-primary);
}

.script-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.cat-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.script-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    resize: vertical;
}

.script-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.script-status {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.script-status.ready {
    background: rgba(124, 184, 140, 0.2);
    color: var(--accent-primary);
}

.script-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.script-duration-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

.script-status-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
}

.script-word-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.script-word-count.warning {
    color: var(--warning, #f59e0b);
    font-weight: 500;
}

/* ============ GENERATION PROGRESS ============ */

.generation-card {
    text-align: center;
    padding: 2rem;
}

.progress-section {
    max-width: 500px;
    margin: 2rem auto;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.progress-bar {
    height: 12px;
    background: var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4F46E5, #6366F1);
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.progress-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.progress-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.progress-warning {
    color: var(--accent-primary);
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* ============ RESULTS GRID ============ */

.download-btn {
    display: inline-block;
    margin-bottom: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: center;
    transition: all 0.2s ease;
}

.result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.result-card video {
    width: 100%;
    aspect-ratio: 9/16;
    background: #1a1a1a;
}

.result-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-card .btn {
    margin: 0 0.5rem 0.75rem;
}

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

/* ============ CLIP SELECTION MODAL ============ */

.clip-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.clip-select-item {
    position: relative;
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 3px solid transparent;
    transition: var(--transition);
}

.clip-select-item img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
}

.clip-select-item:hover {
    border-color: var(--accent-primary-border);
}

.clip-select-item.selected {
    border-color: var(--accent-primary);
}

.clip-select-item.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.modal-actions {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ============ CAPTION OPTIONS ============ */

.caption-options {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Caption Style Sections */
.caption-style-section {
    margin-bottom: 1rem;
}

.caption-style-section:last-child {
    margin-bottom: 0;
}

.style-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.caption-style-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.caption-style-option {
    padding: 0.625rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.caption-style-option:hover {
    border-color: var(--accent-primary-border);
}

.caption-style-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.caption-style-option h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.caption-style-option p {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.2;
}

/* Viral Styles Section */
.caption-style-section.viral-styles {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(250, 204, 21, 0.05));
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.caption-style-option.viral {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(250, 204, 21, 0.08));
    border-color: rgba(239, 68, 68, 0.3);
}

.caption-style-option.viral:hover {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(250, 204, 21, 0.15));
}

.caption-style-option.viral.selected {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(250, 204, 21, 0.2));
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.caption-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.caption-preset-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.caption-preset-option:hover {
    border-color: var(--accent-primary-border);
}

.caption-preset-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.caption-preset-option span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.preset-swatch {
    width: 48px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.preset-swatch.classic {
    background: #1a1a1a;
    color: #ffff00;
}

.preset-swatch.red {
    background: #1a1a1a;
    color: #ff0000;
}

.preset-swatch.blue {
    background: #1a1a1a;
    color: #00ffff;
}

.preset-swatch.green {
    background: #1a1a1a;
    color: #00ff00;
}

/* Caption Position Control */
.caption-position-control {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.position-preview {
    flex-shrink: 0;
}

.position-phone {
    width: 60px;
    height: 120px;
    background: #1a1a1a;
    border-radius: 8px;
    position: relative;
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.position-indicator {
    position: absolute;
    left: 5px;
    right: 5px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
    transform: translateY(-50%);
    transition: top 0.1s ease;
}

.position-phone .position-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 6px;
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
    top: 70%;
}

.position-slider-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.position-slider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-light);
    border-radius: 4px;
    outline: none;
}

.position-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

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

.position-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.position-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

@media (max-width: 900px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .scripts-header,
    .script-row {
        grid-template-columns: 30px 100px 1fr 60px;
    }
}

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

    .clips-card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .clip-card-info {
        padding: 0.35rem;
    }

    .clip-card-name {
        font-size: 0.7rem;
    }

    .clip-card-duration {
        font-size: 0.65rem;
        padding: 0.15rem 0.35rem;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .step-line {
        width: 20px;
    }
}

/* ============ GAME LABEL PRESETS ============ */

.game-label-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.game-label-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-main);
}

.game-label-option:hover {
    border-color: var(--accent-primary-border);
}

.game-label-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.game-label-option .label-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.game-label-option span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
}

.game-label-option.selected span {
    color: var(--accent-primary);
}

/* ============ END CARD PRESETS ============ */

.endcard-preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.endcard-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.endcard-option:hover {
    border-color: var(--accent-primary-border);
}

.endcard-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.endcard-option span {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
}

.endcard-option.selected span {
    color: var(--accent-primary);
}

/* Custom End Card Upload */
.custom-endcard-upload {
    margin-top: 0.5rem;
}

.custom-endcard-upload .upload-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.custom-endcard-preview {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    background: var(--bg-tertiary);
}

.custom-endcard-preview img {
    max-width: 120px;
    max-height: 200px;
    display: block;
    object-fit: contain;
}

.remove-custom-endcard {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.remove-custom-endcard:hover {
    background: var(--error);
}

.endcard-preview {
    width: 100%;
    aspect-ratio: 9/16;
    border-radius: 4px;
    max-height: 48px;
}

.endcard-preview.layout-preview {
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    position: relative;
}

.lp-logo {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--text-secondary);
}

.lp-badges {
    width: 20px;
    height: 6px;
    border-radius: 2px;
    background: var(--accent-primary);
}

.lp-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    background: rgba(0,0,0,0.6);
    border-radius: 0 0 4px 4px;
}

.lp-logo-big {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--text-secondary);
}

.lp-minimal {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--text-secondary);
}

/* ============ FORM RANGE ============ */

.form-range {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
}

/* ============ CAPTION EDITOR MODAL ============ */

.caption-editor-content {
    max-width: 720px;
    width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
}

.caption-editor-layout {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.caption-editor-left {
    flex: 1;
    min-width: 0;
}

.caption-editor-right {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2rem;
}

.editor-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.editor-section:last-child {
    border-bottom: none;
}

.editor-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
}

.editor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.editor-row label {
    font-size: 0.8rem;
    color: var(--text-primary);
    white-space: nowrap;
    min-width: 100px;
}

.editor-row .form-select,
.editor-row .form-input {
    flex: 1;
    max-width: 180px;
}

.toggle-row {
    justify-content: space-between;
}

.toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.sub-row {
    padding-left: 1rem;
    border-left: 2px solid var(--accent-primary-border);
    margin-left: 0.5rem;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-input-group input[type="color"] {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
}

.color-hex {
    width: 72px !important;
    font-family: monospace;
    font-size: 0.8rem;
}

.num-input {
    width: 64px !important;
    text-align: center;
}

.btn-group {
    display: flex;
    gap: 2px;
    background: var(--bg-main);
    border-radius: 6px;
    padding: 2px;
    border: 1px solid var(--border-color);
}

.btn-icon {
    padding: 0.35rem 0.6rem;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

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

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

.caption-preview-box {
    width: 160px;
    height: 284px;
    background: #1a1a2e;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.caption-preview-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.5));
}

.preview-text {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Caption preset grid enhancements */
.caption-preset-option {
    position: relative;
    overflow: hidden;
}

.caption-preset-option .preset-label {
    font-size: 0.65rem;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    text-align: center;
}

@media (max-width: 640px) {
    .caption-editor-layout {
        flex-direction: column;
    }
    .caption-editor-right {
        width: 100%;
        padding-top: 0;
    }
    .caption-preview-box {
        width: 100%;
        height: 160px;
    }
}

/* ============ UNIFIED PREVIEW ============ */

.voice-settings-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.unified-preview-container {
    position: sticky;
    top: 80px;
}

.unified-preview-phone {
    width: 180px;
    height: 320px;
    background: #000;
    border-radius: 24px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    margin: 0 auto;
}

.unified-preview-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
}

/* Caption Layer */
.unified-caption-layer {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    transform: translateY(-50%);
    z-index: 10;
    transition: top 0.3s ease, opacity 0.3s ease;
}

.unified-caption {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
}

.unified-caption .caption-word {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    transition: all 0.2s ease;
}

.unified-caption .caption-word.active {
    color: #FFD700;
    transform: scale(1.15);
}

/* Caption color presets */
.unified-caption.preset-classic .caption-word.active { color: #FFD700; }
.unified-caption.preset-red .caption-word.active { color: #ff4444; }
.unified-caption.preset-blue .caption-word.active { color: #44aaff; }
.unified-caption.preset-green .caption-word.active { color: #44ff88; }

/* Caption style variations */
.unified-caption.style-single_word .caption-word { display: none; }
.unified-caption.style-single_word .caption-word.active {
    display: block;
    font-size: 18px;
    transform: scale(1);
}

.unified-caption.style-three_word .caption-word {
    font-size: 10px;
    opacity: 0.6;
}
.unified-caption.style-three_word .caption-word.active {
    opacity: 1;
    font-size: 12px;
}

.unified-caption.style-karaoke .caption-word {
    opacity: 0.4;
}
.unified-caption.style-karaoke .caption-word.active {
    opacity: 1;
    color: #FFD700;
}

.unified-caption.style-mrbeast .caption-word {
    font-size: 14px;
    -webkit-text-stroke: 1px #000;
}
.unified-caption.style-mrbeast .caption-word.active {
    transform: scale(1.3);
}

.unified-caption.style-hormozi .caption-word {
    font-size: 10px;
    text-shadow: 2px 2px 0 #000;
}

.unified-caption.style-bounce .caption-word.active {
    animation: captionBounce 0.3s ease;
}

.unified-caption.style-glow .caption-word.active {
    text-shadow: 0 0 8px #FFD700, 0 0 16px #FFD700;
}

.unified-caption.style-boxed .caption-word.active {
    background: #FFD700;
    color: #000;
    padding: 2px 4px;
    border-radius: 2px;
    text-shadow: none;
}

.unified-caption.style-outline .caption-word {
    color: transparent;
    -webkit-text-stroke: 1px #fff;
}
.unified-caption.style-outline .caption-word.active {
    -webkit-text-stroke: 1px #FFD700;
}

.unified-caption.style-popup .caption-word {
    opacity: 0;
    transform: scale(0.5);
}
.unified-caption.style-popup .caption-word.active {
    opacity: 1;
    transform: scale(1);
}

/* Template preset styles */
.unified-caption.style-cove .caption-word {
    font-style: italic;
}
.unified-caption.style-cove .caption-word.active {
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.unified-caption.style-million .caption-word.active {
    background: #fff;
    color: #000;
    padding: 1px 3px;
    text-shadow: none;
}

.unified-caption.style-mizar .caption-word.active {
    color: #a855f7;
    text-shadow: 0 0 10px #a855f7, 0 0 20px #a855f7;
}

.unified-caption.style-energy .caption-word.active {
    background: #000;
    color: #fff;
    padding: 2px 4px;
    text-shadow: none;
}

.unified-caption.style-focus .caption-word {
    text-transform: uppercase;
    font-size: 10px;
}
.unified-caption.style-focus .caption-word.active {
    color: #facc15;
}

.unified-caption.style-medusa .caption-word.active {
    color: #22c55e;
}

.unified-caption.style-pop_style .caption-word { display: none; }
.unified-caption.style-pop_style .caption-word.active {
    display: block;
    font-size: 16px;
    animation: captionBounce 0.3s ease;
}

.unified-caption.style-shift .caption-word.active {
    background: linear-gradient(90deg, #22c55e, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes captionBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Game Label Layer */
.unified-game-label-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 20;
    transition: all 0.3s ease;
}

.unified-game-label-layer .game-label-icon {
    font-size: 24px;
}

.unified-game-label-layer .game-label-text {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    max-width: 140px;
}

/* Game label static style differences */
.unified-game-label-layer.slide_in .game-label-text {
    border-left: 3px solid #fff;
    padding-left: 8px;
}

.unified-game-label-layer.pop_bounce .game-label-text {
    background: rgba(255,255,255,0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

.unified-game-label-layer.neon .game-label-text {
    color: #0ff;
    text-shadow: 0 0 10px #0ff, 0 0 20px #0ff, 0 0 30px #0ff;
}

.unified-game-label-layer.typewriter .game-label-text {
    font-family: 'Courier New', monospace;
    border-bottom: 2px solid #fff;
}

.unified-game-label-layer.signboard .game-label-text {
    background: #8B4513;
    padding: 6px 12px;
    border: 2px solid #5D3A1A;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.unified-game-label-layer.paper_rollout .game-label-text {
    background: #f5f5dc;
    color: #333;
    padding: 6px 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-shadow: none;
}

/* Game label animation styles */
.unified-game-label-layer.slide_in.animate-in {
    animation: slideInLabel 0.5s ease forwards;
}
.unified-game-label-layer.pop_bounce.animate-in {
    animation: popBounceLabel 0.5s ease forwards;
}
.unified-game-label-layer.neon.animate-in {
    animation: neonLabel 0.5s ease forwards;
}
.unified-game-label-layer.typewriter.animate-in {
    animation: typewriterLabel 0.5s ease forwards;
}
.unified-game-label-layer.signboard.animate-in {
    animation: signboardLabel 0.5s ease forwards;
}
.unified-game-label-layer.paper_rollout.animate-in {
    animation: paperRollLabel 0.5s ease forwards;
}
.unified-game-label-layer.animate-out {
    animation: fadeOutLabel 0.3s ease forwards;
}

@keyframes slideInLabel {
    from { transform: translate(-150%, -50%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}
@keyframes popBounceLabel {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes neonLabel {
    0%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
    50% { opacity: 1; }
}
@keyframes typewriterLabel {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}
@keyframes signboardLabel {
    0% { transform: translate(-50%, -50%) rotateX(90deg); }
    100% { transform: translate(-50%, -50%) rotateX(0deg); }
}
@keyframes paperRollLabel {
    0% { transform: translate(-50%, -50%) scaleY(0); }
    100% { transform: translate(-50%, -50%) scaleY(1); }
}
@keyframes fadeOutLabel {
    to { opacity: 0; }
}

/* End Card Layer */
.unified-endcard-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.unified-endcard-layer.theme-gradient_dark {
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.9) 100%);
}
.unified-endcard-layer.theme-blur_bg {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
}
.unified-endcard-layer.theme-game_themed {
    background: linear-gradient(135deg, var(--accent-primary), #1a1a2e);
}

.unified-endcard-layer .endcard-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.unified-endcard-layer .endcard-logo {
    font-size: 32px;
}

.unified-endcard-layer .endcard-cta {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.unified-endcard-layer .endcard-badges {
    display: flex;
    gap: 6px;
}

.unified-endcard-layer .badge-ios,
.unified-endcard-layer .badge-android,
.unified-endcard-layer .badge-steam {
    font-size: 7px;
    padding: 3px 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    color: #fff;
}

.unified-endcard-layer .endcard-steam {
    margin-top: 6px;
}

.unified-endcard-layer .badge-steam {
    background: linear-gradient(135deg, #1b2838, #2a475e);
}

.unified-endcard-layer.animate-in {
    animation: fadeInEndcard 0.5s ease forwards;
}

@keyframes fadeInEndcard {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Layout variations */
.unified-endcard-layer.layout-bottom_bar .endcard-content {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
}

.unified-endcard-layer.layout-minimalist .endcard-badges {
    display: none;
}

/* Timeline indicator */
.preview-timeline {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 4px;
    z-index: 40;
}

.timeline-segment {
    width: 24px;
    height: 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    font-size: 6px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-segment.active {
    background: var(--accent-primary);
    color: #fff;
}

/* Compact caption settings (no side preview) */
.caption-settings-compact {
    max-width: 100%;
}

.caption-settings-compact .caption-style-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.caption-settings-compact .caption-preset-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Preview controls */
.preview-controls {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.preview-play-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.preview-play-btn:hover {
    background: var(--accent-primary-hover);
}

.preview-play-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 900px) {
    .voice-settings-layout {
        grid-template-columns: 1fr;
    }
    .unified-preview-container {
        position: relative;
        top: 0;
        margin-bottom: 1.5rem;
    }
}

/* ============ SMART TAGS ============ */

.tags-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.loading-spinner-small {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.refresh-tags-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    margin-left: 0.5rem;
}

.refresh-tags-btn:hover {
    background: var(--bg-white);
    color: var(--accent-primary);
    border-color: var(--accent-primary-border);
}

.refresh-tags-btn svg {
    transition: transform 0.3s ease;
}

.refresh-tags-btn:hover svg {
    transform: rotate(180deg);
}

/* ============ GAME HISTORY BUTTON ============ */

.game-item-wrapper {
    display: flex;
    flex-direction: column;
}

.game-item-wrapper.active .game-history-btn {
    display: flex;
}

.game-history-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    margin-top: 2px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    border-radius: var(--radius-sm);
}

.game-history-btn:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.game-history-btn svg {
    flex-shrink: 0;
}

/* ============ HISTORY MODAL ============ */

.modal-large {
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.history-content {
    min-height: 200px;
}

.history-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

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

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: var(--text-secondary);
}

.history-empty svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.history-empty .text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.history-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.history-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: all var(--transition);
}

.history-card:hover {
    border-color: var(--accent-primary-border);
    box-shadow: var(--shadow-md);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-card-date {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.history-card-rating {
    font-size: 0.9rem;
}

.history-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.cat-badge-small {
    padding: 0.15rem 0.4rem;
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 500;
}

.history-card-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    max-height: 60px;
    overflow: hidden;
}

.history-card-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.history-card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-outline:hover {
    border-color: var(--accent-primary-border);
    color: var(--accent-primary);
}

/* ============ SCRIPT DETAIL MODAL ============ */

.detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
}

.detail-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.detail-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.detail-script-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.detail-script-text {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
}

.copy-script-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.copy-script-btn:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary-border);
}

.detail-stats-form h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-field label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.stat-field input {
    width: 100%;
    padding: 0.5rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.stat-field input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.rating-section {
    margin-bottom: 1.5rem;
}

.rating-section label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.rating-buttons {
    display: flex;
    gap: 0.5rem;
}

.rating-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
}

.rating-btn:hover {
    border-color: var(--accent-primary-border);
}

.rating-btn.active {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.rating-btn.rating-none.active {
    background: var(--bg-light);
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* ============ REMIX MODAL ============ */

.remix-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.remix-section {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.remix-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.remix-section .text-muted {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.video-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    color: var(--text-secondary);
}

.video-upload-zone:hover,
.video-upload-zone.dragover {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.video-upload-zone svg {
    margin-bottom: 0.75rem;
    opacity: 0.6;
}

.video-upload-zone p {
    font-size: 0.85rem;
}

.video-upload-zone .text-success {
    color: var(--success);
}

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

.churn-timeframes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.churn-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.churn-option input {
    accent-color: var(--accent-primary);
}

.remix-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.remix-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.remix-option:hover {
    border-color: var(--accent-primary-border);
}

.remix-option input {
    accent-color: var(--accent-primary);
}

.remix-option:has(input:checked) {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary);
}

.remix-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.remix-actions .btn svg {
    margin-right: 0.5rem;
}

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

/* ============ AI CLIP ANALYSIS STEP ============ */

.analysis-start-card {
    max-width: 500px;
    margin: 2rem auto;
    text-align: center;
    padding: 2.5rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.analysis-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent-primary);
}

.analysis-start-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.analysis-start-card > p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.analysis-features {
    text-align: left;
    list-style: none;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.analysis-features li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.analysis-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
}

.analysis-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.analysis-actions .btn svg {
    margin-right: 0.5rem;
}

.analysis-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Analysis Progress */
.analysis-progress-card {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
}

.analysis-progress-visual {
    margin-bottom: 1.5rem;
}

.circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 50%;
    background: conic-gradient(
        var(--accent-primary) calc(var(--progress) * 3.6deg),
        var(--bg-light) 0
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-progress::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    background: var(--bg-white);
    border-radius: 50%;
}

.progress-value {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.analysis-progress-info {
    text-align: center;
}

.progress-phase {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-count {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

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

.progress-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Analysis Spinner */
.analysis-spinner-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
    gap: 1.5rem;
}

.analysis-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.analysis-progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.analysis-witty-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

.generation-spinner-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
    gap: 1rem;
}

/* Analysis Results */
.analysis-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.analysis-result-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.analysis-result-card.failed {
    background: rgba(239, 68, 68, 0.05);
    border-color: var(--error);
}

.clip-thumb-small {
    width: 80px;
    height: 142px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.clip-thumb-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clip-analysis-info {
    flex: 1;
    min-width: 0;
}

.clip-analysis-info strong {
    display: block;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analysis-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.analysis-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.analysis-tag {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.analysis-tag.moment {
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-primary);
}

.analysis-tag.beat {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.analysis-tag.intensity {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.error-text {
    display: block;
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 0.25rem;
}

/* ============ Q&A STEP ============ */

.qa-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.qa-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition);
}

.qa-card.answered {
    border-color: var(--success);
}

.qa-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 50%;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.qa-card.answered .qa-number {
    background: var(--success);
    color: white;
}

.qa-content {
    flex: 1;
}

.qa-question {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.qa-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qa-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.qa-option:hover {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary-border);
}

.qa-option.selected {
    background: var(--accent-primary-light);
    border-color: var(--accent-primary);
}

.qa-option input[type="radio"] {
    accent-color: var(--accent-primary);
}

.qa-option-text {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.qa-option-other {
    flex-wrap: wrap;
}

.qa-other-input {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.qa-other-input:disabled {
    background: var(--bg-light);
    color: var(--text-muted);
}

.qa-other-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.qa-progress {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* Step Navigation */
.step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    margin-top: 1.5rem;
}

.step-nav .btn-text {
    background: transparent;
    color: var(--text-secondary);
}

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

/* Large button variant */
.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

/* ============ ONBOARDING MODAL ============ */

.onboarding-modal {
    max-width: 480px;
    text-align: center;
    padding: 2.5rem 2rem;
}

.onboarding-icon {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.onboarding-icon svg {
    width: 64px;
    height: 64px;
}

.onboarding-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
}

.onboarding-content {
    text-align: left;
    margin-bottom: 2rem;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 600;
    flex-shrink: 0;
}

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

.onboarding-list li {
    position: relative;
    padding: 0.625rem 0 0.625rem 1.75rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.onboarding-list li:last-child {
    border-bottom: none;
}

.onboarding-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
}

.onboarding-honest p,
.onboarding-warmup p,
.onboarding-coming p {
    font-size: 0.9375rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.onboarding-note {
    background: var(--accent-primary-light);
    border-left: 3px solid var(--accent-primary);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.875rem;
    color: var(--accent-primary-hover);
    margin-top: 1rem;
}

.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-color);
    transition: all 0.2s ease;
}

.progress-dot.active {
    background: var(--accent-primary);
    transform: scale(1.2);
}

.progress-dot.completed {
    background: var(--success);
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.onboarding-actions .btn {
    min-width: 100px;
}

.onboarding-actions .btn-primary {
    flex: 1;
    max-width: 200px;
}

/* Onboarding slide animations */
.onboarding-slide-container {
    overflow: hidden;
}

.onboarding-slide {
    animation-duration: 0.35s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
}

.onboarding-slide-next {
    animation-name: slideInFromRight;
}

.onboarding-slide-back {
    animation-name: slideInFromLeft;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============ INLINE SUBSCRIPTION VIEW ============ */

.inline-subscription-view {
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.subscription-view-header {
    margin-bottom: 2rem;
}

.subscription-view-header h1 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.subscription-view-header .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.subscription-view-header .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    transition: color var(--transition);
}

.subscription-view-header .back-btn:hover {
    color: var(--accent-primary);
}

.subscription-view-header .back-btn svg {
    width: 18px;
    height: 18px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pricing-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all var(--transition);
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.pricing-card.featured {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.pricing-card.current {
    border-color: var(--success);
}

.current-badge,
.featured-badge,
.discount-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.featured-badge {
    background: var(--accent-primary);
    color: white;
}

.discount-badge {
    left: auto;
    right: 1rem;
    transform: none;
    background: #ef4444;
    color: white;
}

.plan-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.plan-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.plan-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    min-height: 2.5rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.price-currency {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.price-period {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.price-original {
    font-size: 1.25rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.price-discounted {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.plan-features {
    flex: 1;
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.feature-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.feature-item svg.check {
    stroke: var(--success);
}

.feature-item svg.x {
    stroke: var(--text-muted);
}

.feature-item.disabled {
    color: var(--text-muted);
}

.feature-highlight {
    font-weight: 600;
    color: var(--accent-primary);
}

.plan-cta {
    margin-top: auto;
}

.plan-cta .btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 0.9rem;
}

.btn-current {
    background: var(--bg-light);
    color: var(--text-secondary);
    cursor: default;
}

.btn-current:hover {
    background: var(--bg-light);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

