* {
    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;
    padding: 20px;
}

.game-container {
    max-width: 1400px;
    width: 100%;
}

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

.game-title {
    color: white;
    font-size: 3em;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

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

.info-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.info-card h3 {
    color: #667eea;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 2px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item .label {
    color: #666;
    font-size: 1em;
    font-weight: 500;
}

.info-item .value {
    color: #333;
    font-size: 1.4em;
    font-weight: bold;
}

.info-item .value.score {
    color: #667eea;
    font-size: 1.8em;
}

.controls-card {
    background: rgba(255, 255, 255, 0.95);
}

.control-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
}

.key {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    font-size: 0.9em;
}

.desc {
    color: #666;
    font-size: 0.95em;
}

.game-board-container {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.board {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #2d3748;
    padding: 15px;
    border-radius: 15px;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.3);
}

.board-row {
    display: flex;
    gap: 2px;
}

.cell {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    transition: all 0.1s ease;
}

.cell.filled {
    box-shadow: 
        inset 0 0 10px rgba(255, 255, 255, 0.5),
        0 0 10px rgba(0, 0, 0, 0.3);
    border-width: 2px;
}

.cell.current-piece {
    animation: pieceGlow 0.5s ease-in-out infinite alternate;
}

@keyframes pieceGlow {
    from {
        filter: brightness(1);
    }
    to {
        filter: brightness(1.3);
    }
}

.next-piece-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.next-piece {
    background: #2d3748;
    padding: 15px;
    border-radius: 10px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.next-row {
    display: flex;
    gap: 2px;
}

.next-cell {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.next-cell.filled {
    box-shadow: 
        inset 0 0 8px rgba(255, 255, 255, 0.5),
        0 0 8px rgba(0, 0, 0, 0.3);
    border-width: 2px;
}

.control-btn {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.pause-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.pause-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.pause-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-btn:last-child {
    margin-bottom: 0;
}

.game-over-overlay,
.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.game-over-content,
.pause-content {
    text-align: center;
    color: white;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.final-score {
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #ffd700;
    font-weight: bold;
}

.restart-btn {
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

@media (max-width: 1200px) {
    .game-content {
        flex-direction: column;
        align-items: center;
    }
    
    .side-panel {
        width: 100%;
        max-width: 500px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .info-card {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .game-title {
        font-size: 2em;
    }
    
    .side-panel {
        flex-direction: column;
    }
    
    .cell {
        width: 22px;
        height: 22px;
    }
    
    .game-over-content h2,
    .pause-content h2 {
        font-size: 2em;
    }
}
