:root {
    /* Muted Pastel Valentine Palette */
    --bg-color: #Fdf0f0;
    /* Light dusty background */
    --primary: #D88383;
    /* Muted rose red */
    --secondary: #FFF9F9;
    /* Warm cream white */
    --accent: #F4C2C2;
    /* Soft blush pink */
    --text-color: #4A3B3B;
    /* Dark brownish red */
    --border-color: #4A3B3B;
    /* Sharp contrast for pixel art */

    --pixel-size: 4px;
    /* Base unit for "pixel" look */
}

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

body {
    font-family: 'Press Start 2P', system-ui, sans-serif;
    /* Flat Valentine sky — no gradient */
    background: #fdf0f0;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    image-rendering: pixelated;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Utilities */
.hidden {
    display: none !important;
}

.game-container {
    width: 100%;
    max-width: 640px;
    /* Standard retro width */
    margin: 0 auto;
    text-align: center;
}

/* Screen Layouts */
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    /* 8px grid * 4 */
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
h1.pixel-title {
    font-size: 24px;
    color: var(--primary);
    text-shadow: 2px 2px 0px var(--border-color);
    /* Retro shadow */
    margin-bottom: 16px;
    line-height: 1.4;
}

p {
    font-size: 12px;
    /* Readable pixel font size */
    margin-bottom: 16px;
}

/* ========================================
   NPC DIALOG BOX — Google Doodle Style
   ======================================== */
.pixel-box {
    background: rgba(255, 249, 249, 0.95);
    border: 4px solid var(--border-color);
    border-radius: 12px;
    padding: 28px;
    width: 100%;
    position: relative;
    /* Double border via outline */
    outline: 3px solid var(--accent);
    outline-offset: -8px;
    /* Retro drop shadow + inner glow */
    box-shadow:
        6px 6px 0px rgba(74, 59, 59, 0.15),
        inset 0 0 20px rgba(244, 194, 194, 0.25);
}

/* Speech triangle tail — bottom center */
.pixel-box::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 16px solid var(--border-color);
    filter: drop-shadow(2px 2px 0px rgba(74, 59, 59, 0.1));
}

/* Inner triangle (creates the double-border effect on the tail) */
.pixel-box::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid rgba(255, 249, 249, 0.95);
    z-index: 2;
}

.intro-box {
    text-align: center;
}

.intro-box p:last-child {
    margin-bottom: 0;
}

/* Buttons — Retro with rounded dialog corners */
.pixel-btn {
    font-family: 'Press Start 2P', cursive;
    background: var(--primary);
    color: white;
    border: 4px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 24px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 4px 4px 0px var(--border-color);
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
    outline: 2px solid var(--accent);
    outline-offset: -6px;
}

.pixel-btn:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--border-color);
    background: var(--accent);
    color: var(--text-color);
}

.pixel-btn:active {
    transform: translate(4px, 4px);
    box-shadow: 0px 0px 0px var(--border-color);
}

/* HUD */
.hud {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--accent);
    margin-bottom: 16px;
}

.score-label {
    font-size: 12px;
    color: var(--primary);
    text-shadow: 1px 1px 0px rgba(74, 59, 59, 0.15);
}

/* Letter Graphic */
.pixel-letter-icon {
    margin: 20px 0;
}

.letter-graphic {
    width: 128px;
    height: 96px;
    background: var(--secondary);
    border: 4px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    margin: 0 auto;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.1);
}

/* Simple CSS envelope drawing */
.envelope-back {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    border-bottom: 48px solid var(--accent);
    /* Height of flap */
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    opacity: 0.5;
    z-index: 1;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 48px solid var(--primary);
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    z-index: 2;
    transform-origin: top;
}

.heart-seal {
    position: absolute;
    top: 36px;
    left: 50%;
    transform: translateX(-50%);
    color: #cc0000;
    font-size: 24px;
    z-index: 3;
    text-shadow: 2px 2px 0px white;
}

/* Question Area — Dialog box for question screen */
.question-container {
    width: 100%;
}

.question-text {
    font-size: 14px;
    margin-bottom: 32px;
    min-height: 40px;
    line-height: 2.5;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
}

/* Option buttons — lighter dialog variant, no speech tail */
.option-btn {
    background: rgba(255, 249, 249, 0.9);
    color: var(--text-color);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-size: 10px;
    cursor: pointer;
    text-align: left;
    box-shadow: 3px 3px 0px rgba(74, 59, 59, 0.15);
    font-family: 'Press Start 2P', cursive;
    transition: all 0.1s;
    outline: 2px solid var(--accent);
    outline-offset: -5px;
    line-height: 1.7;
}

.option-btn:hover {
    background: var(--accent);
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0px rgba(74, 59, 59, 0.2);
    outline-color: var(--primary);
}

.option-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px rgba(74, 59, 59, 0.15);
}

/* Final Letter — same dialog box, left-aligned */
.final-letter-box {
    text-align: left;
    padding: 32px;
    max-height: 60vh;
    overflow-y: auto;
}

.final-letter-box::after,
.final-letter-box::before {
    display: none;
}

.letter-content {
    font-family: 'Courier New', monospace;
    /* More readable for long text, still retro */
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    font-weight: bold;
}

.signature {
    margin-top: 32px;
    text-align: right;
    font-style: italic;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(74, 59, 59, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-box {
    max-width: 400px;
    text-align: center;
    /* Speech triangle points down from modal too */
}

/* ========================================
   REASONS SCREEN
   ======================================== */
.reasons-box {
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reason-text {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 0;
    animation: reasonSlideIn 0.4s ease;
}

@keyframes reasonSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   PROPOSAL SCREEN
   ======================================== */
.proposal-box {
    text-align: center;
    margin-top: 8px;
}

.proposal-question {
    font-size: 16px;
    margin-bottom: 24px;
    color: var(--primary);
    text-shadow: 1px 1px 0px rgba(74, 59, 59, 0.15);
}

.proposal-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Yes button — warm green/gold accent */
.yes-btn {
    background: #7cb87c;
    border-color: #3a5a3a;
    box-shadow: 4px 4px 0px #3a5a3a;
    outline-color: #a8d8a8;
}

.yes-btn:hover {
    background: #a8d8a8;
    color: #2a3a2a;
    box-shadow: 2px 2px 0px #3a5a3a;
}

/* No button — muted, less prominent */
.no-btn {
    background: var(--accent);
    border-color: var(--border-color);
    font-size: 12px;
    padding: 12px 20px;
    opacity: 0.75;
}

.no-btn:hover {
    opacity: 1;
    background: var(--primary);
    color: white;
}

/* ========================================
   CELEBRATION OVERLAY
   ======================================== */
.celebration-box {
    max-width: 480px;
    position: relative;
    z-index: 10;
    animation: celebrationPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.celebration-title {
    font-size: 20px;
    animation: celebrationPulse 1.5s ease-in-out infinite;
}

.celebration-emoji {
    font-size: 40px;
    margin-bottom: 16px;
    font-family: system-ui, sans-serif;
}

@keyframes celebrationPop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes celebrationPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        text-shadow: 2px 2px 0px var(--border-color), 0 0 20px rgba(216, 131, 131, 0.4);
    }
}

/* Confetti container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

/* Heart-shaped confetti variant */
.confetti-heart {
    width: auto;
    height: auto;
    background: none !important;
    font-size: 16px;
    line-height: 1;
    font-family: system-ui, sans-serif;
}

/* ========================================
   REJECTION MODAL
   ======================================== */
.rejection-box {
    animation: rejectShake 0.5s ease;
}

.rejection-emoji {
    font-size: 48px;
    margin-bottom: 8px;
    font-family: system-ui, sans-serif;
}

@keyframes rejectShake {

    0%,
    100% {
        transform: translateX(0);
    }

    15% {
        transform: translateX(-8px) rotate(-2deg);
    }

    30% {
        transform: translateX(8px) rotate(2deg);
    }

    45% {
        transform: translateX(-6px) rotate(-1deg);
    }

    60% {
        transform: translateX(6px) rotate(1deg);
    }

    75% {
        transform: translateX(-3px);
    }

    90% {
        transform: translateX(3px);
    }
}

@media (min-width: 600px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
        /* 2 columns on desktop */
    }
}

/* ========================================
   MARIO-STYLE STATIC BACKGROUND
   ======================================== */

.mario-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    image-rendering: pixelated;
}

/* ---------- CLOUDS ---------- */
.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    border: 3px solid rgba(74, 59, 59, 0.12);
    border-radius: 50px;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border: inherit;
    border-radius: 50%;
}

.cloud-1 {
    width: 120px;
    height: 48px;
    top: 8%;
    left: 10%;
}

.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 20px;
}

.cloud-1::after {
    width: 40px;
    height: 40px;
    top: -18px;
    left: 55px;
}

.cloud-2 {
    width: 100px;
    height: 40px;
    top: 12%;
    right: 15%;
}

.cloud-2::before {
    width: 44px;
    height: 44px;
    top: -22px;
    left: 15px;
}

.cloud-2::after {
    width: 36px;
    height: 36px;
    top: -16px;
    left: 48px;
}

.cloud-3 {
    width: 80px;
    height: 32px;
    top: 18%;
    left: 55%;
}

.cloud-3::before {
    width: 36px;
    height: 36px;
    top: -18px;
    left: 10px;
}

.cloud-3::after {
    width: 28px;
    height: 28px;
    top: -12px;
    left: 38px;
}

/* ---------- HILLS ---------- */
.hill {
    position: absolute;
    bottom: 64px;
    /* sits on top of ground */
    border-radius: 50% 50% 0 0;
    border: 3px solid rgba(74, 59, 59, 0.1);
    border-bottom: none;
}

.hill-1 {
    width: 280px;
    height: 90px;
    left: -40px;
    background: linear-gradient(180deg, #f4c2c2 0%, #e8b4b8 100%);
    opacity: 0.6;
}

.hill-2 {
    width: 200px;
    height: 65px;
    right: 5%;
    background: linear-gradient(180deg, #f0d0d0 0%, #e8b4b8 100%);
    opacity: 0.5;
}

.hill-3 {
    width: 320px;
    height: 100px;
    left: 35%;
    background: linear-gradient(180deg, #f4c2c2 0%, #d88383 100%);
    opacity: 0.35;
}

/* ---------- QUESTION BLOCKS ---------- */
.q-block {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--accent);
    border: 4px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #cc0000;
    box-shadow:
        inset -3px -3px 0px rgba(74, 59, 59, 0.15),
        inset 3px 3px 0px rgba(255, 255, 255, 0.3),
        3px 3px 0px rgba(74, 59, 59, 0.12);
    animation: blockBob 3s ease-in-out infinite;
}

/* Rivets / corner dots */
.q-block::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 4px;
    height: 4px;
    background: var(--border-color);
    border-radius: 1px;
    box-shadow:
        22px 0 0 var(--border-color),
        0 22px 0 var(--border-color),
        22px 22px 0 var(--border-color);
}

.q-block-1 {
    top: 30%;
    left: 8%;
    animation-delay: 0s;
}

.q-block-2 {
    top: 25%;
    right: 10%;
    animation-delay: 1s;
}

.q-block-3 {
    top: 45%;
    left: 75%;
    animation-delay: 2s;
}

.q-block-4 {
    top: 15%;
    left: 40%;
    animation-delay: 0.5s;
}

.q-block-5 {
    top: 55%;
    left: 20%;
    animation-delay: 1.5s;
}

.q-block-6 {
    top: 35%;
    right: 30%;
    animation-delay: 2.5s;
}

.q-block-7 {
    top: 60%;
    right: 18%;
    animation-delay: 0.8s;
}

@keyframes blockBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* ---------- PIPES ---------- */
.pipe {
    position: absolute;
    bottom: 64px;
    /* sits on ground */
}

.pipe-top {
    width: 56px;
    height: 24px;
    background: linear-gradient(90deg, #d88383 0%, #f4c2c2 40%, #d88383 100%);
    border: 4px solid var(--border-color);
    border-radius: 4px 4px 0 0;
    margin-left: -6px;
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.2);
}

.pipe-body {
    width: 44px;
    height: 60px;
    background: linear-gradient(90deg, #d88383 0%, #f4c2c2 35%, #d88383 100%);
    border: 4px solid var(--border-color);
    border-top: none;
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.2);
}

.pipe-1 {
    left: 5%;
}

.pipe-1 .pipe-body {
    height: 50px;
}

.pipe-2 {
    right: 8%;
}

.pipe-2 .pipe-body {
    height: 80px;
}

/* ---------- GROUND (BRICK PLATFORM) ---------- */
.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background: var(--primary);
    border-top: 4px solid var(--border-color);
}

.ground-bricks {
    width: 100%;
    height: 100%;
    background-image:
        /* Horizontal mortar lines */
        linear-gradient(0deg,
            transparent 0px,
            transparent 28px,
            rgba(74, 59, 59, 0.2) 28px,
            rgba(74, 59, 59, 0.2) 32px,
            transparent 32px),
        /* Vertical mortar lines - row 1 (staggered) */
        linear-gradient(90deg,
            transparent 0px,
            transparent 60px,
            rgba(74, 59, 59, 0.15) 60px,
            rgba(74, 59, 59, 0.15) 64px,
            transparent 64px);
    background-size: 64px 32px;
}

/* ========================================
   PIXEL CHARACTERS — Google Doodle Style
   ======================================== */

.pixel-char {
    position: absolute;
    bottom: 64px;
    /* sits on ground */
    width: 32px;
    height: 48px;
    transition: left 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), right 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    image-rendering: pixelated;
    animation: charIdle 2s ease-in-out infinite;
}

/* Idle breathing animation */
@keyframes charIdle {

    0%,
    100% {
        transform: translateY(0) scaleY(1);
    }

    50% {
        transform: translateY(1px) scaleY(0.98);
    }
}

/* --- Shared Parts Structure --- */
.pixel-char .char-head {
    width: 20px;
    height: 18px;
    background: #FFDFC4;
    /* Warm skin tone */
    border: 3px solid var(--border-color);
    border-radius: 4px;
    /* Soft pixel look */
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: inset -2px -2px 0 rgba(74, 59, 59, 0.1);
    z-index: 3;
}

/* Eyes (using pseudo-elements) */
.pixel-char .char-head::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 3px;
    width: 3px;
    height: 3px;
    background: var(--text-color);
    box-shadow: 8px 0 0 var(--text-color);
    /* Right eye */
}

/* Blush checks */
.pixel-char .char-head::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 1px;
    width: 3px;
    height: 2px;
    background: rgba(244, 194, 194, 0.6);
    /* Soft blush */
    box-shadow: 12px 0 0 rgba(244, 194, 194, 0.6);
}

.pixel-char .char-body {
    width: 20px;
    height: 18px;
    /* Slightly taller for better proportion */
    border: 3px solid var(--border-color);
    position: absolute;
    top: 15px;
    /* Neck overlap */
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.pixel-char .char-legs {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    z-index: 1;
}

/* Legs geometry */
.pixel-char .char-legs::before,
.pixel-char .char-legs::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 100%;
    background: var(--border-color);
    bottom: 0;
}

.pixel-char .char-legs::before {
    left: 0;
}

.pixel-char .char-legs::after {
    right: 0;
}

.pixel-char .char-hair {
    position: absolute;
    z-index: 4;
}

/* --- GIRL CHARACTER (Left) --- */
.char-girl {
    left: 12%;
}

.char-girl .char-body {
    background: var(--primary);
    /* Rose dress */
    border-radius: 6px 6px 4px 4px;
    /* White collar detail */
    box-shadow: inset 0 2px 0 var(--secondary);
}

/* Skirt flow using pseudo-element on body */
.char-girl .char-body::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    height: 4px;
    background: rgba(0, 0, 0, 0.1);
    /* Belt/detail */
}

.char-girl .char-hair {
    width: 24px;
    height: 20px;
    background: #5D4037;
    /* Dark brown */
    border: 3px solid var(--border-color);
    border-radius: 10px 10px 4px 4px;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
}

/* Bangs */
.char-girl .char-hair::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 2px;
    width: 6px;
    height: 6px;
    background: #5D4037;
    box-shadow: 4px 0 0 #5D4037, 8px 0 0 #5D4037;
}

/* Red Bow */
.char-girl .char-hair::after {
    content: '';
    position: absolute;
    top: -6px;
    right: -2px;
    width: 10px;
    height: 6px;
    background: #cc0000;
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

.char-girl .char-legs::before,
.char-girl .char-legs::after {
    background: var(--primary);
    /* Tights matching dress or dark */
    border: 2px solid var(--border-color);
    width: 6px;
}

/* --- BOY CHARACTER (Right) --- */
.char-boy {
    right: 15%;
}

.char-boy .char-body {
    background: var(--secondary);
    /* Cream shirt */
    border-radius: 4px;
    /* Suspender/Button detail */
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* Pants - using bottom half of body or legs? 
   Let's make the legs look like pants + body having a belt */
.char-boy .char-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--text-color);
    /* Dark pants start */
}

.char-boy .char-hair {
    width: 22px;
    height: 8px;
    background: #3E2723;
    /* Very dark brown */
    border-top: 3px solid var(--border-color);
    border-left: 3px solid var(--border-color);
    border-right: 3px solid var(--border-color);
    border-radius: 6px 6px 0 0;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
}

/* Spiky top hair */
.char-boy .char-hair::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 4px;
    width: 6px;
    height: 6px;
    background: #3E2723;
    box-shadow: 6px 1px 0 #3E2723;
    border-radius: 2px;
}

.char-boy .char-legs::before,
.char-boy .char-legs::after {
    background: var(--text-color);
    /* Dark pants */
    border: 2px solid var(--border-color);
    /* Pant legs */
    width: 7px;
}

/* --- ANIMATIONS --- */

@keyframes charHop {
    0% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-24px) scaleY(1.05);
    }

    100% {
        transform: translateY(0) scaleY(0.95);
    }

    /* Landing squash */
}

.pixel-char.hopping {
    animation: charHop 0.5s ease;
}

/* Merging bodies for hug */
.pixel-char.hugging {
    animation: hugPulse 2s infinite ease-in-out;
    z-index: 20;
}

.pixel-char.hugging .char-head {
    transform: translateX(-50%) rotate(5deg);
    /* Lean in head */
}

.char-boy.hugging .char-head {
    transform: translateX(-50%) rotate(-5deg);
}

@keyframes hugPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Hearts Container */
.char-hearts {
    position: absolute;
    bottom: 64px;
    left: 0;
    width: 100%;
    height: 250px;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

.char-heart {

    position: absolute;
    top: -20px;
    font-size: 14px;
    animation: heartDrop 2s ease-in forwards;
    font-family: system-ui, sans-serif;
}

@keyframes heartDrop {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        transform: translateY(180px) scale(0.5);
        opacity: 0;
    }
}

/* ========================================
   HOT AIR BALLOONS
   ======================================== */

.hot-air-balloon {
    position: absolute;
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: balloonFloat 6s ease-in-out infinite;
    z-index: 0;
}

.balloon-1 {
    top: 6%;
    left: 22%;
    animation-delay: 0s;
}

.balloon-2 {
    top: 10%;
    right: 18%;
    animation-delay: 3s;
    transform: scale(0.85);
}

/* Balloon envelope (the big rounded part) */
.balloon-envelope {
    width: 64px;
    height: 72px;
    background: var(--primary);
    border: 4px solid var(--border-color);
    border-radius: 50% 50% 30% 30%;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset -4px -4px 0px rgba(74, 59, 59, 0.12),
        inset 4px 4px 0px rgba(255, 255, 255, 0.2),
        3px 3px 0px rgba(74, 59, 59, 0.1);
}

/* Stripes on the balloon */
.balloon-stripe {
    position: absolute;
    width: 100%;
    height: 14px;
}

.balloon-stripe.stripe-1 {
    top: 12px;
    background: var(--accent);
}

.balloon-stripe.stripe-2 {
    top: 32px;
    background: var(--secondary);
}

.balloon-stripe.stripe-3 {
    top: 52px;
    background: var(--accent);
}

/* Ropes from envelope to basket */
.balloon-rope {
    position: absolute;
    top: 72px;
    width: 2px;
    height: 20px;
    background: var(--border-color);
}

.balloon-rope.rope-left {
    left: 22px;
}

.balloon-rope.rope-right {
    right: 22px;
}

/* Basket */
.balloon-basket {
    width: 28px;
    height: 16px;
    background: #c9a06c;
    border: 3px solid var(--border-color);
    border-radius: 0 0 4px 4px;
    margin-top: 18px;
    box-shadow:
        inset -2px -2px 0px rgba(74, 59, 59, 0.1),
        inset 2px 2px 0px rgba(255, 255, 255, 0.15),
        2px 2px 0px rgba(74, 59, 59, 0.08);
    /* Wicker pattern */
    background-image:
        linear-gradient(90deg, rgba(74, 59, 59, 0.1) 1px, transparent 1px),
        linear-gradient(0deg, rgba(74, 59, 59, 0.1) 1px, transparent 1px);
    background-size: 4px 4px;
}

/* Dangling card below the basket */
.balloon-card {
    margin-top: 6px;
    background: var(--secondary);
    border: 3px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 10px;
    width: 90px;
    text-align: center;
    position: relative;
    box-shadow:
        3px 3px 0px rgba(74, 59, 59, 0.1),
        inset 0 0 8px rgba(244, 194, 194, 0.15);
    animation: cardSwing 4s ease-in-out infinite;
}

/* String from basket to card */
.balloon-card::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 8px;
    background: var(--border-color);
}

.balloon-card p {
    font-family: 'Press Start 2P', cursive;
    font-size: 6px;
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

/* Balloon 2 uses a different color scheme */
.balloon-2 .balloon-envelope {
    background: var(--accent);
}

.balloon-2 .balloon-stripe.stripe-1 {
    background: var(--primary);
}

.balloon-2 .balloon-stripe.stripe-2 {
    background: #f0d0d0;
}

.balloon-2 .balloon-stripe.stripe-3 {
    background: var(--primary);
}

/* Float animation */
@keyframes balloonFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }
}

.balloon-2 {
    animation: balloonFloat2 6s ease-in-out infinite;
    animation-delay: 3s;
}

@keyframes balloonFloat2 {

    0%,
    100% {
        transform: scale(0.85) translateY(0px);
    }

    50% {
        transform: scale(0.85) translateY(-10px);
    }
}

/* Card swing animation */
@keyframes cardSwing {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(2deg);
    }

    75% {
        transform: rotate(-2deg);
    }
}

/* Inner highlight on ground for depth */
.ground::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   PIXEL BUTTERFLIES - Background Layer
   ======================================== */

.butterfly-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.game-container {
    position: relative;
    z-index: 1;
}

/* Each butterfly is a small container that drifts across the screen */
.pixel-butterfly {
    position: absolute;
    width: 24px;
    height: 20px;
    image-rendering: pixelated;
    opacity: 0;
    animation: butterflyFloat linear infinite, butterflyFadeIn 1s ease forwards;
}

/* Butterfly built from CSS pixel art */
.pixel-butterfly .wing-left,
.pixel-butterfly .wing-right {
    position: absolute;
    top: 0;
    width: 10px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 2px;
    animation: wingFlap 0.3s ease-in-out infinite alternate;
}

.pixel-butterfly .wing-left {
    left: 0;
    transform-origin: right center;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 2px;
}

.pixel-butterfly .wing-right {
    right: 0;
    transform-origin: left center;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 2px;
    animation-delay: 0.05s;
}

.pixel-butterfly .body {
    position: absolute;
    left: 50%;
    top: 2px;
    width: 4px;
    height: 14px;
    background: var(--border-color);
    transform: translateX(-50%);
    border-radius: 1px;
}

/* Antennae */
.pixel-butterfly .antenna-left,
.pixel-butterfly .antenna-right {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 6px;
    background: var(--border-color);
}

.pixel-butterfly .antenna-left {
    left: 8px;
    transform: rotate(-25deg);
}

.pixel-butterfly .antenna-right {
    right: 8px;
    transform: rotate(25deg);
}

/* Color Variants — using the palette */
.pixel-butterfly.color-rose .wing-left,
.pixel-butterfly.color-rose .wing-right {
    background: var(--primary);
    /* D88383 */
}

.pixel-butterfly.color-blush .wing-left,
.pixel-butterfly.color-blush .wing-right {
    background: var(--accent);
    /* F4C2C2 */
}

.pixel-butterfly.color-cream .wing-left,
.pixel-butterfly.color-cream .wing-right {
    background: #e8b4b8;
    /* between primary and accent */
}

.pixel-butterfly.color-soft .wing-left,
.pixel-butterfly.color-soft .wing-right {
    background: #f0d0d0;
    /* lighter blush */
}

/* Wing dot accents */
.pixel-butterfly .wing-left::after,
.pixel-butterfly .wing-right::after {
    content: '';
    position: absolute;
    top: 3px;
    width: 4px;
    height: 4px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.6);
}

.pixel-butterfly .wing-left::after {
    left: 2px;
}

.pixel-butterfly .wing-right::after {
    right: 2px;
}

/* Wing Flap Animation */
@keyframes wingFlap {
    0% {
        transform: scaleX(1) rotateY(0deg);
    }

    100% {
        transform: scaleX(0.4) rotateY(50deg);
    }
}

/* Float path animation —  overridden per-butterfly via JS */
@keyframes butterflyFloat {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(60px, -80px) rotate(5deg);
    }

    50% {
        transform: translate(120px, -30px) rotate(-3deg);
    }

    75% {
        transform: translate(60px, -120px) rotate(4deg);
    }

    100% {
        transform: translate(0, -200px) rotate(0deg);
    }
}

/* Staggered fade in */
@keyframes butterflyFadeIn {
    0% {
        opacity: 0;
    }

    100% {
        opacity: var(--butterfly-opacity, 0.6);
    }
}

/* Size variants */
.pixel-butterfly.size-sm {
    transform: scale(0.7);
}

.pixel-butterfly.size-md {
    transform: scale(1);
}

.pixel-butterfly.size-lg {
    transform: scale(1.3);
}

/* ========================================
   PASSWORD SCREEN
   ======================================== */
.password-box {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.password-box p {
    margin-bottom: 8px;
}

.pixel-input {
    font-family: 'Press Start 2P', cursive;
    background: #fff;
    border: 4px solid var(--border-color);
    padding: 12px;
    font-size: 14px;
    width: 200px;
    /* Specific width */
    text-align: center;
    outline: none;
    box-shadow: inset 4px 4px 0px rgba(0, 0, 0, 0.1);
}

.pixel-input:focus {
    background: var(--secondary);
    border-color: var(--primary);
}

.hints-container {
    margin-top: 24px;
    border-top: 2px dashed var(--accent);
    padding-top: 16px;
    width: 100%;
}

.hint-label {
    font-size: 10px;
    color: var(--primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hints-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.hint-item {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border: 3px solid var(--border-color);
    border-radius: 4px;
    /* Slightly grounded */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: white;
    font-family: 'Press Start 2P', cursive;
    box-shadow: 4px 4px 0px rgba(74, 59, 59, 0.15);
    transition: transform 0.1s, background-color 0.2s;
}

.hint-item:hover {
    transform: translateY(-2px);
    background: var(--primary);
    box-shadow: 4px 6px 0px rgba(74, 59, 59, 0.15);
}

.hint-item:active {
    transform: translateY(2px);
    box-shadow: 0px 0px 0px rgba(74, 59, 59, 0.15);
}

.hint-text {
    font-size: 10px;
    color: var(--text-color);
    min-height: 24px;
    font-style: italic;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hint-text.visible {
    opacity: 1;
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}