/* ============================================
   StickMotion — CSS Design System
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
    --bg-primary: #06060c;
    --bg-secondary: #0c0c16;
    --bg-surface: rgba(255, 255, 255, 0.025);
    --bg-surface-hover: rgba(255, 255, 255, 0.05);

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(0, 255, 136, 0.3);

    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --accent-secondary: #00ffaa;
    --accent-gradient: linear-gradient(135deg, #00ff88, #00cc6a);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.45);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --font-family: 'Patrick Hand', 'Inter', -apple-system, sans-serif;
    --font-family-heading: 'Permanent Marker', 'Inter', sans-serif;
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 255, 136, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 80% 80%, rgba(0, 255, 136, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Screens ---------- */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: screenFadeIn 0.5s var(--transition-slow);
}

@keyframes screenFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ============================================
   SCREEN 1: UPLOAD (HERO & LOGO)
   ============================================ */

.brand {
    position: relative;
    width: 100%;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: opacity 0.2s ease-out;
    padding: 2rem 1.5rem;
}

.brand-left {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.animatic-logo-hero {
    width: clamp(120px, 20vw, 240px);
    height: clamp(120px, 20vw, 240px);
    filter: drop-shadow(0 0 24px rgba(0, 255, 136, 0.5));
    animation: logoEntrance 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes logoEntrance {
    from { transform: scale(0) rotate(-15deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.brand-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
}

.brand-title {
    font-family: var(--font-family-heading) !important;
    font-size: clamp(2.6rem, 7vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #ffffff;
    line-height: 1;
    text-shadow: 3px 3px 0px #06060c, 5px 5px 0px rgba(0, 255, 136, 0.3);
}

.brand-title span {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.6), 3px 3px 0px #06060c, 5px 5px 0px rgba(0, 255, 136, 0.4);
}

.tagline {
    font-size: clamp(0.95rem, 2.5vw, 1.2rem);
    color: var(--text-secondary);
    font-weight: 400;
    text-align: center;
    max-width: 480px;
    margin-bottom: 0.5rem;
}

.desktop-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px auto 0 auto;
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #00ff88;
    background: rgba(0, 255, 136, 0.06);
    border: 1.5px dashed rgba(0, 255, 136, 0.3);
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.03);
    animation: badgePulse 2s infinite ease-in-out;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(0, 255, 136, 0.03);
        border-color: rgba(0, 255, 136, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 16px rgba(0, 255, 136, 0.15);
        border-color: rgba(0, 255, 136, 0.65);
    }
}

.scroll-hint {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: hintBounce 2s infinite ease-in-out;
}

.scroll-arrow {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

@keyframes hintBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ============================================
   ANIMATIC BOX (CARTOON / POP-ART STYLING)
   ============================================ */

.animatic-box {
    background-color: var(--bg-secondary);
    background-image: radial-gradient(rgba(0, 255, 136, 0.04) 1.5px, transparent 1.5px) !important;
    background-size: 10px 10px !important;
    border: 3px solid rgba(0, 255, 136, 0.25);
    border-radius: 24px 14px 28px 12px/12px 28px 14px 24px;
    padding: 1.25rem 1.25rem;
    box-shadow: 6px 6px 0px #06060c, 8px 8px 0px rgba(0, 255, 136, 0.25);
    transition: all var(--transition-base);
}

.animatic-box:hover {
    border-color: rgba(0, 255, 136, 0.55);
    box-shadow: 8px 8px 0px #06060c, 12px 12px 0px rgba(0, 255, 136, 0.5);
    transform: translate(-2px, -2px);
    filter: url(#sketchy-wiggle);
}

/* ---------- Drop Zone ---------- */
.drop-zone {
    position: relative;
    border-radius: 24px 14px 28px 12px/12px 28px 14px 24px;
    padding: 3px;
    cursor: pointer;
    transition: all var(--transition-base);
    background: linear-gradient(135deg,
        rgba(0, 255, 136, 0.35),
        rgba(0, 204, 106, 0.2)
    );
    box-shadow: 6px 6px 0px #06060c, 8px 8px 0px rgba(0, 255, 136, 0.25);
}

.drop-zone:hover {
    box-shadow: 8px 8px 0px #06060c, 12px 12px 0px rgba(0, 255, 136, 0.5);
    transform: translate(-2px, -2px);
    filter: url(#sketchy-wiggle);
}

.drop-zone:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

.drop-zone.drag-over {
    box-shadow: 8px 8px 0px #06060c, 12px 12px 0px rgba(0, 255, 136, 0.75);
    transform: scale(1.01) translate(-2px, -2px);
    filter: url(#sketchy-wiggle);
}

.drop-zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.5rem;
    border-radius: 20px 10px 24px 8px/8px 24px 10px 20px;
    background-color: var(--bg-secondary);
    background-image: radial-gradient(rgba(0, 255, 136, 0.05) 1.5px, transparent 1.5px) !important;
    background-size: 10px 10px !important;
    text-align: center;
    gap: 0.5rem;
    min-height: 210px;
}

.upload-icon-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0, 255, 136, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    transition: var(--transition-base);
}

.drop-zone:hover .upload-icon-wrap {
    background: rgba(0, 255, 136, 0.14);
    transform: scale(1.05);
}

.upload-icon {
    width: 36px;
    height: 36px;
    color: var(--accent);
}

.drop-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.drop-divider {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.btn-browse {
    display: inline-block;
    background: rgba(0, 255, 136, 0.08);
    background-image: radial-gradient(rgba(0, 255, 136, 0.15) 1.2px, transparent 1.2px);
    background-size: 6px 6px;
    border: 2px solid rgba(0, 255, 136, 0.25);
    color: var(--accent);
    padding: 0.65rem 1.75rem;
    border-radius: 20px 8px 18px 10px/10px 18px 8px 20px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-browse:hover {
    background: rgba(0, 255, 136, 0.18);
    border-color: rgba(0, 255, 136, 0.6);
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.25);
    filter: url(#sketchy-wiggle);
}

.drop-formats {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
    letter-spacing: 0.02em;
}

/* ---------- Selected State ---------- */
.selected-icon-wrap {
    background: rgba(0, 255, 136, 0.14) !important;
    animation: pulseSelectedIcon 1.5s infinite ease-in-out;
}

@keyframes pulseSelectedIcon {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.2); }
    50% { box-shadow: 0 0 16px 4px rgba(0, 255, 136, 0.15); }
}

.selected-ready {
    color: #00ff88 !important;
    font-weight: 700 !important;
    font-size: 1.25rem !important;
}

.selected-filename {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    max-width: 90%;
    margin-top: 4px;
}

.selected-fileinfo {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.change-file-hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@keyframes slideUp {
    from { transform: translateY(12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-logo-glow {
    animation: defaultGlow 3s infinite ease-in-out;
}

@keyframes defaultGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 12px rgba(255, 255, 255, 0.05); }
    50% { transform: scale(1.03); box-shadow: 0 0 20px rgba(0, 255, 136, 0.12); }
}

/* ============================================
   STACKED UPLOAD FLOW LAYOUT (VERTICAL TIMELINE)
   ============================================ */

.upload-flow-container {
    position: relative;
    z-index: 10;
    margin-top: 2rem;
    background: var(--bg-primary);
    padding-top: 1.5rem;
    box-shadow: 0 -20px 40px rgba(6, 6, 12, 0.95);
    border-top: 2px solid var(--border-subtle);
}

.upload-card-wrapper {
    margin-bottom: 1rem;
}

.settings-grid-stacked {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 2rem;
}

.settings-card {
    /* extends .animatic-box */
}

.settings-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px dashed rgba(0, 255, 136, 0.18);
    padding-bottom: 0.5rem;
    text-align: left;
}

.settings-card .setting-row + .setting-row {
    border-top: 1px solid var(--border-subtle);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.5rem;
    gap: 1rem;
}

.setting-label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: left;
}

.setting-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-hint {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ---------- Manga-style Toggle Switch ---------- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #111116;
    border: 2.5px solid #ffffff;
    border-radius: 12px 6px 11px 5px/5px 11px 6px 12px;
    box-shadow: 2px 2px 0px #000000;
    transition: all var(--transition-base);
}

.toggle-switch:hover .toggle-slider {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
    filter: url(#sketchy-wiggle);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 4px;
    bottom: 3.5px;
    background: #ffffff;
    border: 1.5px solid #000000;
    border-radius: 50% 45% 48% 40% !important;
    transition: all var(--transition-base);
}

.toggle-switch input:checked + .toggle-slider {
    background: #00ff88;
    background-image: radial-gradient(#06060c 1.5px, transparent 1.5px);
    background-size: 6px 6px;
    border-color: #00ff88;
    box-shadow: 2px 2px 0px rgba(0, 255, 136, 0.3);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: #06060c;
    border-color: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.toggle-switch input:focus-visible + .toggle-slider {
    outline: 2px dashed #00ff88;
    outline-offset: 3px;
}

/* ---------- Segmented Control ---------- */
.segmented-control {
    display: flex;
    background-color: rgba(0, 0, 0, 0.45);
    background-image: radial-gradient(rgba(0, 255, 136, 0.04) 1px, transparent 1px);
    background-size: 8px 8px;
    border: 2px solid rgba(0, 255, 136, 0.15);
    border-radius: 30px 10px 25px 12px/12px 25px 10px 30px;
    padding: 4px;
    gap: 4px;
    width: 100%;
    margin-top: 4px;
    transition: var(--transition-base);
}

.segmented-control:hover {
    border-color: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.1);
}

.segment-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font-family);
    border-radius: 25px 8px 20px 6px/6px 20px 8px 25px;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    white-space: nowrap;
}

.segment-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 255, 136, 0.06);
    filter: url(#sketchy-wiggle);
}

.segment-btn.active {
    background: var(--accent);
    color: #06060c;
    border-radius: 20px 8px 18px 10px/10px 18px 8px 20px;
    box-shadow: 0 2px 12px rgba(0, 255, 136, 0.4);
    filter: url(#sketchy-wiggle);
    background-image: radial-gradient(rgba(6, 6, 12, 0.15) 1.5px, transparent 1.5px);
    background-size: 6px 6px;
    font-weight: 750;
}

.setting-row.vertical {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0.65rem !important;
}

.setting-row.vertical .setting-label {
    width: 100% !important;
}

.setting-row.vertical .segmented-control {
    width: 100% !important;
}

.file-input-small {
    font-family: var(--font-family);
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    max-width: 200px;
}

.file-input-small::file-selector-button {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.25);
    color: var(--accent);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-family: var(--font-family);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.5rem;
    transition: var(--transition-fast);
}

.file-input-small::file-selector-button:hover {
    background: rgba(0, 255, 136, 0.18);
    border-color: rgba(0, 255, 136, 0.4);
}

/* ============================================
   SCREEN 2: PROCESSING (RENDERING PAGE)
   ============================================ */

.processing-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.processing-header h2 {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.processing-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.preview-wrapper {
    max-width: 440px;
    margin: 0 auto 2rem auto;
}

.preview-frame {
    position: relative;
    width: 100%;
    border-radius: 24px 14px 28px 12px/12px 28px 14px 24px;
    overflow: hidden;
    background: #000;
    border: 3px solid rgba(0, 255, 136, 0.25);
    box-shadow: 6px 6px 0px #06060c, 8px 8px 0px rgba(0, 255, 136, 0.25);
    aspect-ratio: 16 / 9;
    background-image: radial-gradient(rgba(0, 255, 136, 0.05) 1.5px, transparent 1.5px) !important;
    background-size: 10px 10px !important;
    transition: all var(--transition-base);
}

.preview-frame:hover {
    border-color: rgba(0, 255, 136, 0.55);
    box-shadow: 8px 8px 0px #06060c, 12px 12px 0px rgba(0, 255, 136, 0.5);
    transform: translate(-2px, -2px);
}

.preview-frame canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ---------- Progress ---------- */
.progress-container {
    margin-bottom: 2rem;
    background-color: var(--bg-secondary);
    background-image: radial-gradient(rgba(0, 255, 136, 0.03) 1.5px, transparent 1.5px) !important;
    background-size: 10px 10px !important;
    border: 3px solid rgba(0, 255, 136, 0.25);
    border-radius: 20px 8px 18px 10px/10px 18px 8px 20px;
    padding: 1.5rem;
    box-shadow: 6px 6px 0px #06060c, 8px 8px 0px rgba(0, 255, 136, 0.2);
    transition: all var(--transition-base);
}

.progress-container:hover {
    border-color: rgba(0, 255, 136, 0.5);
    box-shadow: 8px 8px 0px #06060c, 12px 12px 0px rgba(0, 255, 136, 0.4);
    filter: url(#sketchy-wiggle);
}

.progress-track {
    width: 100%;
    height: 20px;
    border-radius: 25px 8px 20px 6px/6px 20px 8px 25px;
    border: 2px solid rgba(0, 255, 136, 0.3);
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
    margin-bottom: 0.75rem;
    padding: 2.5px;
}

.progress-fill {
    height: 100%;
    border-radius: 20px 6px 18px 5px/5px 18px 6px 20px;
    background: var(--accent-gradient);
    background-image: radial-gradient(rgba(6, 6, 12, 0.2) 1.5px, transparent 1.5px);
    background-size: 6px 6px;
    transition: width 0.3s ease;
    position: relative;
    min-width: 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
}

.progress-info #progress-text {
    color: var(--accent);
}

.progress-info #progress-eta {
    color: var(--text-tertiary);
}

.tab-safe-msg {
    text-align: center;
    font-size: 0.82rem;
    color: var(--accent-dim);
    font-weight: 500;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    background: rgba(0, 255, 136, 0.05);
    border: 1.5px dashed rgba(0, 255, 136, 0.25);
    border-radius: var(--radius-sm);
    letter-spacing: 0.01em;
}

/* ============================================
   SCREEN 3: RESULT
   ============================================ */

.result-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-header h2 {
    font-size: clamp(1.4rem, 3vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.result-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.result-preview {
    margin-bottom: 2rem;
    border-radius: 24px 14px 28px 12px/12px 28px 14px 24px;
    overflow: hidden;
    background: #000;
    border: 3px solid rgba(0, 255, 136, 0.25);
    box-shadow: 6px 6px 0px #06060c, 8px 8px 0px rgba(0, 255, 136, 0.25);
    background-image: radial-gradient(rgba(0, 255, 136, 0.05) 1.5px, transparent 1.5px) !important;
    background-size: 10px 10px !important;
    transition: all var(--transition-base);
}

.result-preview:hover {
    border-color: rgba(0, 255, 136, 0.55);
    box-shadow: 8px 8px 0px #06060c, 12px 12px 0px rgba(0, 255, 136, 0.5);
    transform: translate(-2px, -2px);
}

.result-preview video {
    display: block;
    width: 100%;
    max-height: 65vh;
    background: #000;
}

.result-actions {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.85rem;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all var(--transition-base);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    background-image: radial-gradient(rgba(6, 6, 12, 0.15) 1.5px, transparent 1.5px), var(--accent-gradient);
    background-size: 6px 6px, 100% 100%;
    color: #06060c;
    font-weight: 800;
    border: 3px solid #00ff88;
    border-radius: 30px 12px 28px 14px/14px 28px 12px 30px;
    box-shadow: 4px 4px 0px rgba(0, 255, 136, 0.25);
}

.btn-primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(0, 255, 136, 0.45);
    filter: url(#sketchy-wiggle);
}

.btn-primary:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0px rgba(0, 255, 136, 0.2);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.02);
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1.2px, transparent 1.2px);
    background-size: 6px 6px;
    color: var(--text-secondary);
    border: 2px solid var(--border-medium);
    border-radius: 24px 10px 22px 12px/12px 22px 10px 24px;
    box-shadow: 4px 4px 0px rgba(255, 255, 255, 0.05);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(0, 255, 136, 0.04);
    border-color: rgba(0, 255, 136, 0.4);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px rgba(0, 255, 136, 0.15);
    filter: url(#sketchy-wiggle);
}

.btn-ghost:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0px rgba(255, 255, 255, 0.02);
}

/* ============================================
   ERROR OVERLAY
   ============================================ */

.error-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 6, 12, 0.85);
    backdrop-filter: blur(12px);
    animation: overlayFadeIn 0.3s ease;
}

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

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

.error-card {
    background: var(--bg-secondary);
    background-image: radial-gradient(rgba(255, 0, 85, 0.04) 1.5px, transparent 1.5px);
    background-size: 10px 10px;
    border: 3px solid rgba(255, 0, 85, 0.3);
    border-radius: 24px 14px 28px 12px/12px 28px 14px 24px;
    padding: 2.5rem 2rem;
    max-width: 400px;
    text-align: center;
    box-shadow: 6px 6px 0px #06060c, 8px 8px 0px rgba(255, 0, 85, 0.2);
    transition: all var(--transition-base);
}

.error-card:hover {
    border-color: rgba(255, 0, 85, 0.6);
    box-shadow: 8px 8px 0px #06060c, 12px 12px 0px rgba(255, 0, 85, 0.4);
    transform: translate(-2px, -2px);
    filter: url(#sketchy-wiggle);
}

.error-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
}

.error-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.error-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* ============================================
   SCROLLBAR & SELECTION
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

::selection {
    background: rgba(0, 255, 136, 0.25);
    color: #fff;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border-medium);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

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

/* ============================================
   RESPONSIVE & DESKTOP CONFIGURATIONS
   ============================================ */

@media (max-width: 640px) {
    .container {
        padding: 1.5rem 1rem;
    }

    .drop-zone-inner {
        padding: 2rem 1.5rem;
        min-height: 220px;
    }

    .result-actions {
        flex-direction: column;
    }

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

@media (min-width: 1024px) {
    #screen-upload .container {
        max-width: 900px; /* Keep container spacious enough for split brand banner */
        width: 100%;
        margin: 0 auto;
        padding: 0 1.5rem 3rem 1.5rem;
    }
    
    .brand {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 3.5rem !important;
        max-width: 900px !important;
        min-height: 80vh !important;
        margin: 0 auto !important;
    }
    
    .brand-left {
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .brand-right {
        align-items: flex-start !important;
        text-align: left !important;
        flex-grow: 1 !important;
    }
    
    .tagline {
        text-align: left !important;
    }
    
    .desktop-badge {
        margin: 6px 0 0 0 !important;
    }
    
    .upload-flow-container {
        position: relative;
        margin-top: 2rem !important;
        background: var(--bg-primary);
        padding-top: 2.5rem;
        box-shadow: 0 -30px 60px rgba(6, 6, 12, 0.98);
        border-top: 2px solid var(--border-subtle);
        max-width: 680px; /* Center content to match upload zone width */
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

.audio-upload-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 0.5rem;
}

.audio-filename-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 1rem;
    word-break: break-all;
}

/* ================================================================
   THREE-STAGE SCROLL SNAP LAYOUT, ANIMATED MASCOT, & ENTRANCE EFFECTS
   ================================================================ */



#screen-upload.screen.active {
    display: block;
    position: relative;
    min-height: 100vh;
    width: 100%;
}

.scroll-section {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    padding: 3rem 1.5rem;
    overflow: visible;
}

.hero-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.section-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 0;
}

.scroll-section::before,
.scroll-section::after {
    content: '';
    display: block;
    flex: 1 1 0px;
    pointer-events: none;
}

/* Scroll Entrance Transitions */
.scroll-section-content, .brand {
    transform: translateY(40px) scale(0.96);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.8s ease;
}

.scroll-section.in-view .scroll-section-content, 
.scroll-section.in-view .brand {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.upload-flow-container-new {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

/* Dynamic Mascot Camera Animations */
.camera-head {
    transform-origin: 50px 72px;
    animation: cameraBob 3s infinite ease-in-out;
}

@keyframes cameraBob {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(1.5deg);
    }
}

.animatic-lens {
    transform-origin: 50px 45px;
    animation: lensWobble 5s infinite ease-in-out;
}

@keyframes lensWobble {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(1.5px, 1px) scale(0.98);
    }
    75% {
        transform: translate(-1px, -0.5px) scale(1.02);
    }
}

.animatic-play {
    transform-origin: 50px 45px;
    animation: playPulse 2s infinite ease-in-out;
}

@keyframes playPulse {
    0%, 100% {
        transform: scale(1);
        fill-opacity: 0.2;
    }
    50% {
        transform: scale(1.15);
        fill-opacity: 0.45;
        filter: drop-shadow(0 0 6px rgba(0, 255, 136, 0.8));
    }
}

.tripod-leg-left {
    transform-origin: 50px 80px;
    animation: legTapLeft 1.2s infinite ease-in-out;
}

@keyframes legTapLeft {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(6deg);
    }
}

.tripod-leg-right {
    transform-origin: 50px 80px;
    animation: legTapRight 1.2s infinite ease-in-out;
}

@keyframes legTapRight {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-6deg);
    }
}

.tripod-leg-center {
    transform-origin: 50px 80px;
    animation: legWobbleCenter 2.4s infinite ease-in-out;
}

@keyframes legWobbleCenter {
    0%, 50%, 100% {
        transform: scaleY(1);
    }
    25% {
        transform: scaleY(0.94);
    }
    75% {
        transform: scaleY(1.06);
    }
}

/* Scroll Hint next sections */
.scroll-hint.next-hint {
    margin-top: 1rem;
    cursor: pointer;
    font-family: var(--font-family-heading);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--accent);
}

.scroll-hint.next-hint:hover {
    color: #ffffff;
    filter: url(#sketchy-wiggle);
}



/* Responsive Split-Column Layout for Desktop Settings */
@media (min-width: 768px) {
    .section-container {
        max-width: 860px !important;
    }
    .upload-flow-container-new {
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 1.5rem !important;
    }
    .upload-flow-container-new > * {
        flex: 1 !important;
        min-width: 0 !important;
    }
    .upload-card-wrapper {
        margin-bottom: 0 !important;
        display: flex;
        flex-direction: column;
    }
    .drop-zone {
        flex: 1;
        display: flex;
        flex-direction: column;
    }
    .drop-zone-inner {
        flex: 1;
        justify-content: center;
        min-height: auto !important;
    }
}
