/* ============================================
   🎂 Birthday Website — Responsive Styles
   ============================================ */

/* --- Tablet (768px and below) --- */
@media (max-width: 768px) {
    :root {
        --section-padding: 80px 20px;
    }

    .section {
        padding: 80px 20px;
    }

    /* Entrance */
    .entrance-emoji {
        font-size: 60px;
    }

    .enter-btn {
        padding: 15px 40px;
        font-size: 1rem;
        letter-spacing: 2px;
    }

    /* Hero */
    .hero {
        padding-top: 60px;
    }

    .hero-greeting {
        letter-spacing: 4px;
        font-size: 0.9rem;
    }

    .hero-name {
        font-size: clamp(2.5rem, 15vw, 5rem);
    }

    /* Balloons */
    .balloon {
        width: 45px;
        height: 56px;
    }

    .balloon:nth-child(n+6) {
        display: none;
    }

    /* Cake */
    .cake-layer-bottom { width: 200px; height: 65px; }
    .cake-layer-middle { width: 165px; height: 55px; }
    .cake-layer-top { width: 130px; height: 50px; }
    .cake-plate { width: 230px; }

    .candles-row {
        gap: 16px;
    }

    .candle-stick {
        width: 8px;
        height: 35px;
    }

    .candle-flame {
        width: 12px;
        height: 18px;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 30px;
        padding: 10px;
    }

    .polaroid {
        padding: 10px 10px 40px 10px;
    }

    /* Message */
    .message-card {
        padding: 35px 25px;
    }

    .message-card::before {
        font-size: 80px;
    }

    .wishes-grid {
        gap: 12px;
    }

    .wish-card {
        padding: 15px 20px;
        font-size: 0.9rem;
    }

    /* Countdown */
    .countdown-grid {
        gap: 15px;
    }

    .countdown-item {
        padding: 20px 15px;
        min-width: 100px;
    }

    .countdown-number {
        font-size: 2.5rem;
    }

    /* Footer */
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }

    .share-btn {
        width: 200px;
        justify-content: center;
    }

    .music-toggle {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    /* Page Navigation — Tablet */
    .page-arrow {
        width: 46px;
        height: 46px;
    }

    .page-arrow-prev { left: 15px; }
    .page-arrow-next { right: 15px; }

    .page-dot {
        width: 30px;
        height: 30px;
    }

    .page-dot .dot-icon {
        font-size: 12px;
    }

    .page-indicators {
        bottom: 20px;
    }
}

/* --- Mobile (480px and below) --- */
@media (max-width: 480px) {
    :root {
        --section-padding: 60px 15px;
    }

    .section {
        padding: 60px 15px;
    }

    /* Entrance */
    .entrance-emoji {
        font-size: 50px;
        margin-bottom: 20px;
    }

    .entrance-subtitle {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .enter-btn {
        padding: 14px 35px;
        font-size: 0.9rem;
        letter-spacing: 2px;
    }

    /* Hero */
    .hero-name {
        font-size: clamp(2rem, 18vw, 4rem);
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    /* Balloons - fewer on mobile */
    .balloon:nth-child(n+5) {
        display: none;
    }

    .balloon {
        width: 35px;
        height: 44px;
    }

    /* Cake */
    .cake-layer-bottom { width: 170px; height: 55px; }
    .cake-layer-middle { width: 140px; height: 48px; }
    .cake-layer-top { width: 110px; height: 42px; }
    .cake-plate { width: 200px; height: 14px; }

    .candles-row {
        gap: 12px;
    }

    .candle-stick {
        width: 7px;
        height: 30px;
    }

    .candle-flame {
        width: 10px;
        height: 16px;
    }

    .cake-instruction {
        font-size: 0.9rem;
    }

    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .polaroid {
        max-width: 320px;
        margin: 0 auto;
    }

    /* Message */
    .message-card {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .message-text {
        font-size: 1rem;
        line-height: 1.8;
    }

    .message-signature {
        font-size: 1.5rem;
    }

    .message-card::before {
        font-size: 60px;
        top: 5px;
        left: 10px;
    }

    /* Hearts - fewer on mobile */
    .floating-heart:nth-child(n+6) {
        display: none;
    }

    .wishes-grid {
        flex-direction: column;
        align-items: center;
    }

    .wish-card {
        width: 100%;
        max-width: 300px;
    }

    /* Countdown */
    .countdown-grid {
        gap: 10px;
    }

    .countdown-item {
        padding: 15px 12px;
        min-width: 70px;
        border-radius: 16px;
    }

    .countdown-number {
        font-size: 2rem;
    }

    .countdown-label {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }

    /* Birthday Today */
    .birthday-today-emoji {
        font-size: 70px;
    }

    .birthday-today-text {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    /* Footer */
    .footer-section .section-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .footer-subtitle {
        font-size: 0.95rem;
    }

    .footer-hearts {
        font-size: 24px;
    }

    .share-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }

    .music-toggle {
        bottom: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    /* Page Navigation — Mobile */
    .page-arrow {
        width: 40px;
        height: 40px;
        top: auto;
        bottom: 80px;
        transform: none;
    }

    .page-arrow:hover {
        transform: scale(1.1);
    }

    .page-arrow-prev { left: 20px; }
    .page-arrow-next { right: 20px; }

    .page-arrow svg {
        width: 20px;
        height: 20px;
    }

    .page-dot {
        width: 26px;
        height: 26px;
    }

    .page-dot .dot-icon {
        font-size: 10px;
    }

    .page-indicators {
        bottom: 15px;
    }

    .page-counter {
        font-size: 0.7rem;
    }

    /* Sections in page mode — tighter padding */
    .section {
        padding: 60px 15px;
    }

    .gallery-section .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* --- Small Mobile (360px and below) --- */
@media (max-width: 360px) {
    .hero-name {
        font-size: 2rem;
    }

    .cake-layer-bottom { width: 150px; height: 50px; }
    .cake-layer-middle { width: 120px; height: 42px; }
    .cake-layer-top { width: 95px; height: 38px; }
    .cake-plate { width: 175px; }

    .candles-row {
        gap: 10px;
    }

    .countdown-item {
        min-width: 62px;
        padding: 12px 8px;
    }

    .countdown-number {
        font-size: 1.8rem;
    }
}

/* --- Landscape mode fix --- */
@media (max-height: 500px) and (orientation: landscape) {
    .entrance {
        overflow-y: auto;
    }

    .entrance-content {
        min-height: 100vh;
        padding: 30px 20px;
    }

    .entrance-emoji {
        font-size: 40px;
        margin-bottom: 15px;
    }

    .enter-btn {
        margin-top: 20px;
    }

    .section {
        min-height: auto;
        padding: 60px 20px;
    }
}

/* --- Prefers Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .balloon,
    .floating-heart,
    .candle-flame {
        animation: none !important;
    }
}

/* --- High contrast mode --- */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.8);
        --glass-border: rgba(255, 255, 255, 0.5);
        --text-muted: rgba(255, 255, 255, 0.8);
    }

    .polaroid {
        border: 2px solid white;
    }
}
