/* Hero Tetris Game Styles */
.tetris-container {
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 243, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    border: 1px solid rgba(0, 243, 255, 0.3);
    max-width: 550px;
    width: 100%;
    position: relative;
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    margin-left: auto;
    margin-right: 20px;
}

.tetris-header {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    position: relative;
}

.tetris-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.5), transparent);
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.terminal-btn.close {
    background: linear-gradient(135deg, #ff5f57, #ff3b30);
    box-shadow: 0 0 10px rgba(255, 95, 87, 0.3);
}

.terminal-btn.minimize {
    background: linear-gradient(135deg, #ffbd2e, #ff9500);
    box-shadow: 0 0 10px rgba(255, 189, 46, 0.3);
}

.terminal-btn.maximize {
    background: linear-gradient(135deg, #28ca42, #30d158);
    box-shadow: 0 0 10px rgba(40, 202, 66, 0.3);
}

.terminal-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px currentColor;
}

.tetris-title {
    color: #00f3ff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    letter-spacing: 1px;
}

.tetris-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-hint {
    color: #888;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 4px 8px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.tetris-game {
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: radial-gradient(circle at center, rgba(0, 243, 255, 0.03), transparent);
}

#tetris-canvas {
    border: 2px solid rgba(0, 243, 255, 0.3);
    border-radius: 8px;
    background: #000;
    box-shadow: 
        0 0 20px rgba(0, 243, 255, 0.2),
        inset 0 0 50px rgba(0, 243, 255, 0.05);
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

#tetris-canvas:hover {
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 
        0 0 30px rgba(0, 243, 255, 0.3),
        inset 0 0 50px rgba(0, 243, 255, 0.08);
}

#tetris-canvas.controls-locked {
    border: 2px solid #ffd700;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    cursor: crosshair;
}

#tetris-canvas.controls-locked:hover {
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        inset 0 0 30px rgba(255, 215, 0, 0.2);
}

#tetris-canvas.controls-locked::before {
    content: '🔒';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 12px;
    z-index: 10;
    pointer-events: none;
}

.tetris-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 80px;
}

.score-display, .level-display, .lines-display {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.score-label, .level-label, .lines-label, .next-label {
    color: #00f3ff;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 4px;
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.5);
}

.score-value, .level-value, .lines-value {
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.next-piece {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

#next-canvas {
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 4px;
    background: #000;
    display: block;
    margin: 0 auto;
}

.tetris-message {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.1), rgba(0, 243, 255, 0.05));
    border-top: 1px solid rgba(0, 243, 255, 0.2);
    padding: 12px 16px;
    text-align: center;
    color: #00f3ff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
    position: relative;
    overflow: hidden;
    font-size: 12px;
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(0, 243, 255, 0.2);
    transition: all 0.3s ease;
}

.tetris-message.tetris-code-spell {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Tetris Block Colors */
.tetris-block-i { background: #00f3ff; box-shadow: 0 0 10px rgba(0, 243, 255, 0.5); }
.tetris-block-o { background: #ffff00; box-shadow: 0 0 10px rgba(255, 255, 0, 0.5); }
.tetris-block-t { background: #800080; box-shadow: 0 0 10px rgba(128, 0, 128, 0.5); }
.tetris-block-s { background: #00ff00; box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); }
.tetris-block-z { background: #ff0000; box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
.tetris-block-j { background: #0000ff; box-shadow: 0 0 10px rgba(0, 0, 255, 0.5); }
.tetris-block-l { background: #ffa500; box-shadow: 0 0 10px rgba(255, 165, 0, 0.5); }

/* Responsive Design */
@media (max-width: 768px) {
    .tetris-container {
        max-width: 100%;
    }
    
    .tetris-game {
        padding: 15px;
        gap: 15px;
        flex-direction: column;
        align-items: center;
    }
    
    #tetris-canvas {
        width: 240px;
        height: 320px;
    }
    
    .tetris-info {
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        max-width: 240px;
    }
    
    .next-piece {
        order: -1;
    }
}

@media (max-width: 480px) {
    .tetris-header {
        padding: 8px 12px;
    }
    
    .tetris-title {
        font-size: 12px;
    }
    
    .control-hint {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    #tetris-canvas {
        width: 200px;
        height: 280px;
    }
    
    .tetris-info {
        max-width: 200px;
    }
}

/* Animation effects */
.tetris-container:hover {
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(0, 243, 255, 0.2);
    transform: translateY(-2px);
}

.tetris-line-clear {
    animation: lineClear 0.5s ease-in-out;
}

@keyframes lineClear {
    0% { opacity: 1; }
    50% { opacity: 0.3; background: rgba(0, 243, 255, 0.8); }
    100% { opacity: 1; }
}

.tetris-code-spell {
    animation: codeSpell 2s ease-in-out;
}

@keyframes codeSpell {
    0%, 100% { transform: scale(1); }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 50px rgba(0, 243, 255, 0.6);
    }
}

/* Control Locking Visual Feedback */
#tetris-canvas {
    transition: all 0.3s ease;
    cursor: pointer;
}

#tetris-canvas:hover {
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

#tetris-canvas.controls-locked {
    border: 2px solid #ffd700;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    cursor: crosshair;
}

#tetris-canvas.controls-locked:hover {
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        inset 0 0 30px rgba(255, 215, 0, 0.2);
}

/* Enhanced Message Styling */
.tetris-message {
    font-size: 12px;
    color: #00f3ff;
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(0, 243, 255, 0.2);
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
    transition: all 0.3s ease;
}

.tetris-message.tetris-code-spell {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Control Hints */
.control-hints {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 10px;
    color: #888;
    font-family: 'Courier New', monospace;
}

.control-hint {
    padding: 4px 6px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 3px;
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.control-hint.active {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.3);
}

/* Mobile Touch Feedback */
@media (max-width: 768px) {
    #tetris-canvas {
        touch-action: none;
    }
    
    #tetris-canvas.controls-locked {
        border-width: 3px;
    }
    
    .control-hints {
        font-size: 9px;
        flex-direction: column;
        gap: 5px;
    }
}
