/**
 * Tetris Top Right Button - Styles
 */

/* ========================================
   Fixed Game Button
   ======================================== */

.ttrb-fixed-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.ttrb-fixed-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5a6fd6 0%, #6a4190 100%);
}

.ttrb-fixed-button:active {
    transform: translateY(0);
}

.ttrb-fixed-button svg {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .ttrb-button-text {
        display: none;
    }
    
    .ttrb-fixed-button {
        padding: 10px;
        top: 10px;
        right: 10px;
    }
}

/* ========================================
   Modal Overlay
   ======================================== */

.ttrb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.ttrb-modal.ttrb-active {
    display: flex;
}

/* Backdrop for click-to-close */
.ttrb-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Modal Content Box */
.ttrb-modal-content {
    position: relative;
    background: #1a1a2e;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    animation: ttrb-modalIn 0.3s ease-out;
}

@keyframes ttrb-modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ttrb-modal.ttrb-closing .ttrb-modal-content {
    animation: ttrb-modalOut 0.2s ease-in forwards;
}

@keyframes ttrb-modalOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
}

/* Modal Header */
.ttrb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ttrb-modal-title {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Close Button */
.ttrb-close-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ttrb-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.ttrb-close-button:active {
    transform: scale(0.95);
}

/* Modal Body */
.ttrb-modal-body {
    padding: 20px;
}

/* ========================================
   Game Container
   ======================================== */

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

@media (max-width: 600px) {
    .ttrb-game-container {
        flex-direction: column;
        align-items: center;
    }
}

/* Canvas */
#ttrb-canvas {
    display: block;
    background: #0a0a0a;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

@media (max-width: 480px) {
    #ttrb-canvas {
        width: 250px;
        height: 500px;
    }
}

/* Game Info Panel */
.ttrb-game-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 100px;
}

.ttrb-score-box,
.ttrb-level-box,
.ttrb-lines-box {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ttrb-label {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b9dc3;
    margin-bottom: 4px;
}

.ttrb-value {
    display: block;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

/* Controls Info */
.ttrb-controls {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ttrb-controls p {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    color: #8b9dc3;
    text-align: center;
}

/* Prevent body scroll when modal is open */
body.ttrb-modal-open {
    overflow: hidden;
}
