/* Main Tetris Game Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
}

#game-area {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#game-canvas {
    border: 3px solid #fff;
    border-radius: 5px;
    background: #000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#side-panel {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    min-width: 200px;
    backdrop-filter: blur(5px);
}

#next-piece-container {
    text-align: center;
    margin-bottom: 20px;
}

#next-piece-container h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#next-piece-canvas {
    border: 2px solid #fff;
    border-radius: 5px;
    background: #000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#score-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-size: 16px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: background 0.3s ease;
}

.score-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.label {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

.score-value {
    font-weight: bold;
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Menu styles */
#menu-container, #game-over-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    min-width: 300px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    z-index: 100;
}

#menu-container h1, #game-over-container h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

#high-scores h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

#scores-list {
    list-style: none;
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
}

#scores-list li {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 5px;
    color: #333;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#scores-list li:nth-child(1) {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    font-weight: bold;
}

#scores-list li:nth-child(2) {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #333;
    font-weight: bold;
}

#scores-list li:nth-child(3) {
    background: linear-gradient(135deg, #cd7f32, #e4a853);
    color: #333;
    font-weight: bold;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

/* Pause overlay */
#pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

#pause-message {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#pause-message h2 {
    margin-bottom: 15px;
    color: #333;
    font-size: 28px;
}

#pause-message p {
    color: #666;
    font-size: 16px;
    margin-bottom: 0;
}

/* Mobile controls */
#mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.control-row {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.control-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #667eea;
    color: #667eea;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 0;
    padding: 0;
}

.control-button:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.control-button:active {
    transform: scale(0.95);
    background: #764ba2;
    border-color: #764ba2;
}

/* Game over specific styles */
#game-over p {
    color: #666;
    font-size: 18px;
    margin-bottom: 20px;
}

#final-score {
    font-weight: bold;
    color: #667eea;
    font-size: 24px;
}

/* Animation classes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 0.5s ease-in-out;
}

/* Score update animation */
.score-update {
    animation: pulse 0.3s ease-in-out;
    color: #ffd700 !important;
}

/* Line clear effect */
@keyframes lineClear {
    0% {
        background: rgba(255, 255, 255, 0.8);
    }
    100% {
        background: transparent;
    }
}

.line-clear {
    animation: lineClear 0.5s ease-out;
}