/* ==========================================================================
   DrinkDuel — Global Styles & Theme System
   Designed for ultra-responsive mobile browser experience (zero AI generic feel)
   ========================================================================== */

:root {
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    /* Background Gradients */
    --bg-home: linear-gradient(145deg, #161b33 0%, #0b0c10 50%, #1f1135 100%);
    --bg-setup: linear-gradient(145deg, #0b2239 0%, #0d1b2a 50%, #13404f 100%);
    --bg-intro: linear-gradient(145deg, #241442 0%, #131124 50%, #0f3d3e 100%);
    --bg-game: linear-gradient(145deg, #111422 0%, #0a0b12 50%, #141c2b 100%);
    --bg-winner: linear-gradient(145deg, #063820 0%, #071f14 50%, #0e4d40 100%);
    --bg-loser: linear-gradient(145deg, #420d0d 0%, #1f0707 50%, #611818 100%);
    --bg-shot: linear-gradient(145deg, #b31217 0%, #e52d27 50%, #780206 100%);
    --bg-gameover: linear-gradient(145deg, #141124 0%, #0a0814 50%, #3e124d 100%);

    /* Colors */
    --c-amber: #f39c12;
    --c-red: #e74c3c;
    --c-silver: #95a5a6;
    --c-magenta: #e91e8e;
    --c-yellow: #f1c40f;
    --c-cyan: #3498db;
    --c-green: #2ecc71;
    --c-purple: #9b59b6;

    --surface-glass: rgba(255, 255, 255, 0.08);
    --surface-glass-strong: rgba(255, 255, 255, 0.14);
    --surface-glass-border: rgba(255, 255, 255, 0.18);
    --surface-dark: rgba(10, 12, 18, 0.75);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.45);

    --safe-top: max(env(safe-area-inset-top, 0px), 38px);
    --safe-bottom: max(env(safe-area-inset-bottom, 0px), 16px);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    font-family: var(--font-stack);
    background-color: #0b0c10;
    color: var(--text-primary);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* App Wrapper */
#app-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 500px; /* Tablet / desktop preview containment */
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-home);
    transition: background 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Canvas Overlays */
#fx-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Screens System */
#screens-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: calc(var(--safe-top) + 12px) 14px calc(var(--safe-bottom) + 14px) 14px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(30px);
    transition: opacity 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
                visibility 0.32s;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    z-index: 2;
}

#screen-player-setup {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.screen.exit-left {
    opacity: 0;
    transform: translateX(-30px);
}

/* Typography Defaults */
h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

p {
    font-size: 1rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

/* Utility Flex helpers */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.w-full {
    width: 100%;
}
