/* Tetris Game Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
    overflow: hidden;
}

#game-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

#game-board {
    position: relative;
    background: #000;
    border: 3px solid #444;
    border-radius: 5px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

#game-canvas {
    display: block;
}

/* Side Panels */
#side-panel-left,
#side-panel-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 120px;
}

.panel-box {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.panel-box h3 {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.panel-box canvas {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
}

/* Stats */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 12px;
    color: #888;
}

.stat-value {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

#score {
    color: #00ff88;
    font-size: 16px;
}

#level {
    color: #ffcc00;
}

#lines {
    color: #00ccff;
}

/* Overlay Screens */
#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;
    z-index: 10;
    border-radius: 5px;
}

#overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    padding: 30px;
}

.overlay-content.hidden {
    display: none;
}

.overlay-content h1 {
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 0 0 20px #00ff88, 0 0 40px #00ff88;
    letter-spacing: 8px;
}

.overlay-content h2 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #ff4444;
}

/* Menu Buttons */
.menu-btn {
    display: block;
    width: 200px;
    margin: 10px auto;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(180deg, #444 0%, #222 100%);
    border: 2px solid #555;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.menu-btn:hover {
    background: linear-gradient(180deg, #555 0%, #333 100%);
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.menu-btn:active {
    transform: scale(0.98);
}

/* Controls Screen */
.control-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid #333;
}

.control-row:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.key {
    background: #333;
    padding: 5px 12px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 14px;
    border: 1px solid #555;
}

.action {
    color: #aaa;
    font-size: 14px;
}

/* Game Over Screen */
#final-score {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

#final-score-value {
    font-size: 24px;
    color: #00ff88;
    display: block;
    margin-top: 5px;
}

#player-name {
    width: 200px;
    padding: 10px;
    font-size: 16px;
    background: #222;
    border: 2px solid #444;
    border-radius: 5px;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
}

#player-name::placeholder {
    color: #666;
}

/* Responsive Design */
@media (max-width: 800px) {
    #game-container {
        flex-direction: column;
        align-items: center;
    }
    
    #side-panel-left,
    #side-panel-right {
        flex-direction: row;
        width: auto;
    }
    
    .panel-box {
        margin: 0 10px;
    }
}

@media (max-width: 500px) {
    #game-container {
        padding: 10px;
        gap: 10px;
    }
    
    .overlay-content h1 {
        font-size: 32px;
    }
    
    .menu-btn {
        width: 150px;
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Touch Controls (for mobile) */
@media (pointer: coarse) {
    #touch-controls {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 10px;
    }
    
    .touch-btn {
        width: 60px;
        height: 60px;
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 24px;
        color: #fff;
        user-select: none;
    }
}

/* Animations */
@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.line-clear {
    animation: flash 0.2s ease-in-out;
}

.level-up {
    animation: pulse 0.3s ease-in-out;
}

/* Settings Screen */
.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #333;
}

.settings-row:last-of-type {
    border-bottom: none;
    margin-bottom: 20px;
}

.setting-label {
    color: #aaa;
    font-size: 14px;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #00ff88;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Volume/Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    width: 120px;
    height: 8px;
    background: #333;
    border-radius: 4px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #00ff88;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #00ff88;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}