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

:root {
    --bg-cream: #f6f5f0;
    --border-dark: #33273e;
    --kuromi-purple: #c5b3e6;
    --kuromi-dark-purple: #8672a9;
    --kuromi-pink: #ffc0cb;
    --pastel-blue: #bfe5e7;
    --pastel-yellow: #fef4c5;
    --card-white: #ffffff;
    --font-pixel: 'VT323', monospace;
    --font-hand: 'Gaegu', cursive, sans-serif;
    --font-clean: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-cream);
    color: var(--border-dark);
    font-family: var(--font-clean);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* Page Wrapper */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    z-index: 10;
    width: 100%;
    max-width: 540px;
}

/* Top Header */
.booth-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.header-icon {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
}

.header-subtitle {
    font-family: var(--font-pixel);
    font-size: 1.35rem;
    color: #615273;
    letter-spacing: 0.5px;
}

/* Booth Container Layout */
.booth-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Photo Booth Frame */
.booth-frame {
    width: 100%;
    background: var(--pastel-blue);
    border: 2.5px solid var(--border-dark);
    border-radius: 16px;
    box-shadow: 0 8px 0 rgba(51, 39, 62, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 5;
    position: relative;
}

/* Marquee Header */
.booth-marquee {
    background: var(--kuromi-purple);
    border-bottom: 2.5px solid var(--border-dark);
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
}

.marquee-text {
    font-family: var(--font-pixel);
    font-size: 1.9rem;
    color: var(--border-dark);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 1px 1px 0px #ffffff;
}

.marquee-icon {
    font-size: 1.1rem;
}

/* Booth Content Stage */
.booth-stage {
    background: #eef7f6;
    padding: 1.5rem 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-height: 250px;
    justify-content: center;
    background-image: 
        radial-gradient(#c5b3e6 1px, transparent 1px);
    background-size: 16px 16px;
}

/* Kuromi Display Frame */
.kuromi-display {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.kuromi-avatar {
    width: 115px;
    height: 115px;
    image-rendering: pixelated;
    filter: drop-shadow(0 4px 0px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
}

.kuromi-display:hover .kuromi-avatar {
    transform: scale(1.05) rotate(-2deg);
}

.party-hat {
    position: absolute;
    top: -12px;
    right: 12px;
    font-size: 1.8rem;
    transform: rotate(15deg);
}

/* Cake & Candles */
.cake-container {
    cursor: pointer;
    margin-top: 0.5rem;
    transition: transform 0.2s ease;
}

.cake-container:hover {
    transform: scale(1.04);
}

.cake {
    position: relative;
    width: 140px;
    height: 85px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.cake-base {
    width: 140px;
    height: 36px;
    background: var(--kuromi-purple);
    border: 2px solid var(--border-dark);
    border-radius: 0 0 8px 8px;
    position: relative;
}

.cake-top {
    width: 115px;
    height: 30px;
    background: var(--kuromi-pink);
    border: 2px solid var(--border-dark);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.cake-icing {
    position: absolute;
    top: 18px;
    width: 120px;
    height: 12px;
    background: #ffffff;
    border: 2px solid var(--border-dark);
    border-radius: 10px;
    z-index: 2;
}

.cake-plate {
    width: 160px;
    height: 8px;
    background: #ffffff;
    border: 2px solid var(--border-dark);
    border-radius: 10px;
}

/* Candles */
.candle {
    position: absolute;
    top: -2px;
    width: 8px;
    height: 25px;
    background: repeating-linear-gradient(
        0deg,
        #ffffff,
        #ffffff 4px,
        var(--kuromi-dark-purple) 4px,
        var(--kuromi-dark-purple) 8px
    );
    border: 1.5px solid var(--border-dark);
    border-radius: 2px;
    z-index: 3;
}

.candle.c1 { left: 42px; }
.candle.c2 { left: 66px; }
.candle.c3 { left: 90px; }

.flame {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 14px;
    background: #ffbe0b;
    border-radius: 50% 50% 20% 20%;
    border: 1px solid var(--border-dark);
    box-shadow: 0 0 8px #ffbe0b;
    animation: flame-wiggle 0.5s infinite alternate ease-in-out;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.flame.out {
    opacity: 0;
    transform: translateX(-50%) scale(0.2);
}

@keyframes flame-wiggle {
    0% { transform: translateX(-50%) rotate(-4deg) scale(1); }
    100% { transform: translateX(-50%) rotate(4deg) scale(1.1); }
}

/* Decorative Sparkles */
.decor-sparkle {
    position: absolute;
    font-size: 1.2rem;
    animation: float-sparkle 2.5s infinite ease-in-out alternate;
}
.s1 { top: 15px; left: 15px; animation-delay: 0s; }
.s2 { top: 20px; right: 20px; animation-delay: 0.8s; }
.s3 { bottom: 15px; left: 20px; animation-delay: 1.4s; }

@keyframes float-sparkle {
    0% { transform: translateY(0); }
    100% { transform: translateY(-6px); }
}

/* Polaroid Photo Strip / Message Card */
.photo-strip {
    width: 90%;
    background: var(--card-white);
    border: 2.5px solid var(--border-dark);
    border-radius: 14px;
    padding: 1.4rem;
    margin-top: -18px;
    box-shadow: 0 10px 24px rgba(51, 39, 62, 0.12);
    z-index: 10;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
}

.photo-strip.hidden {
    opacity: 0;
    transform: translateY(-40px) scale(0.9);
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border: none;
}

.strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1.5px dashed var(--kuromi-purple);
    padding-bottom: 0.5rem;
}

.strip-stamp {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
}

.strip-date {
    font-family: var(--font-pixel);
    font-size: 1.25rem;
    color: var(--kuromi-dark-purple);
}

.strip-photo {
    background: #faf7ff;
    border: 2px solid var(--border-dark);
    border-radius: 8px;
    height: 115px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.photo-img {
    width: 85px;
    height: 85px;
    image-rendering: pixelated;
}

.strip-message p {
    font-family: var(--font-hand);
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--border-dark);
    white-space: pre-wrap;
    text-align: center;
}

.strip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-pixel);
    font-size: 1.2rem;
    color: var(--kuromi-dark-purple);
    padding-top: 0.5rem;
    border-top: 1.5px dashed var(--kuromi-purple);
}

/* Action Button */
.action-bar {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
    z-index: 20;
}

.aesthetic-btn {
    background: #ffffff;
    color: var(--border-dark);
    border: 2px solid var(--border-dark);
    border-radius: 12px;
    padding: 0.65rem 1.6rem;
    font-family: var(--font-clean);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    box-shadow: 0 3px 0 var(--border-dark);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.aesthetic-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--border-dark);
    background: #fffbfe;
}

.aesthetic-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 var(--border-dark);
}

/* Floating Kuromi Balloons */
#balloons-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.balloon {
    position: absolute;
    bottom: -100px;
    width: 44px;
    height: 54px;
    border: 2px solid var(--border-dark);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    opacity: 0.9;
    animation: floatUp 9s infinite linear;
    display: flex;
    justify-content: center;
    align-items: center;
}

.balloon::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 1.5px;
    height: 20px;
    background: var(--border-dark);
}

.balloon-face {
    width: 18px;
    height: 18px;
    image-rendering: pixelated;
    opacity: 0.85;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.95;
    }
    50% {
        transform: translateY(-50vh) rotate(6deg);
    }
    100% {
        transform: translateY(-110vh) rotate(-6deg);
        opacity: 0.2;
    }
}

/* Canvas Confetti */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 90;
}
