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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
}

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

.game-header h1 {
    font-size: 3em;
    color: #2c3e50;
    letter-spacing: 8px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.game-info {
    display: flex;
    justify-content: space-around;
    gap: 15px;
}

.info-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.info-box .label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.info-box .value {
    color: white;
    font-size: 1.8em;
    font-weight: bold;
}

.game-content {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.next-piece-container,
.controls-info,
.highscore-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.next-piece-container h3,
.controls-info h3,
.highscore-container h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-align: center;
}

#nextPieceCanvas {
    display: block;
    margin: 0 auto;
    background: white;
    border-radius: 5px;
}

.controls-info p {
    color: #555;
    margin: 8px 0;
    font-size: 0.9em;
    line-height: 1.6;
}

.highscore-container {
    max-height: 300px;
    overflow-y: auto;
}

#highscoreList {
    color: #2c3e50;
    font-size: 0.9em;
}

.highscore-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 5px 0;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.highscore-entry:nth-child(1) {
    border-left-color: #ffd700;
    background: #fffef0;
}

.highscore-entry:nth-child(2) {
    border-left-color: #c0c0c0;
    background: #f8f8f8;
}

.highscore-entry:nth-child(3) {
    border-left-color: #cd7f32;
    background: #fff8f0;
}

.highscore-name {
    font-weight: bold;
}

.highscore-score {
    color: #667eea;
    font-weight: bold;
}

.game-board-container {
    position: relative;
}

#gameCanvas {
    display: block;
    background: #000;
    border: 4px solid #2c3e50;
    border-radius: 5px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 40px;
}

.overlay-content h2 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.overlay-content p {
    font-size: 1.3em;
    margin-bottom: 30px;
}

#restartButton,
#submitNameButton {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

#restartButton:hover,
#submitNameButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

#restartButton:active,
#submitNameButton:active {
    transform: translateY(0);
}

#nameInput {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #667eea;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

#nameInput:focus {
    border-color: #764ba2;
}

@media (max-width: 768px) {
    .game-content {
        flex-direction: column;
        align-items: center;
    }
    
    .game-info {
        flex-wrap: wrap;
    }
    
    .info-box {
        min-width: 80px;
        padding: 10px 15px;
    }
    
    .game-header h1 {
        font-size: 2em;
    }
}
