:root {
    --sonic-blue: #0A32B8;
    --sky-blue: #70C5CE;
    --sky-light: #a7f0ff;
    --sonic-yellow: #FFCC00;
    --sonic-red: #D21404;
    --sonic-green: #38b422;
    --grass-light: #62f23d;
    --dirt-light: #d68940;
    --dirt-dark: #b66a22;
    --text-dark: #1f2937;
    --bg-dark: #1a1a2e;
    --card-bg: #89e2f4;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at center, #2a2a4e 0%, var(--bg-dark) 100%);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    /* min-height: 100dvh; */
    height: 100dvh;
    padding: 0;
    /* Removing padding globally to fix mobile height issues */
}

.invitation-card {
    background-color: var(--card-bg);
    background-image: linear-gradient(to bottom, var(--sky-light) 0%, var(--card-bg) 60%);
    width: 100%;
    max-width: 440px;
    height: 100%;
    /* Dynamic viewport accounts for mobile browser UI (Address bar) */
    border-radius: 0;
    /* Flat edges for mobile app feel */
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0;
    box-shadow: none;
    /* Removed for mobile to be edge-to-edge */
    overflow-y: auto;
    overflow-x: hidden;
    /* scrollbar-width: none; */
    /* Hide scrollbar in Firefox */
}

.invitation-card::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome/Safari */
}

/* === HEADER (SKY) === */
.header {
    padding: 2.5rem 1.5rem 1rem;
    position: relative;
    text-align: center;
    min-height: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
    width: 100%;
}

.header-content .sonic-img {
    margin-left: -100px;
}

.header-content h1 {
    margin-left: 150px;
}

.title {
    font-family: 'Press Start 2P', cursive;
    color: var(--sonic-yellow);
    font-size: 2.5rem;
    line-height: 1.4;
    /* Thick outlining for pixel text */
    text-shadow:
        4px 4px 0px var(--sonic-blue),
        -2px -2px 0px var(--sonic-blue),
        2px -2px 0px var(--sonic-blue),
        -2px 2px 0px var(--sonic-blue),
        2px 2px 0px var(--sonic-blue),
        0 8px 10px rgba(0, 0, 0, 0.4);
    margin-bottom: 0;
    transform: rotate(-3deg);
    position: relative;
    z-index: 2;
}

.sonic-img {
    width: 220px;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    opacity: 0.85;
    /* slight transparency so text pops more */
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.5));
    animation: float-behind 4s ease-in-out infinite;
}

@keyframes float-behind {

    0%,
    100% {
        transform: translate(-50%, -50%);
    }

    50% {
        transform: translate(-50%, -60%);
    }
}

/* === INFO SECTION === */
.info-section {
    background: rgba(255, 255, 255, 0.95);
    margin: 0 1.5rem 1.5rem;
    padding: 1.5rem 1.5rem;
    border-radius: 12px;
    border: 4px solid var(--sonic-blue);
    text-align: center;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-family: 'Press Start 2P', cursive;
    font-size: 1rem;
    color: var(--sonic-blue);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.info-item {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.location {
    font-weight: 600;
    color: #444;
}

/* === VIP ZONE (RSVP) === */
.vip-zone {
    padding: 0 1.5rem 200px;
    /* Space to scroll completely past the RSVP button since footer is smaller */
    position: relative;
    z-index: 2;
}

.vip-box {
    background-color: var(--sonic-blue);
    border: 4px solid var(--sonic-yellow);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
}

.vip-box h3 {
    text-align: center;
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    text-transform: uppercase;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="text"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 3px solid #ccc;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
}

input[type="text"]:focus {
    border-color: var(--sonic-yellow);
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.3);
}

.buttons-container {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn {
    flex: 1;
    padding: 0.8rem 0.5rem;
    border: none;
    border-radius: 8px;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.1s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-yes {
    background-color: var(--sonic-green);
    box-shadow: 0 4px 0 #1e7a10;
}

.btn-no {
    background-color: var(--sonic-red);
    box-shadow: 0 4px 0 #8a0c02;
}

.btn:hover {
    filter: brightness(1.1);
}

.btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 transparent;
}

.btn-icon {
    border: 2px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.1);
}

/* === FOOTER (GREEN HILL) === */
.footer {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    margin-top: auto;
    z-index: 10;
}

.decorations {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 0 1rem;
    margin-bottom: -5px;
    /* Sink sprites into grass slightly */
    position: relative;
    z-index: 3;
    gap: 0.5rem;
}

.ring-img {
    height: 40px;
    width: auto;
    animation: spin 2s linear infinite;
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.2));
}

.ring-img.delay-1 {
    animation-delay: 0s;
}

.ring-img.delay-2 {
    animation-delay: -0.6s;
}

.ring-img.delay-3 {
    animation-delay: -1.2s;
}

.tails-img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.2));
    animation: fly-tails 3s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes spin {
    0% {
        transform: scaleX(1) translateY(0);
    }

    25% {
        transform: scaleX(0.1) translateY(-5px);
    }

    50% {
        transform: scaleX(1) translateY(0);
    }

    75% {
        transform: scaleX(0.1) translateY(5px);
    }

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

@keyframes fly-tails {

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

    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}

.ground-texture {
    height: 50px;
    background-color: var(--dirt-light);
    /* Classic checkerboard dirt */
    background-image:
        linear-gradient(45deg, var(--dirt-dark) 25%, transparent 25%, transparent 75%, var(--dirt-dark) 75%, var(--dirt-dark)),
        linear-gradient(45deg, var(--dirt-dark) 25%, transparent 25%, transparent 75%, var(--dirt-dark) 75%, var(--dirt-dark));
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    border-top: 16px solid var(--sonic-green);
    position: relative;
    z-index: 2;
}

.ground-texture::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--grass-light);
}

/* === OVERLAY AUDIO === */
.audio-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 50, 184, 0.85);
    /* Sonic blue tinted */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    transition: opacity 0.5s ease;
}

.audio-prompt-box {
    background-color: white;
    padding: 2.5rem 2rem;
    border-radius: 16px;
    border: 6px solid var(--sonic-yellow);
    text-align: center;
    max-width: 90%;
    width: 360px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.audio-prompt-box h3 {
    color: var(--sonic-blue);
    margin-bottom: 1rem;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.1rem;
    line-height: 1.4;
}

.audio-prompt-box p {
    margin-bottom: 2rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.audio-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

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

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* === RESPONSIVE === */
@media (max-width: 360px) {
    body {
        padding: 0;
        /* Remove body padding on mobile */
    }

    .title {
        font-size: 2.1rem;
    }

    .sonic-img {
        width: 180px;
    }

    .buttons-container {
        flex-direction: column;
    }

    .btn {
        padding: 1rem;
    }
}


@media (min-width: 480px) {
    body {
        padding: 1rem;
    }

    .invitation-card {
        border-radius: 20px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 6px var(--sonic-yellow), 0 0 0 10px var(--sonic-blue);
        height: 850px;
        max-height: calc(100vh - 2rem);
    }
}