* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Verdana', 'Arial', sans-serif;
    background: linear-gradient(135deg, #006b9e 0%, #064563 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #363636;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border: 2px solid #006b9e;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: #006b9e;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.score-board {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f7f7f7;
    padding: 15px;
    border-radius: 10px;
    min-width: 80px;
    border: 1px solid #006b9e;
}

.score-item span:first-child {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
    color: #363636;
}

.score-item span:last-child {
    font-size: 1.5rem;
    font-weight: bold;
    color: #006b9e;
}

.game-area {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
}

.game-board {
    border: 3px solid #006b9e;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

#gameCanvas {
    display: block;
    border-radius: 7px;
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
    min-width: 200px;
}

.highscores-sidebar {
    min-width: 250px;
}

.next-piece {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #006b9e;
}

.next-piece h3 {
    margin-bottom: 15px;
    color: #006b9e;
}

#nextCanvas {
    background: #000;
    border-radius: 10px;
    border: 2px solid #006b9e;
}

.controls {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #006b9e;
}

.controls h3 {
    margin-bottom: 15px;
    color: #006b9e;
    text-align: center;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 107, 158, 0.2);
}

.control-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.control-item span:first-child {
    background: #006b9e;
    color: #fff;
    padding: 4px 8px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
}

.start-btn, .reset-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Verdana', 'Arial', sans-serif;
}

.start-btn {
    background: linear-gradient(45deg, #006b9e, #064563);
    color: white;
}

.start-btn:hover {
    background: linear-gradient(45deg, #064563, #006b9e);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 107, 158, 0.4);
}

.reset-btn {
    background: linear-gradient(45deg, #4b78b6, #006b9e);
    color: white;
}

.reset-btn:hover {
    background: linear-gradient(45deg, #006b9e, #4b78b6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(75, 120, 182, 0.4);
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid #006b9e;
    color: #363636;
}

.game-over h2 {
    color: #006b9e;
    margin-bottom: 20px;
    font-size: 2rem;
}

.paused {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    border-radius: 15px;
    border: 2px solid #006b9e;
    color: #006b9e;
    font-size: 1.5rem;
    font-weight: bold;
}

.highscores {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #006b9e;
    max-height: 500px;
    overflow-y: auto;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.highscores h3 {
    margin-bottom: 15px;
    color: #006b9e;
    text-align: center;
    flex-shrink: 0;
}

.highscores-list {
    font-size: 0.9rem;
    flex: 1;
    overflow-y: auto;
}

.highscore-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 107, 158, 0.2);
}

.highscore-item:last-child {
    border-bottom: none;
}

.highscore-rank {
    font-weight: bold;
    color: #006b9e;
    min-width: 30px;
}

.highscore-name {
    flex: 1;
    margin: 0 10px;
    color: #363636;
    font-size: 0.85rem;
}

.highscore-score {
    font-weight: bold;
    color: #006b9e;
    min-width: 70px;
    text-align: right;
}

.highscore-date {
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    margin-left: 8px;
}

.name-input-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.98);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #006b9e;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.name-input-overlay h3 {
    color: #006b9e;
    margin-bottom: 15px;
}

.name-input-overlay input {
    width: 200px;
    padding: 10px;
    border: 2px solid #006b9e;
    border-radius: 5px;
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: center;
}

.name-input-overlay button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin: 0 5px;
}

.name-input-overlay .save-btn {
    background: #006b9e;
    color: white;
}

.name-input-overlay .cancel-btn {
    background: #ccc;
    color: #333;
}

.name-input-overlay .save-btn:hover {
    background: #064563;
}

.name-input-overlay .cancel-btn:hover {
    background: #999;
}

@media (max-width: 768px) {
    .game-container {
        padding: 20px;
        margin: 10px;
    }
    
    .game-area {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
    
    .highscores-sidebar {
        min-width: auto;
        width: 100%;
        max-width: 300px;
    }
    
    .highscores {
        height: auto;
        max-height: 300px;
    }
    
    .score-board {
        flex-direction: column;
        gap: 10px;
    }
    
    .score-item {
        flex-direction: row;
        justify-content: space-between;
        min-width: auto;
    }
}
