/* Tetris Corner Modal Styles */

/* Fixed Corner Button */
.tcm-corner-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    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;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

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

.tcm-corner-button:active {
    transform: translateY(0);
}

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

.tcm-label {
    display: inline-block;
}

/* Modal Overlay */
.tcm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tcm-modal.active {
    opacity: 1;
    visibility: visible;
}

.tcm-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.tcm-modal-content {
    position: relative;
    background: #1a1a2e;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tcm-modal.active .tcm-modal-content {
    transform: scale(1);
}

/* Modal Header */
.tcm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #2d2d44;
}

.tcm-modal-title {
    margin: 0;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.tcm-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Modal Body */
.tcm-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    gap: 20px;
}

/* Game Canvas */
#tetris-canvas {
    display: block;
    background: #0f0f23;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Game Info */
.tcm-game-info {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
}

.tcm-score-box,
.tcm-level-box,
.tcm-lines-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 24px;
    border-radius: 8px;
    min-width: 80px;
}

.tcm-score-box .tcm-label,
.tcm-level-box .tcm-label,
.tcm-lines-box .tcm-label {
    color: #8b8b9e;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.tcm-value {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

/* Controls Hint */
.tcm-controls-hint {
    text-align: center;
    color: #8b8b9e;
    font-size: 13px;
    line-height: 1.6;
}

.tcm-controls-hint p {
    margin: 0;
}

.tcm-controls-hint strong {
    color: #667eea;
}

/* Responsive */
@media (max-width: 600px) {
    .tcm-corner-button {
        top: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .tcm-icon {
        font-size: 16px;
    }
    
    #tetris-canvas {
        width: 250px;
        height: 500px;
    }
    
    .tcm-modal-body {
        padding: 16px;
    }
    
    .tcm-game-info {
        gap: 12px;
    }
    
    .tcm-score-box,
    .tcm-level-box,
    .tcm-lines-box {
        padding: 8px 16px;
        min-width: 60px;
    }
    
    .tcm-value {
        font-size: 18px;
    }
}

/* Animation for button appearance */
@keyframes tcm-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.6);
    }
}

.tcm-corner-button {
    animation: tcm-pulse 2s infinite;
}

.tcm-corner-button:hover {
    animation: none;
}

/* Game Over overlay */
.tcm-game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.tcm-game-over h3 {
    font-size: 32px;
    margin-bottom: 16px;
    color: #ff6b6b;
}

.tcm-game-over button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.tcm-game-over button:hover {
    transform: scale(1.05);
}