@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap");

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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    display: flex;
    min-height: 100vh;
    color: white;
    padding: 20px;
    gap: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(2px 2px at 15% 90%, white, transparent),
        radial-gradient(1px 1px at 45% 20%, white, transparent),
        radial-gradient(1px 1px at 25% 60%, white, transparent),
        radial-gradient(2px 2px at 70% 40%, white, transparent),
        radial-gradient(1px 1px at 85% 85%, white, transparent),
        radial-gradient(1px 1px at 10% 50%, white, transparent),
        radial-gradient(2px 2px at 40% 10%, white, transparent),
        radial-gradient(1px 1px at 65% 25%, white, transparent),
        radial-gradient(1px 1px at 30% 40%, white, transparent),
        radial-gradient(2px 2px at 55% 90%, white, transparent),
        radial-gradient(1px 1px at 75% 65%, white, transparent),
        radial-gradient(1px 1px at 95% 45%, white, transparent),
        radial-gradient(1px 1px at 5% 75%, white, transparent),
        radial-gradient(2px 2px at 48% 55%, white, transparent),
        radial-gradient(1px 1px at 12% 12%, white, transparent),
        radial-gradient(2px 2px at 88% 88%, white, transparent),
        radial-gradient(1px 1px at 42% 72%, white, transparent),
        radial-gradient(1px 1px at 68% 18%, white, transparent),
        radial-gradient(2px 2px at 22% 48%, white, transparent),
        radial-gradient(1px 1px at 58% 38%, white, transparent),
        radial-gradient(1px 1px at 78% 78%, white, transparent),
        radial-gradient(2px 2px at 35% 65%, white, transparent),
        radial-gradient(1px 1px at 52% 8%, white, transparent),
        radial-gradient(1px 1px at 8% 28%, white, transparent),
        radial-gradient(2px 2px at 92% 32%, white, transparent),
        radial-gradient(1px 1px at 18% 58%, white, transparent),
        radial-gradient(1px 1px at 72% 52%, white, transparent),
        radial-gradient(2px 2px at 38% 82%, white, transparent),
        radial-gradient(1px 1px at 62% 92%, white, transparent),
        radial-gradient(1px 1px at 28% 22%, white, transparent),
        radial-gradient(2px 2px at 82% 68%, white, transparent),
        radial-gradient(1px 1px at 15% 42%, white, transparent),
        radial-gradient(1px 1px at 48% 78%, white, transparent),
        radial-gradient(2px 2px at 65% 35%, white, transparent),
        radial-gradient(1px 1px at 7% 15%, white, transparent),
        radial-gradient(1px 1px at 93% 25%, white, transparent),
        radial-gradient(2px 2px at 27% 77%, white, transparent),
        radial-gradient(1px 1px at 53% 43%, white, transparent),
        radial-gradient(1px 1px at 87% 53%, white, transparent),
        radial-gradient(2px 2px at 13% 63%, white, transparent),
        radial-gradient(1px 1px at 37% 17%, white, transparent),
        radial-gradient(1px 1px at 67% 87%, white, transparent),
        radial-gradient(2px 2px at 97% 7%, white, transparent),
        radial-gradient(1px 1px at 3% 97%, white, transparent),
        radial-gradient(1px 1px at 17% 27%, white, transparent),
        radial-gradient(2px 2px at 47% 57%, white, transparent),
        radial-gradient(1px 1px at 77% 37%, white, transparent),
        radial-gradient(1px 1px at 23% 67%, white, transparent),
        radial-gradient(2px 2px at 63% 13%, white, transparent),
        radial-gradient(1px 1px at 43% 83%, white, transparent),
        radial-gradient(1px 1px at 83% 23%, white, transparent),
        radial-gradient(2px 2px at 33% 33%, white, transparent),
        radial-gradient(1px 1px at 73% 73%, white, transparent),
        radial-gradient(1px 1px at 9% 39%, white, transparent),
        radial-gradient(2px 2px at 59% 69%, white, transparent),
        radial-gradient(1px 1px at 89% 19%, white, transparent),
        radial-gradient(1px 1px at 19% 89%, white, transparent),
        radial-gradient(2px 2px at 49% 9%, white, transparent),
        radial-gradient(1px 1px at 79% 59%, white, transparent),
        radial-gradient(1px 1px at 29% 49%, white, transparent),
        radial-gradient(2px 2px at 69% 79%, white, transparent),
        radial-gradient(1px 1px at 39% 29%, white, transparent),
        radial-gradient(1px 1px at 99% 99%, white, transparent),
        radial-gradient(2px 2px at 1% 1%, white, transparent),
        radial-gradient(1px 1px at 11% 71%, white, transparent),
        radial-gradient(1px 1px at 61% 31%, white, transparent),
        radial-gradient(2px 2px at 91% 91%, white, transparent),
        radial-gradient(1px 1px at 21% 11%, white, transparent),
        radial-gradient(1px 1px at 71% 61%, white, transparent),
        radial-gradient(2px 2px at 31% 21%, white, transparent),
        radial-gradient(1px 1px at 81% 81%, white, transparent),
        radial-gradient(1px 1px at 41% 51%, white, transparent),
        radial-gradient(2px 2px at 51% 41%, white, transparent),
        radial-gradient(1px 1px at 14% 84%, white, transparent),
        radial-gradient(1px 1px at 64% 14%, white, transparent),
        radial-gradient(2px 2px at 94% 64%, white, transparent),
        radial-gradient(1px 1px at 24% 34%, white, transparent),
        radial-gradient(1px 1px at 74% 94%, white, transparent),
        radial-gradient(2px 2px at 34% 74%, white, transparent),
        radial-gradient(1px 1px at 84% 4%, white, transparent),
        radial-gradient(1px 1px at 4% 44%, white, transparent),
        radial-gradient(2px 2px at 54% 24%, white, transparent),
        radial-gradient(1px 1px at 44% 64%, white, transparent),
        radial-gradient(1px 1px at 96% 36%, white, transparent),
        radial-gradient(2px 2px at 26% 96%, white, transparent),
        radial-gradient(1px 1px at 76% 26%, white, transparent),
        radial-gradient(1px 1px at 36% 56%, white, transparent),
        radial-gradient(2px 2px at 86% 76%, white, transparent),
        radial-gradient(1px 1px at 6% 86%, white, transparent),
        radial-gradient(1px 1px at 56% 6%, white, transparent),
        radial-gradient(2px 2px at 46% 46%, white, transparent),
        radial-gradient(1px 1px at 66% 66%, white, transparent),
        radial-gradient(1px 1px at 16% 16%, white, transparent),
        radial-gradient(2px 2px at 32% 52%, white, transparent),
        radial-gradient(1px 1px at 52% 32%, white, transparent),
        radial-gradient(1px 1px at 72% 42%, white, transparent),
        radial-gradient(2px 2px at 42% 92%, white, transparent),
        radial-gradient(1px 1px at 92% 12%, white, transparent),
        radial-gradient(1px 1px at 2% 62%, white, transparent),
        radial-gradient(2px 2px at 62% 2%, white, transparent),
        radial-gradient(1px 1px at 22% 72%, white, transparent),
        radial-gradient(1px 1px at 82% 22%, white, transparent),
        radial-gradient(2px 2px at 12% 32%, white, transparent),
        radial-gradient(1px 1px at 57% 77%, white, transparent),
        radial-gradient(1px 1px at 37% 7%, white, transparent),
        radial-gradient(2px 2px at 87% 47%, white, transparent),
        radial-gradient(1px 1px at 47% 37%, white, transparent),
        radial-gradient(1px 1px at 77% 97%, white, transparent),
        radial-gradient(2px 2px at 27% 27%, white, transparent),
        radial-gradient(1px 1px at 97% 57%, white, transparent),
        radial-gradient(1px 1px at 7% 67%, white, transparent),
        radial-gradient(2px 2px at 67% 17%, white, transparent),
        radial-gradient(1px 1px at 17% 47%, white, transparent),
        radial-gradient(1px 1px at 87% 87%, white, transparent),
        radial-gradient(2px 2px at 57% 27%, white, transparent),
        radial-gradient(1px 1px at 3% 53%, white, transparent),
        radial-gradient(1px 1px at 53% 93%, white, transparent),
        radial-gradient(2px 2px at 93% 3%, white, transparent),
        radial-gradient(1px 1px at 13% 23%, white, transparent),
        radial-gradient(1px 1px at 63% 83%, white, transparent),
        radial-gradient(2px 2px at 43% 13%, white, transparent),
        radial-gradient(1px 1px at 83% 63%, white, transparent),
        radial-gradient(1px 1px at 23% 93%, white, transparent),
        radial-gradient(2px 2px at 73% 43%, white, transparent),
        radial-gradient(1px 1px at 33% 73%, white, transparent),
        radial-gradient(1px 1px at 98% 28%, white, transparent),
        radial-gradient(2px 2px at 8% 18%, white, transparent),
        radial-gradient(1px 1px at 68% 98%, white, transparent),
        radial-gradient(1px 1px at 28% 8%, white, transparent),
        radial-gradient(2px 2px at 88% 58%, white, transparent),
        radial-gradient(1px 1px at 18% 38%, white, transparent),
        radial-gradient(1px 1px at 78% 88%, white, transparent),
        radial-gradient(2px 2px at 38% 68%, white, transparent),
        radial-gradient(1px 1px at 58% 48%, white, transparent),
        radial-gradient(1px 1px at 88% 8%, white, transparent),
        radial-gradient(2px 2px at 48% 98%, white, transparent),
        radial-gradient(1px 1px at 8% 78%, white, transparent),
        radial-gradient(1px 1px at 94% 54%, white, transparent),
        radial-gradient(2px 2px at 54% 74%, white, transparent),
        radial-gradient(1px 1px at 74% 34%, white, transparent),
        radial-gradient(1px 1px at 34% 94%, white, transparent),
        radial-gradient(2px 2px at 14% 54%, white, transparent),
        radial-gradient(1px 1px at 64% 4%, white, transparent),
        radial-gradient(1px 1px at 44% 44%, white, transparent),
        radial-gradient(2px 2px at 24% 14%, white, transparent),
        radial-gradient(1px 1px at 4% 24%, white, transparent),
        radial-gradient(1px 1px at 84% 94%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    animation: twinkling 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(102, 126, 234, 0.15) 0%,
        rgba(0, 0, 0, 0) 70%
    );
    pointer-events: none;
    z-index: 0;
}

@keyframes twinkling {
    0% {
        opacity: 0.5;
        filter: brightness(0.7);
    }
    25% {
        opacity: 0.8;
        filter: brightness(1.2);
    }
    50% {
        opacity: 1;
        filter: brightness(1.5);
    }
    75% {
        opacity: 0.8;
        filter: brightness(1.2);
    }
    100% {
        opacity: 0.5;
        filter: brightness(0.7);
    }
}

#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    padding-top: 100px;
}

h1 {
    margin: 20px 0;
    font-size: 48px;
    letter-spacing: 2px;
    -webkit-text-stroke: 2px white;
    text-stroke: 2px white;
    font-family: "Orbitron", sans-serif;
    font-weight: 900;
    display: flex;
    gap: 2px;
}

.title-sol,
.title-pong {
    display: flex;
}

.title-sol span {
    color: #4caf50;
}

.title-pong span {
    color: #9945ff;
}

.title-sol span:nth-child(1) {
    animation: glow-green 1.5s ease-in-out infinite;
    animation-delay: 0.7s;
}

.title-sol span:nth-child(2) {
    animation: glow-green 1.5s ease-in-out infinite;
    animation-delay: 0.3s;
}

.title-sol span:nth-child(3) {
    animation: glow-green 1.5s ease-in-out infinite;
    animation-delay: 1.1s;
}

.title-pong span:nth-child(1) {
    animation: glow-purple 1.5s ease-in-out infinite;
    animation-delay: 0.5s;
}

.title-pong span:nth-child(2) {
    animation: glow-purple 1.5s ease-in-out infinite;
    animation-delay: 0s;
}

.title-pong span:nth-child(3) {
    animation: glow-purple 1.5s ease-in-out infinite;
    animation-delay: 0.9s;
}

.title-pong span:nth-child(4) {
    animation: glow-purple 1.5s ease-in-out infinite;
    animation-delay: 0.2s;
}

@keyframes glow-green {
    0%,
    100% {
        text-shadow:
            0 0 5px rgba(76, 175, 80, 0.4),
            0 0 10px rgba(76, 175, 80, 0.3),
            0 0 15px rgba(76, 175, 80, 0.2),
            0 0 20px rgba(76, 175, 80, 0.1);
    }
    50% {
        text-shadow:
            0 0 20px rgba(76, 175, 80, 1),
            0 0 30px rgba(76, 175, 80, 0.8),
            0 0 40px rgba(76, 175, 80, 0.6),
            0 0 60px rgba(76, 175, 80, 0.4),
            0 0 80px rgba(76, 175, 80, 0.2);
    }
}

@keyframes glow-purple {
    0%,
    100% {
        text-shadow:
            0 0 5px rgba(153, 69, 255, 0.4),
            0 0 10px rgba(153, 69, 255, 0.3),
            0 0 15px rgba(153, 69, 255, 0.2),
            0 0 20px rgba(153, 69, 255, 0.1);
    }
    50% {
        text-shadow:
            0 0 20px rgba(153, 69, 255, 1),
            0 0 30px rgba(153, 69, 255, 0.8),
            0 0 40px rgba(153, 69, 255, 0.6),
            0 0 60px rgba(153, 69, 255, 0.4),
            0 0 80px rgba(153, 69, 255, 0.2);
    }
}

#wallet-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

#navbar {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    gap: 20px;
}

.nav-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.info-btn {
    background: linear-gradient(
        135deg,
        rgba(96, 165, 250, 0.2),
        rgba(96, 165, 250, 0.1)
    );
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.1);
}

.info-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(96, 165, 250, 0.3),
        rgba(96, 165, 250, 0.2)
    );
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 30px rgba(96, 165, 250, 0.3);
    transform: translateY(-2px);
}

.info-btn:active {
    transform: translateY(0);
}

.about-btn {
    background: linear-gradient(
        135deg,
        rgba(168, 85, 247, 0.2),
        rgba(168, 85, 247, 0.1)
    );
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.1);
}

.about-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(168, 85, 247, 0.3),
        rgba(168, 85, 247, 0.2)
    );
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.3);
    transform: translateY(-2px);
}

.about-btn:active {
    transform: translateY(0);
}

#player-info-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

#navbar .balance-display {
    background: rgba(153, 69, 255, 0.2);
    border: 2px solid rgba(153, 69, 255, 0.4);
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 0;
}

#navbar .balance-label {
    font-size: 14px;
}

#navbar .balance-value {
    font-size: 16px;
}

#navbar .bet-settings {
    margin-top: 0;
    padding: 4px 15px;
}

#min-bet-input {
    margin-bottom: 5px;
}

body {
    padding-top: 0;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: #4caf50;
    color: white;
}

.btn-secondary {
    background: #2196f3;
    color: white;
}

.btn-danger {
    background: #f44336;
    color: white;
}

#wallet-address {
    font-size: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

#game-container {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 900px;
}

canvas {
    display: block;
    background: #000;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    touch-action: none;
    width: 100%;
    height: auto;
}

#connection-panel {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    max-width: 600px;
    width: 100%;
    display: none;
}

#connection-panel h3 {
    margin-bottom: 15px;
}

.connection-section {
    margin-bottom: 20px;
}

textarea,
input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-family: monospace;
    font-size: 12px;
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: white;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

#status {
    margin-top: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

#scores {
    display: none; /* Hidden by default, shown during gameplay */
    justify-content: space-around;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: bold;
}

#scores.active {
    display: flex;
}

.score-label {
    text-align: center;
}

#game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    border-radius: 10px;
    z-index: 10;
}

#game-over-overlay.visible {
    display: flex;
}

#start-game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 20px;
    border-radius: 10px;
    z-index: 10;
}

#start-game-overlay.hidden {
    display: none;
}

.start-game-btn {
    padding: 20px 50px;
    font-size: 24px;
    background: #9945ff;
    border: none;
    border-radius: 15px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(153, 69, 255, 0.4);
}

.start-game-btn:hover {
    background: #7d3ad4;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(153, 69, 255, 0.6);
}

.start-game-btn:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

.connection-status {
    font-size: 16px;
    opacity: 0.8;
}

.winner-text {
    font-size: 48px;
    font-weight: bold;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
    animation: pulse 2s infinite;
}

.final-score {
    font-size: 32px;
    opacity: 0.9;
}

.restart-btn {
    padding: 15px 40px;
    font-size: 18px;
    background: #4caf50;
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.restart-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.6);
}

/* Leave Game Button */
.leave-game-btn {
    margin-top: 15px;
    padding: 12px 30px;
    font-size: 16px;
    background: #ef4444;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    display: block;
    width: 100%;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.leave-game-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.6);
}

.leave-game-btn:active {
    transform: translateY(0);
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.controls-info {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
}

.balance-display {
    margin-top: 15px;
    padding: 15px;
    background: rgba(153, 69, 255, 0.15);
    border: 2px solid rgba(153, 69, 255, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.balance-label {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.balance-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.bet-settings {
    margin-top: 15px;
    padding: 4px 20px;
    background: rgba(153, 69, 255, 0.2);
    border: 2px solid rgba(153, 69, 255, 0.4);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bet-settings label {
    font-size: 14px;
    color: #fff;
    font-weight: 600;
}

.bet-settings input[type="number"] {
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    width: 80px;
    max-width: 80px;
    transition: all 0.3s ease;
}

.bet-settings input[type="number"]:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(0, 0, 0, 0.5);
}

.bet-settings input[type="number"]:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.bet-settings span {
    font-size: 13px;
    color: #ffd700;
    font-weight: 600;
}

.bet-settings .btn {
    padding: 6px 15px;
    font-size: 13px;
    margin-left: auto;
}

#status-bar {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-label {
    font-weight: 600;
    opacity: 0.8;
    font-size: 14px;
}

.status-value {
    font-weight: 700;
    font-size: 16px;
    color: #9945ff;
}

.bet-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bet-input {
    width: 100px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid rgba(153, 69, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 14px;
    font-weight: 600;
}

.bet-input:focus {
    outline: none;
    border-color: #9945ff;
}

.btn-save {
    padding: 8px 16px;
    background: #9945ff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-save:hover {
    background: #7d3ad4;
    transform: translateY(-2px);
}

#side-panel {
    width: 320px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    position: relative;
    z-index: 1;
    margin-top: 100px;
    transition:
        width 0.3s ease,
        border-radius 0.3s ease;
}

/* Collapsed sidebar - show only icons */
#side-panel.collapsed {
    width: 70px;
    border-radius: 20px;
}

#side-panel.collapsed .tab-label,
#side-panel.collapsed .panel-section h3,
#side-panel.collapsed .tab-content {
    display: none;
}

#side-panel.collapsed .tab-btn {
    padding: 12px;
    justify-content: center;
}

#side-panel.collapsed .tab-icon {
    font-size: 24px;
}

/* Toggle button */
#sidebar-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

#sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

#side-panel.collapsed #sidebar-toggle {
    right: 50%;
    transform: translateX(50%);
}

#side-panel.collapsed #sidebar-toggle:hover {
    transform: translateX(50%) scale(1.05);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

#side-panel:not(.collapsed) .toggle-icon {
    transform: rotate(90deg);
}

.tab-buttons {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px 20px 0 0;
    padding: 50px 10px 10px 10px;
    gap: 8px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.tab-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.tab-label {
    flex: 1;
    text-align: left;
    transition: opacity 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: rgba(76, 175, 80, 0.3);
}

/* Challenge badge on tab button */
.challenge-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s ease-in-out infinite;
}

#side-panel.collapsed .challenge-badge {
    top: 2px;
    right: 2px;
}

.tab-btn {
    position: relative;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.tab-content.active {
    display: flex;
}

.panel-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 15px;
}

.panel-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tier section styling */
.tier-section {
    margin-bottom: 20px;
}

.tier-header {
    font-size: 14px;
    font-weight: bold;
    color: #4caf50;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4caf50;
    border-radius: 4px;
}

.tier-players {
    padding-left: 8px;
}

.user-item,
.leaderboard-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.3s;
    cursor: pointer;
}

/* Player entering animation */
.user-item.player-entering {
    opacity: 0;
    transform: translateX(-30px) scale(0.9);
    animation: slideInLeft 0.4s ease-out forwards;
}

.user-item.player-entered {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Player leaving animation */
.user-item.player-leaving {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.9);
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideOutRight {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateX(15px) scale(0.95);
    }
    100% {
        opacity: 0;
        transform: translateX(50px) scale(0.8);
    }
}

.user-item:hover {
    background: rgba(76, 175, 80, 0.2);
    transform: translateX(5px);
}

/* Don't apply hover effect during animations */
.user-item.player-entering:hover,
.user-item.player-leaving:hover {
    transform: translateX(0);
    background: rgba(0, 0, 0, 0.3);
}

.user-item:last-child,
.leaderboard-item:last-child {
    margin-bottom: 0;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.user-address {
    font-weight: 600;
    font-size: 14px;
}

.user-bet {
    font-size: 12px;
    color: #4caf50;
    font-weight: 600;
}

.user-wallet-type {
    font-size: 11px;
    opacity: 0.7;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: default;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rank {
    font-size: 20px;
    font-weight: 700;
    width: 30px;
    text-align: center;
}

.rank-1 {
    color: #ffd700;
}
.rank-2 {
    color: #c0c0c0;
}
.rank-3 {
    color: #cd7f32;
}

.leaderboard-info {
    flex: 1;
}

.leaderboard-address {
    font-weight: 600;
    font-size: 13px;
}

.leaderboard-earnings {
    font-size: 14px;
    color: #4caf50;
    font-weight: 700;
}

.stats-summary {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-label {
    opacity: 0.8;
}

.stat-value {
    font-weight: 700;
}

.stat-value.positive {
    color: #4caf50;
}

.stat-value.negative {
    color: #f44336;
}

.game-history-item,
.history-item {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border-left: 4px solid;
    transition: background 0.2s ease;
}

.history-item:hover {
    background: rgba(0, 0, 0, 0.5);
}

.game-history-item.win,
.history-item.win {
    border-left-color: #4caf50;
}

.game-history-item.loss,
.history-item.loss {
    border-left-color: #f44336;
}

.game-history-item:last-child,
.history-item:last-child {
    margin-bottom: 0;
}

.game-header,
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

.result-icon {
    font-weight: 700;
    font-size: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon.win {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.result-icon.loss {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.opponent-address,
.opponent {
    font-weight: 600;
    font-size: 13px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bet-amount {
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.bet-amount.positive {
    color: #4caf50;
}

.bet-amount.negative {
    color: #f44336;
}

.game-result {
    font-weight: 700;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
}

.game-result.win {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.game-result.loss {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.game-details,
.history-details {
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.5;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.history-details .score {
    font-weight: 600;
}

.history-details .date {
    text-align: right;
}

.game-bet {
    color: #ffd700;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    opacity: 0.5;
    font-size: 14px;
    padding: 20px;
}

#challenge-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#challenge-modal.visible {
    display: flex;
}

.modal-content {
    background: linear-gradient(
        135deg,
        rgba(102, 126, 234, 0.9) 0%,
        rgba(118, 75, 162, 0.9) 100%
    );
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.modal-player-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.modal-player-address {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    word-break: break-all;
}

.modal-wallet-type {
    font-size: 13px;
    opacity: 0.8;
}

.modal-bet-section {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.bet-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.bet-row:last-child {
    margin-bottom: 0;
}

.bet-label {
    opacity: 0.8;
}

.bet-value {
    font-weight: 700;
    color: #ffd700;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-btn-primary {
    background: #4caf50;
    color: white;
}

.modal-btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 1200px) {
    body {
        flex-direction: column;
    }

    #side-panel {
        width: 100%;
        max-height: none;
        margin-top: 0;
    }

    #main-content {
        padding-top: 0;
    }
}

@media (min-width: 1201px) {
    #navbar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        gap: 10px;
    }

    h1 {
        font-size: 24px;
        margin: 10px 0;
    }

    #wallet-section {
        padding: 10px 15px;
    }

    #game-container {
        padding: 10px;
    }

    #connection-panel {
        padding: 15px;
    }

    .controls-info {
        font-size: 12px;
    }

    #navbar {
        padding: 10px 15px;
    }
}

/* Settings Button (Gear Icon) */
.settings-btn {
    font-size: 20px;
    padding: 8px 16px;
}

/* Settings Modal */
#settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#settings-modal.active {
    display: flex;
}

#settings-modal .modal-content {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0;
    max-width: 500px;
    width: 90%;
}

#settings-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#settings-modal .modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

#settings-modal .modal-body {
    padding: 24px;
}

/* Settings Panel */
.settings-group {
    margin-bottom: 24px;
}

.settings-group:last-child {
    margin-bottom: 0;
}

.settings-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #e0e0e0;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input[type="text"] {
    flex: 1;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.2s;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #4caf50;
}

.input-group .btn-primary {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}

.input-group .btn-primary:hover {
    background: #45a049;
}

.input-group .btn-primary:active {
    background: #3d8b40;
}

.input-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Challenge Requests Modal */
.challenge-request-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.challenge-request-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.5);
}

.challenge-request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.challenge-request-address {
    font-size: 14px;
    font-weight: 600;
    color: #60a5fa;
}

.challenge-request-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.challenge-request-info {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
}

.challenge-request-actions {
    display: flex;
    gap: 8px;
}

.challenge-request-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.challenge-request-btn.accept {
    background: #10b981;
    color: white;
}

.challenge-request-btn.accept:hover {
    background: #059669;
}

.challenge-request-btn.decline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.challenge-request-btn.decline:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Countdown Overlay */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.countdown-overlay.active {
    display: flex;
}

.countdown-number {
    font-family: "Orbitron", monospace;
    font-size: 180px;
    font-weight: 900;
    color: #60a5fa;
    text-shadow:
        0 0 40px rgba(96, 165, 250, 0.8),
        0 0 80px rgba(96, 165, 250, 0.4);
    animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.countdown-number.go {
    font-size: 140px;
    color: #10b981;
    text-shadow:
        0 0 40px rgba(16, 185, 129, 0.8),
        0 0 80px rgba(16, 185, 129, 0.4);
}

/* Challenge notification badge */
.challenge-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* ==================== BET AND ESCROW DISPLAY ==================== */

#bet-escrow-container {
    display: none; /* Hidden by default, shown during gameplay */
    justify-content: space-between;
    align-items: center;
    margin: 15px 0 10px 0;
    padding: 0 10px;
    max-width: 800px;
    width: 100%;
}

#bet-escrow-container.active {
    display: flex;
}

.player-bet {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "Orbitron", monospace;
    font-size: 16px;
    font-weight: 700;
    padding: 8px 16px;
    background: linear-gradient(
        135deg,
        rgba(96, 165, 250, 0.1),
        rgba(96, 165, 250, 0.05)
    );
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 8px;
    min-width: 140px;
    transition: all 0.3s ease;
}

.player-bet.left {
    justify-content: flex-start;
}

.player-bet.right {
    justify-content: flex-end;
}

.player-bet .bet-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

.player-bet .bet-amount {
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.player-bet.active {
    border-color: rgba(16, 185, 129, 0.6);
    background: linear-gradient(
        135deg,
        rgba(16, 185, 129, 0.15),
        rgba(16, 185, 129, 0.05)
    );
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.player-bet.deposited {
    border-color: rgba(34, 197, 94, 0.8);
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.2),
        rgba(34, 197, 94, 0.1)
    );
}

.player-bet.deposited .bet-icon {
    animation: depositPulse 2s ease-in-out infinite;
}

.escrow-status {
    flex: 1;
    text-align: center;
    padding: 10px 20px;
    font-family: "Orbitron", monospace;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(
        135deg,
        rgba(168, 85, 247, 0.1),
        rgba(168, 85, 247, 0.05)
    );
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 8px;
    margin: 0 15px;
    transition: all 0.3s ease;
}

.escrow-status .escrow-text {
    color: #c4b5fd;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

.escrow-status.waiting {
    border-color: rgba(251, 191, 36, 0.6);
    background: linear-gradient(
        135deg,
        rgba(251, 191, 36, 0.15),
        rgba(251, 191, 36, 0.05)
    );
}

.escrow-status.waiting .escrow-text {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.escrow-status.active {
    border-color: rgba(16, 185, 129, 0.6);
    background: linear-gradient(
        135deg,
        rgba(16, 185, 129, 0.15),
        rgba(16, 185, 129, 0.05)
    );
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
    animation: escrowPulse 3s ease-in-out infinite;
}

.escrow-status.active .escrow-text {
    color: #10b981;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

.escrow-status.completed {
    border-color: rgba(34, 197, 94, 0.8);
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.2),
        rgba(34, 197, 94, 0.1)
    );
}

.escrow-status.completed .escrow-text {
    color: #22c55e;
}

@keyframes depositPulse {
    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.9));
    }
}

@keyframes escrowPulse {
    0%,
    100% {
        box-shadow: 0 0 25px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
    }
}

/* ==================== MATCH FOUND MODAL ==================== */

.match-found-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.match-found-modal.active {
    display: flex;
}

.match-found-content {
    background: linear-gradient(
        135deg,
        rgba(20, 20, 40, 0.95),
        rgba(10, 10, 30, 0.95)
    );
    border: 3px solid rgba(96, 165, 250, 0.5);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow:
        0 0 60px rgba(96, 165, 250, 0.4),
        0 0 120px rgba(96, 165, 250, 0.2);
    animation: modalSlideIn 0.5s ease-out;
}

.match-found-header {
    text-align: center;
    margin-bottom: 30px;
}

.match-found-header .match-icon {
    font-size: 60px;
    display: block;
    margin-bottom: 15px;
    animation: iconBounce 1s ease-in-out infinite;
}

.match-found-header h2 {
    font-family: "Orbitron", monospace;
    font-size: 36px;
    font-weight: 900;
    color: #60a5fa;
    text-shadow:
        0 0 20px rgba(96, 165, 250, 0.8),
        0 0 40px rgba(96, 165, 250, 0.4);
    margin: 0;
    letter-spacing: 3px;
}

.match-found-body {
    margin-bottom: 30px;
}

.player-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(96, 165, 250, 0.2);
}

.matched-player {
    text-align: center;
    flex: 1;
}

.player-avatar {
    font-size: 50px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.5));
}

.player-name {
    font-family: "Orbitron", monospace;
    font-size: 16px;
    font-weight: 700;
    color: #60a5fa;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

.vs-divider {
    font-family: "Orbitron", monospace;
    font-size: 32px;
    font-weight: 900;
    color: #f59e0b;
    text-shadow:
        0 0 15px rgba(245, 158, 11, 0.8),
        0 0 30px rgba(245, 158, 11, 0.4);
    padding: 0 20px;
    animation: vsGlow 2s ease-in-out infinite;
}

.match-bet-info {
    text-align: center;
    padding: 15px;
    background: linear-gradient(
        135deg,
        rgba(16, 185, 129, 0.15),
        rgba(16, 185, 129, 0.05)
    );
    border: 2px solid rgba(16, 185, 129, 0.4);
    border-radius: 12px;
    font-family: "Orbitron", monospace;
}

.match-bet-info .bet-label {
    font-size: 14px;
    color: #c4b5fd;
    margin-right: 8px;
}

.match-bet-info .bet-value {
    font-size: 24px;
    font-weight: 700;
    color: #10b981;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

.match-countdown {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid rgba(96, 165, 250, 0.2);
}

.countdown-text {
    font-family: "Orbitron", monospace;
    font-size: 18px;
    color: #c4b5fd;
    margin-bottom: 15px;
}

.countdown-timer {
    font-family: "Orbitron", monospace;
    font-size: 80px;
    font-weight: 900;
    color: #60a5fa;
    text-shadow:
        0 0 30px rgba(96, 165, 250, 0.8),
        0 0 60px rgba(96, 165, 250, 0.4);
    animation: countdownPulse 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes iconBounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ==================== ALERT MODAL ==================== */

.alert-modal-content {
    max-width: 500px;
}

.alert-message {
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    white-space: pre-line;
}

.alert-modal-footer {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.alert-modal-footer .btn {
    min-width: 120px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.alert-modal-footer .btn-primary {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    border: 2px solid rgba(96, 165, 250, 0.5);
    color: white;
}

.alert-modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: rgba(96, 165, 250, 0.8);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.5);
    transform: translateY(-2px);
}

/* Transaction and Waiting Modals */
.transaction-message {
    font-size: 18px;
    color: #e0e0e0;
    text-align: center;
    margin: 20px 0;
    line-height: 1.6;
}

.transaction-note {
    font-size: 14px;
    color: #a0a0a0;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
}

.cancellation-message {
    font-size: 20px;
    color: #ff6b6b;
    text-align: center;
    margin: 30px 0;
    font-weight: bold;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(96, 165, 250, 0.2);
    border-top: 4px solid rgba(96, 165, 250, 1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes vsGlow {
    0%,
    100% {
        text-shadow:
            0 0 15px rgba(245, 158, 11, 0.8),
            0 0 30px rgba(245, 158, 11, 0.4);
    }
    50% {
        text-shadow:
            0 0 25px rgba(245, 158, 11, 1),
            0 0 50px rgba(245, 158, 11, 0.6);
    }
}

@keyframes countdownPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==================== LANDING PAGE MODAL ==================== */

.landing-page-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    z-index: 10000;
    padding: 40px 20px;
}

.landing-page-modal.active {
    display: block;
}

.landing-close-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 28px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.landing-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.landing-close-btn:active {
    transform: rotate(90deg) scale(1);
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

.landing-header {
    text-align: center;
    margin-bottom: 60px;
}

.landing-title {
    font-family: "Orbitron", monospace;
    font-size: 72px;
    font-weight: 900;
    margin: 0 0 20px 0;
    letter-spacing: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.landing-subtitle {
    font-family: "Orbitron", monospace;
    font-size: 24px;
    font-weight: 400;
    color: #c4b5fd;
    text-shadow: 0 0 15px rgba(168, 85, 247, 0.5);
    margin: 0;
    letter-spacing: 2px;
}

.landing-content {
    margin-bottom: 60px;
}

.landing-section {
    background: linear-gradient(
        135deg,
        rgba(20, 20, 40, 0.6),
        rgba(10, 10, 30, 0.4)
    );
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 20px;
    padding: 40px;
    margin-top: 40px;
    margin-bottom: 40px;
    box-shadow: 0 0 40px rgba(96, 165, 250, 0.1);
    transition: all 0.3s ease;
}

.landing-section:hover {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 60px rgba(96, 165, 250, 0.2);
    transform: translateY(-5px);
}

.landing-section h2 {
    font-family: "Orbitron", monospace;
    font-size: 32px;
    font-weight: 700;
    color: #60a5fa;
    text-shadow: 0 0 20px rgba(96, 165, 250, 0.6);
    margin: 0 0 25px 0;
    text-align: center;
    letter-spacing: 3px;
}

.landing-section p {
    font-size: 18px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    margin: 0;
}

/* How It Works Grid */
.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.step-card {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(96, 165, 250, 0.2);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.step-card:hover {
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(96, 165, 250, 0.3);
}

.step-number {
    font-family: "Orbitron", monospace;
    font-size: 48px;
    font-weight: 900;
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    margin-bottom: 15px;
}

.step-card h3 {
    font-family: "Orbitron", monospace;
    font-size: 20px;
    font-weight: 700;
    color: #60a5fa;
    margin: 0 0 12px 0;
    letter-spacing: 1px;
}

.step-card p {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
}

/* Bet Tiers Grid */
.tiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tier-card {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.tier-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px;
}

/* Lower Ranks - Cool colors (Purple/Blue/Green) */
.tier-card.tier-micro {
    border-color: rgba(139, 92, 246, 0.4);
}

.tier-card.tier-micro:hover {
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
}

.tier-card.tier-rookie {
    border-color: rgba(34, 197, 94, 0.4);
}

.tier-card.tier-rookie:hover {
    border-color: rgba(34, 197, 94, 0.8);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

.tier-card.tier-private {
    border-color: rgba(59, 130, 246, 0.4);
}

.tier-card.tier-private:hover {
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.tier-card.tier-specialist {
    border-color: rgba(99, 102, 241, 0.4);
}

.tier-card.tier-specialist:hover {
    border-color: rgba(99, 102, 241, 0.8);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.tier-card.tier-corporal {
    border-color: rgba(6, 182, 212, 0.4);
}

.tier-card.tier-corporal:hover {
    border-color: rgba(6, 182, 212, 0.8);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.4);
}

/* Mid Ranks - Transitioning to warm colors */
.tier-card.tier-sergeant {
    border-color: rgba(20, 184, 166, 0.4);
}

.tier-card.tier-sergeant:hover {
    border-color: rgba(20, 184, 166, 0.8);
    box-shadow: 0 0 30px rgba(20, 184, 166, 0.4);
}

.tier-card.tier-lieutenant {
    border-color: rgba(16, 185, 129, 0.4);
}

.tier-card.tier-lieutenant:hover {
    border-color: rgba(16, 185, 129, 0.8);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.tier-card.tier-captain {
    border-color: rgba(251, 191, 36, 0.4);
}

.tier-card.tier-captain:hover {
    border-color: rgba(251, 191, 36, 0.8);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
}

.tier-card.tier-major {
    border-color: rgba(245, 158, 11, 0.4);
}

.tier-card.tier-major:hover {
    border-color: rgba(245, 158, 11, 0.8);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4);
}

/* High Ranks - Warm/Hot colors (Orange/Red) */
.tier-card.tier-commander {
    border-color: rgba(249, 115, 22, 0.4);
}

.tier-card.tier-commander:hover {
    border-color: rgba(249, 115, 22, 0.8);
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.4);
}

.tier-card.tier-colonel {
    border-color: rgba(239, 68, 68, 0.4);
}

.tier-card.tier-colonel:hover {
    border-color: rgba(239, 68, 68, 0.8);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.tier-card.tier-brigadier {
    border-color: rgba(220, 38, 38, 0.4);
}

.tier-card.tier-brigadier:hover {
    border-color: rgba(220, 38, 38, 0.8);
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.4);
}

/* Elite Ranks - Purple/Pink (Legendary) */
.tier-card.tier-general {
    border-color: rgba(192, 38, 211, 0.4);
}

.tier-card.tier-general:hover {
    border-color: rgba(192, 38, 211, 0.8);
    box-shadow: 0 0 30px rgba(192, 38, 211, 0.4);
}

.tier-card.tier-megawhale {
    border-color: rgba(236, 72, 153, 0.4);
}

.tier-card.tier-megawhale:hover {
    border-color: rgba(236, 72, 153, 0.8);
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.4);
}

.tier-card h3 {
    font-family: "Orbitron", monospace;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px 0;
    letter-spacing: 2px;
}

/* Lower Rank Colors */
.tier-card.tier-micro h3 {
    color: #a78bfa;
    text-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
}

.tier-card.tier-rookie h3 {
    color: #22c55e;
    text-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
}

.tier-card.tier-private h3 {
    color: #3b82f6;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
}

.tier-card.tier-specialist h3 {
    color: #6366f1;
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
}

.tier-card.tier-corporal h3 {
    color: #06b6d4;
    text-shadow: 0 0 15px rgba(6, 182, 212, 0.6);
}

/* Mid Rank Colors */
.tier-card.tier-sergeant h3 {
    color: #14b8a6;
    text-shadow: 0 0 15px rgba(20, 184, 166, 0.6);
}

.tier-card.tier-lieutenant h3 {
    color: #10b981;
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

.tier-card.tier-captain h3 {
    color: #fbbf24;
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.tier-card.tier-major h3 {
    color: #f59e0b;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
}

/* High Rank Colors */
.tier-card.tier-commander h3 {
    color: #f97316;
    text-shadow: 0 0 15px rgba(249, 115, 22, 0.6);
}

.tier-card.tier-colonel h3 {
    color: #ef4444;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

.tier-card.tier-brigadier h3 {
    color: #dc2626;
    text-shadow: 0 0 15px rgba(220, 38, 38, 0.6);
}

/* Elite Rank Colors */
.tier-card.tier-general h3 {
    color: #c026d3;
    text-shadow: 0 0 15px rgba(192, 38, 211, 0.6);
}

.tier-card.tier-megawhale h3 {
    color: #ec4899;
    text-shadow: 0 0 15px rgba(236, 72, 153, 0.6);
}

.tier-range {
    font-family: "Orbitron", monospace;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.feature-card {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    border-color: rgba(16, 185, 129, 0.6);
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-5px);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.feature-card h3 {
    font-family: "Orbitron", monospace;
    font-size: 20px;
    font-weight: 700;
    color: #10b981;
    margin: 0 0 12px 0;
    letter-spacing: 1px;
}

.feature-card p {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
}

/* Enter Game Button */
.btn-large {
    display: block;
    margin: 0 auto;
    padding: 20px 60px;
    font-family: "Orbitron", monospace;
    font-size: 24px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #10b981, #059669);
    border: 3px solid rgba(16, 185, 129, 0.5);
    border-radius: 15px;
    cursor: pointer;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.btn-large:hover {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: rgba(16, 185, 129, 0.8);
    box-shadow: 0 0 50px rgba(16, 185, 129, 0.6);
    transform: translateY(-5px) scale(1.05);
}

.btn-large:active {
    transform: translateY(-2px) scale(1.02);
}

/* Landing Footer */
.landing-footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px solid rgba(96, 165, 250, 0.2);
}

.landing-footer p {
    font-family: "Orbitron", monospace;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Animations */
@keyframes titleGlow {
    0%,
    100% {
        text-shadow:
            0 0 30px rgba(96, 165, 250, 0.8),
            0 0 60px rgba(96, 165, 250, 0.4),
            0 0 90px rgba(96, 165, 250, 0.2);
    }
    50% {
        text-shadow:
            0 0 40px rgba(96, 165, 250, 1),
            0 0 80px rgba(96, 165, 250, 0.6),
            0 0 120px rgba(96, 165, 250, 0.3);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .landing-title {
        font-size: 48px;
        letter-spacing: 4px;
    }

    .landing-subtitle {
        font-size: 18px;
    }

    .landing-section {
        padding: 25px;
    }

    .landing-section h2 {
        font-size: 24px;
    }

    .how-it-works-grid,
    .tiers-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }

    .btn-large {
        padding: 15px 40px;
        font-size: 20px;
    }
}

/* ==================== ABOUT PAGE MODAL ==================== */

.about-page-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    z-index: 10000;
    padding: 40px 20px;
}

.about-page-modal.active {
    display: block;
}

.about-close-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 28px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.about-close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.4);
}

.about-close-btn:active {
    transform: rotate(90deg) scale(1);
}

.about-container {
    max-width: 900px;
    margin: 0 auto;
    animation: fadeIn 0.8s ease-out;
}

.about-header {
    text-align: center;
    margin-bottom: 50px;
}

.about-title {
    font-family: "Orbitron", monospace;
    font-size: 56px;
    font-weight: 900;
    color: #a78bfa;
    text-shadow:
        0 0 30px rgba(168, 85, 247, 0.8),
        0 0 60px rgba(168, 85, 247, 0.4);
    margin: 0;
    letter-spacing: 8px;
}

.about-content {
    background: linear-gradient(
        135deg,
        rgba(20, 20, 40, 0.6),
        rgba(10, 10, 30, 0.4)
    );
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    padding: 50px;
    margin-bottom: 40px;
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.1);
}

.about-message {
    font-size: 18px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 25px 0;
}

.about-message:last-of-type {
    margin-bottom: 35px;
}

.about-signature {
    font-size: 18px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-align: right;
    font-style: italic;
}

.about-signature strong {
    color: #a78bfa;
    font-size: 20px;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Responsive Design for About Modal */
@media (max-width: 768px) {
    .about-title {
        font-size: 36px;
        letter-spacing: 4px;
    }

    .about-content {
        padding: 30px;
    }

    .about-message,
    .about-signature {
        font-size: 16px;
    }
}
