/* ==========================================
   GAME MODAL - Fullscreen Game Board
   Modal overlay style for immersive gameplay
   ========================================== */

/* Game Modal Container */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 10000;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.game-modal.active {
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Header */
.game-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.game-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.game-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.game-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

.game-modal-close:active {
    transform: scale(0.95);
}

/* Modal Content */
.game-modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: white;
}

.game-modal-body {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-top: 10px;
}

/* Game Board inside Modal */
.game-modal .game-board {
    touch-action: none !important;
    overscroll-behavior: none !important;
    max-width: 100%;
    max-height: 100%;
}

.game-modal .container {
    width: 100%;
    height: 100%;
    position: static;
    overflow: visible;
}

.game-modal .container > * {
    max-height: none;
}

/* Hide content outside modal */
body.game-modal-open {
    overflow: hidden !important;
    position: fixed !important;
}

body.game-modal-open > *:not(.game-modal) {
    display: none;
}

/* Info Bar */
.game-modal-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.game-modal-info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.game-modal-info-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
}

.game-modal-info-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .game-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
    }

    .game-modal-header {
        padding: 12px 15px;
    }

    .game-modal-title {
        font-size: 18px;
    }

    .game-modal-close {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .game-modal-body {
        padding: 15px;
    }

    .game-modal-info {
        padding: 12px;
    }
}

/* Prevent scroll outside modal */
html.game-modal-open {
    overflow: hidden !important;
}

/* Animation for close */
@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.game-modal.closing {
    animation: slideDown 0.3s ease-in forwards;
}
