    :root {
            --neon-purple: #6a3dff;
            --neon-purple-glow: 0 0 8px rgba(106, 61, 255, 0.6);
            --bg-gradient: radial-gradient(ellipse at center, #0a0a14 0%, #05020a 80%);
            --gold: #ffc107;
            --gold-glow: 0 0 8px rgba(255, 193, 7, 0.6);
            --silver: #c0c0c0;
            --silver-glow: 0 0 8px rgba(192, 192, 192, 0.6);
            --bronze: #cd7f32;
            --bronze-glow: 0 0 8px rgba(205, 127, 50, 0.6);
        }

        
        body {
            font-family: 'Inter', sans-serif;
            background: var(--bg-gradient);
            color: white;
            min-height: 100vh;
        }
        
        .card {
            background: rgba(15, 15, 25, 0.6);
            border: 1px solid rgba(106, 61, 255, 0.2);
            border-radius: 12px;
            transition: all 0.3s ease;
        }
        
        .card:hover {
            border-color: rgba(106, 61, 255, 0.5);
            box-shadow: var(--neon-purple-glow);
        }
        
        .glass-card {
            background: rgba(15, 15, 25, 0.6);
            border: 1px solid rgba(106, 61, 255, 0.2);
            border-radius: 12px;
            transition: all 0.3s ease;
        }
        
        .glass-card:hover {
            border-color: rgba(106, 61, 255, 0.5);
            box-shadow: var(--neon-purple-glow);
        }
        
        .neon-text {
            color: white;
            text-shadow: 0 0 5px rgba(106, 61, 255, 0.7);
        }
        
        .neon-button {
            background-color: rgba(106, 61, 255, 0.15);
            border: 1px solid rgba(106, 61, 255, 0.3);
            transition: all 0.3s ease;
        }
        
        .neon-button:hover {
            background-color: rgba(106, 61, 255, 0.25);
            border-color: rgba(106, 61, 255, 0.6);
            box-shadow: var(--neon-purple-glow);
        }
        
        .danger-button {
            background-color: rgba(255, 61, 61, 0.15);
            border: 1px solid rgba(255, 61, 61, 0.3);
            transition: all 0.3s ease;
        }
        
        .danger-button:hover {
            background-color: rgba(255, 61, 61, 0.25);
            border-color: rgba(255, 61, 61, 0.6);
            box-shadow: 0 0 8px rgba(255, 61, 61, 0.6);
        }
        .undo-button:disabled {
            opacity: 0.7;
            filter: grayscale(100%);
            cursor: not-allowed;
            background-color: rgba(107, 114, 128, 0.2) !important; 
            border: 1px solid rgba(107, 114, 128, 0.4) !important; 
            color: #9ca3af !important; 
            box-shadow: none !important;
        }
        
        .undo-button:disabled:hover {
            background-color: rgba(107, 114, 128, 0.2) !important;
            border: 1px solid rgba(107, 114, 128, 0.4) !important;
            color: #9ca3af !important;
            box-shadow: none !important;
            transform: none !important;
        }
        
        .match-completed {
            position: relative;
            transition: all 0.3s ease;
        }
        
        .match-completed::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(15, 15, 25, 0.85);
            border-radius: 12px;
            z-index: 1;
            pointer-events: none;
            transition: all 0.3s ease;
        }
        
        .match-completed .bracket-match-card {
            filter: grayscale(70%) brightness(0.7);
        }
        
        .match-completed:hover {
            transform: none !important;
            box-shadow: none !important;
        }
        
        .match-completed .undo-button {
            position: relative !important;
            z-index: 10 !important;
            opacity: 1 !important;
            filter: none !important;
            background-color: rgba(255, 61, 61, 0.15) !important;
            border: 1px solid rgba(255, 61, 61, 0.3) !important;
            color: white !important;
            box-shadow: 0 0 0 1px rgba(255, 61, 61, 0.2) !important;
        }
        
        .match-completed .undo-button:hover {
            background-color: rgba(255, 61, 61, 0.25) !important;
            border-color: rgba(255, 61, 61, 0.6) !important;
            box-shadow: 0 0 8px rgba(255, 61, 61, 0.6), 0 0 0 1px rgba(255, 61, 61, 0.4) !important;
            transform: translateY(-1px) !important;
        }
        
        .match-completed .undo-button:disabled {
            background-color: rgba(107, 114, 128, 0.2) !important;
            border: 1px solid rgba(107, 114, 128, 0.4) !important;
            color: #9ca3af !important;
            box-shadow: none !important;
            filter: grayscale(100%) !important;
        }
        
        .match-completed .undo-button:disabled:hover {
            background-color: rgba(107, 114, 128, 0.2) !important;
            border: 1px solid rgba(107, 114, 128, 0.4) !important;
            color: #9ca3af !important;
            box-shadow: none !important;
            transform: none !important;
        }
        

        
        .winner-avatar {
            border: 1px solid rgba(106, 61, 255, 0.5);
            box-shadow: var(--neon-purple-glow);
        }
        
        .gw-divider {
            height: 1px;
            background: linear-gradient(90deg, rgba(106, 61, 255, 0) 0%, rgba(106, 61, 255, 0.5) 50%, rgba(106, 61, 255, 0) 100%);
        }
        
        .countdown-circle {
            position: relative;
            width: 160px;
            height: 160px;
        }
        
        .countdown-circle svg {
            transform: rotate(-90deg);
        }
        
        .countdown-circle circle {
            fill: transparent;
            stroke-width: 8;
            stroke-linecap: round;
        }
        
        .countdown-bg {
            stroke: rgba(106, 61, 255, 0.2);
        }
        
        .countdown-progress {
            stroke: #6a3dff;
            stroke-dasharray: 440;
            stroke-dashoffset: 110;
            filter: drop-shadow(0 0 4px rgba(106, 61, 255, 0.8));
            transform-origin: center;
            transition: stroke-dashoffset 0.5s linear;
        }
        
        .countdown-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 1.75rem;
            font-weight: 600;
        }
        
        .participant-item {
            transition: transform 0.2s ease;
        }
        
        .participant-item:hover {
            transform: translateY(-2px);
            background-color: rgba(106, 61, 255, 0.08) !important;
        }
        
        .back-button {
            position: absolute;
            top: 20px;
            left: 20px;
            z-index: 10;
        }
        
        .bet-won-border {
            border-left: 4px solid #28a745;
        }
        
        .bet-lost-border {
            border-left: 4px solid #dc3545;
        }
        .timeline-connector {
            position: absolute;
            left: 50%;
            top: 100%;
            width: 2px;
            height: 40px;
            background: linear-gradient(to bottom, #a78bfa 0%, transparent 100%);
            z-index: 0;
        }
        .timeline-dot {
            width: 24px;
            height: 24px;
            background: #6a3dff;
            border-radius: 50%;
            border: 3px solid #fff;
            box-shadow: 0 0 0 4px rgba(106, 61, 255, 0.2);
            position: relative;
            z-index: 1;
        }
        .timeline-card {
            background: rgba(15, 15, 25, 0.7);
            border: 1px solid rgba(106, 61, 255, 0.2);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 2rem;
            position: relative;
        }
        .timeline-card .winner-avatar {
            border: 2px solid #ffcc00;
            box-shadow: 0 0 8px #ffcc00aa;
        }
        .timeline-badge {
            background: #22c55e;
            color: #fff;
            border-radius: 9999px;
            padding: 0.25rem 0.75rem;
            font-size: 0.75rem;
            font-weight: 600;
            position: absolute;
            right: 1.5rem;
            top: 1.5rem;
        }
        .timeline-meta {
            font-size: 0.9rem;
            color: #a3a3a3;
        }
        .timeline-prize {
            color: #ffcc00;
            font-weight: bold;
        }
        .timeline-participants {
            color: #a78bfa;
            font-weight: bold;
        }
        .timeline-winner {
            color: #ffcc00;
            font-weight: bold;
        }
        .meta-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: rgba(124, 77, 255, 0.08);
            border: 1px solid rgba(124, 77, 255, 0.25);
            border-radius: 9999px;
            font-weight: 600;
        }
        .meta-chip .fa-ticket { color: #a78bfa; }
        .meta-chip .fa-coins { color: #ffd54a; }
        .prize-banner {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            background: rgba(255, 215, 0, 0.1);
            border: 1px solid rgba(255, 215, 0, 0.35);
            border-radius: 12px;
            color: #ffd54a;
            font-weight: 800;
        }
        .prize-banner .fa-trophy { color: #ffd54a; }
        .countdown-gradient {
            background: linear-gradient(90deg, #a78bfa, #6a3dff, #a78bfa);
            background-size: 200% 100%;
            animation: slideBg 6s linear infinite;
        }
        @keyframes slideBg {
            0% { background-position: 0% 50%; }
            100% { background-position: -200% 50%; }
        }
        .autocomplete-item {
            background: #18182a;
        }
        .autocomplete-item:hover, .autocomplete-item.bg-purple-500\/20 {
            background: #474747 !important;
        }
        
        .hero-card {
            background: rgba(15, 15, 25, 0.6);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(106, 61, 255, 0.2);
            border-radius: 12px;
            transition: all 0.3s ease;
        }
        
        .gw-status {
            background: linear-gradient(180deg, rgba(106, 61, 255, 0.1) 0%, rgba(106, 61, 255, 0.05) 100%);
        }
        
        .gw-item {
            transition: transform 0.2s ease;
        }
        
        .gw-item:hover {
            transform: translateY(-2px);
        }
        
        .gw-divider {
            height: 1px;
            background: linear-gradient(90deg, rgba(106, 61, 255, 0) 0%, rgba(106, 61, 255, 0.5) 50%, rgba(106, 61, 255, 0) 100%);
        }

        .primary-button {
            background: linear-gradient(135deg, #6a3dff, #8b6eff);
            border-radius: 8px;
            color: white;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 0 15px rgba(106, 61, 255, 0.4);
            border: none;
        }

        .primary-button:hover {
            box-shadow: 0 0 20px rgba(106, 61, 255, 0.6);
            transform: translateY(-2px);
        }

        .tab-button {
            padding: 8px 16px;
            border-radius: 4px;
            transition: background-color 0.2s ease;
            font-weight: 500;
            font-size: 14px;
            border: 1px solid transparent;
        }

        .tab-button.active {
            background: #6a3dff;
            color: white;
        }

        .tab-button:not(.active) {
            color: #9ca3af;
            background: rgba(15, 15, 25, 0.4);
            border: 1px solid rgba(106, 61, 255, 0.2);
        }

        .tab-button:not(.active):hover {
            background: rgba(106, 61, 255, 0.1);
            color: #d1d5db;
        }

        .pagination-button {
            transition: all 0.3s ease;
        }
        
        .pagination-button:not(:disabled):hover {
            background-color: rgba(106, 61, 255, 0.25);
            border-color: rgba(106, 61, 255, 0.6);
            box-shadow: var(--neon-purple-glow);
        }
        
        .pagination-button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        @media (max-width: 640px) {
            .hero-card {
                padding: 1.5rem;
            }
            
            .hero-card h2 {
                font-size: 1.25rem;
            }
        }

        .prize-display {
            background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
            border-radius: 8px;
            padding: 8px 12px;
            transition: all 0.3s ease;
        }
        
        .prize-display:hover {
            background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 215, 0, 0.08) 100%);
            border-color: rgba(255, 193, 7, 0.5);
            box-shadow: 0 0 8px rgba(255, 193, 7, 0.3);
        }

        .history-card {
            background: rgba(15, 15, 25, 0.6);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(106, 61, 255, 0.2);
            border-radius: 12px;
            padding: 20px;
            transition: all 0.3s ease;
        }

        .history-card:hover {
            border-color: rgba(106, 61, 255, 0.5);
            box-shadow: var(--neon-purple-glow);
            transform: translateY(-2px);
        }

        .history-card.compact {
            padding: 12px;
            min-height: auto;
        }

        .history-card.compact:hover {
            transform: translateY(-1px);
        }

        .status-badge {
            display: inline-flex;
            align-items: center;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 9px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .won-badge {
            background: none;
            color: #38d974;
            border: none;
        }

        .lost-badge {
            background: none;
            color: #ef4444;
            border: none;
        }

        .pending-badge {
            background: none;
            color: #9ca3af;
            border: none;
        }

        .prize-badge {
            background: rgba(106, 61, 255, 0.15);
            border: 1px solid rgba(106, 61, 255, 0.3);
            border-radius: 9999px;
            padding: 0.25rem 0.75rem;
            font-size: 0.875rem;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #a78bfa;
        }

        .winner-avatar {
            border: 1px solid rgba(106, 61, 255, 0.5);
            box-shadow: var(--neon-purple-glow);
            border-radius: 50%;
        }

        .winning-ticket {
            border-color: rgba(255, 193, 7, 0.6) !important;
            box-shadow: 0 0 8px rgba(255, 193, 7, 0.4) !important;
        }

        .selected-player {
            background-color: rgba(106, 61, 255, 0.2) !important;
            border-color: rgba(106, 61, 255, 0.6) !important;
            box-shadow: 0 0 8px rgba(106, 61, 255, 0.4) !important;
        }


        .winner-avatar { border-radius: 50%; overflow: hidden; }
        
        .card-minimal {
            background: rgba(15, 15, 25, 0.6);
            border: 1px solid rgba(106, 61, 255, 0.2);
        }
        
        .history-scroll {
            scrollbar-width: thin;
        }
        
        .history-scroll::-webkit-scrollbar {
            width: 6px;
        }
        
        .history-scroll::-webkit-scrollbar-track {
            background: rgba(15, 15, 25, 0.6);
            border-radius: 3px;
        }
        
        .history-scroll::-webkit-scrollbar-thumb {
            background: var(--neon-purple);
            border-radius: 3px;
        }
        
        .history-scroll::-webkit-scrollbar-thumb:hover {
            background: #7c4dff;
        }
        
        .h-80vh {
            height: 80vh;
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(5px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 50;
        }
        
        .modal {
            background: rgba(15, 15, 25, 0.95);
            border: 1px solid rgba(106, 61, 255, 0.3);
            border-radius: 16px;
            box-shadow: 0 0 20px rgba(106, 61, 255, 0.3);
            max-width: 90%;
            width: 500px;
            max-height: 90vh;
            overflow-y: auto;
        }
        
        .modal-header {
            background: rgba(106, 61, 255, 0.15);
            border-bottom: 1px solid rgba(106, 61, 255, 0.3);
            border-radius: 16px 16px 0 0;
        }
        
        .modal-title {
            background: linear-gradient(135deg, #6a3dff, #a183ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: var(--neon-purple-glow);
        }
        
        .close-button {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }
        
        .close-button:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: rotate(90deg);
        }
        
        .form-input {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(106, 61, 255, 0.2);
            border-radius: 8px;
            color: white;
            transition: all 0.3s ease;
        }
        
        .form-input:focus {
            border-color: rgba(106, 61, 255, 0.5);
            box-shadow: 0 0 0 2px rgba(106, 61, 255, 0.2);
            outline: none;
        }
        
        .form-label {
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.875rem;
            margin-bottom: 0.5rem;
            display: block;
        }
        
        .submit-button {
            background: linear-gradient(135deg, #6a3dff, #8a63ff);
            border-radius: 8px;
            padding: 0.75rem 1.5rem;
            font-weight: 600;
            transition: all 0.3s ease;
            border: none;
            color: white;
        }
        
        .submit-button:hover {
            box-shadow: 0 0 15px rgba(106, 61, 255, 0.5);
            transform: translateY(-2px);
        }

        .modal-hidden {
            display: none !important;
        }
        
        .scroll-area::-webkit-scrollbar {
            width: 4px;
        }

        .scroll-area::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.02);
            border-radius: 2px;
        }

        .scroll-area::-webkit-scrollbar-thumb {
            background: rgba(106, 61, 255, 0.3);
            border-radius: 2px;
        }

        .scroll-area::-webkit-scrollbar-thumb:hover {
            background: rgba(106, 61, 255, 0.5);
        }
     .first-place .winner-avatar { border: 2px solid var(--gold); box-shadow: var(--gold-glow); }
        
        .tournament-header {
            animation: fadeInDown 0.6s ease-out;
        }
        
        @keyframes fadeInDown {
            0% {
                opacity: 0;
                transform: translateY(-20px);
            }
            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        @media (max-width: 900px) {
            .tournament-header {
                display: none;
            }
        }
        
        #userBetIndicator {
            animation: fadeInUp 0.5s ease-out;
        }
        
        @keyframes fadeInUp {
            0% {
                opacity: 0;
                transform: translateY(10px);
            }
            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .bracket-grid { display: grid; gap: 20px; align-items: start; justify-items: stretch; }
        .match-card { min-width: 220px; }
        
        .bracket-two-sided {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            gap: 40px;
            align-items: start;
            justify-items: center;
            width: 100%;
            margin: 0 auto;
        }
        
        .bracket-left {
            display: flex;
            gap: 24px;
            align-items: start;
            justify-content: flex-end;
        }

        .bracket-controls {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 16px;
        }

        @media (max-width: 768px) {
            .bracket-controls {
                display: none !important;
            }
        }

        .bracket-fs {
            background: #0b0b14 !important;
        }
        .bracket-fs #tournamentBracket {
            position: absolute !important;
            top: 16px;
            left: 16px;
            right: 16px;
            bottom: 84px;
            overflow: hidden !important;
            width: auto !important;
            height: auto !important;
        }
        .bracket-fs .bracket-controls {
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            bottom: 16px;
            margin-top: 0;
            z-index: 3;
        }
        
        .bracket-center {
            display: flex;
            flex-direction: column;
            gap: 20px;
            align-items: center;
            width: 200px;
            flex-shrink: 0;
        }
        
        .bracket-right {
            display: flex;
            gap: 24px;
            align-items: start;
            justify-content: flex-start;
            flex-direction: row-reverse;
        }
        
        .bracket-round {
            display: flex;
            flex-direction: column;
            width: 200px;
            flex-shrink: 0;
            min-height: 600px;
            position: relative;
        }
        
        .bracket-round-right {
            align-items: flex-end;
        }
        
        .bracket-match-card {
            width: 200px !important;
            max-width: 200px !important;
            box-sizing: border-box;
        }
        
        .bracket-match-left {
            align-self: flex-end;
        }
        
        .bracket-match-right {
            align-self: flex-start;
        }
        
        .bracket-two-sided .glass-card {
            transition: all 0.2s ease;
        }
        
        .bracket-two-sided .glass-card:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(106, 61, 255, 0.3);
        }
        .winner-card {
            box-shadow: 0 0 12px rgba(250, 204, 21, 0.25);
            border-color: #facc15 !important;
            transition: all 0.3s ease;
        }
        
        .winner-card:hover {
            box-shadow: 0 0 16px rgba(250, 204, 21, 0.4);
            transform: translateY(-1px);
            border-color: rgba(255, 193, 7, 0.8) !important;
            box-shadow: 0 0 20px rgba(255, 193, 7, 0.6), 0 0 16px rgba(250, 204, 21, 0.4);
        }
        
        .winner-card .fa-crown {
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 8px rgba(255, 193, 7, 0.6));
        }
        
        .winner-card .bet-badge {
            display: none !important;
        }
        .bet-badge {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 16px;
            height: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #10b981;
            font-size: 8px;
            pointer-events: none;
            z-index: 10;
        }
        
        .bet-badge.mirror {
            right: auto;
            left: 4px;
        }
        
        .match-completed .bet-badge {
            color: #6b7280;
        }
        .ticket-badge {
    background: rgba(106, 61, 255, 0.15);
    border: 1px solid rgba(106, 61, 255, 0.3);
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex
;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
        }
    #entryFeeDisplay {
    margin: 0 4px;
}
        
        @media (max-width: 1200px) {
            .bracket-two-sided {
                gap: 20px;
            }
            .bracket-left, .bracket-right {
                gap: 16px;
            }
            .bracket-round {
                width: 180px;
            }
            .bracket-match-card {
                width: 180px !important;
                max-width: 180px !important;
            }
            .bracket-center {
                width: 200px;
            }
        }
        
        @media (max-width: 900px) {
            .bracket-two-sided {
                display: grid;
                grid-template-columns: 1fr;
                gap: 16px;
            }
            .bracket-left, .bracket-right, .bracket-center {
                width: 100%;
            }
            .bracket-left, .bracket-right {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 12px;
            }
            .bracket-round {
                width: auto;
            }
            .bracket-center {
                order: 2;
            }
        }
        
        #bracketCard {
            height: 80vh !important;
            display: flex !important;
            overflow: hidden;
            flex-direction: column !important;
        }
        
        #bracketCard.bracket-fs {
            height: 100vh !important;
            z-index: 1000;
        }
        
        #tournamentBracket {
            flex: 1 !important;
            min-height: 0 !important;
        }
        
        .tournament-header {
            flex-shrink: 0 !important;
            z-index: 10000;
        }
        
        .bracket-controls {
            flex-shrink: 0 !important;
            z-index: 10000;
        }