        html, body { height: 100%; margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background:#f5f5f5; }

        /* App container - wraps sidebar and map */
        #appContainer {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }

        /* Sidebar */
        #sidebar {
            position: absolute; top:0; left:0; bottom:0;
            width: 33.333%;
            background: #fff;
            box-shadow: 2px 0 8px rgba(0,0,0,0.15);
            overflow-y: auto;
            z-index: 1000;
            padding: 0;
            display: flex; flex-direction: column;
        }

        /* Menu button */
        .menu-button {
            background: #4CAF50;
            border: none;
            color: white;
            font-size: 24px;
            padding: 15px 20px;
            cursor: pointer;
            width: 60px;
            text-align: left;
            transition: background 0.3s;
        }

        .menu-button:hover {
            background: #45a049;
        }

        /* Menu overlay */
        .menu-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 2000;
        }

        .menu-overlay.active {
            display: block;
        }

        /* Menu panel */
        .menu-panel {
            position: fixed;
            top: 0;
            left: -250px;
            width: 250px;
            height: 100%;
            background: #2c3e50;
            z-index: 2001;
            transition: left 0.3s ease;
            box-shadow: 2px 0 10px rgba(0,0,0,0.3);
        }

        .menu-panel.active {
            left: 0;
        }

        .menu-header {
            background: #34495e;
            color: white;
            padding: 20px;
            font-size: 1.3em;
            font-weight: bold;
            border-bottom: 2px solid #4CAF50;
        }

        .menu-items {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .menu-items li {
            border-bottom: 1px solid #34495e;
        }

        .menu-items li a {
            display: block;
            color: white;
            padding: 15px 20px;
            text-decoration: none;
            transition: background 0.2s;
            cursor: pointer;
        }

        .menu-items li a:hover {
            background: #34495e;
        }

        .menu-items li a.active {
            background: #4CAF50;
            font-weight: bold;
        }

        /* Sidebar content area */
        .sidebar-content {
            padding: 12px 16px;
            flex: 1;
            overflow-y: auto;
        }

        /* View panels */
        .view-panel {
            display: none;
        }

        .view-panel.active {
            display: block;
        }

        #sidebar h2 {
            margin-top:0; margin-bottom:10px;
            font-size:1.4em; color:#333;
            text-align:center;
            border-bottom: 2px solid #4CAF50; padding-bottom:4px;
        }

        .searchBox {
            width: 100%; padding: 8px; margin-bottom: 8px;
            border-radius:6px; border:1px solid #ccc; font-size:1em;
            box-sizing: border-box;
        }

        #casinoList { list-style: none; padding:0; margin:0; flex-grow:1; }

        /* Casino card */
        .casino-card {
            background:#f9f9f9; margin-bottom:8px; padding:10px 12px;
            border-radius:6px; cursor:pointer; transition:all 0.2s ease;
            box-shadow:0 1px 3px rgba(0,0,0,0.1);
            border-left: 4px solid #4CAF50;
            position: relative;
        }
        .casino-card:hover { background:#e8f5e9; transform:translateY(-2px); box-shadow:0 4px 8px rgba(0,0,0,0.15); }
        .casino-card.selected { border-left-width: 24px; background:#e0f2e9; padding-left: 8px; }

        /* Roulette number badge - hidden by default, shown when selected */
        .casino-card .roulette-number {
            position: absolute;
            left: -20px;
            top: 50%;
            transform: translateY(-50%);
            width: 24px;
            text-align: center;
            font-size: 0.75em;
            font-weight: bold;
            color: white;
            opacity: 0;
            transition: opacity 0.2s ease;
            pointer-events: none;
            text-shadow: 0 1px 2px rgba(0,0,0,0.3);
        }
        .casino-card.selected .roulette-number { opacity: 1; left: -24px; }

        /* Casino card color variants - just the left border accent */
        .casino-card.card-red { border-left-color: #e74c3c; }
        .casino-card.card-red:hover { background: #fdeaea; }
        .casino-card.card-red.selected { background: #f9d6d6; }

        .casino-card.card-black { border-left-color: #2c3e50; }
        .casino-card.card-black:hover { background: #eaecee; }
        .casino-card.card-black.selected { background: #d5d8dc; }

        .casino-card.card-green { border-left-color: #27ae60; }
        .casino-card.card-green:hover { background: #e8f5e9; }
        .casino-card.card-green.selected { background: #d4edda; }

        .casino-name { font-weight:bold; font-size:1.05em; margin-bottom:3px; color:#2c3e50; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
        .amenity-flags { display: inline-flex; gap: 4px; font-size: 1.1em; }
        .amenity-icon { cursor: help; transition: transform 0.15s ease; display: inline-block; }
        .amenity-icon:hover { transform: scale(1.3); }
        .tribe-name { font-weight:bold; font-size:0.8em; margin-bottom:3px; color:#2c3e50; text-align: center; }
        .slot-list { margin-left:10px; font-size:0.9em; color:#555; display:none; padding-top:5px; }
        .slot-list li { margin-bottom:3px; }
        .slot-list li.low { color:#1abc9c; }
        .slot-list li.medium { color:#f39c12; }
        .slot-list li.high { color:#e74c3c; }

        /* Map */
        #map { position:absolute; top:0; bottom:0; left:33.333%; right:0; }

        /* Custom cluster styling */
        .marker-cluster {
            background-color: rgba(76, 175, 80, 0.6);
            border-radius: 50%;
        }
        .marker-cluster div {
            background-color: #4CAF50;
            color: white;
            border-radius: 50%;
            text-align: center;
            font-weight: bold;
            width: 30px;
            height: 30px;
            line-height: 30px;
            margin: 5px;
        }

        /* 📌 NEW: Custom Marker Styles for L.divIcon */
        .custom-marker {
            width: 32px;
            height: 42px;
            position: relative;
        }

        /* The main teardrop shape */
        .custom-marker-pin {
            position: absolute;
            top: 0;
            left: 0;
            width: 32px;
            height: 32px;
            border-radius: 50% 50% 50% 0;
            transform: rotate(-45deg); /* Rotated square */
            border: 2px solid #fff;
            box-shadow: 0 1px 4px rgba(0,0,0,0.4);
            /* Flexbox to perfectly center the content inside the rotated shape */
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 5;
        }

        /* Wrapper to counter-rotate the content so it looks straight */
        .custom-marker-content-wrapper {
            width: 26px; 
            height: 26px;
            transform: rotate(45deg); /* Counter-rotation */
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* The circular clipper for the image/dice */
        .custom-marker-content {
            width: 100%;
            height: 100%;
            border-radius: 50%; 
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .custom-marker-shadow {
            position: absolute;
            width: 16px;
            height: 4px;
            bottom: 0;
            left: 8px;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.2);
            z-index: 1;
        }

        .custom-marker-favicon {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .custom-marker-badge {
            position: absolute;
            top: 2px;
            right: -8px;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            color: white;
            text-align: center;
            line-height: 12px;
            font-size: 8px;
            font-weight: bold;
            z-index: 20;
        }

        /* Dice Fallback styles */
        .dice-icon {
            display: none; /* Hidden by default, shown when favicon fails */
            grid-template-columns: 1fr 1fr;
            grid-template-rows: 1fr 1fr;
            gap: 5px;
            width: 16px;
            height: 16px;
        }
        .dice-dot {
            width: 4px;
            height: 4px;
            border-radius: 50%;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            z-index: 2000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            animation: fadeIn 0.3s;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal-content {
            background-color: #fff;
            margin: 5% auto;
            padding: 20px 24px;
            border-radius: 10px;
            width: 90%;
            max-width: 600px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            max-height: 80vh;
            overflow-y: auto;
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            border-bottom: 2px solid #4CAF50;
            padding-bottom: 8px;
        }

        .modal-header h2 {
            margin: 0;
            color: #333;
        }

        .close {
            font-size: 28px;
            font-weight: bold;
            color: #aaa;
            cursor: pointer;
            transition: color 0.2s;
        }

        .close:hover {
            color: #000;
        }

        .form-group {
            margin-bottom: 14px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
            color: #555;
            font-size: 0.95em;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 5px;
            font-size: 14px;
            box-sizing: border-box;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 70px;
        }

        .denomination-list, .minimum-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 8px;
        }

        .denomination-item, .minimum-item {
            background: #e8f5e9;
            padding: 6px 10px;
            border-radius: 5px;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.95em;
        }

        .denomination-item button, .minimum-item button {
            background: #f44336;
            color: white;
            border: none;
            border-radius: 3px;
            padding: 2px 6px;
            cursor: pointer;
        }

        /* Denomination checkbox button styling */
        .denom-checkbox {
            display: none; /* Hide the actual checkbox */
        }

        .denom-checkbox + span {
            display: inline-block;
            padding: 10px 16px;
            background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
            border: 2px solid #ced4da;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.15s ease;
            font-weight: 600;
            color: #495057;
            text-align: center;
            min-width: 60px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1), inset 0 -2px 4px rgba(0,0,0,0.05);
            -webkit-user-select: none;
            user-select: none;
        }

        .denom-checkbox + span:hover {
            background: linear-gradient(to bottom, #e9ecef 0%, #dee2e6 100%);
            border-color: #adb5bd;
        }

        .denom-checkbox:checked + span {
            background: linear-gradient(to bottom, #4CAF50 0%, #45a049 100%);
            border-color: #388e3c;
            color: white;
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.1);
            transform: translateY(2px);
        }

        .denom-checkbox:checked + span:hover {
            background: linear-gradient(to bottom, #45a049 0%, #3d8b40 100%);
        }

        /* Animation for click */
        .denom-checkbox + span:active {
            transform: translateY(2px);
            box-shadow: inset 0 2px 4px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.1);
        }

        .btn-primary {
            background: #4CAF50;
            color: white;
            padding: 12px 30px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            transition: background 0.2s;
        }

        .btn-primary:hover {
            background: #45a049;
        }

        .btn-secondary {
            background: #2196F3;
            color: white;
            padding: 8px 16px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            margin-top: 10px;
        }

        .btn-secondary:hover {
            background: #0b7dda;
        }

        .btn-removal {
            background: #f44336;
            color: white;
            padding: 12px 30px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            font-weight: bold;
            transition: background 0.2s;
        }

        .btn-removal:hover {
            background: #da190b;
        }

        .add-game-btn {
            background: #4CAF50;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
            margin: 5px 0;
        }

        .add-game-btn:hover {
            background: #45a049;
        }

        /* Leaderboard Styles */
        .leaderboard-container {
            margin-top: 20px;
        }

        .leaderboard-entry {
            background: #f9f9f9;
            padding: 15px;
            margin-bottom: 10px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 15px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            transition: all 0.2s;
        }

        .leaderboard-entry:hover {
            background: #e8f5e9;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        }

        .rank-badge {
            min-width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.2em;
        }

        .rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: white; }
        .rank-2 { background: linear-gradient(135deg, #C0C0C0, #808080); color: white; }
        .rank-3 { background: linear-gradient(135deg, #CD7F32, #8B4513); color: white; }
        .rank-other { background: #e0e0e0; color: #666; }

        .leaderboard-info {
            flex: 1;
        }

        .leaderboard-username {
            font-weight: bold;
            font-size: 1.1em;
            margin-bottom: 5px;
        }

        .leaderboard-points {
            color: #666;
            font-size: 0.9em;
        }

        .leaderboard-tier {
            margin-left: 8px;
        }

        /* Profile Stats */
        .profile-stats {
            background: linear-gradient(135deg, #4CAF50, #45a049);
            padding: 20px;
            border-radius: 10px;
            color: white;
            margin-bottom: 20px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .profile-stats h3 {
            margin: 0 0 15px 0;
            font-size: 1.3em;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 15px;
            margin-bottom: 15px;
        }

        .stat-item {
            text-align: center;
        }

        .stat-value {
            font-size: 2em;
            font-weight: bold;
            display: block;
        }

        .stat-label {
            font-size: 0.85em;
            opacity: 0.9;
        }

        .progress-bar {
            background: rgba(255,255,255,0.3);
            border-radius: 10px;
            height: 20px;
            overflow: hidden;
            margin-top: 10px;
        }

        .progress-fill {
            background: white;
            height: 100%;
            transition: width 0.5s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75em;
            font-weight: bold;
            color: #4CAF50;
        }

        .next-tier-info {
            text-align: center;
            margin-top: 10px;
            font-size: 0.9em;
        }

        /* Ownership Badge Styles */
        .ownership-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 0.75em;
            font-weight: bold;
            margin-left: 6px;
        }

        .ownership-badge.verified {
            background: linear-gradient(135deg, #FFD700, #FFA500);
            color: white;
        }

        .ownership-badge.locked {
            background: #e74c3c;
            color: white;
        }

        .ownership-badge.claimed {
            background: #3498db;
            color: white;
        }

        /* Claim Button */
        .claim-ownership-btn {
            width: 100%;
            padding: 10px;
            background: linear-gradient(135deg, #3498db, #2980b9);
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 0.9em;
            cursor: pointer;
            margin-top: 10px;
            transition: all 0.2s;
        }

        .claim-ownership-btn:hover {
            background: linear-gradient(135deg, #2980b9, #21618c);
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        .claim-ownership-btn:disabled {
            background: #95a5a6;
            cursor: not-allowed;
            transform: none;
        }

        /* Mobile-specific styles */
        @media (max-width: 768px) {
            /* Stack layout: map on top, sidebar below */
            html, body {
                height: auto;
                min-height: 100%;
                overflow-x: hidden;
            }

            /* Flexbox container for stacking */
            #appContainer {
                position: relative !important;
                display: flex;
                flex-direction: column;
            }

            /* Map goes first (on top) */
            #map {
                position: relative !important;
                left: 0 !important;
                width: 100% !important;
                height: 60vh !important;
                min-height: 300px;
                order: 1; /* Map appears first */
                flex-shrink: 0;
            }

            /* Sidebar goes second (below map) */
            #sidebar {
                position: relative !important;
                width: 100% !important;
                height: auto !important;
                min-height: 40vh;
                top: auto !important;
                left: auto !important;
                bottom: auto !important;
                box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
                order: 2; /* Sidebar appears second */
                flex-grow: 1;
            }

            /* Make casino list scrollable */
            #casinoList {
                max-height: none !important;
                overflow-y: visible !important;
                padding-bottom: 20px;
            }

            /* Casino cards - better touch targets */
            .casino-card {
                padding: 14px 16px;
                margin-bottom: 10px;
            }

            .casino-name {
                font-size: 1.1em;
            }

            .tribe-name {
                font-size: 0.85em;
            }

            /* Search box improvements */
            #searchBoxCasino, #searchBoxSlot {
                font-size: 16px !important; /* Prevents zoom on iOS */
                padding: 12px !important;
            }

            /* Menu button bigger touch target */
            .menu-button {
                padding: 12px 16px;
                min-height: 48px;
            }

            /* Sidebar header adjustments */
            .sidebar-content h2 {
                font-size: 1.3em;
                margin: 10px 0;
            }

            /* Increase font size in Leaflet popups on mobile */
            .leaflet-popup-content {
                font-size: 16px !important;
                line-height: 1.5;
            }

            .leaflet-popup-content b {
                font-size: 18px !important;
            }

            .leaflet-popup-content .add-game-btn {
                font-size: 14px !important;
                padding: 10px 16px !important;
                min-height: 44px; /* Better touch target */
            }

            .leaflet-popup-content a {
                font-size: 14px !important;
                padding: 10px 14px !important;
                min-height: 44px; /* Better touch target */
            }

            .leaflet-popup-content .amenity-flags {
                font-size: 1.4em !important;
            }

            /* Modal improvements for mobile */
            .modal-content {
                width: 95% !important;
                max-width: none !important;
                margin: 10px auto !important;
                max-height: 90vh !important;
                overflow-y: auto !important;
            }

            /* Profile/Leaderboard panel on mobile */
            #profilePanel, #leaderboardPanel {
                width: 100% !important;
                left: 0 !important;
            }

            /* View panels on mobile */
            .view-panel {
                padding: 10px 15px;
            }
        }
/* FAQ Styling */
.faq-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #4CAF50;
}

.faq-item h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
    font-weight: 600;
}

.faq-item p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

#faqView {
    overflow-y: auto;
}

#faqView h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
}

/* Shop Styling */
.shop-container {
    padding: 10px 0;
}

.shop-category {
    margin-bottom: 30px;
}

.shop-category-title {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.shop-item {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shop-item:hover {
    border-color: #9C27B0;
    box-shadow: 0 4px 8px rgba(156, 39, 176, 0.2);
    transform: translateY(-2px);
}

.shop-item.owned {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.shop-item.equipped {
    border-color: #2196F3;
    background: #e3f2fd;
}

.shop-item-preview {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shop-preview-text {
    display: inline-block;
}

.shop-item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-item-name {
    font-weight: 600;
    color: #333;
    font-size: 1em;
}

.shop-item-description {
    font-size: 0.85em;
    color: #666;
    line-height: 1.4;
}

.shop-btn {
    padding: 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-btn-buy {
    background: #9C27B0;
    color: white;
}

.shop-btn-buy:hover {
    background: #7B1FA2;
    transform: scale(1.02);
}

.shop-btn-equip {
    background: #4CAF50;
    color: white;
}

.shop-btn-equip:hover {
    background: #388E3C;
    transform: scale(1.02);
}

.shop-btn-equipped {
    background: #2196F3;
    color: white;
    cursor: default;
}

.shop-btn-equipped:hover {
    background: #1976D2;
}

/* Color effect animations */
@keyframes color-shift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(180deg); }
}

@keyframes rainbow-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 5px currentColor; }
    50% { text-shadow: 0 0 20px currentColor; }
}

/* Mobile responsive for shop */
@media (max-width: 768px) {
    .shop-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .shop-item {
        padding: 12px;
    }

    .shop-item-preview {
        min-height: 50px;
        font-size: 1em;
    }
}
