/* Global styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, #1b1b3a 0, #050510 45%, #000 100%);
    color: #f8f8ff;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

.hidden {
    display: none;
}

/* Loader overlay */
#loader-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, #20255a 0, #050510 45%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader-content {
    text-align: center;
    color: #f8f8ff;
}

.loader-text {
    margin-top: 1.5rem;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c5c8ff;
}

.loader-cube {
    position: relative;
    width: 120px;
    height: 120px;
    transform-style: preserve-3d;
    animation: rotateCube 3.5s infinite linear;
    margin: 0 auto;
}

.loader-cube .face {
    position: absolute;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    background: linear-gradient(135deg, #ff6cab, #7366ff);
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.55);
}

.loader-cube .front  { transform: translateZ(60px); }
.loader-cube .back   { transform: rotateY(180deg) translateZ(60px); }
.loader-cube .right  { transform: rotateY(90deg) translateZ(60px); }
.loader-cube .left   { transform: rotateY(-90deg) translateZ(60px); }
.loader-cube .top    { transform: rotateX(90deg) translateZ(60px); }
.loader-cube .bottom { transform: rotateX(-90deg) translateZ(60px); }

@keyframes rotateCube {
    0%   { transform: rotateX(-20deg) rotateY(0deg); }
    100% { transform: rotateX(-20deg) rotateY(360deg); }
}

/* Hero section */
.hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem 4rem;
    background: radial-gradient(circle at 20% 0, rgba(255, 108, 171, 0.3), transparent 55%),
                radial-gradient(circle at 80% 0, rgba(115, 102, 255, 0.35), transparent 55%);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at bottom, rgba(0, 0, 0, 0.75), transparent 60%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 700px;
    padding: 1.5rem;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.35),
        0 0 40px rgba(115, 102, 255, 0.4);
}

.hero h1 span {
    background: linear-gradient(135deg, #ffcf71, #ff6cab, #7366ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    font-size: 1.05rem;
    color: #d2d4ff;
    max-width: 520px;
    margin: 0 auto 1.8rem;
}

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.8rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    border-radius: 999px;
    border: none;
    outline: none;
    cursor: pointer;
    color: #050510;
    background: linear-gradient(135deg, #ffcf71, #ff6cab, #7366ff);
    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.65),
        0 0 18px rgba(255, 108, 171, 0.8);
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, filter 0.15s ease-out;
}

.primary-btn:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.05);
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.85),
        0 0 25px rgba(255, 108, 171, 0.95);
}

.primary-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.7),
        0 0 14px rgba(255, 108, 171, 0.7);
}

.primary-btn.full-width {
    width: 100%;
}

/* Cake section */
.cake-section {
    padding: 3rem 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.cake-wrapper {
    position: relative;
    width: min(320px, 80vw);
    height: 260px;
    margin-bottom: 1.25rem;
    transform-style: preserve-3d;
    transform: rotateX(15deg);
}

.cake-shadow {
    position: absolute;
    bottom: 15px;
    left: 50%;
    width: 70%;
    height: 32px;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.65), transparent 60%);
    transform: translateX(-50%);
    filter: blur(2px);
    opacity: 0.85;
}

.cake {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%) rotateY(-18deg);
    width: 200px;
    height: 160px;
    transform-style: preserve-3d;
}

.cake-layer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 55px;
    border-radius: 999px / 60px;
    background: linear-gradient(145deg, #ffe3f1, #ffb3d1);
    box-shadow:
        inset 0 0 10px rgba(255, 255, 255, 0.7),
        0 18px 30px rgba(0, 0, 0, 0.45);
}

.layer-bottom { bottom: 0; }
.layer-middle { bottom: 38px; width: 185px; background: linear-gradient(145deg, #ffd1ea, #ff9ac4); }
.layer-top    { bottom: 72px; width: 170px; background: linear-gradient(145deg, #ffc4e4, #ff87bc); }

.cake-heart {
    position: absolute;
    bottom: 115px;
    left: 50%;
    transform: translateX(-50%) scale(1);
    width: 95px;
    height: 80px;
    background: radial-gradient(circle at 30% 30%, #ffeef7, #ff4f9a);
    transform-origin: center bottom;
    clip-path: path('M24 0C10 0 0 10 0 24c0 24 28 32 48 56 20-24 48-32 48-56C96 10 86 0 72 0 60 0 52 6 48 14 44 6 36 0 24 0z');
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.45),
        0 0 28px rgba(255, 79, 154, 0.9);
    animation: heartbeat 1.6s infinite ease-in-out;
}

@keyframes heartbeat {
    0%, 100% { transform: translateX(-50%) scale(1); }
    20%      { transform: translateX(-50%) scale(1.06); }
    40%      { transform: translateX(-50%) scale(0.98); }
    60%      { transform: translateX(-50%) scale(1.05); }
    80%      { transform: translateX(-50%) scale(1); }
}

.candle {
    position: absolute;
    bottom: 152px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 45px;
    background: repeating-linear-gradient(
        -45deg,
        #ffffff,
        #ffffff 6px,
        #ffd1ea 6px,
        #ffd1ea 12px
    );
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.flame {
    position: absolute;
    top: -22px;
    left: 50%;
    width: 18px;
    height: 26px;
    transform: translateX(-50%);
    background: radial-gradient(circle at 30% 20%, #fff8d0, #ffcf71, #ff7b00);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow:
        0 0 18px rgba(255, 200, 100, 0.9),
        0 0 35px rgba(255, 150, 50, 0.9);
    animation: flameFlicker 0.8s infinite alternate;
}

@keyframes flameFlicker {
    0%   { transform: translateX(-50%) scale(1); }
    100% { transform: translateX(-50%) scale(1.15) translateY(-2px); }
}

/* Falling cake pieces */
.cake-piece {
    position: absolute;
    width: 45px;
    height: 35px;
    background: linear-gradient(145deg, #ffe3f1, #ffb3d1);
    border-radius: 12px;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.55);
    opacity: 0;
    transform: translate3d(0, -40px, 0) scale(0.9) rotateZ(0);
}

.piece-1 { left: 18%; top: 15%; animation: dropPiece1 3s ease-in-out infinite; }
.piece-2 { left: 50%; top: 8%;  animation: dropPiece2 3s ease-in-out infinite 0.5s; }
.piece-3 { right: 14%; top: 12%; animation: dropPiece3 3s ease-in-out infinite 1s; }

@keyframes dropPiece1 {
    0%, 20%   { opacity: 0; transform: translate3d(0, -40px, 0) scale(0.9) rotateZ(0deg); }
    30%, 70%  { opacity: 1; transform: translate3d(-18px, 90px, 0) scale(1) rotateZ(-18deg); }
    100%      { opacity: 0; transform: translate3d(-40px, 160px, 0) scale(0.9) rotateZ(-30deg); }
}

@keyframes dropPiece2 {
    0%, 20%   { opacity: 0; transform: translate3d(0, -50px, 0) scale(0.9) rotateZ(0deg); }
    30%, 70%  { opacity: 1; transform: translate3d(6px, 95px, 0) scale(1) rotateZ(10deg); }
    100%      { opacity: 0; transform: translate3d(16px, 170px, 0) scale(0.9) rotateZ(25deg); }
}

@keyframes dropPiece3 {
    0%, 20%   { opacity: 0; transform: translate3d(0, -40px, 0) scale(0.9) rotateZ(0deg); }
    30%, 70%  { opacity: 1; transform: translate3d(18px, 82px, 0) scale(1) rotateZ(15deg); }
    100%      { opacity: 0; transform: translate3d(42px, 160px, 0) scale(0.9) rotateZ(28deg); }
}

.cake-caption {
    font-size: 1rem;
    color: #e0d8ff;
}

/* Message & wishes sections */
.message-section,
.wishes-section {
    padding: 2.5rem 1.5rem;
}

.message-card {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.8rem 1.6rem;
    background: linear-gradient(135deg, rgba(11, 14, 48, 0.95), rgba(21, 9, 38, 0.98));
    border-radius: 24px;
    box-shadow:
        0 18px 45px rgba(0, 0, 0, 0.8),
        0 0 32px rgba(115, 102, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.message-card h2 {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: #ffcfef;
}

.message-card p {
    margin-bottom: 0.7rem;
    line-height: 1.7;
    color: #d4dbff;
}

.wishes-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
    gap: 1.8rem;
}

.wish-form-card,
.wish-list-card {
    padding: 1.6rem 1.5rem;
    background: radial-gradient(circle at top left, rgba(115, 102, 255, 0.18), rgba(12, 10, 40, 0.98));
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
}

.wish-form-card h3,
.wish-list-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #ffcfef;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    font-size: 0.85rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    color: #b8bdff;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(2, 4, 26, 0.88);
    color: #f8f8ff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out, background-color 0.15s ease-out;
}

input[type="text"]:focus,
textarea:focus {
    border-color: rgba(255, 108, 171, 0.8);
    box-shadow: 0 0 0 1px rgba(255, 108, 171, 0.75);
    background: rgba(2, 4, 26, 0.98);
}

.form-note {
    font-size: 0.8rem;
    color: #9fa8ff;
    margin-top: 0.7rem;
}

.wish-list {
    list-style: none;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 0.4rem;
}

.wish-item + .wish-item {
    margin-top: 0.9rem;
}

.wish-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.2rem;
}

.wish-name {
    font-weight: 600;
    color: #ffcf71;
}

.wish-date {
    font-size: 0.75rem;
    color: #9fa8ff;
}

.wish-message {
    font-size: 0.9rem;
    color: #d7dbff;
    line-height: 1.5;
}

.empty-state {
    font-size: 0.9rem;
    color: #c3c7ff;
}

.site-footer {
    text-align: center;
    padding: 1.6rem 1rem 2rem;
    font-size: 0.85rem;
    color: #8d93ff;
}

/* Confetti canvas */
#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .wishes-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .hero {
        padding-top: 4rem;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .cake-wrapper {
        height: 230px;
    }
}

