/* Fixed corner button */
.tetris-corner-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.tetris-corner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.tetris-corner-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.tetris-icon {
    font-size: 18px;
}

.tetris-label {
    letter-spacing: 1px;
}

/* Modal overlay */
.tetris-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.tetris-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tetris-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.tetris-modal-content {
    position: relative;
    z-index: 10001;
    background: #1a1a2e;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Modal header */
.tetris-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border-bottom: 2px solid #e94560;
}

.tetris-modal-header h2 {
    margin: 0;
    color: #e94560;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    letter-spacing: 4px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.tetris-close-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tetris-close-btn:hover {
    background: #ff6b6b;
    transform: scale(1.1);
}

/* Modal body */
.tetris-modal-body {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: #1a1a2e;
}

#tetris-canvas {
    background: #0f0f23;
    border: 3px solid #533483;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.tetris-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 120px;
}

.tetris-score-box,
.tetris-level-box,
.tetris-lines-box,
.tetris-next-box {
    background: #16213e;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    border: 2px solid #533483;
}

.tetris-score-label,
.tetris-level-label,
.tetris-lines-label,
.tetris-next-label {
    color: #e94560;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.tetris-score-value,
.tetris-level-value,
.tetris-lines-value {
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: bold;
}

#tetris-next {
    background: #0f0f23;
    border-radius: 4px;
}

.tetris-controls-hint {
    background: #16213e;
    border-radius: 8px;
    padding: 12px;
    border: 2px solid #533483;
}

.tetris-controls-hint p {
    margin: 4px 0;
    color: #aaa;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

/* Modal footer */
.tetris-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: #16213e;
    border-top: 1px solid #533483;
}

.tetris-action-btn {
    flex: 1;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tetris-action-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
}

.tetris-action-btn:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 600px) {
    .tetris-corner-btn {
        padding: 10px 16px;
        font-size: 12px;
        top: 10px;
        right: 10px;
    }
    
    .tetris-icon {
        font-size: 16px;
    }
    
    .tetris-label {
        display: none;
    }
    
    .tetris-modal-body {
        flex-direction: column;
        align-items: center;
    }
    
    .tetris-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #tetris-canvas {
        width: 250px;
        height: 500px;
    }
}
