@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #6750A4;
    --primary-container: #EADDFF;
    --on-primary-container: #21005D;
    --secondary: #625B71;
    --surface: #F7F2FA;
    --surface-variant: #E7E0EC;
    --on-surface: #1D1B20;
    --outline: #79747E;
    --shadow: rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #F7F2FA;
    color: var(--on-surface);
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: stretch;
    overflow-x: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(103, 80, 164, 0.03) 1px, transparent 0);
    background-size: 32px 32px;
}

#root {
    width: 100%;
    max-width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-shell {
    min-height: 100vh;
}

.mobile-header {
    transition: padding 0.3s ease, border-radius 0.3s ease, box-shadow 0.3s ease;
}

.app-main {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.menu-grid .game-card {
    scroll-snap-align: start;
}

@media (min-width: 1024px) {
    main.app-main {
        overflow: visible !important;
        max-width: 1180px;
        padding: 0 28px;
    }
    #root {
        height: auto;
        min-height: 100vh;
        max-height: none;
        width: 100%;
        max-width: 1350px;
        margin: 0 auto;
        padding: 0 28px 42px;
        border-radius: 26px;
        background: var(--surface);
        box-shadow: 0 32px 88px rgba(0, 0, 0, 0.24);
        overflow: visible;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
}

.pattern-bg {
    background: linear-gradient(135deg, #6750A4 0%, #433685 100%);
    position: relative;
    overflow: hidden;
}

.pattern-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 2px 2px, rgba(255,255,255,0.1) 1px, transparent 0);
    background-size: 24px 24px;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.game-card {
    background: white;
    border-radius: 28px;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

#game-canvas {
    touch-action: none;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(103, 80, 164, 0.12);
}

.game-card:active {
    transform: scale(0.98);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.floating { animation: float 4s ease-in-out infinite; }

.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.radio-visualizer {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.bar {
    width: 3px;
    height: 100%;
    background: #4ade80;
    border-radius: 10px;
    animation: bounce 0.8s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

@media (max-width: 640px) {
    #root {
        height: auto;
        min-height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
    body {
        align-items: stretch;
    }
    .app-shell {
        padding-bottom: 24px;
    }
    .pattern-bg {
        padding: 1.25rem 1rem 2.4rem !important;
        border-radius: 0 0 28px 28px !important;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    }
    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 50;
    }
    main.app-main {
        padding: 0 0.9rem !important;
        margin-top: -14px;
    }
    .menu-grid {
        gap: 0.9rem !important;
        padding-bottom: 1.5rem;
    }
    .menu-grid .game-card {
        border-radius: 20px;
    }
    .game-card {
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
    }

    .text-3xl { font-size: 1.5rem; }
    .text-4xl { font-size: 1.875rem; }
    .p-10 { padding: 1.5rem; }
    .p-16 { padding: 2rem; }
    button, .game-card { touch-action: manipulation; }
}
