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

html,
body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Lora', serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #a8d8ea, #d0e8d0);
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

body.loaded {
    opacity: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.confetti,
.balloon {
    position: fixed;
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    pointer-events: none;
}

.redirect-btn,
.menu-btn,
.start-btn,
.sound-btn {
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    background-color: #6ca0a1;
}

.redirect-btn:hover,
.redirect-btn:focus,
.menu-btn:hover,
.menu-btn:focus,
.start-btn:hover,
.start-btn:focus,
.sound-btn:hover,
.sound-btn:focus,
.option:hover,
.option:focus {
    background-color: #4a7c7d;
    transform: translateY(-2px);
}

.redirect-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    z-index: 1000;
    font-size: 14px;
    min-height: 44px;
}

.select-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 280px;
    z-index: 1000;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-family: Arial, Helvetica, sans-serif;
    border-radius: 8px;
    font-size: 14px;
    min-height: 44px;
}

.menu-btn i {
    transition: transform 0.3s ease;
}

.menu-btn.open i {
    transform: rotate(180deg);
}

.options {
    list-style-type: none;
    margin: 4px 0 0 0;
    padding: 0;
    background-color: #6ca0a1;
    border-radius: 8px;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.options.open {
    max-height: 400px;
}

.option {
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    background-color: #6ca0a1;
}

.start-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: fixed;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #a8d8ea, #d0e8d0);
    z-index: 500;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.start-container.hide {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.start-btn {
    padding: 16px 32px;
    font-size: 1.6rem;
    font-weight: bold;
    border-radius: 12px;
    margin-bottom: 20px;
    min-height: 48px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.4);
}

.start-btn:hover{
    transform: scale(1.05);
    box-shadow: 0 5px 8px rgba(0, 0, 0, 0.6);
    outline-offset: 3px;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 450px;
    min-width: 280px;
    text-align: center;
    position: fixed;
    opacity: 0;
    transform: translateY(30px) scale(0.9) translateZ(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    z-index: 100;
    backface-visibility: hidden;
}

.card.show-card {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
}

.card pre {
    font-family: 'Pacifico', cursive;
    font-size: 2.2rem;
    color: #4a4a4a;
    margin-bottom: 1rem;
    font-weight: 600;
    user-select: none;
    line-height: 1.2;
}

.card p {
    font-size: 1.1rem;
    color: #3a3a3a;
    margin-bottom: 1.5rem;
    user-select: none;
    line-height: 1.5;
}

.sound-btn {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    min-height: 48px;
    box-shadow: 0 3px 10px rgba(108, 160, 161, 0.3);
}

.sound-btn:hover,
.sound-btn:focus {
    box-shadow: 0 5px 15px rgba(108, 160, 161, 0.4);
}

.hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
    max-height: 0;
    overflow: hidden;
}

.reveal {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
    padding-top: 1rem;
}

footer {
    margin-top: 1.5rem;
    font-size: 1rem;
    color: #4a4a4a;
    font-style: italic;
    line-height: 1.4;
}

.confetti {
    position: fixed;
    top: -10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: fall linear forwards;
    pointer-events: none;
}

@keyframes fall {
    0% {
        transform: translate3d(0, -10vh, 0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate3d(var(--drift), 110vh, 0) rotate(720deg);
        opacity: 0;
    }
}

.balloon {
    position: fixed;
    bottom: -80px;
    width: 35px;
    height: 50px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: floatUp linear forwards;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.balloon::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 60px;
    background: #666;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
}

@keyframes floatUp {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate3d(0, -110vh, 0) rotate(10deg);
        opacity: 0;
    }
}

.theme-pink-gradient {
    background: linear-gradient(135deg, #ff9a9e, #fbc2eb) !important;
}

.theme-ocean-breeze {
    background: linear-gradient(135deg, #a8e6cf, #dcedc1) !important;
}

.theme-spring-blossom {
    background: linear-gradient(135deg, #f8b195, #f67280) !important;
}

.theme-tropical-paradise {
    background: linear-gradient(135deg, #a1c4fd, #c2e9fb) !important;
}

.theme-cool-mint {
    background: linear-gradient(135deg, #a8e6cf, #dcedc1) !important;
}

.theme-lavender-fields {
    background: linear-gradient(135deg, #d4a5a5, #f9d9d9) !important;
}

body.theme-pink-gradient .menu-btn,
body.theme-pink-gradient .options,
body.theme-pink-gradient .option,
body.theme-pink-gradient .redirect-btn,
body.theme-pink-gradient .start-btn,
body.theme-pink-gradient .sound-btn {
    background-color: #ff6f61 !important;
}

body.theme-ocean-breeze .menu-btn,
body.theme-ocean-breeze .options,
body.theme-ocean-breeze .option,
body.theme-ocean-breeze .redirect-btn,
body.theme-ocean-breeze .start-btn,
body.theme-ocean-breeze .sound-btn {
    background-color: #26a69a !important;
}

body.theme-spring-blossom .menu-btn,
body.theme-spring-blossom .options,
body.theme-spring-blossom .option,
body.theme-spring-blossom .redirect-btn,
body.theme-spring-blossom .start-btn,
body.theme-spring-blossom .sound-btn {
    background-color: #f67280 !important;
}

body.theme-tropical-paradise .menu-btn,
body.theme-tropical-paradise .options,
body.theme-tropical-paradise .option,
body.theme-tropical-paradise .redirect-btn,
body.theme-tropical-paradise .start-btn,
body.theme-tropical-paradise .sound-btn {
    background-color: #00bfa5 !important;
}

body.theme-cool-mint .menu-btn,
body.theme-cool-mint .options,
body.theme-cool-mint .option,
body.theme-cool-mint .redirect-btn,
body.theme-cool-mint .start-btn,
body.theme-cool-mint .sound-btn {
    background-color: #00897b !important;
}

body.theme-lavender-fields .menu-btn,
body.theme-lavender-fields .options,
body.theme-lavender-fields .option,
body.theme-lavender-fields .redirect-btn,
body.theme-lavender-fields .start-btn,
body.theme-lavender-fields .sound-btn {
    background-color: #957dad !important;
}

body.theme-pink-gradient .menu-btn:hover,
body.theme-pink-gradient .option:hover,
body.theme-pink-gradient .redirect-btn:hover,
body.theme-pink-gradient .start-btn:hover,
body.theme-pink-gradient .sound-btn:hover,
body.theme-pink-gradient .menu-btn:focus,
body.theme-pink-gradient .option:focus,
body.theme-pink-gradient .redirect-btn:focus,
body.theme-pink-gradient .start-btn:focus,
body.theme-pink-gradient .sound-btn:focus {
    background-color: #ff4500 !important;
}

body.theme-ocean-breeze .menu-btn:hover,
body.theme-ocean-breeze .option:hover,
body.theme-ocean-breeze .redirect-btn:hover,
body.theme-ocean-breeze .start-btn:hover,
body.theme-ocean-breeze .sound-btn:hover,
body.theme-ocean-breeze .menu-btn:focus,
body.theme-ocean-breeze .option:focus,
body.theme-ocean-breeze .redirect-btn:focus,
body.theme-ocean-breeze .start-btn:focus,
body.theme-ocean-breeze .sound-btn:focus {
    background-color: #00796b !important;
}

body.theme-spring-blossom .menu-btn:hover,
body.theme-spring-blossom .option:hover,
body.theme-spring-blossom .redirect-btn:hover,
body.theme-spring-blossom .start-btn:hover,
body.theme-spring-blossom .sound-btn:hover,
body.theme-spring-blossom .menu-btn:focus,
body.theme-spring-blossom .option:focus,
body.theme-spring-blossom .redirect-btn:focus,
body.theme-spring-blossom .start-btn:focus,
body.theme-spring-blossom .sound-btn:focus {
    background-color: #c06c84 !important;
}

body.theme-tropical-paradise .menu-btn:hover,
body.theme-tropical-paradise .option:hover,
body.theme-tropical-paradise .redirect-btn:hover,
body.theme-tropical-paradise .start-btn:hover,
body.theme-tropical-paradise .sound-btn:hover,
body.theme-tropical-paradise .menu-btn:focus,
body.theme-tropical-paradise .option:focus,
body.theme-tropical-paradise .redirect-btn:focus,
body.theme-tropical-paradise .start-btn:focus,
body.theme-tropical-paradise .sound-btn:focus {
    background-color: #00897b !important;
}

body.theme-cool-mint .menu-btn:hover,
body.theme-cool-mint .option:hover,
body.theme-cool-mint .redirect-btn:hover,
body.theme-cool-mint .start-btn:hover,
body.theme-cool-mint .sound-btn:hover,
body.theme-cool-mint .menu-btn:focus,
body.theme-cool-mint .option:focus,
body.theme-cool-mint .redirect-btn:focus,
body.theme-cool-mint .start-btn:focus,
body.theme-cool-mint .sound-btn:focus {
    background-color: #00695c !important;
}

body.theme-lavender-fields .menu-btn:hover,
body.theme-lavender-fields .option:hover,
body.theme-lavender-fields .redirect-btn:hover,
body.theme-lavender-fields .start-btn:hover,
body.theme-lavender-fields .sound-btn:hover,
body.theme-lavender-fields .menu-btn:focus,
body.theme-lavender-fields .option:focus,
body.theme-lavender-fields .redirect-btn:focus,
body.theme-lavender-fields .start-btn:focus,
body.theme-lavender-fields .sound-btn:focus {
    background-color: #6d4c71 !important;
}

body.theme-pink-gradient .start-container {
    background: linear-gradient(135deg, #ff9a9e, #fbc2eb) !important;
}

body.theme-ocean-breeze .start-container {
    background: linear-gradient(135deg, #a8e6cf, #dcedc1) !important;
}

body.theme-spring-blossom .start-container {
    background: linear-gradient(135deg, #f8b195, #f67280) !important;
}

body.theme-tropical-paradise .start-container {
    background: linear-gradient(135deg, #a1c4fd, #c2e9fb) !important;
}

body.theme-cool-mint .start-container {
    background: linear-gradient(135deg, #a8e6cf, #dcedc1) !important;
}

body.theme-lavender-fields .start-container {
    background: linear-gradient(135deg, #d4a5a5, #f9d9d9) !important;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 480px) {
    .redirect-btn {
        font-size: 12px;
        padding: 10px 12px;
        top: 10px;
        left: 10px;
        min-height: 48px;
        min-width: 48px;
    }

    .select-menu {
        width: 150px;
    }

    .menu-btn,
    .option {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 48px;
    }

    .option-text {
        display: none;
    }

    .start-btn {
        font-size: 1.2rem;
        padding: 12px 24px;
        min-height: 48px;
        min-width: 48px;
    }

    .card {
        padding: 1.2rem;
        border-radius: 15px;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .card pre {
        font-size: 1.6rem;
    }

    .card p {
        font-size: 0.9rem;
    }

    .sound-btn {
        font-size: 0.9rem;
        padding: 10px 20px;
        min-height: 48px;
        min-width: 48px;
    }

    .confetti {
        animation-duration: 1.5s !important;
    }

    .balloon {
        animation-duration: 3s !important;
    }
}

@media (max-width: 768px) {
    .select-menu {
        width: 170px;
        top: 20px;
        right: 10px;
    }

    .menu-btn,
    .option {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 44px;
    }

    .start-btn {
        font-size: 1.4rem;
        padding: 14px 28px;
        min-height: 48px;
    }

    .card {
        padding: 1.5rem;
        width: 95%;
    }

    .card pre {
        font-size: 1.8rem;
    }

    .card p {
        font-size: 1rem;
    }

    .sound-btn {
        min-height: 48px;
    }
}

@media screen and (max-height: 600px) {
    .card {
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .confetti,
    .balloon {
        display: none;
    }

    body {
        animation: none;
    }
}

@media (prefers-contrast: high) {
    .card {
        background: white;
        border: 3px solid #000;
    }

    .card p,
    .card pre {
        color: #000;
    }

    .menu-btn,
    .redirect-btn,
    .start-btn,
    .sound-btn {
        border: 2px solid #000;
    }
}
