 * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            overflow: hidden;
            background: #000;
            font-family: 'Segoe UI', Arial, sans-serif;
            -webkit-font-smoothing: antialiased;
        }

        #container {
            width: 100vw;
            height: 100vh;
        }

        /* ========== Snackbar ========== */
        #snackbar {
            position: fixed;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            background: linear-gradient(135deg, rgba(26, 26, 46, 0.95), rgba(15, 15, 35, 0.98));
            color: #fff;
            padding: 14px 28px;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 500;
            z-index: 10001;
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            max-width: 90%;
            text-align: center;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 215, 0, 0.2);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 215, 0, 0.3);
        }

        #snackbar.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        /* ========== Info Panels ========== */
        .info-panel {
            position: fixed;
            background: linear-gradient(145deg, rgba(26, 26, 46, 0.95), rgba(15, 15, 35, 0.98));
            padding: 16px;
            border-radius: 8px;
            color: white;
            z-index: 1000;
            border: 2px solid rgba(255, 215, 0, 0.25);
            backdrop-filter: blur(10px);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            min-width: 200px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        #playerInfoPanel {
            top: 20px;
            left: 20px;
        }

        #gameInfoPanel {
            top: 20px;
            right: 20px;
        }

        .info-panel-header {
            display: none;
            justify-content: space-between;
            align-items: center;
            cursor: pointer;
            user-select: none;
            padding: 8px;
        }

        .info-panel-header h3 {
            margin: 0;
            color: #ffd700;
            font-size: 13px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .info-panel-toggle {
            width: 24px;
            height: 24px;
            border-radius: 6px;
            background: rgba(255, 215, 0, 0.2);
            color: #ffd700;
            border: 1px solid rgba(255, 215, 0, 0.3);
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.3s ease;
        }

        .info-panel-content {
            transition: all 0.3s ease;
            overflow: hidden;
        }

        .info-panel > h3 {
            margin: 0 0 12px 0;
            color: #ffd700;
            font-size: 14px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1px;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(255, 215, 0, 0.2);
        }

        .info-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 3px 0;
            font-size: 13px;
        }

        .info-label {
            color: #a8b0bb;
            font-weight: 500;
        }

        .info-value {
            color: #fff;
            font-weight: 600;
        }

        .info-value.gold { color: #ffd700; }
        .info-value.green { color: #28a745; }
        .info-value.red { color: #dc3545; }

        /* ========== Action Buttons ========== */
        #actionButtons {
            position: fixed;
            bottom: 20px;
            right: 20px;
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            z-index: 1000;
            max-width: 340px;
            padding: 14px;
            background: linear-gradient(135deg, rgba(0, 0, 0, 0.88), rgba(20, 20, 40, 0.95));
            border-radius: 16px;
            border: 1px solid rgba(255, 215, 0, 0.3);
            backdrop-filter: blur(14px);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        }

        #actionButtons button {
            padding: 12px 16px;
            border: none;
            border-radius: 10px;
            font-weight: 600;
            font-size: 12px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            position: relative;
            overflow: hidden;
        }

        #actionButtons button:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
        }

        #actionButtons button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        #actionButtons button.your-turn {
            animation: buttonPulse 1.5s ease-in-out infinite;
        }

        @keyframes buttonPulse {
            0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
            50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
        }

        #packButton { background: linear-gradient(135deg, #dc3545, #c82333); color: white; }
        #seeCardsButton { background: linear-gradient(135deg, #17a2b8, #138496); color: white; }
        #playBlindButton { background: linear-gradient(135deg, #6c757d, #5a6268); color: white; }
        #chaalButton { background: linear-gradient(135deg, #28a745, #218838); color: white; }
        #raiseButton { background: linear-gradient(135deg, #ffc107, #e0a800); color: #000; }
        #allInButton { background: linear-gradient(135deg, #ff6b6b, #ee5a6f); color: white; }
        #slideShowButton { 
            background: linear-gradient(135deg, #9b59b6, #8e44ad); 
            color: white;
            grid-column: 1 / -1;
        }

        #betControls {
            grid-column: 1 / -1;
            display: none;
            align-items: center;
            gap: 10px;
            background: rgba(0, 0, 0, 0.5);
            padding: 10px 12px;
            border-radius: 10px;
            border: 1px solid rgba(255, 215, 0, 0.25);
        }

        #betAmount {
            flex: 1;
            padding: 8px 12px;
            border-radius: 8px;
            border: 1px solid rgba(255, 215, 0, 0.4);
            background: rgba(26, 26, 46, 0.9);
            color: #ffd700;
            font-weight: 600;
            font-size: 13px;
            text-align: center;
        }

        #customBetButton {
            padding: 8px 16px;
            background: linear-gradient(135deg, #28a745, #1e7e34);
            border: none;
            border-radius: 8px;
            color: white;
            font-weight: 600;
            font-size: 11px;
            cursor: pointer;
        }

        /* ========== Turn Timer ========== */
        #turnTimerContainer {
            position: fixed;
            top: 110px;
            right: 20px;
            z-index: 1001;
            display: none;
        }

        #turnTimer {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            background: linear-gradient(145deg, rgba(26, 26, 46, 0.95), rgba(15, 15, 35, 0.98));
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
            border: 2px solid rgba(255, 215, 0, 0.3);
        }

        #turnTimer.warning {
            animation: timerPulse 0.5s ease-in-out infinite;
            border-color: #ff6b6b;
        }

        @keyframes timerPulse {
            0%, 100% {
                transform: scale(1);
                box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
            }
            50% {
                transform: scale(1.05);
                box-shadow: 0 8px 40px rgba(255, 107, 107, 0.6);
            }
        }

        /* ========== Card Display ========== */
        #cardDisplay {
            position: fixed;
            bottom: 120px;
            left: 20px;
            background: linear-gradient(145deg, rgba(26, 26, 46, 0.98), rgba(15, 15, 35, 0.98));
            padding: 14px 18px;
            border-radius: 16px;
            display: none;
            z-index: 999;
            border: 2px solid rgba(255, 215, 0, 0.4);
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
        }

        #playerInfo {
            color: #ffd700;
            text-align: center;
            margin: 0 0 10px 0;
            font-size: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 1.2px;
        }

        #cardsContainer {
            display: flex;
            gap: 3px;
            justify-content: center;
        }

        .card-image {
            width:50px;
            height: 70px;
            object-fit: cover;
            border-radius: 3px;
            border: 1px solid #ffd700;
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
            transition: transform 0.3s;
        }

        .card-image:hover {
            transform: translateY(-8px) scale(1.08);
        }

        /* ========== Status Message ========== */
        #statusMessage {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0, 0, 0, 0.9);
            color: #ffd700;
            padding: 20px 40px;
            border-radius: 10px;
            text-align: center;
            z-index: 5000;
            display: none;
            font-size: 18px;
            border: 2px solid #ffd700;
        }

        /* ========== TABLET (768px and below) ========== */
        @media (max-width: 768px) {
            /* Collapsible panels */
            .info-panel-header {
                display: flex !important;
            }
            
            .info-panel > h3 {
                display: none;
            }
            
            .info-panel-content {
                max-height: 500px;
                opacity: 1;
                padding-top: 8px;
            }
            
            .info-panel.collapsed .info-panel-content {
                max-height: 0 !important;
                opacity: 0;
                padding-top: 0;
            }
            
            .info-panel.collapsed .info-panel-toggle {
                transform: rotate(-90deg);
            }
            
            .info-panel.collapsed {
                padding: 8px;
                min-width: auto;
            }
            
            .info-panel {
                min-width: 160px;
                padding: 12px;
            }
            
            #playerInfoPanel,
            #gameInfoPanel {
                top: 10px;
            }
            
            #playerInfoPanel { left: 10px; }
            #gameInfoPanel { right: 10px; }
            
            /* Turn timer */
            #turnTimerContainer {
                top: 80px;
                right: 10px;
            }
            
            #turnTimer {
                width: 60px;
                height: 60px;
            }
            
            /* Action buttons */
            #actionButtons {
                bottom: 10px;
                right: 10px;
                max-width: 280px;
                padding: 12px;
                gap: 8px;
            }
            
            #actionButtons button {
                padding: 10px 12px;
                font-size: 11px;
            }
            
            /* Card display */
            #cardDisplay {
                bottom: 100px;
                left: 10px;
                padding: 12px 14px;
            }
            
            .card-image {
                width: 50px;
                height: 70px;
            }

            #snackbar {
                bottom: 90px;
                font-size: 12px;
                padding: 12px 24px;
            }
        }

        /* ========== MOBILE (480px and below) ========== */
        @media (max-width: 480px) {
            .info-panel {
                min-width: 140px;
                padding: 10px;
                border-radius: 12px;
            }
            
            .info-panel.collapsed {
                padding: 6px 8px;
            }
            
            #playerInfoPanel,
            #gameInfoPanel {
                top: 8px;
            }
            
            #playerInfoPanel { left: 8px; }
            #gameInfoPanel { right: 8px; }
            
            .info-panel-header h3 {
                font-size: 11px;
            }
            
            .info-row {
                font-size: 11px;
                padding: 4px 0;
            }
            
            .info-panel-toggle {
                width: 20px;
                height: 20px;
                font-size: 12px;
            }
            
            /* Turn timer */
            #turnTimerContainer {
                top: 70px;
                right: 8px;
            }
            
            #turnTimer {
                width: 50px;
                height: 50px;
            }
            
            /* Action buttons - compact grid */
            #actionButtons {
                bottom: 8px;
                right: 8px;
                max-width: 240px;
                padding: 8px;
                gap: 6px;
                border-radius: 12px;
            }
            
            #actionButtons button {
                padding: 8px 10px;
                font-size: 10px;
                border-radius: 8px;
            }
            
            #betControls {
                padding: 8px 10px;
                gap: 6px;
            }
            
            #betAmount {
                padding: 6px 8px;
                font-size: 11px;
                width: 80px;
            }
            
            #customBetButton {
                padding: 6px 10px;
                font-size: 10px;
            }
            
            /* Card display */
            #cardDisplay {
                bottom: 80px;
                left: 8px;
                padding: 10px 12px;
                border-radius: 12px;
            }
            
            #playerInfo {
                font-size: 10px;
                margin-bottom: 8px;
            }
            
            .card-image {
                width: 50px;
                height: 70px;
            }
            
            #cardsContainer {
                gap: 3px;
            }

            #snackbar {
                bottom: 80px;
                font-size: 11px;
                padding: 10px 20px;
            }

            #statusMessage {
                font-size: 14px;
                padding: 16px 32px;
            }
        }

        /* ========== LANDSCAPE MODE ========== */
        @media (max-height: 500px) and (orientation: landscape) {
            #actionButtons {
                bottom: 5px;
                padding: 6px;
                max-width: 260px;
                gap: 5px;
            }
            
            #actionButtons button {
                padding: 6px 10px;
                font-size: 10px;
            }
            
            #turnTimerContainer {
                top: 10px;
                right: 10px;
            }
            
            #turnTimer {
                width: 50px;
                height: 50px;
            }
            
            #cardDisplay {
                bottom: 60px;
                padding: 8px 10px;
            }
            
            .card-image {
                width: 50px;
                height: 70px;
            }
            
            .info-panel {
                padding: 8px;
            }

            #snackbar {
                bottom: 70px;
            }
        }


        /* In your index.css — fix all popup overlays */
.popup-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 99999 !important;
  display: flex;                    /* NO !important here — JS needs to override */
  align-items: center !important;
  justify-content: center !important;
  background: rgba(0, 0, 0, 0.7) !important;
}

.popup-card {
  position: relative !important;
  z-index: 100000 !important;
  background: #1a1a2e !important;
  border: 1px solid rgba(255, 215, 0, 0.3) !important;
  border-radius: 16px !important;
  padding: 30px !important;
  color: white !important;
  max-width: 90vw !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
}

/* Also fix the Three.js canvas to stay behind UI */
#container canvas {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 0 !important;
}

/* Ensure action buttons and panels are above canvas */
#actionButtons {
  z-index: 1000 !important;
  position: fixed !important;
}

#playerInfoPanel,
#gameInfoPanel {
  z-index: 1000 !important;
  position: fixed !important;
}

#cardDisplay {
  z-index: 1000 !important;
  position: fixed !important;
}

#turnTimerContainer {
  z-index: 1000 !important;
  position: fixed !important;
}

#winnerAnnouncement {
  z-index: 99999 !important;
  position: fixed !important;
}