body {
    background-color: #000000;
    color: #c9d1d9;
    font-family: 'Roboto Mono', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
}

/* Telegram Dark Theme */
body.telegram-dark {
    background-color: #000000;
    color: #ffffff;
}

body.telegram-dark .game-container {
    background-color: #2b5278;
    border-color: #4a9eff;
}

/* Telegram Light Theme */
body.telegram-light {
    background-color: #000000;
    color: #ffffff;
}

body.telegram-light .game-container {
    background-color: #03090e;
    border-color: #dee2e6;
    color: #000000;
}

/* Mobile optimizations for Telegram */
@media (max-width: 768px) {
    body {
        padding: 0;
        align-items: flex-start;
        padding-top: 10px;
    }
    
    .game-container {
        width: 100%;
        max-width: 340px;
        padding: 10px;
        margin: 0;
    }
    
    #game-board {
        width: 300px;
        height: 300px;
    }
}

.game-container {
    border: 2px solid #30363d;
    border-radius: 10px;
    padding: 10px; /* Reduced padding */
    background-color: #0d1117;
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
    max-width: 360px;
}

h1 {
    font-family: 'Press Start 2P', cursive;
    color: #58a6ff;
    margin-bottom: 10px; /* Reduced margin */
    text-shadow: 0 0 5px #58a6ff;
    font-size: 1.5rem; /* Reduced font size */
}

.controls-hint {
    color: #8b949e;
    font-size: 0.8rem; /* Reduced font size */
    margin-bottom: 10px; /* Reduced margin */
    display: flex;
    justify-content: center;
    gap: 15px; /* Reduced gap */
    flex-wrap: wrap;
}

.controls-hint span {
    background-color: #0d1117;
    padding: 3px 8px; /* Reduced padding */
    border-radius: 5px;
    border: 1px solid #30363d;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin: 10px 0; /* Reduced margin */
    background-color: #161b22;
    padding: 8px; /* Reduced padding */
    border-radius: 6px;
    border: 1px solid #30363d;
}

.stat {
    width: 30%;
}

.stat-label {
    font-size: 0.6rem; /* Slightly reduced font size */
    color: #8b949e;
}

.stat-value {
    font-size: 1.1rem; /* Reduced font size */
    font-weight: bold;
    color: #c9d1d9;
}

#game-board {
    background-color: #161b22;
    border: 1px solid #30363d;
    width: 320px;
    height: 320px;
}

#connection-status {
    margin-top: 15px;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#status-indicator {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.status-disconnected {
    background-color: #2e1515;
    color: #e55353;
}
.status-disconnected #status-indicator {
    background-color: #e55353;
}

.status-connected {
    background-color: #112a1a;
    color: #57ab5a;
}
.status-connected #status-indicator {
    background-color: #57ab5a;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center; /* Center the buttons */
}

#visitor-counter {
    margin-top: 20px;
    color: #8b949e;
    font-size: 0.9rem;
    text-align: center;
}

#donate-btn, #leaderboard-btn, #share-btn {
    background-color: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    transition: background-color 0.2s;
}

#donate-btn:hover, #leaderboard-btn:hover, #share-btn:hover {
    background-color: #30363d;
}


/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #161b22;
    margin: auto;
    padding: 25px;
    border: 1px solid #30363d;
    width: 90%;
    max-width: 450px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.close-btn {
    color: #8b949e;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: #c9d1d9;
}

.modal-content h2, .modal-content h3 {
    margin-top: 0;
}

.modal-content p {
    color: #8b949e;
    margin: 10px 0;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 6px;
    border: 1px solid #30363d;
    background-color: #0d1117;
    color: #c9d1d9;
    font-size: 1.1rem;
    box-sizing: border-box; /* Important for padding */
}



/* --- Donate Modal --- */
#address-list {
    margin-top: 15px;
}

.address-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 10px;
    background-color: #0d1117;
}

.address-info {
    text-align: left;
    flex-grow: 1;
    overflow-wrap: break-word;
    word-break: break-all;
}

.crypto-name {
    font-weight: bold;
    color: #c9d1d9;
}

.crypto-address {
    font-size: 0.85rem;
    color: #8b949e;
    margin-top: 5px;
}

.address-actions button {
    background: none;
    border: 1px solid #30363d;
    color: #58a6ff;
    cursor: pointer;
    padding: 8px;
    margin-left: 8px;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.address-actions button:hover {
    background-color: #30363d;
}

/* --- QR Code Modal --- */
#qrcode-canvas {
    background-color: white;
    padding: 10px;
    border-radius: 6px;
    margin: 10px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    text-align: center;
}

#qrcode-canvas canvas,
#qrcode-canvas img {
    border-radius: 4px;
    max-width: 100%;
    height: auto;
}

#qrcode-address-text {
    font-size: 0.9rem;
    word-break: break-all;
    color: #8b949e;
}

/* --- Game Over Modal --- */


/* New single restart button styling */
.modal-button-group.single {
    display: flex;
    justify-content: center;
}

#restart-btn.primary-restart {
    width: 100%;
    padding: 14px 16px;
    margin-top: 12px;
    background-color: #238636;
    color: #ffffff;
    border: 1px solid #2ea043;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.05s ease-in-out;
}

#restart-btn.primary-restart:hover {
    background-color: #2ea043;
}

#restart-btn.primary-restart:active {
    transform: translateY(1px);
}

/* Donate title red */
.donate-title , .gameover-title {
    color: #e55353;
}