/* styles.css - Essential Game Styles only (Layout handled by Tailwind) */

:root {
    --palette-primary: #ff6b81;
    --palette-accent: #e84393;
    --radius-lg: 48px;
    --radius-md: 32px;
}

/* Base resets & Essential animations */
html {
    scroll-behavior: smooth;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Simon Game specific styles */
.simon-btn {
    transition: all 0.15s ease;
    filter: brightness(0.9);
}

.simon-btn:active,
.simon-btn.active {
    filter: brightness(1.2);
    transform: scale(0.96);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Memory Game specific styles */
.memory-card {
    aspect-ratio: 1;
    background: #fff;
    border: 2px solid #ffe8ed;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: transparent;
    user-select: none;
    box-shadow: 0 4px 0 #ffe8ed;
}

.memory-card.flipped {
    background: #fff;
    color: #333;
    transform: rotateY(180deg);
    border-color: var(--palette-primary);
    box-shadow: 0 4px 15px rgba(255, 107, 129, 0.2);
}

.memory-card.matched {
    background: #f0fff4;
    border-color: #38a169;
    color: #38a169;
    cursor: default;
    box-shadow: none;
}

/* Balloon animations */
.balloon {
    position: absolute;
    font-size: 3rem;
    bottom: -100px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s;
    animation: rise 8s linear infinite;
    z-index: 5;
    pointer-events: auto;
}

.balloon:hover {
    transform: scale(1.2);
}

.balloon.popped {
    animation: pop 0.3s ease-out forwards;
}

@keyframes rise {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-120vh) rotate(20deg);
        opacity: 0;
    }
}

@keyframes pop {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Platformer styles used by games.js */
canvas {
    touch-action: none;
    image-rendering: pixelated;
    /* Crisp game graphics */
}

/* Platformer overlay */
.platformer-overlay {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(12, 18, 32, 0.55);
    backdrop-filter: blur(6px);
}

.platformer-overlay.active {
    display: flex;
}

.platformer-stage {
    width: min(100%, 920px);
}

.platformer-stage canvas {
    width: 100%;
    height: auto;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(12, 18, 32, 0.35);
    background: #dff5ff;
}

.platformer-exit {
    position: absolute;
    top: calc(16px + env(safe-area-inset-top));
    right: calc(16px + env(safe-area-inset-right));
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

body.platformer-open {
    overflow: hidden;
}

/* Mobile layout + controls */
#mobile-controls {
    bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
    padding-bottom: env(safe-area-inset-bottom);
}

#mobile-controls .d-pad button,
#btn-action {
    touch-action: none;
}

@media (max-width: 640px) {
    #mobile-controls .d-pad {
        width: 6.5rem;
        height: 6.5rem;
    }

    #mobile-controls .d-pad button {
        width: 2.5rem;
        height: 2.5rem;
    }

    #btn-action {
        width: 4.5rem;
        height: 4.5rem;
        font-size: 1.25rem;
    }
}

@media (min-width: 640px) {
    #mobile-controls {
        bottom: 2rem !important;
    }
}

/* Keep left cards and right video block aligned in the first hub section */
@media (min-width: 1024px) {
    #hero-sync-section {
        align-items: stretch;
    }

    #hero-left-col,
    #hero-right-col {
        height: 100%;
    }

    #hero-video-shell {
        height: 100%;
        display: flex;
        align-items: stretch;
        justify-content: center;
    }

    #hero-video-frame {
        height: 100%;
        width: auto;
        aspect-ratio: 9 / 16;
    }
}

/* Mobile D-Pad button active states */
.d-pad button:active {
    background: #ff6b81 !important;
    color: white !important;
    transform: scale(0.9);
}

/* Custom transitions for Tailwind hidden/flex if needed */
.transition-opacity {
    transition-property: opacity;
}

.duration-300 {
    transition-duration: 300ms;
}
