/* =========================================
   1. DESIGN TOKENS & VARIABLES
   ========================================= */
:root {
    /* Colors - Romantic & Professional */
    --color-bg-main: #FAFAFA;       /* Clean off-white background */
    --color-bg-card: #FFFFFF;       /* Pure white for cards */
    --color-primary: #FF5A78;       /* Sophisticated rose-pink */
    --color-primary-hover: #E84563; /* Darker rose for interactions */
    --color-primary-light: #FFF0F3; /* Very light pink for backgrounds/accents */
    
    --color-text-heading: #2D2D2D;  /* Near-black for headings */
    --color-text-body: #555555;     /* Dark gray for body text */
    --color-text-muted: #888888;    /* Medium gray for helpers */
    
    --color-border: #EAEAEA;        /* Subtle border color */
    --color-border-focus: #FFB3C1;  /* Focus ring color */
    
    --color-success: #4CAF50;
    --color-error: #F44336;

    /* Spacing & Layout */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 40px;
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
    --shadow-hover: 0 8px 24px rgba(255, 90, 120, 0.15); /* Pink-tinted shadow */

    /* Typography */
    --font-heading: 'Quicksand', sans-serif; /* Friendly but clean */
    --font-body: 'Inter', system-ui, -apple-system, sans-serif; /* Highly readable */
    
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;

    /* Animation Timing */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --dur-fast: 200ms;
    --dur-normal: 300ms;
    --dur-slow: 600ms;
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-main);
    color: var(--color-text-body);
    line-height: 1.6;
    height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #DDD;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #CCC;
}

/* =========================================
   3. COMPONENTS
   ========================================= */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: all var(--dur-fast) var(--ease-smooth);
    cursor: pointer;
    border: none;
    outline: none;
    gap: 8px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 90, 120, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 90, 120, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background-color: white;
    color: var(--color-text-body);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #F5F5F5;
    border-color: #DDD;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Cards */
.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform var(--dur-fast) var(--ease-smooth), box-shadow var(--dur-fast) var(--ease-smooth);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Form Controls */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--color-text-heading);
    margin-bottom: var(--spacing-sm);
    font-size: var(--text-base);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 90, 120, 0.15);
}

/* Custom Radio / Checkbox Tiles */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-md);
}

.choice-tile {
    position: relative;
    cursor: pointer;
}

.choice-tile input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.choice-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--dur-fast) var(--ease-smooth);
    height: 100%;
    text-align: center;
}

.choice-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-muted);
    transition: color var(--dur-fast);
}

.choice-label {
    font-weight: 500;
    color: var(--color-text-body);
}

/* Selected State */
.choice-tile input:checked + .choice-content {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.choice-tile input:checked + .choice-content .choice-icon {
    color: var(--color-primary);
    transform: scale(1.1);
}

.choice-tile:hover .choice-content {
    border-color: #CCC;
    background-color: #FAFAFA;
}

/* =========================================
   4. LAYOUT STRUCTURE
   ========================================= */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md) 0;
}

.brand-logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--color-text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-icon {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

/* Progress Bar */
.progress-container {
    margin-bottom: var(--spacing-xl);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-weight: 500;
}

.progress-track {
    height: 6px;
    background-color: #EAEAEA;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--color-primary);
    width: 0%;
    border-radius: var(--radius-full);
    transition: width 0.6s var(--ease-smooth);
}

/* Main Content Area */
.survey-step {
    flex: 1;
    display: none; /* Hidden by default */
    animation: fadeSlideUp var(--dur-normal) var(--ease-smooth);
}

.survey-step.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.step-header {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.step-title {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-text-heading);
    margin-bottom: var(--spacing-xs);
}

.step-description {
    color: var(--color-text-muted);
    font-size: var(--text-base);
}

/* Footer Navigation */
.step-footer {
    display: flex;
    justify-content: space-between;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

/* =========================================
   5. BUNNY SURPRISE (Character)
   ========================================= */
.bunny-wrapper {
    position: fixed;
    bottom: -10px;
    right: -120px; /* Initially hidden */
    z-index: 1000;
    width: 150px;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Bouncier entrance */
    cursor: pointer;
}

.bunny-wrapper.peek {
    transform: translateX(-140px) rotate(-10deg);
}

.bunny-wrapper.leave {
    transform: translateX(200px) rotate(20deg);
    transition: transform 0.4s ease-in;
}

.speech-bubble {
    position: absolute;
    bottom: 100%;
    right: 20px;
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-right-radius: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text-heading);
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

.bunny-wrapper:hover .speech-bubble,
.bunny-wrapper.speaking .speech-bubble {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Bunny "Alive" Animations */
.bunny-wrapper.peek .bunny-ear-right {
    transform-origin: 50% 100%;
    animation: earTwitch 4s ease-in-out infinite;
}

.bunny-wrapper.peek .bunny-nose {
    transform-origin: center;
    animation: noseTwitch 3s ease-in-out infinite;
}

/* Bunny Eye Blink Animation */
.bunny-wrapper.peek .bunny-eye {
    transform-origin: center;
    transform-box: fill-box;
    animation: eyeBlink 4s ease-in-out infinite;
}

/* Hide the old eyelid approach */
.bunny-eyelid {
    display: none;
}

/* Hover Reaction */
.bunny-wrapper:hover svg g {
    transform: translateY(-2px) scale(1.02);
    transition: transform 0.3s var(--ease-bounce);
}

.bunny-wrapper:hover .bunny-ear-left {
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.bunny-wrapper:hover .bunny-ear-right {
    transform: rotate(5deg);
    transition: transform 0.3s ease;
}

@keyframes earTwitch {
    0%, 85%, 100% { transform: rotate(0deg); }
    88% { transform: rotate(8deg); }
    91% { transform: rotate(-3deg); }
    94% { transform: rotate(5deg); }
    97% { transform: rotate(0deg); }
}

@keyframes noseTwitch {
    0%, 90%, 100% { transform: scale(1); }
    92% { transform: scale(1.1) translateY(-0.5px); }
    94% { transform: scale(1); }
    96% { transform: scale(1.1) translateY(-0.5px); }
    98% { transform: scale(1); }
}

@keyframes eyeBlink {
    0%, 42%, 58%, 100% { transform: scaleY(1); }
    45%, 55% { transform: scaleY(0.1); }
}

/* Eye Sparkle */
.bunny-eye-sparkle {
    display: none !important; /* Sparkle hidden to avoid render artifacts */
}

@keyframes eyeSparkle {
    0%, 70%, 100% { opacity: 0; transform: scale(0); }
    75% { opacity: 1; transform: scale(1); }
    85% { opacity: 1; transform: scale(1.2); }
    90% { opacity: 0; transform: scale(0); }
}

/* Speech Bubble Wobble */
.bunny-wrapper.peek .speech-bubble {
    animation: speechWobble 3s ease-in-out infinite;
}

@keyframes speechWobble {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
    25% { transform: translateY(-2px) scale(1.02) rotate(1deg); }
    50% { transform: translateY(0) scale(1) rotate(0deg); }
    75% { transform: translateY(-1px) scale(1.01) rotate(-1deg); }
}

/* Bunny Wave Animation */
.bunny-wrapper.waving .bunny-arm {
    transform-origin: 100% 50%;
    animation: bunnyWave 0.6s ease-in-out 3;
}

@keyframes bunnyWave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-20deg); }
}

/* Bunny Pointing */
.bunny-wrapper.pointing {
    transform: translateX(-160px) rotate(-15deg) translateY(-20px);
}

.bunny-wrapper.pointing .bunny-arm {
    transform: rotate(-40deg) translateX(-5px);
}

@keyframes bunnyWave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-20deg); }
}

/* =========================================
   6. ANIMATED SVG ICONS (Global)
   ========================================= */
svg {
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.icon-animated:hover {
    transform: scale(1.1);
}

/* =========================================
   7. MINI-GAMES STYLING
   ========================================= */
.game-container {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

/* Memory Game Grid */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
    max-width: 400px;
    margin: 20px auto;
}

.memory-card {
    aspect-ratio: 1;
    background: #F0F0F0;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card-front, .memory-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.memory-card-front {
    background: #F0F0F0;
    color: #AAA;
}

.memory-card-back {
    background: var(--color-primary-light);
    transform: rotateY(180deg);
    border: 2px solid var(--color-primary);
}

/* Secret Progress Indicator */
.secret-progress {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-primary-light);
    transform: translateY(-100px);
    transition: transform 0.5s var(--ease-bounce);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 900;
}

.secret-progress.visible {
    transform: translateY(0);
}

/* Final Reveal Overlay */
.final-reveal-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #FFF0F3, #FFC2D1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

.final-reveal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Add missing styles from previous prompt */
.custom-icon {
    width: 64px;
    height: 64px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    transition: all 0.4s var(--ease-smooth);
}

.choice-tile:hover .custom-icon {
    transform: scale(1.05) translateY(-2px);
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.15));
}

.choice-tile input:checked + .choice-content .custom-icon {
    stroke-width: 2;
    transform: scale(1.1);
}

/* Staggered Entry Animations - Cinematic Pacing */
.stagger-enter {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeSlideUp var(--dur-slow) var(--ease-smooth) forwards;
}

.delay-1 { animation-delay: 200ms; }
.delay-2 { animation-delay: 400ms; }
.delay-3 { animation-delay: 600ms; }
.delay-4 { animation-delay: 800ms; }

/* Soft Press Button Interaction */
.choice-tile:hover .choice-content {
    border-color: #CCC;
    background-color: #FAFAFA;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.choice-tile:active .choice-content {
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.choice-tile input:checked + .choice-content {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
    box-shadow: 0 0 0 1px var(--color-primary);
    transform: translateY(0);
}

.btn:active {
    transform: scale(0.97);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.hint-hidden {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(8px);
    transition: opacity 0.6s var(--ease-smooth), filter 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}

.hint-reveal {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}
.brand-placeholder {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.progress-pill {
    background: #F3F4F6;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* Glitch Button Effect */
.btn-glitch {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.btn-glitch::after {
    content: "UNLOCK?";
    position: absolute;
    inset: 0;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
}

.btn-glitch:hover::after {
    opacity: 1;
    animation: glitch-text 0.45s steps(2, end) 1 forwards;
}

@keyframes glitch-text {
    0% { transform: translateX(-12px); }
    20% { transform: translateX(6px); }
    40% { transform: translateX(-4px); }
    60% { transform: translateX(3px); }
    80% { transform: translateX(-2px); }
    100% { transform: translateX(0); opacity: 0; }
}

/* System Overload Animation */
.system-overload-container {
    font-family: 'Courier New', monospace;
    text-align: center;
    color: #FF5A78;
    position: relative;
    overflow: hidden;
}

/* System Override (premium) */
.system-override {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.system-override::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    z-index: 2;
    pointer-events: none;
}

.system-override::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 50%, rgba(0,0,0,0.4));
    z-index: 3;
    pointer-events: none;
}

.override-glow {
    position: absolute;
    inset: -80px;
    background: radial-gradient(circle at 50% 45%, rgba(255, 50, 80, 0.15), rgba(0,0,0,0));
    animation: overridePulse 2s ease-in-out infinite;
    z-index: 0;
}

.override-panel {
    position: relative;
    padding: 40px 50px;
    border: 2px solid #ff3b3b;
    background: rgba(20, 0, 5, 0.9);
    box-shadow: 0 0 20px rgba(255, 59, 59, 0.3), inset 0 0 20px rgba(255, 59, 59, 0.1);
    z-index: 1;
    width: min(420px, 90vw);
    overflow: hidden;
    animation: cinematicShake 0.4s infinite;
}

.override-title {
    font-size: 2.8rem;
    letter-spacing: 4px;
    margin-bottom: 14px;
    color: #ff3b3b;
    text-shadow: 2px 0 #00ffff, -2px 0 #ff00ff;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    animation: textGlitch 0.3s infinite;
}

.override-tag {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #ff3b3b;
    padding: 4px 12px;
    border: 1px solid #ff3b3b;
    display: inline-block;
    margin-bottom: 20px;
    background: rgba(255, 59, 59, 0.1);
    letter-spacing: 0.1em;
}

.override-bar {
    position: relative;
    width: 100%;
    height: 20px;
    border: 2px solid #ff3b3b;
    background: #1a0505;
    overflow: hidden;
    margin: 0 auto 16px;
}

.override-fill {
    position: absolute;
    inset: 0;
    background: #ff3b3b;
    transform: scaleX(0);
    transform-origin: left;
    animation: overrideFill 2.8s ease-out forwards;
    box-shadow: 0 0 10px #ff3b3b;
}

.override-spark {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 10px #fff;
    animation: overrideSpark 2.8s linear infinite;
    z-index: 2;
}

.status-text {
    color: #ff3b3b;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    animation: blink 0.1s infinite;
}

@keyframes cinematicShake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes textGlitch {
    0% { transform: translate(0); clip-path: inset(0 0 0 0); }
    20% { transform: translate(-2px, 2px); clip-path: inset(10% 0 80% 0); }
    40% { transform: translate(2px, -2px); clip-path: inset(80% 0 10% 0); }
    60% { transform: translate(-2px, 0); clip-path: inset(40% 0 40% 0); }
    80% { transform: translate(2px, 2px); clip-path: inset(0 0 0 0); }
    100% { transform: translate(0); clip-path: inset(0 0 0 0); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes glitch-anim-1 {
    0% { clip-path: polygon(0 2%, 100% 2%, 100% 5%, 0 5%); }
    20% { clip-path: polygon(0 15%, 100% 15%, 100% 15%, 0 15%); }
    40% { clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%); }
    60% { clip-path: polygon(0 1%, 100% 1%, 100% 2%, 0 2%); }
    80% { clip-path: polygon(0 33%, 100% 33%, 100% 33%, 0 33%); }
    100% { clip-path: polygon(0 44%, 100% 44%, 100% 44%, 0 44%); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: polygon(0 2%, 100% 2%, 100% 5%, 0 5%); }
    20% { clip-path: polygon(0 15%, 100% 15%, 100% 15%, 0 15%); }
    40% { clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%); }
    60% { clip-path: polygon(0 1%, 100% 1%, 100% 2%, 0 2%); }
    80% { clip-path: polygon(0 33%, 100% 33%, 100% 33%, 0 33%); }
    100% { clip-path: polygon(0 44%, 100% 44%, 100% 44%, 0 44%); }
}

@keyframes load-fill {
    0% { width: 0%; }
    20% { width: 10%; }
    40% { width: 60%; }
    60% { width: 65%; }
    80% { width: 90%; }
    100% { width: 100%; }
}

@keyframes fuseFill {
    0% { transform: scaleX(0); }
    20% { transform: scaleX(0.25); }
    50% { transform: scaleX(0.6); }
    80% { transform: scaleX(0.95); }
    100% { transform: scaleX(1); }
}

@keyframes fuseSpark {
    0% { transform: translateX(0); opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateX(300px); opacity: 0; }
}

@keyframes overrideFill {
    0% { transform: scaleX(0); }
    25% { transform: scaleX(0.3); }
    60% { transform: scaleX(0.75); }
    100% { transform: scaleX(1); }
}

@keyframes overrideSpark {
    0% { transform: translateX(0); opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translateX(306px); opacity: 0; }
}

@keyframes overridePulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.7; }
}

@keyframes overrideScan {
    0% { transform: translateY(-100%); opacity: 0; }
    30% { opacity: 0.35; }
    100% { transform: translateY(120%); opacity: 0; }
}

@keyframes overrideGlow {
    0%, 100% { text-shadow: 0 0 18px rgba(255, 90, 120, 0.35); }
    50% { text-shadow: 0 0 32px rgba(255, 90, 120, 0.65); }
}

@keyframes overrideGlitch {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-1px, 0); }
    20% { transform: translate(2px, -1px); }
    30% { transform: translate(-1px, 1px); }
    40% { transform: translate(1px, 0); }
    50% { transform: translate(0, 0); }
    60% { transform: translate(2px, 0); }
    70% { transform: translate(-2px, -1px); }
    80% { transform: translate(1px, 1px); }
    90% { transform: translate(-1px, 0); }
    100% { transform: translate(0, 0); }
}

@keyframes overrideJitter {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-1px, 0) rotate(-0.2deg); }
    30% { transform: translate(1px, -1px) rotate(0.15deg); }
    50% { transform: translate(-2px, 1px) rotate(-0.1deg); }
    70% { transform: translate(2px, 0) rotate(0.2deg); }
    90% { transform: translate(-1px, -1px) rotate(-0.15deg); }
}

@keyframes overrideShake {
    0%, 100% { transform: translate(0, 0); filter: brightness(1); }
    2% { transform: translate(-4px, 2px); }
    4% { transform: translate(4px, -1px); filter: brightness(1.1); }
    6% { transform: translate(-2px, 0); }
    8% { transform: translate(0, 0); filter: brightness(0.95); }
    20% { transform: translate(0, 0); }
    22% { transform: translate(3px, -2px); filter: brightness(1.15); }
    24% { transform: translate(-5px, 1px); }
    26% { transform: translate(2px, 0); filter: brightness(1); }
    40% { transform: translate(0, 0); }
    42% { transform: translate(-3px, -1px); filter: brightness(0.9); }
    44% { transform: translate(4px, 2px); }
    46% { transform: translate(-1px, 0); filter: brightness(1.1); }
    60% { transform: translate(0, 0); filter: brightness(1); }
    80% { transform: translate(0, 0); }
    82% { transform: translate(2px, -1px); filter: brightness(1.2); }
    84% { transform: translate(-4px, 0); }
    86% { transform: translate(1px, 1px); filter: brightness(0.95); }
}

@keyframes overrideSweep {
    0% { transform: translateX(-120%); opacity: 0; }
    40% { opacity: 0.5; }
    100% { transform: translateX(120%); opacity: 0; }
}

@keyframes overrideMicroJitter {
    0%, 100% { transform: translate(0, 0); }
    15% { transform: translate(0.5px, 0); }
    35% { transform: translate(-0.5px, 0.5px); }
    55% { transform: translate(0.5px, -0.5px); }
    75% { transform: translate(-0.5px, 0); }
}

@keyframes screenFlicker {
    0%, 100% { opacity: 1; }
    3% { opacity: 0.85; }
    6% { opacity: 1; }
    42% { opacity: 1; }
    44% { opacity: 0.7; }
    46% { opacity: 1; }
    78% { opacity: 1; }
    80% { opacity: 0.9; }
    82% { opacity: 0.75; }
    84% { opacity: 1; }
}

/* =========================================
   11. CYBER BREACH TERMINAL
   ========================================= */
.terminal-breach {
    position: fixed;
    inset: 0;
    background-color: #050000;
    font-family: 'Courier New', monospace;
    color: #FF003C;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.terminal-bg {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 60, 0.06), rgba(255, 0, 60, 0.02), rgba(255, 0, 60, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 1;
}

.terminal-console {
    position: relative;
    width: 80%;
    max-width: 800px;
    height: 60vh;
    border: 2px solid #FF003C;
    background: rgba(10, 0, 0, 0.9);
    padding: 20px;
    box-shadow: 0 0 20px rgba(255, 0, 60, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.terminal-header {
    border-bottom: 1px solid #FF003C;
    padding-bottom: 10px;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 5px #FF003C;
    display: flex;
    justify-content: space-between;
}

.terminal-logs {
    flex: 1;
    overflow-y: hidden;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #FF69B4;
    text-shadow: 0 0 2px #FF69B4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.log-line {
    margin-bottom: 4px;
    opacity: 0.8;
}

.terminal-progress-container {
    margin-top: 20px;
    border: 1px solid #FF003C;
    height: 30px;
    position: relative;
    background: #1a0005;
}

.terminal-progress-bar {
    height: 100%;
    background: #FF003C;
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px #FF003C;
}

.terminal-status {
    margin-top: 10px;
    text-align: right;
    font-size: 1rem;
    color: #FFF;
    font-weight: bold;
}

.crt-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 10;
}

.scanline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 0, 60, 0.3);
    opacity: 0.4;
    animation: scanlineMove 3s linear infinite;
    pointer-events: none;
    z-index: 11;
}

@keyframes scanlineMove {
    0% { top: -5%; }
    100% { top: 105%; }
}

.glitch-text {
    animation: textGlitch 0.3s infinite;
}

.success-flash {
    animation: flashWhite 0.5s ease-out forwards;
}

@keyframes flashWhite {
    0% { background-color: white; }
    100% { background-color: transparent; }
}

.letter-slots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.letter-slot {
    width: 50px;
    height: 60px;
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: #FAFAFA;
}

.letter-slot.drag-over {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    transform: scale(1.05);
}

.letter-bank {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 70px;
    padding: 16px;
    background: #F5F5F5;
    border-radius: 12px;
}

.letter-tile {
    width: 50px;
    height: 60px;
    background: white;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    cursor: grab;
    transition: all 0.2s ease;
    user-select: none;
}

.letter-tile:hover {
    transform: translateY(-4px) rotate(-2deg);
    box-shadow: 0 8px 20px rgba(255, 90, 120, 0.25);
}

.letter-tile.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.letter-tile.in-slot {
    cursor: pointer;
}

/* =========================================
   9. EPIC REVEAL OVERLAY
   ========================================= */
.epic-reveal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    opacity: 0;
    transition: opacity 1s ease;
    overflow: hidden;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23FF5A78'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") 12 12, auto;
}

.epic-reveal.active {
    opacity: 1;
}

.reveal-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 90, 120, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #1a0a0e 0%, #2d1015 50%, #1a0a0e 100%);
}

.reveal-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.reveal-name {
    font-family: 'Quicksand', cursive;
    font-size: 4rem;
    font-weight: 700;
    color: #FF5A78;
    text-shadow: 0 0 60px rgba(255, 90, 120, 0.5);
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-name.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Typewriter Cursor */
.typewriter-cursor {
    animation: cursorBlink 0.8s infinite;
    color: #FF5A78;
    font-weight: 300;
}

.reveal-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease 0.2s;
}

.reveal-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Relationship Timer */
.relationship-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.8s ease;
}

.relationship-timer.visible {
    opacity: 1;
    transform: translateY(0);
}

.timer-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.timer-value {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #FF8BA7;
    text-shadow: 0 0 20px rgba(255, 139, 167, 0.5);
}

/* Polaroid Gallery */
.polaroid-gallery {
    display: flex;
    gap: 20px;
    margin: 40px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.polaroid {
    background: white;
    padding: 10px 10px 40px 10px;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    transform: rotate(-5deg) translateY(50px);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.polaroid.p2 { transform: rotate(3deg) translateY(50px); }
.polaroid.p3 { transform: rotate(-8deg) translateY(50px); }

.polaroid.visible {
    opacity: 1;
    transform: rotate(-5deg) translateY(0);
}

.polaroid.visible.p2 { transform: rotate(3deg) translateY(0); }
.polaroid.visible.p3 { transform: rotate(-8deg) translateY(0); }

.polaroid-img {
    width: 150px;
    height: 150px;
    border-radius: 2px;
    /* Replace gradient with actual photo using: background-image: url('photo.jpg'); background-size: cover; */
}

.polaroid-caption {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-family: 'Quicksand', cursive;
    font-size: 0.9rem;
    color: #333;
}

.reveal-question {
    margin: 30px 0;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s ease;
}

.reveal-question.visible {
    opacity: 1;
    transform: scale(1);
}

.reveal-question p {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
}

.reveal-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.btn-reveal-yes,
.btn-reveal-no {
    border: none;
    padding: 16px 46px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Quicksand', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.btn-reveal-yes {
    background: linear-gradient(135deg, #FF5A78 0%, #FF8BA7 100%);
    color: white;
    box-shadow: 0 10px 40px rgba(255, 90, 120, 0.4);
}

.btn-reveal-no {
    background: rgba(255,255,255,0.08);
    color: #FFDDE7;
    border: 1px solid rgba(255,255,255,0.25);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.btn-reveal-yes.visible,
.btn-reveal-no.visible {
    opacity: 1;
    transform: translateY(0);
}

.btn-reveal-yes.visible {
    animation: pulse-glow 2s infinite;
}

.btn-reveal-yes:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 50px rgba(255, 90, 120, 0.6);
}

.btn-reveal-no:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.4);
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 10px 40px rgba(255, 90, 120, 0.4); }
    50% { box-shadow: 0 10px 60px rgba(255, 90, 120, 0.7); }
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* =========================================
   10. CELEBRATION
   ========================================= */
#fireworks-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.celebration {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #2d1015 0%, #1a0a0e 100%);
    position: relative;
    overflow: hidden;
}

.celebration-text {
    font-family: 'Quicksand', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: #FF5A78;
    text-shadow: 0 0 80px rgba(255, 90, 120, 0.8);
    animation: heartbeat 1.5s ease-in-out infinite;
}

.celebration-sub {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 16px;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.1); }
    30% { transform: scale(1); }
    45% { transform: scale(1.05); }
}

.hearts-explosion {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.floating-heart {
    position: absolute;
    bottom: -50px;
    width: 30px;
    height: 30px;
    color: #FF5A78;
    animation: float-up 4s ease-out forwards;
}

.floating-heart svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(255, 90, 120, 0.5));
}

@keyframes float-up {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--drift)) rotate(360deg) scale(1);
        opacity: 0;
    }
}
