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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #19157e !important;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: white;
    position: relative;
    overflow-x: hidden;
}

/* Base network стильные элементы */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(0, 82, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(45, 127, 255, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(26, 79, 255, 0.05) 0%, transparent 60%);
    z-index: -1;
}

/* Сетка в стиле Base */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: -1;
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 100%;
    margin: 10px;
}


.game-info {
    width: 200px;
}

.base-logo {
    text-align: center;
    margin-bottom: 10px;
}

.base-logo h1 {
    font-size: 2.5em;
    font-weight: 300;
    color: #fff;
    text-shadow: none;
    margin: 0;
    letter-spacing: 8px;
    font-family: 'Arial', sans-serif;
    text-transform: uppercase;
    opacity: 0.9;
}

 .game-avatar {
     display: flex;
     justify-content: center;
     margin: 10px 0 12px;
 }

 .game-avatar img {
     width: 84px;
     height: 84px;
     border-radius: 999px;
     object-fit: cover;
     border: 2px solid rgba(255, 215, 0, 0.8);
     background: rgba(0, 0, 0, 0.35);
     box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
 }

.game-info h1 {
    font-size: 1.5em;
    margin-bottom: 15px;
    text-align: center;
    color: #fff;
    text-shadow: none;
    font-weight: bold;
}

.game-info p, .game-info div {
    color: #fff;
}

.wallet-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.wallet-status p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #ff6b6b;
}

.wallet-status.connected p {
    color: #0dff72;
}

.wallet-btn {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    background: linear-gradient(45deg, #0052ff, #0066ff);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.3);
}

.wallet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
}

.wallet-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.wallet-info {
    margin-top: 10px;
    font-size: 0.8em;
}

.wallet-info p {
    margin: 3px 0;
    color: #ccc;
}

.wallet-info span {
    color: #ffd700;
    font-weight: bold;
}

 .tx-status {
     margin: 8px 0;
     padding: 10px;
     border-radius: 8px;
     font-size: 0.85em;
     background: rgba(0, 0, 0, 0.25);
     border: 1px solid rgba(255, 255, 255, 0.15);
     color: #fff;
 }

 .tx-status.success {
     border-color: rgba(13, 255, 114, 0.6);
 }

 .tx-status.error {
     border-color: rgba(255, 107, 107, 0.7);
 }

.score-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.score-container p {
    margin: 5px 0;
    font-size: 1.1em;
}

.score-container span {
    font-weight: bold;
    color: #ffd700;
}

.controls {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.controls p {
    margin: 5px 0;
}

.controls strong {
    color: #ffd700;
}

button {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.game-board {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
    padding: 0;
}

#gameCanvas {
    border: 3px solid #ffd700;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    display: block;
    margin: 0 0 5px 0;
    padding: 0;
}

.next-piece {
    width: 150px;
    margin-bottom: 5px;
    text-align: center;
    padding: 0;
}

.next-piece h3 {
    margin-bottom: 5px;
    text-align: center;
    color: #ffd700;
}

#nextCanvas {
    border: 2px solid #ffd700;
    border-radius: 8px;
    background: #000;
    display: block;
    margin: 0 auto;
    padding: 0;
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 3px solid #ff6b6b;
    display: none;
}

/* Мобильное управление под игрой */
.mobile-controls {
    display: block !important;
    margin: 0 0;
    padding: 10px;
    gap: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    border: 2px solid #667eea;
    width: 100%;
    max-width: 400px;
    touch-action: none;
}

.mobile-controls-row {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-bottom: 10px;
}

.mobile-btn {
    width: 60px;
    height: 60px;
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(145deg, #667eea, #764ba2);
    border: 2px solid #ffd700;
    border-radius: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

.mobile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.mobile-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.mobile-btn.rotate {
    background: linear-gradient(145deg, #f093fb, #f5576c);
}

.mobile-btn.drop {
    background: linear-gradient(145deg, #fa709a, #fee140);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
        padding: 10px;
    }
    
    .game-info {
        width: 100%;
        max-width: 350px;
        margin-bottom: 20px;
    }
    
    .mobile-controls {
        display: block !important;
    }
    
    .controls {
        display: none;
    }
    
    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    #gameCanvas {
        width: 250px;
        height: 500px;
    }
    
    .next-piece {
        width: 120px;
        margin-top: 20px;
    }
    
    #nextCanvas {
        width: 100px;
        height: 100px;
    }
}

/* Всегда показываем мобильные кнопки для тестирования */
@media (min-width: 769px) {
    .mobile-controls {
        display: block !important;
    }
    
    .controls {
        display: none;
    }
}

@media (max-width: 480px) {
    .mobile-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    #gameCanvas {
        width: 200px;
        height: 400px;
    }
    
    .game-info h1 {
        font-size: 20px;
    }

    .game-avatar img {
        width: 72px;
        height: 72px;
    }
}

.game-over h2 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 2em;
}

.game-over p {
    margin: 10px 0;
    font-size: 1.2em;
}

@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .game-info {
        width: 100%;
        text-align: center;
    }
    
    .next-piece {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}
