/**
 * Mesitas Game Styles
 * Professional memory game with progressive levels
 */

/* ==================== DEMO MINIMAP (Landing Page) ==================== */
.mesitas-demo-preview {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 15px 30px var(--shadow);
    text-align: center;
}

.mesitas-demo-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 1.5rem;
}

.mesitas-demo-map {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 300px;
    background: #dfe6e9;
    border-radius: var(--radius-md);
    margin: 0 auto 1.5rem;
    border: 3px solid #2d3436;
}

.mesitas-demo-table {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    font-weight: bold;
    font-size: 20px;
    color: #2d3436;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.mesitas-demo-table--round {
    border-radius: 50%;
    background-color: #ffeaa7;
    border: 4px solid #fdcb6e;
}

.mesitas-demo-table--square {
    border-radius: 8px;
    background-color: #74b9ff;
    border: 4px solid #0984e3;
}

.mesitas-demo-table:hover {
    transform: scale(1.1);
}

.mesitas-demo-table.correct {
    background-color: #00b894 !important;
    border-color: #00b894 !important;
    color: #fff !important;
    animation: pulse 0.5s ease;
}

.mesitas-demo-table.wrong {
    background-color: #d63031 !important;
    border-color: #d63031 !important;
    color: #fff !important;
    animation: shake 0.5s ease;
}

.mesitas-demo-message {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    min-height: 30px;
    color: var(--txt);
}

/* ==================== DECORATIVE IMAGES ==================== */
.mesitas-decorative-images {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.mesitas-decorative-images img {
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 20px var(--shadow);
}

/* ==================== FULLSCREEN GAME MODAL ==================== */
.mesitas-fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f6fa;
    z-index: 9999;
    display: none;
    flex-direction: column;
}

.mesitas-fullscreen-modal.active {
    display: flex;
}

/* Top Bar */
.mesitas-top-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    min-height: 70px;
}

.mesitas-top-bar-title {
    font-family: var(--font-title);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
}

.mesitas-top-bar-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.mesitas-btn-mute {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
    padding: 0.7rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
}

.mesitas-btn-mute:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.mesitas-btn-mute.muted {
    background: rgba(255,255,255,0.1);
    opacity: 0.7;
}

.mesitas-btn-exit {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.mesitas-btn-exit:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* Map Area */
.mesitas-map-area {
    flex: 1;
    background: #dfe6e9;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.mesitas-map-area:active {
    cursor: grabbing;
}

.mesitas-map-area-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

.mesitas-restaurant-map {
    position: relative;
    background: transparent;
}

/* Table Elements - All tables have white background with dark border */
.mesitas-table {
    background-color: #ffffff;
    border: 3px solid #2d3436;
}

.mesitas-table.number-hidden {
    color: transparent !important;
    user-select: none;
}

.mesitas-table.correct {
    background-color: #00b894 !important;
    border-color: #00b894 !important;
    color: #fff !important;
    animation: pulse 0.5s ease;
}

.mesitas-table.revealed {
    background-color: #00b894 !important;
    border-color: #00b894 !important;
    color: #fff !important;
}

.mesitas-table.wrong {
    background-color: #d63031 !important;
    border-color: #d63031 !important;
    color: #fff !important;
    animation: shake 0.5s ease;
}

/* Bottom Bar */
.mesitas-bottom-bar {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    min-height: 80px;
    flex-wrap: wrap;
    gap: 1rem;
}

.mesitas-difficulty-selector {
    display: flex;
    gap: 1rem;
}

.mesitas-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: var(--radius-pill);
    border: 2px solid #dfe6e9;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    background: white;
}

.mesitas-radio-label:has(input:checked) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.mesitas-radio-label input {
    display: none;
}

.mesitas-btn-start {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-pill);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,184,148,0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.mesitas-btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0,184,148,0.5);
}

.mesitas-game-stats {
    display: none;
    gap: 2rem;
    flex-wrap: wrap;
}

.mesitas-game-stats.active {
    display: flex;
    flex: 1;
    justify-content: center;
}

.mesitas-stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #2d3436;
}

.mesitas-stat-item i {
    font-size: 1.3rem;
    color: #667eea;
}

.mesitas-stat-value {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
}

/* Flash Card */
.mesitas-flash-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(100%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 -4px 20px rgba(102,126,234,0.3);
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    pointer-events: none;
}

.mesitas-flash-card.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.mesitas-flash-card-content i {
    font-size: 3rem;
    margin: 0;
    display: block;
}

.mesitas-flash-card-content p {
    font-family: var(--font-title);
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
}

/* Message Toast */
.mesitas-message-toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #2d3436;
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 1.1rem;
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.mesitas-message-toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Final Modal */
.mesitas-final-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.mesitas-final-modal.active {
    display: flex;
}

.mesitas-final-modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
}

.mesitas-final-modal h2 {
    color: #667eea;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
}

.mesitas-final-modal h2 i {
    margin-right: 0.5rem;
}

.mesitas-btn-close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #636e72;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.mesitas-btn-close-modal:hover {
    opacity: 1;
}

.mesitas-final-stats {
    width: 100%;
}

.mesitas-final-score {
    font-family: var(--font-title);
    font-size: 4rem;
    color: #667eea;
    text-align: center;
    margin-bottom: 2rem;
}

.mesitas-final-details {
    margin-bottom: 2rem;
}

.mesitas-final-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #ecf0f1;
    font-size: 1.1rem;
}

.mesitas-final-stat-row:last-child {
    border-bottom: none;
}

.mesitas-final-stat-row span {
    color: #636e72;
    font-weight: 600;
}

.mesitas-final-stat-row strong {
    color: #2d3436;
    font-family: 'Courier New', monospace;
}

.mesitas-final-stats .message {
    text-align: center;
    font-size: 1.2rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 2rem;
}

.mesitas-final-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.mesitas-btn-next-level,
.mesitas-btn-restart,
.mesitas-btn-close {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.mesitas-btn-next-level {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(102,126,234,0.3);
}

.mesitas-btn-next-level:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(102,126,234,0.4);
}

.mesitas-btn-restart {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(0,184,148,0.3);
}

.mesitas-btn-restart:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0,184,148,0.4);
}

.mesitas-btn-close {
    background: #636e72;
    color: white;
}

.mesitas-btn-close:hover {
    background: #2d3436;
    transform: scale(1.05);
}

/* ==================== ANIMATIONS ==================== */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .mesitas-top-bar {
        padding: 0.5rem 0.8rem;
        min-height: 48px;
    }

    .mesitas-top-bar-title {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .mesitas-top-bar-actions {
        gap: 0.5rem;
    }

    .mesitas-btn-mute {
        width: 38px;
        height: 38px;
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .mesitas-btn-exit {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        gap: 0.3rem;
    }

    .mesitas-bottom-bar {
        padding: 0.6rem 0.8rem;
        min-height: auto;
        gap: 0.5rem;
    }

    .mesitas-difficulty-selector {
        display: flex;
        gap: 0.5rem;
        flex: 1;
    }

    .mesitas-radio-label {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        flex: 1;
        justify-content: center;
    }

    .mesitas-radio-label i {
        font-size: 0.9rem;
    }

    .mesitas-btn-start {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .mesitas-game-stats.active {
        display: flex;
        gap: 0.8rem;
        flex-wrap: nowrap;
        flex: 1;
        justify-content: space-between;
    }

    .mesitas-stat-item {
        font-size: 0.75rem;
        gap: 0.25rem;
        flex-direction: column;
        align-items: center;
    }

    .mesitas-stat-item i {
        font-size: 1rem;
    }

    .mesitas-stat-value {
        font-size: 0.8rem;
    }

    .mesitas-flash-card {
        padding: 1.25rem 1.5rem;
        bottom: 70px;
    }

    .mesitas-flash-card-content i {
        font-size: 2rem;
    }

    .mesitas-flash-card-content p {
        font-size: 1.1rem;
    }

    .mesitas-final-modal-content {
        padding: 2rem 1.5rem;
        max-height: 90vh;
    }

    .mesitas-final-modal h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .mesitas-final-score {
        font-size: 3rem;
    }

    .mesitas-final-stat-row {
        font-size: 1rem;
    }

    .mesitas-final-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .mesitas-btn-next-level,
    .mesitas-btn-restart,
    .mesitas-btn-close {
        width: 100%;
        justify-content: center;
    }

    .mesitas-demo-map {
        height: 250px;
    }

    .mesitas-demo-table {
        width: 60px;
        height: 60px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .mesitas-message-toast {
        bottom: 100px;
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }
}
