/* =============================================================================
   Can't Reach My Beer! — Styles
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One:wght@400&family=Inter:wght@400;500;600;700&display=swap');

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', system-ui, sans-serif;
    background: #2C1810;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Canvas fills available space above touch controls */
.game-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

#gameCanvas {
    flex: 1;
    width: 100%;
    display: block;
    cursor: default;
}

/* =============================================================================
   Mobile touch controls
   ============================================================================= */

#touchControls {
    display: none; /* shown by JS on mobile */
    padding: 6px;
    background: rgba(30, 25, 20, 0.95);
    border-top: 2px solid #8B4513;
    max-height: 160px;
    min-height: 120px;
}

.touch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.05) 100%);
    border: 2px solid rgba(139, 69, 19, 0.5);
    border-radius: 10px;
    color: #DEB887;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.1s ease;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.touch-btn:active,
.touch-btn.touch-active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4) 0%, rgba(6, 182, 212, 0.3) 100%);
    border-color: #8B5CF6;
    transform: scale(0.93);
    color: #fff;
}

.touch-btn.touch-expected {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.25) 0%, rgba(255, 68, 68, 0.1) 100%);
    border-color: #EF4444;
    color: #FF6B6B;
    animation: touch-pulse 0.8s infinite;
}

@keyframes touch-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* =============================================================================
   Loading state
   ============================================================================= */

.loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2C1810;
    color: #DEB887;
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    z-index: 100;
}

/* =============================================================================
   Responsive tweaks
   ============================================================================= */

@media (max-width: 768px) {
    #touchControls {
        max-height: 180px;
        min-height: 140px;
        padding: 8px;
    }

    .touch-btn {
        font-size: 20px;
        border-radius: 8px;
    }
}

@media (max-height: 500px) {
    #touchControls {
        max-height: 100px;
        min-height: 80px;
    }

    .touch-btn {
        font-size: 14px;
        min-height: 36px;
    }
}
