* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Arial', sans-serif;
    padding: 10px;
}

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 100%;
}

.game-area {
    display: flex;
    justify-content: center;
    align-items: center;
}

#boardCanvas {
    background-color: #000;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    width: 100%;
    height: auto;
    max-width: 300px;
}

.info-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
    color: white;
    min-width: 120px;
}

.next-piece {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 10px;
}

.next-piece h3 {
    margin-bottom: 8px;
    font-size: 1em;
}

#nextCanvas {
    background-color: #000;
    border: 1px solid #fff;
    margin: 0 auto;
    width: 80px;
    height: 80px;
}

.score-board {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.score-board p {
    margin: 8px 0;
    font-size: 0.9em;
}

.score-board span {
    font-weight: bold;
    color: #ffd700;
    font-size: 1.1em;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 0.9em;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

button:active {
    transform: scale(0.95);
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    margin-top: 20px;
    gap: 10px;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
}

.control-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 2em;
    padding: 15px 25px;
    min-width: 70px;
    cursor: pointer;
    transition: all 0.1s ease;
    font-weight: bold;
}

.control-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

#hardDropBtn {
    font-size: 1.5em;
    padding: 15px 20px;
}

/* Blink animation for lines */
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.blink {
    animation: blink 0.2s ease-in-out 3;
}

/* Desktop styles */
@media (min-width: 768px) {
    .container {
        gap: 30px;
        padding: 20px;
    }
    
    .info-area {
        min-width: 150px;
    }
    
    .next-piece h3 {
        font-size: 1.2em;
    }
    
    #nextCanvas {
        width: 120px;
        height: 120px;
    }
    
    .score-board p {
        font-size: 1.1em;
    }
    
    button {
        font-size: 1em;
        padding: 10px 20px;
    }
}

/* Show mobile controls only on small screens */
@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
    
    .container {
        gap: 10px;
        padding: 10px;
    }
    
    .control-btn {
        padding: 12px 20px;
        font-size: 1.8em;
        min-width: 60px;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .control-btn {
        padding: 10px 15px;
        font-size: 1.5em;
        min-width: 50px;
    }
    
    #hardDropBtn {
        font-size: 1.2em;
        padding: 10px 15px;
    }
    
    .score-board p {
        font-size: 0.8em;
    }
}