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

body {
    font-family: 'Press Start 2P', monospace;
    background-color: #1a1a1a;
    color: #FFFFFF;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.game-header {
    text-align: center;
    width: 100%;
}

.game-title {
    font-size: 2.5rem;
    color: #FFFF00;
    text-shadow: 3px 3px 0px #FF0000, 6px 6px 0px #0000FF;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.score-display, .level-display, .lines-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.label {
    font-size: 0.8rem;
    color: #CCCCCC;
}

.value {
    font-size: 1.2rem;
    font-weight: bold;
}

.score-display .value {
    color: #FFFF00;
}

.level-display .value {
    color: #00FFFF;
}

.lines-display .value {
    color: #00FF00;
}

.game-main {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.game-board-container {
    position: relative;
    border: 3px solid #333333;
    border-radius: 20px;
    background-color: #000000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

#gameCanvas {
    display: block;
    background-color: #000000;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay-content {
    text-align: center;
    padding: 20px;
}

.overlay-content h2 {
    font-size: 1.5rem;
    color: #FF0000;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px #000000;
}

.overlay-content p {
    font-size: 0.9rem;
    color: #FFFF00;
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-width: 200px;
}

.next-piece, .controls {
    background-color: #000000;
    border: 2px solid #333333;
    padding: 15px;
    text-align: center;
}

.next-piece h3, .controls h3 {
    font-size: 0.9rem;
    color: #FFFF00;
    margin-bottom: 15px;
    text-shadow: 1px 1px 0px #000000;
}

#nextCanvas {
    background-color: #000000;
    border: 1px solid #333333;
}

.control-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
}

.key {
    background-color: #333333;
    color: #FFFFFF;
    padding: 5px 8px;
    border-radius: 3px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.action {
    color: #CCCCCC;
}

.start-level {
    background-color: #000000;
    border: 2px solid #333333;
    padding: 15px;
    text-align: center;
}

.start-level h3 {
    font-size: 0.9rem;
    color: #FFFF00;
    margin-bottom: 15px;
    text-shadow: 1px 1px 0px #000000;
}

.level-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.level-btn {
    background-color: #333333;
    color: #FFFFFF;
    border: 2px solid #666666;
    font-family: 'Press Start 2P', monospace;
    font-size: 1rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.level-btn:hover {
    background-color: #FFFF00;
    color: #000000;
    border-color: #FFFF00;
}

.level-btn:active {
    transform: scale(0.95);
}

.level-display {
    font-size: 1.2rem;
    color: #00FFFF;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.music-controls {
    background-color: #000000;
    border: 2px solid #333333;
    padding: 15px;
    text-align: center;
}

.music-controls h3 {
    font-size: 0.9rem;
    color: #FFFF00;
    margin-bottom: 15px;
    text-shadow: 1px 1px 0px #000000;
}

.music-controls-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.music-btn {
    background-color: #333333;
    color: #FFFFFF;
    border: 2px solid #666666;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.8rem;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.music-btn:hover {
    background-color: #FFFF00;
    color: #000000;
    border-color: #FFFF00;
}

.music-btn:active {
    transform: scale(0.95);
}

.volume-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 100%;
    height: 6px;
    background: #333333;
    outline: none;
    border-radius: 3px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #FFFF00;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #333333;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #FFFF00;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #333333;
}

.volume-label {
    font-size: 0.7rem;
    color: #CCCCCC;
}

/* Touch control zones - visible on all devices for testing */
.touch-zones {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    display: block;
}

.touch-zone {
    position: absolute;
    height: 100%;
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

.touch-zone.left {
    left: 0;
    width: 33.33%;
    background: linear-gradient(to right, rgba(255, 255, 0, 0.3), transparent);
}

.touch-zone.right {
    right: 0;
    width: 33.33%;
    background: linear-gradient(to left, rgba(255, 255, 0, 0.3), transparent);
}

.touch-zone.center {
    left: 33.33%;
    width: 33.33%;
    background: linear-gradient(to right, transparent, rgba(0, 255, 255, 0.3), transparent);
}

.touch-zone.bottom {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, rgba(255, 0, 255, 0.3), transparent);
}

/* Hide touch zones when game is paused or over */
.game-paused .touch-zones,
.game-over .touch-zones {
    display: none;
}

.menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.menu-content {
    background-color: #000000;
    border: 3px solid #FFFF00;
    padding: 40px;
    text-align: center;
    min-width: 300px;
}

.menu-content h2 {
    font-size: 1.5rem;
    color: #FFFF00;
    margin-bottom: 30px;
    text-shadow: 2px 2px 0px #000000;
}

.menu-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #333333;
    color: #FFFFFF;
    border: 2px solid #666666;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-btn:hover {
    background-color: #FFFF00;
    color: #000000;
    border-color: #FFFF00;
}

.menu-btn:active {
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 1.8rem;
        text-shadow: 2px 2px 0px #FF0000, 4px 4px 0px #0000FF;
    }
    
    .game-info {
        gap: 20px;
    }
    
    .game-main {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .game-sidebar {
        flex-direction: row;
        gap: 20px;
        min-width: auto;
    }
    
    .next-piece, .controls {
        padding: 10px;
    }
    
    .control-item {
        font-size: 0.6rem;
    }
    
    .key {
        min-width: 50px;
        padding: 3px 6px;
    }
    
    .menu-content {
        margin: 20px;
        padding: 30px;
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.4rem;
    }
    
    .game-sidebar {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }
    
    #gameCanvas {
        width: 300px;
        height: 400px;
    }
    
    #nextCanvas {
        width: 100px;
        height: 100px;
    }
}

/* Animation for Tetris effect */
@keyframes tetris-flash {
    0%, 100% { background-color: #000000; }
    25% { background-color: #FFFF00; }
    50% { background-color: #FF0000; }
    75% { background-color: #00FFFF; }
}

/* Tetris flash effect */
.tetris-flash {
    animation: tetris-flash 0.5s ease-in-out;
}

@keyframes tetris-flash {
    0%, 100% { filter: brightness(1) hue-rotate(0deg); }
    50% { filter: brightness(1.5) hue-rotate(180deg); }
}

/* Rotation start effect */
.rotation-start {
    animation: rotation-start 1s ease-in-out;
}

@keyframes rotation-start {
    0% { 
        filter: brightness(1) saturate(1);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    }
    50% { 
        filter: brightness(1.3) saturate(1.5);
        box-shadow: 0 0 40px rgba(0, 255, 255, 0.6);
    }
    100% { 
        filter: brightness(1) saturate(1);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    }
}

/* Animation for holding down */
@keyframes pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
} 