/* =============================================
   CONCEPT BUBBLE — Interactive Story Styles
   Based on Figma Design
   ============================================= */

/* CSS Custom Properties (Design Tokens from Figma) */
:root {
    --amber: #FFA500;
    --amber-light: #FFD080;
    --purple: #8F24F5;
    --purple-accent: #A855F7;
    --purple-light: #B76EFF;
    --black: #0D0D0D;
    --white: #FFFFFF;
    --gray-dark: #1a1a1a;
    --gray-medium: #2a2a2a;
    --gray-light: #4a4a4a;
    --easel-brown: #7E5B00;
    --easel-brown-dark: #5a4000;
    --canvas-border: #666666;

    /* Easing functions for organic motion */
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    background: var(--black);
    color: var(--white);
    overflow-x: hidden;
    cursor: none;
}

/* Custom Cursor */
#cursor-glow {
    position: fixed;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255,165,0,0.8) 0%, rgba(255,165,0,0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.2s var(--ease-soft), height 0.2s var(--ease-soft);
    mix-blend-mode: screen;
}

#cursor-glow.painting {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(255,165,0,1) 0%, rgba(255,165,0,0.3) 50%, rgba(255,165,0,0) 70%);
}

#cursor-glow.dragging {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(168,85,247,0.6) 0%, rgba(168,85,247,0) 70%);
}

/* Brush cursor for painting */
#brush-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
}

#painting-area:not(.hidden) #brush-cursor {
    opacity: 1;
}

/* Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--purple-accent), var(--amber));
    width: 0%;
    z-index: 9999;
    transition: width 0.1s linear;
}

/* Scroll Container */
#scroll-container {
    width: 100%;
}

/* =============================================
   SCENES — Common Styles
   ============================================= */

.scene {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s var(--ease-soft);
    overflow: hidden;
    background: var(--black);
}

.scene.active {
    opacity: 1;
}

.scene-content {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scroll Hint */
.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 1;
    animation: fadeInUp 1s var(--ease-soft) 1s both;
    z-index: 100;
}

.scroll-arrow {
    color: rgba(255, 255, 255, 0.85);
    animation: bounce 2s infinite;
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
}

/* Glowing scroll arrow */
.scroll-arrow.glowing {
    color: var(--amber);
    animation: bounce 2s infinite, glowPulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 8px var(--amber));
}

.scroll-hint.glowing .scroll-arrow {
    color: var(--amber);
    animation: bounce 2s infinite, glowPulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px var(--amber));
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.7;
        filter: drop-shadow(0 0 8px var(--amber));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 20px var(--amber)) drop-shadow(0 0 30px var(--amber));
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(12px); }
    60% { transform: translateY(6px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* =============================================
   SCENE 1 — The Blank Canvas (Friction)
   ============================================= */

#scene-1 {
    background: var(--black);
}

/* Title Styling - matching Figma: x=37, y=131 on 1440px frame */
#intro-title {
    position: absolute;
    left: 2.5%;
    top: 12.8%;
    z-index: 25;
}

#intro-title h1 {
    font-size: clamp(72px, 8.3vw, 120px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
}

.title-concept {
    display: block;
    color: var(--white);
}

.title-bubble {
    display: block;
    background: linear-gradient(180deg, var(--purple-accent) 0%, var(--amber) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tagline - Figma: x=37, y=427 */
.tagline {
    margin-top: 32px;
    font-size: clamp(20px, 2.2vw, 32px);
    font-weight: 500;
    color: var(--white);
    opacity: 0.9;
}

/* Girl Character Container - in front of canvas with paintbrush on it */
#girl-container {
    position: absolute;
    left: 11.5%;
    top: 15%;
    rotate: -5deg;
    z-index: 35;
    pointer-events: none;
}

#girl-image {
    width: 90vw;
    max-width: 10000px;
    height: auto;
    filter: drop-shadow(0 10px 40px rgba(0,0,0,0.5));
    pointer-events: none;
}

/* Easel and Canvas - LARGE canvas to the right */
#easel-container {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
}

#easel {
    position: relative;
    width: 520px;
    height: 480px;
}

#easel-post {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 70px;
    background: var(--easel-brown);
    border-radius: 4px;
}

#easel-base {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 490px;
    height: 20px;
    background: var(--easel-brown);
    border-radius: 4px;
}

#canvas-frame {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--canvas-border);
    padding: 10px;
    border-radius: 4px;
    z-index: 30;
    transition: box-shadow 0.5s var(--ease-soft);
}

/* Canvas glow effect before painting */
#canvas-frame.glowing {
    box-shadow: 0 0 30px rgba(255, 165, 0, 0.4), 0 0 60px rgba(255, 165, 0, 0.2);
    animation: canvasGlow 2s ease-in-out infinite;
}

@keyframes canvasGlow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 165, 0, 0.3), 0 0 60px rgba(255, 165, 0, 0.15);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 165, 0, 0.5), 0 0 80px rgba(255, 165, 0, 0.3);
    }
}

#preview-canvas {
    display: block;
    background: #E8E8E8;
    border-radius: 2px;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FFA500' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18.37 2.63L14 7l-1.59-1.59a2 2 0 00-2.82 0L8 7l9 9 1.59-1.59a2 2 0 000-2.82L17 10l4.37-4.37a2.12 2.12 0 10-3-3z'/%3E%3Cpath d='M9 8c-2 3-4 3.5-7 4l8 10c2-1 6-5 6-7'/%3E%3Cpath d='M14.5 17.5L4.5 15'/%3E%3C/svg%3E") 2 22, crosshair;
    width: 470px;
    height: 370px;
}

/* Floating Tasks - positioned directly on top of the canvas */
#floating-tasks {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 32;
}

.floating-task {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: rgba(168, 85, 247, 0.12);
    /* Dashed border for broken/friction feel */
    border: 2px dashed rgba(168, 85, 247, 0.7);
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    backdrop-filter: blur(4px);
    animation: taskFloat var(--float-duration, 8s) ease-in-out infinite, taskShake 0.15s ease-in-out infinite;
    animation-delay: var(--float-delay, 0s);
    pointer-events: auto;
    transition: transform 0.3s var(--ease-elastic), opacity 0.5s, background 0.3s;
    white-space: nowrap;
    /* Multiple offset shadows create vibrating/unstable effect */
    box-shadow:
        2px 2px 0 rgba(168, 85, 247, 0.4),
        -2px -2px 0 rgba(255, 100, 100, 0.3),
        0 0 20px rgba(168, 85, 247, 0.2);
}

/* Constant subtle shake for friction/anxiety feel */
@keyframes taskShake {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(0.5px, -0.5px);
    }
    50% {
        transform: translate(-0.5px, 0.5px);
    }
    75% {
        transform: translate(0.5px, 0.5px);
    }
}

.floating-task:hover {
    transform: scale(1.05);
    background: rgba(168, 85, 247, 0.25);
    border-color: rgba(168, 85, 247, 0.9);
    box-shadow:
        3px 3px 0 rgba(168, 85, 247, 0.5),
        -3px -3px 0 rgba(255, 100, 100, 0.4),
        0 0 30px rgba(168, 85, 247, 0.4);
}

.floating-task.interfering {
    animation: interferePulse 0.4s ease-in-out, taskShake 0.03s ease-in-out infinite;
    background: rgba(168, 85, 247, 0.6);
    border-color: rgba(200, 100, 255, 1);
    border-width: 3px;
    box-shadow:
        6px 6px 0 rgba(168, 85, 247, 0.8),
        -6px -6px 0 rgba(255, 80, 80, 0.6),
        0 0 60px rgba(168, 85, 247, 0.8),
        0 0 100px rgba(255, 100, 100, 0.3);
    transform: scale(1.15);
    z-index: 100;
}

@keyframes taskFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(var(--rotate-start, -5deg));
    }
    25% {
        transform: translate(var(--float-x1, 15px), var(--float-y1, -10px)) rotate(var(--rotate-mid, 0deg));
    }
    50% {
        transform: translate(var(--float-x2, 0px), var(--float-y2, -20px)) rotate(var(--rotate-end, 5deg));
    }
    75% {
        transform: translate(var(--float-x3, -15px), var(--float-y3, -10px)) rotate(var(--rotate-mid, 0deg));
    }
}

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

/* Interference Layer */
#interference-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.interference-flash {
    position: absolute;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: flashFade 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes flashFade {
    from { opacity: 1; transform: scale(0.5); }
    to { opacity: 0; transform: scale(2); }
}

/* Paint Prompt - italic text with glowing arrow */
#paint-prompt {
    position: absolute;
    top: 58%;
    left: 2.5%;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 25;
}

.paint-prompt-text {
    font-size: 16px;
    font-weight: 400;
    font-style: italic;
    color: var(--white);
    opacity: 0.9;
}

.paint-prompt-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--amber);
    animation: arrowGlow 1.5s ease-in-out infinite, arrowBounceRight 1.5s ease-in-out infinite;
}

.paint-prompt-arrow svg {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 8px var(--amber));
}

@keyframes arrowGlow {
    0%, 100% {
        opacity: 0.7;
        filter: drop-shadow(0 0 5px var(--amber));
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 15px var(--amber)) drop-shadow(0 0 25px var(--amber));
    }
}

@keyframes arrowBounceRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(8px); }
}

/* =============================================
   SCENE 2 — Emergence of Bubbles
   ============================================= */

#scene-2 {
    background: var(--black);
}

#bubble-instruction {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
}

#bubble-instruction p {
    font-size: 24px;
    font-weight: 500;
    color: var(--white);
    opacity: 0.9;
}

#bubbles-container {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Bubble styling based on Figma SVG */
.bubble {
    position: absolute;
    border-radius: 50%;
    cursor: grab;
    transition: transform 0.3s var(--ease-elastic), box-shadow 0.3s;
    animation: bubbleFloat 6s ease-in-out infinite, bubbleGlowPulse 2s ease-in-out infinite;
    /* Figma-inspired gradient */
    background:
        radial-gradient(circle at 50% 50%,
            rgba(255, 165, 0, 0.3) 10%,
            rgba(168, 85, 247, 0.2) 60%,
            transparent 100%),
        radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.15) 0%,
            transparent 50%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    box-shadow:
        inset 0 0 30px rgba(255, 255, 255, 0.05),
        0 0 40px rgba(168, 85, 247, 0.2),
        0 0 60px rgba(255, 165, 0, 0.15);
    filter: blur(0.5px);
}

@keyframes bubbleGlowPulse {
    0%, 100% {
        box-shadow:
            inset 0 0 30px rgba(255, 255, 255, 0.05),
            0 0 40px rgba(168, 85, 247, 0.2),
            0 0 60px rgba(255, 165, 0, 0.15);
    }
    50% {
        box-shadow:
            inset 0 0 40px rgba(255, 255, 255, 0.1),
            0 0 60px rgba(168, 85, 247, 0.35),
            0 0 80px rgba(255, 165, 0, 0.25);
    }
}

.bubble:hover {
    transform: scale(1.08);
    box-shadow:
        inset 0 0 40px rgba(255, 255, 255, 0.1),
        0 0 60px rgba(255, 165, 0, 0.2);
}

.bubble.dragging {
    cursor: grabbing;
    animation: none !important;
    transform: scale(1.12);
    filter: blur(0px);
    box-shadow:
        inset 0 0 50px rgba(255, 255, 255, 0.15),
        0 0 80px rgba(255, 165, 0, 0.4);
}

.bubble.captured {
    background:
        radial-gradient(circle at 50% 50%,
            rgba(255, 165, 0, 0.6) 10%,
            rgba(168, 85, 247, 0.45) 50%,
            rgba(168, 85, 247, 0.1) 80%,
            transparent 100%),
        radial-gradient(circle at 30% 30%,
            rgba(255, 255, 255, 0.35) 0%,
            transparent 50%);
    animation: bubbleFloatCaptured 8s ease-in-out infinite !important;
    border: 1px solid rgba(255, 165, 0, 0.4);
    box-shadow:
        inset 0 0 40px rgba(255, 165, 0, 0.2),
        0 0 60px rgba(255, 165, 0, 0.3),
        0 0 100px rgba(168, 85, 247, 0.2);
    filter: blur(0px);
}

/* Captured task inside bubble */
.bubble .captured-task-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 500;
    color: var(--white);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s;
    max-width: 80%;
    line-height: 1.3;
}

.bubble.captured .captured-task-label {
    opacity: 1;
}

/* Neurons inside bubbles */
.bubble-neurons {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s;
}

.bubble.captured .bubble-neurons {
    opacity: 1;
}

.neuron-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--amber);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--amber);
    animation: neuronPulse 2s ease-in-out infinite;
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(2deg); }
    66% { transform: translateY(10px) rotate(-2deg); }
}

@keyframes bubbleFloatCaptured {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-25px) scale(1.03); }
}

@keyframes neuronPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.4); }
}

/* Detached Tasks */
#detached-tasks {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.detached-task {
    position: absolute;
    padding: 10px 18px;
    background: rgba(80, 40, 120, 0.25);
    border: 2px dashed rgba(120, 70, 160, 0.6);
    border-radius: 3px;
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    animation: none;
    transition: all 0.5s var(--ease-elastic);
    white-space: nowrap;
    pointer-events: none;
    box-shadow:
        1px 1px 0 rgba(100, 60, 140, 0.3),
        -1px -1px 0 rgba(80, 50, 80, 0.2);
}

.detached-task.being-captured {
    transform: scale(0.5);
    opacity: 0;
}

@keyframes detachedFloat {
    0%, 100% { transform: translateY(0) translateX(0) rotate(-3deg); }
    25% { transform: translateY(-12px) translateX(8px) rotate(0deg); }
    75% { transform: translateY(8px) translateX(-8px) rotate(3deg); }
}

/* Neurons background (scene 2) */
#neurons-scene2 {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.neuron-bg-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--amber);
    border-radius: 50%;
    opacity: 0.3;
    box-shadow: 0 0 10px var(--amber);
    animation: neuronPulse 3s ease-in-out infinite;
}

/* =============================================
   SCENE 3 — Calm Field (Clarity)
   ============================================= */

#scene-3 {
    background: var(--black);
}

#neuron-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.scene3-intro {
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    font-weight: 400;
    color: var(--white);
    opacity: 0.7;
    z-index: 10;
}

#girl-clear {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

#girl-calm-image {
    width: 700px;
    height: auto;
    filter: drop-shadow(0 0 60px rgba(168, 85, 247, 0.4));
    animation: girlFloat 6s ease-in-out infinite;
}

/* Subtle floating animation for calm girl */
@keyframes girlFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.calm-message {
    position: absolute;
    bottom: 14%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.calm-message p {
    font-size: 32px;
    font-weight: 500;
    color: var(--white);
    margin: 8px 0;
}

.calm-message .highlight {
    background: linear-gradient(90deg, var(--purple-accent), var(--amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

#peaceful-bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.peaceful-bubble {
    position: absolute;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%,
            rgba(255, 165, 0, 0.2) 10%,
            rgba(168, 85, 247, 0.15) 60%,
            transparent 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: peacefulFloat 10s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes peacefulFloat {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-30px) translateX(20px); }
    50% { transform: translateY(-10px) translateX(-15px); }
    75% { transform: translateY(-40px) translateX(10px); }
}

/* =============================================
   SCENE 4 — The Moment to Create
   ============================================= */

#scene-4 {
    background: var(--black);
}

#create-prompt {
    position: absolute;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 5;
    transition: opacity 0.5s;
}

#create-prompt h2 {
    font-size: 48px;
    font-weight: 500;
    color: var(--white);
    margin-bottom: 16px;
}

#create-prompt p {
    font-size: 20px;
    font-weight: 400;
    color: var(--white);
    opacity: 0.8;
}

.gradient-text {
    background: linear-gradient(180deg, var(--purple-accent) 0%, var(--amber) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Floating Canvas Trigger (Scene 4) */
#floating-canvas-trigger {
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: transform 0.5s var(--ease-elastic);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#floating-canvas-trigger:hover {
    transform: translate(-50%, -50%) scale(1.03);
}

#easel-post-trigger {
    width: 6px;
    height: 40px;
    background: var(--easel-brown);
    border-radius: 3px;
}

.canvas-frame-trigger {
    background: var(--canvas-border);
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: box-shadow 0.5s;
}

#floating-canvas-trigger:hover .canvas-frame-trigger {
    box-shadow: 0 25px 80px rgba(255, 165, 0, 0.2);
}

.canvas-surface {
    width: 320px;
    height: 240px;
    background: #E8E8E8;
    border-radius: 2px;
}

#easel-base-trigger {
    width: 280px;
    height: 16px;
    background: var(--easel-brown);
    border-radius: 4px;
    margin-top: -4px;
}

#floating-canvas-trigger.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

/* =============================================
   PAINTING AREA (Overlay)
   ============================================= */

#painting-area {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s;
}

#painting-area.hidden {
    opacity: 0;
    pointer-events: none;
}

#painting-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#painting-easel-post {
    width: 6px;
    height: 30px;
    background: var(--easel-brown);
    border-radius: 3px;
}

#painting-canvas {
    background: #E8E8E8;
    border: 8px solid var(--canvas-border);
    border-radius: 4px;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FFA500' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18.37 2.63L14 7l-1.59-1.59a2 2 0 00-2.82 0L8 7l9 9 1.59-1.59a2 2 0 000-2.82L17 10l4.37-4.37a2.12 2.12 0 10-3-3z'/%3E%3Cpath d='M9 8c-2 3-4 3.5-7 4l8 10c2-1 6-5 6-7'/%3E%3Cpath d='M14.5 17.5L4.5 15'/%3E%3C/svg%3E") 2 22, crosshair;
    touch-action: none;
}

/* Color Palette */
#color-palette {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.color-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: transform 0.2s var(--ease-elastic), box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), 0 0 15px rgba(255, 255, 255, 0.1);
}

/* White button needs stronger outline */
.color-btn[data-color="#FFFFFF"] {
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.color-btn:hover {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3), 0 0 20px rgba(255, 255, 255, 0.25);
}

.color-btn.active {
    transform: scale(1.1);
    border-color: var(--white);
    box-shadow: 0 0 0 3px var(--white), 0 4px 20px rgba(0,0,0,0.4), 0 0 25px rgba(255, 255, 255, 0.3);
}

/* Download button in paint mode */
#download-btn-paint {
    position: absolute;
    bottom: 40px;
    right: 40px;
    padding: 14px 28px;
    background: rgba(126, 91, 0, 0.8);
    border: 1px solid var(--easel-brown);
    border-radius: 25px;
    color: var(--white);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease-soft);
}

#download-btn-paint:hover {
    background: var(--easel-brown);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(126, 91, 0, 0.4);
}

/* Close button for painting area */
#close-painting {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--ease-soft);
}

#close-painting:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

#close-painting svg {
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s;
}

#close-painting:hover svg {
    color: var(--white);
}

/* =============================================
   SCENE 5 — Download & Signature
   ============================================= */

#scene-5 {
    background: var(--black);
}

#final-area {
    text-align: center;
    z-index: 10;
}

.final-text {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 40px;
    opacity: 0.8;
    text-transform: lowercase;
}

#final-preview {
    width: 450px;
    height: 340px;
    margin: 0 auto 40px;
    background: #E8E8E8;
    border: 8px solid var(--canvas-border);
    border-radius: 4px;
    overflow: hidden;
}

#final-preview canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#download-btn {
    padding: 14px 28px;
    background: rgba(126, 91, 0, 0.8);
    border: 1px solid var(--easel-brown);
    border-radius: 25px;
    color: var(--white);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease-soft);
}

#download-btn:hover {
    background: var(--easel-brown);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(126, 91, 0, 0.4);
}

.signature {
    margin-top: 60px;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 4px;
    opacity: 0.5;
    background: linear-gradient(90deg, var(--purple-accent), var(--amber));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =============================================
   SCENE 2 COMPLETION MESSAGE
   ============================================= */

#completion-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s var(--ease-soft);
}

#completion-message.hidden {
    display: none;
}

#completion-message.visible {
    opacity: 1;
    display: block;
}

#completion-message p {
    font-size: 28px;
    font-weight: 500;
    color: var(--white);
    background: linear-gradient(90deg, var(--white) 0%, var(--amber) 50%, var(--purple-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textFadeIn 1s var(--ease-soft) forwards;
    text-shadow: 0 0 40px rgba(255, 165, 0, 0.3);
}

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

/* =============================================
   ERASER BUTTON
   ============================================= */

.eraser-btn {
    background: #666666 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eraser-btn svg {
    width: 20px;
    height: 20px;
    color: var(--white);
}

.eraser-btn.active {
    background: #888888 !important;
}

/* =============================================
   PAINT SCROLL ARROW (Scene 4)
   ============================================= */

#paint-scroll-arrow {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.5s var(--ease-soft);
}

#paint-scroll-arrow.visible {
    opacity: 1;
}

#paint-scroll-arrow p {
    font-size: 14px;
    font-weight: 400;
    color: var(--white);
    opacity: 0.8;
    margin-bottom: 12px;
}

#paint-scroll-arrow .scroll-arrow {
    color: var(--amber);
    width: 40px;
    height: 40px;
    animation: bounce 2s infinite, glowPulse 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px var(--amber));
    cursor: pointer;
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

.hidden {
    opacity: 0;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.8s var(--ease-soft) forwards;
}

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

/* Particle effects */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--amber);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFade 1s ease-out forwards;
}

@keyframes particleFade {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0) translateY(-50px);
    }
}

/* =============================================
   RESPONSIVE (Basic Desktop Focus)
   ============================================= */

@media (max-width: 1400px) {
    #girl-image {
        width: 70vw;
    }

    #girl-calm-image {
        width: 550px;
    }

    #easel-container {
        right: 5%;
        transform: translateY(-50%) scale(0.85);
    }

    #preview-canvas {
        width: 420px;
        height: 320px;
    }

    #girl-container {
        left: 12%;
    }
}

@media (max-width: 1100px) {
    #intro-title {
        left: 3%;
    }

    #girl-container {
        left: 8%;
        top: 22%;
    }

    #girl-image {
        width: 65vw;
    }

    #easel-container {
        right: 3%;
        transform: translateY(-50%) scale(0.7);
    }

    #preview-canvas {
        width: 380px;
        height: 280px;
    }

    #girl-calm-image {
        width: 450px;
    }

    #paint-prompt {
        top: auto;
        bottom: 12%;
    }
}

@media (max-width: 900px) {
    #intro-title {
        top: 5%;
    }

    .tagline {
        max-width: 90%;
    }

    #girl-container {
        left: 5%;
        top: 28%;
    }

    #girl-image {
        width: 70vw;
    }

    #easel-container {
        right: 2%;
        transform: translateY(-50%) scale(0.55);
    }

    #preview-canvas {
        width: 360px;
        height: 270px;
    }

    #girl-calm-image {
        width: 350px;
    }

    #painting-canvas {
        width: 90vw;
        max-width: 500px;
        height: auto;
        aspect-ratio: 7/5;
    }

    .canvas-surface {
        width: 260px;
        height: 200px;
    }

    #paint-prompt {
        top: auto;
        bottom: 10%;
    }
}

/* =============================================
   TABLET RESPONSIVE (768px and below)
   ============================================= */

@media (max-width: 768px) {
    /* Enable default cursor on touch devices */
    body {
        cursor: auto;
    }

    #cursor-glow,
    #brush-cursor {
        display: none;
    }

    /* Scene 1 */
    #intro-title {
        left: 5%;
        top: 3%;
    }

    #intro-title h1 {
        font-size: clamp(36px, 10vw, 56px);
    }

    .tagline {
        font-size: clamp(12px, 3vw, 18px);
        margin-top: 12px;
    }

    /* Girl on the left, larger and level with canvas */
    #girl-container {
        left: -10%;
        top: 25%;
        rotate: -3deg;
        z-index: 20;
        pointer-events: none;
    }

    #girl-image {
        width: 85vw;
        pointer-events: none;
    }

    /* Canvas smaller, on the right, aligned with girl */
    #easel-container {
        left: auto;
        right: 3%;
        top: 38%;
        bottom: auto;
        transform: none;
        z-index: 30;
    }

    #canvas-frame {
        z-index: 35;
        pointer-events: auto;
    }

    #preview-canvas {
        pointer-events: auto;
    }

    #easel {
        transform: scale(0.45);
    }

    #paint-prompt {
        left: 5%;
        right: 5%;
        bottom: 8%;
        top: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        z-index: 40;
    }

    .paint-prompt-text {
        font-size: 12px;
    }

    .paint-prompt-arrow svg {
        width: 22px;
        height: 22px;
    }

    #easel-container {
        right: 2%;
        left: auto;
        transform: translateY(-50%) scale(0.45);
    }

    #preview-canvas {
        width: 350px;
        height: 260px;
    }

    #girl-container {
        left: -5%;
        top: 25%;
    }

    /* Floating tasks - reposition for mobile, below title */
    #floating-tasks {
        z-index: 10;
    }

    .floating-task {
        padding: 6px 12px;
        font-size: 10px;
        left: auto !important;
        right: auto !important;
    }

    .floating-task:nth-child(1) { left: 5% !important; top: 20% !important; }
    .floating-task:nth-child(2) { left: 60% !important; top: 18% !important; }
    .floating-task:nth-child(3) { left: 10% !important; top: 45% !important; }
    .floating-task:nth-child(4) { left: 55% !important; top: 42% !important; }
    .floating-task:nth-child(5) { left: 5% !important; top: 75% !important; }
    .floating-task:nth-child(6) { left: 50% !important; top: 78% !important; }

    /* Scene 2 */
    #bubble-instruction {
        top: 40px;
    }

    #bubble-instruction p {
        font-size: 18px;
        padding: 0 20px;
        text-align: center;
    }

    .bubble {
        transform: scale(0.8);
    }

    .detached-task {
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Scene 3 */
    .scene3-intro {
        top: 40px;
        font-size: 16px;
        padding: 0 20px;
        text-align: center;
    }

    #girl-clear {
        top: 42%;
    }

    #girl-calm-image {
        width: 95vw;
        max-width: 600px;
    }

    .calm-message {
        bottom: 8%;
    }

    .calm-message p {
        font-size: 20px;
    }

    /* Scene 4 */
    #create-prompt {
        top: 12%;
    }

    #create-prompt h2 {
        font-size: 36px;
    }

    #create-prompt p {
        font-size: 16px;
    }

    .canvas-surface {
        width: 240px;
        height: 180px;
    }

    #easel-base-trigger {
        width: 260px;
    }

    /* Painting Area */
    #painting-area {
        padding: 20px;
    }

    #painting-canvas {
        width: 90vw;
        max-width: 400px;
        height: auto;
        aspect-ratio: 7/5;
    }

    #color-palette {
        margin-top: 30px;
        gap: 15px;
    }

    .color-btn {
        width: 38px;
        height: 38px;
    }

    #download-btn-paint {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 14px;
    }

    #close-painting {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }

    /* Scene 5 */
    .final-text {
        font-size: 20px;
    }

    #final-preview {
        width: 90vw;
        max-width: 350px;
        height: auto;
        aspect-ratio: 450/340;
    }

    #download-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .signature {
        margin-top: 40px;
        font-size: 16px;
    }

    /* Scroll hint */
    .scroll-hint {
        bottom: 25px;
    }

    .scroll-arrow {
        width: 30px;
        height: 30px;
    }

    /* Eraser button on tablet */
    .eraser-btn {
        width: 38px;
        height: 38px;
    }

    .eraser-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Completion message */
    #completion-message p {
        font-size: 22px;
        padding: 0 20px;
    }
}

/* =============================================
   MOBILE RESPONSIVE (480px and below)
   ============================================= */

@media (max-width: 480px) {
    /* Scene 1 */
    #intro-title {
        left: 4%;
        top: 2%;
    }

    #intro-title h1 {
        font-size: clamp(28px, 10vw, 42px);
    }

    .tagline {
        font-size: clamp(11px, 3vw, 14px);
        margin-top: 10px;
        max-width: 95%;
    }

    /* Girl on the left, level with canvas */
    #girl-container {
        left: -18%;
        top: 20%;
        rotate: -2deg;
        z-index: 20;
    }

    #girl-image {
        width: 60vw;
    }

    /* Canvas smaller, on the right, higher up */
    #easel-container {
        left: auto;
        right: 3%;
        top: 30%;
        bottom: auto;
        transform: none;
        z-index: 30;
    }

    #easel {
        transform: scale(0.38);
    }

    #paint-prompt {
        left: 4%;
        right: 4%;
        bottom: 6%;
        top: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        z-index: 40;
    }

    .paint-prompt-text {
        font-size: 10px;
    }

    .paint-prompt-arrow svg {
        width: 20px;
        height: 20px;
    }

    #easel-container {
        right: 1%;
        left: auto;
        transform: translateY(-50%) scale(0.38);
    }

    #preview-canvas {
        width: 320px;
        height: 240px;
    }

    #girl-container {
        left: -12%;
        top: 22%;
    }

    #paint-scroll-arrow {
        bottom: 20px;
    }

    #paint-scroll-arrow p {
        font-size: 12px;
    }

    #paint-scroll-arrow .scroll-arrow {
        width: 32px;
        height: 32px;
    }

    /* Floating tasks repositioned for small screens */
    .floating-task {
        padding: 5px 10px;
        font-size: 9px;
        border-radius: 14px;
    }

    .floating-task:nth-child(1) { left: 3% !important; top: 18% !important; }
    .floating-task:nth-child(2) { left: 55% !important; top: 16% !important; }
    .floating-task:nth-child(3) { left: 5% !important; top: 40% !important; }
    .floating-task:nth-child(4) { left: 52% !important; top: 38% !important; }
    .floating-task:nth-child(5) { left: 3% !important; top: 72% !important; }
    .floating-task:nth-child(6) { left: 48% !important; top: 75% !important; }

    /* Scene 2 */
    #bubble-instruction {
        top: 30px;
    }

    #bubble-instruction p {
        font-size: 15px;
        line-height: 1.4;
    }

    .bubble {
        transform: scale(0.55);
    }

    .bubble .captured-task-label {
        font-size: 8px;
    }

    .detached-task {
        padding: 5px 10px;
        font-size: 9px;
        border-radius: 14px;
    }

    /* Scene 3 - larger girl */
    .scene3-intro {
        top: 25px;
        font-size: 13px;
    }

    #girl-clear {
        top: 42%;
    }

    #girl-calm-image {
        width: 100vw;
        max-width: 500px;
    }

    .calm-message {
        bottom: 12%;
        padding: 0 15px;
    }

    .calm-message p {
        font-size: 18px;
        margin: 6px 0;
    }

    /* Scene 4 */
    #create-prompt {
        top: 10%;
        padding: 0 20px;
    }

    #create-prompt h2 {
        font-size: 28px;
        margin-bottom: 12px;
    }

    #create-prompt p {
        font-size: 14px;
    }

    #floating-canvas-trigger {
        top: 52%;
    }

    #easel-post-trigger {
        height: 30px;
    }

    .canvas-surface {
        width: 200px;
        height: 150px;
    }

    #easel-base-trigger {
        width: 220px;
        height: 12px;
    }

    /* Painting Area */
    #painting-area {
        padding: 15px;
    }

    #painting-container {
        margin-top: 60px;
    }

    #painting-easel-post {
        height: 20px;
    }

    #painting-canvas {
        width: 95vw;
        max-width: 320px;
        border-width: 6px;
    }

    #color-palette {
        margin-top: 25px;
        gap: 12px;
    }

    .color-btn {
        width: 34px;
        height: 34px;
    }

    #download-btn-paint {
        position: relative;
        bottom: auto;
        right: auto;
        margin-top: 25px;
        padding: 12px 24px;
        font-size: 14px;
    }

    #close-painting {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }

    #close-painting svg {
        width: 18px;
        height: 18px;
    }

    /* Scene 5 */
    #final-area {
        padding: 0 20px;
    }

    .final-text {
        font-size: 18px;
        letter-spacing: 1px;
        margin-bottom: 30px;
    }

    #final-preview {
        width: 95vw;
        max-width: 300px;
        margin-bottom: 30px;
        border-width: 6px;
    }

    #download-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .signature {
        margin-top: 30px;
        font-size: 14px;
        letter-spacing: 3px;
    }

    /* Scroll hint */
    .scroll-hint {
        bottom: 20px;
    }

    .scroll-arrow {
        width: 28px;
        height: 28px;
    }

    /* Progress bar thicker on mobile for visibility */
    #progress-bar {
        height: 4px;
    }

    /* Eraser button on mobile */
    .eraser-btn {
        width: 34px;
        height: 34px;
    }

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

    /* Completion message on mobile */
    #completion-message p {
        font-size: 18px;
        padding: 0 15px;
    }
}

/* =============================================
   SMALL MOBILE (360px and below)
   ============================================= */

@media (max-width: 360px) {
    #intro-title h1 {
        font-size: 24px;
    }

    .tagline {
        font-size: 10px;
    }

    /* Scene 1 girl smaller */
    #girl-image {
        width: 55vw;
    }

    #easel {
        transform: scale(0.32);
    }

    #easel-container {
        right: 2%;
        top: 28%;
    }

    .floating-task {
        font-size: 8px;
        padding: 4px 8px;
    }

    /* Scene 3 girl larger */
    #girl-calm-image {
        width: 95vw;
        max-width: 400px;
    }

    .calm-message p {
        font-size: 15px;
    }

    .canvas-surface {
        width: 150px;
        height: 110px;
    }

    #easel-base-trigger {
        width: 170px;
    }

    #painting-canvas {
        max-width: 260px;
    }

    #final-preview {
        max-width: 240px;
    }

    #bubble-instruction p {
        font-size: 13px;
    }
}

/* =============================================
   LANDSCAPE MOBILE
   ============================================= */

@media (max-height: 500px) and (orientation: landscape) {
    .scene {
        min-height: 100vh;
    }

    #intro-title {
        top: 5%;
        left: 3%;
    }

    #intro-title h1 {
        font-size: 36px;
    }

    .tagline {
        font-size: 14px;
        margin-top: 10px;
    }

    #girl-container {
        left: 30%;
        top: 10%;
    }

    #girl-image {
        width: 60vw;
    }

    #easel-container {
        left: 70%;
        top: 50%;
    }

    #easel {
        transform: scale(0.5);
    }

    #paint-prompt {
        bottom: 8%;
        left: 3%;
    }

    /* Scene 3 */
    #girl-calm-image {
        width: 200px;
    }

    .calm-message {
        bottom: 5%;
    }

    .calm-message p {
        font-size: 18px;
    }

    /* Scene 4 */
    #create-prompt {
        top: 8%;
    }

    #create-prompt h2 {
        font-size: 28px;
    }

    .canvas-surface {
        width: 200px;
        height: 140px;
    }

    /* Painting area */
    #painting-container {
        margin-top: 40px;
    }

    #painting-canvas {
        max-width: 50vw;
        max-height: 60vh;
    }

    #color-palette {
        margin-top: 15px;
    }

    .color-btn {
        width: 30px;
        height: 30px;
    }

    #download-btn-paint {
        position: absolute;
        bottom: 15px;
        right: 15px;
        margin-top: 0;
        padding: 10px 18px;
        font-size: 12px;
    }

    /* Scene 5 */
    #final-preview {
        max-width: 40vw;
        max-height: 50vh;
        margin-bottom: 20px;
    }

    .final-text {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .signature {
        margin-top: 20px;
    }

    .scroll-hint {
        bottom: 10px;
    }
}
