/* Game Pages Styles */
:root {
    --dossier-ink: #2a2a2a;
    --brand-yellow: #ffff5a;
}

.game-page main {
    background-color: #000;
}

/* HERO SECTION */
.game-hero {
    position: relative;
    width: 100%;
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 100px 20px;
}

.game-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    /* min-height so it extends when content is taller than viewport */
    background-image: url('../assets/images/jogos/pide/pide-hero.avif');
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.margot-hero-bg {
    background-image: url('../assets/images/jogos/margot/margot-hero.avif');
}

.pandemia-hero-bg {
    background-image: url('../assets/images/jogos/pandemia/pandemia-hero.avif');
}

.game-hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 20%, rgba(0, 0, 0, 0.8) 100%);
    z-index: 2;
}

.game-hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

.game-top-logo {
    width: 320px;
    margin-top: 30px;
    margin-bottom: 0px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
}

/* DOSSIER */
.dossier-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin-bottom: 40px;
    filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.9));
}

.dossier-paper {
    background-image: url('../assets/images/jogos/pide/pide-docs.avif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 100%;
    aspect-ratio: 924 / 1111;
    /* Based on typical doc proportions */
    padding: 12% 15% 15% 15%;
    /* Padding to keep text inside paper area */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.dossier-header,
.dossier-body {
    transform: rotate(-2.9deg);
}

/* Pandemia page specifics - Dossier Paper */
.pandemia-page .dossier-container {
    min-width: 600px; /* Prevent shrinking below 600px as requested */
}

.pandemia-page .dossier-paper {
    background-image: url('../assets/images/jogos/pandemia/pandemia-doc.avif');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    width: 100%;
    aspect-ratio: 1200 / 923; /* Actual dimensions 1200x923 */
    padding: 0 40px 20px 40px; /* Top padding 0 as requested */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Perfect vertical centering */
    box-sizing: border-box;
}

.pandemia-page .dossier-header,
.pandemia-page .dossier-body {
    transform: rotate(0deg); /* Pandemia dossier looks cleaner without rotation */
}

.pandemia-page .dossier-body {
    width: 100%;
    max-width: 540px;
    align-self: center;
    padding: 0 40px 20px 40px; /* Top padding 0 as requested */
    font-family: var(--font-condensed);
    font-weight: 500;
    font-size: 1.35rem; /* Stage 1: Desktop */
    line-height: 1.4;
    color: #000;
    text-align: center; /* Centered as requested */
    box-sizing: border-box; /* Ensure padding doesn't affect width */
}

@media (max-width: 768px) {
    .pandemia-page .dossier-body {
        font-size: 1.1rem; /* Stage 2: Tablet (after sandwich) */
    }
}

@media (max-width: 480px) {
    .pandemia-page .dossier-body {
        font-size: 0.95rem; /* Stage 3: Mobile Small */
    }
}

/* Ensure text wraps at window width even if the paper overflows (min-width: 600px) */
@media (max-width: 600px) {
    .pandemia-page .dossier-body {
        max-width: 90vw; 
    }
}

.pandemia-page .dossier-body strong {
    font-weight: 800;
    color: #000;
}

/* Margot page: logo sizing (wide SVG banner) */
/* Increased specificity to avoid being overridden by .game-top-logo at < 768px */
.margot-page .margot-top-logo {
    width: 246px; /* Proportional to 400px mobile container */
    margin-top: 20px;
    margin-bottom: 0px;
}

@media (min-width: 1024px) {
    .margot-page .margot-top-logo {
        width: 320px; /* Proportional to 520px desktop container */
        margin-top: 30px;
    }
}

/* Mobile & Tablet default container */
.margot-page .dossier-container {
    width: 100%;
    max-width: 400px;
    overflow: visible;
}

/* Desktop container */
@media (min-width: 1024px) {
    .margot-page .dossier-container {
        max-width: 520px;
    }
}

.margot-dossier-paper {
    background-image: url('../assets/images/jogos/margot/margot-tarotcard.avif');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    width: 100%;
    aspect-ratio: 1600 / 1762;
    padding: 15% calc(12% + 35px); /* Increased lateral padding by 35px total each side for Mobile/Tablet */
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

/* On mobile/tablet, unlock the aspect-ratio so the card can grow taller if text needs more room */
@media (max-width: 1023px) {
    .margot-dossier-paper {
        aspect-ratio: auto;
        min-height: calc(400px * 1762 / 1600); /* natural height at 400px width ≈ 440px */
    }
}

@media (min-width: 1024px) {
    .margot-dossier-paper {
        padding: 20% 20%;
    }
}

/* Margot story text inside the card */
.margot-story {
    width: 100%;
    text-align: justify;
    color: #000;
    font-family: var(--font-condensed);
    font-weight: 500;
    /* Font scales smoothly with screen width until it reaches 1.2rem */
    font-size: clamp(0.75rem, 4vw, 1.2rem);
    line-height: 1.4;
    text-shadow: none;
}

@media (min-width: 1024px) {
    .margot-story {
        font-size: 1.35rem; /* Fixed comfortable size on large screens */
    }
}

.margot-story strong {
    color: #000 !important;
    font-weight: 800 !important;
}

.margot-story p {
    margin-bottom: 20px;
}


.dossier-title {
    font-family: var(--font-condensed);
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--dossier-ink);
    margin: 0;
}

.dossier-subtitle {
    font-family: var(--font-condensed);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--dossier-ink);
    line-height: 1.1;
    margin: 5px 0 20px 0;
}

.dossier-body {
    font-family: 'Special Elite', serif;
    font-size: 1.25rem;
    color: var(--dossier-ink);
    line-height: 1.5;
}

.dossier-body p {
    margin-bottom: 20px;
}

/* Tablet & Mobile typography adjustments for PIDE */
@media (max-width: 1023px) {
    .pide-page .dossier-title {
        font-size: 2.5rem;
    }
    .pide-page .dossier-subtitle {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
    .pide-page .dossier-body {
        font-size: 1.1rem;
        line-height: 1.4;
    }
}

/* STATS & CTA */
.game-meta-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-top: -25px;
}

.game-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    /* Reduzido para metade conforme pedido */
    background: transparent;
    padding: 0;
    border-radius: 0;
    backdrop-filter: none;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    min-width: unset;
    /* Removido para colarem mais se necessário */
    flex-shrink: 0;
}

.stat-item img {
    width: 85px;
    height: auto;
    margin-bottom: 0;
    flex-shrink: 0;
    object-fit: contain;
}

.stat-item span {
    display: none;
    /* Backup caso ainda existam no HTML */
}

.cta-row {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.btn-cta.btn-yellow {
    background-color: var(--brand-yellow);
    color: #000;
    border: 2px solid var(--brand-yellow);
}

.btn-cta.btn-outline {
    background-color: #000;
    color: var(--brand-yellow);
    border: 2px solid var(--brand-yellow);
}

.game-meta-cta .btn-cta {
    opacity: 1;
    transform: translateY(0);
    /* Keep hover transitions but reset the entry delay from style.css */
    transition: all 0.3s ease;
}

/* INFO BUTTON AND MODAL */
.btn-info {
    background: #fff;
    border: 2px solid #fff;
    color: #000;
    font-family: var(--font-condensed);
    font-weight: 800;
    font-size: 1.1rem;
    padding: 0 25px;
    height: 45px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-info:hover {
    background: var(--brand-yellow);
    border-color: var(--brand-yellow);
    color: #000;
}

.game-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.game-info-modal.active {
    opacity: 1;
    pointer-events: auto;
}

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

.modal-content {
    position: relative;
    background: #f4f4f0;
    width: 90%;
    max-width: 420px;
    border-radius: 20px;
    color: #000;
    transform: translateY(30px);
    transition: transform 0.4s ease;
}

.modal-inner {
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 30px;
    border-radius: 20px;
}

.game-info-modal.active .modal-content {
    transform: translateY(0);
}

/* Specific sizing for Booking Modal */
.booking-modal-content {
    max-width: 1000px;
    width: 95%;
}

.booking-modal-content .modal-inner {
    padding: 0;
    height: 85vh;
    border-radius: 20px;
    overflow: hidden;
}

#bookingIframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 20px;
}

.modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 45px;
    height: 45px;
    background: var(--brand-yellow);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
    color: #000;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-family: var(--font-condensed);
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
}

.modal-header h3 {
    font-family: var(--font-condensed);
    font-size: 1.4rem;
    margin: 0;
}

.modal-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.modal-icons img {
    height: 60px;
    width: 60px;
    object-fit: contain; /* Changed from cover to contain so icons aren't cropped */
    object-position: center;
}

.modal-rules {
    text-align: justify;
    text-align-last: center;
    font-size: 0.85em;
    line-height: 1.4;
    margin-bottom: 25px;
}

.modal-rules h4 {
    font-family: var(--font-condensed);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.modal-rules p {
    margin: 0;
}

.modal-pricing {
    border-top: 1px solid #111;
    border-bottom: 1px solid #111;
    padding: 15px 0;
    margin-bottom: 25px;
}

.modal-pricing h4 {
    text-align: center;
    font-family: var(--font-condensed);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.modal-pricing table {
    width: 100%;
    border-collapse: collapse;
}

.modal-pricing td {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
}

.modal-pricing tr:last-child td {
    border-bottom: none;
}

.price-pax {
    font-weight: 900;
    font-size: 1.2rem;
    width: 20px;
}

.price-icon {
    width: 40px;
}

.price-icon img {
    height: 20px;
}

.price-item {
    font-size: 1.1rem;
}

.price-item span {
    font-size: 0.85em;
    font-weight: normal;
}

.price-total {
    text-align: right;
}

.price-badge {
    background: var(--brand-yellow);
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    color: #000;
    display: inline-block;
}

.modal-action {
    text-align: center;
    margin-bottom: 25px;
}

.modal-action .btn-cta {
    width: 100%;
    box-shadow: 0 0 20px rgba(255, 255, 90, 0.4);
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.modal-help {
    text-align: center;
}

.modal-help h4 {
    margin: 0;
    font-family: var(--font-condensed);
    font-size: 1.1rem;
}

.modal-help p {
    margin: 5px 0 10px;
    font-size: 0.9em;
}

.whatsapp-btn {
    display: inline-block;
    transition: transform 0.3s;
}

.whatsapp-btn:hover {
    transform: scale(1.1);
}

.whatsapp-btn img {
    width: 50px;
    height: 50px;
}

/* GALLERY */
.game-gallery {
    position: relative;
    z-index: 20; /* Ensure it stays in a higher layer than the hero section */
    padding: 0 20px 80px; /* Removed 80px of top padding */
    max-width: 1400px;
    margin: -20px auto 0; /* -20px margin-top moves it up another 20px = 100px total */
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.gallery-item {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 10px;
    border: 2px solid #222;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Mobile: only the CTA booking buttons and gallery stack vertically */
@media (max-width: 768px) {
    .cta-row {
        flex-direction: column;
        width: 100%;
        gap: 12px;
        align-items: center;
    }

    .cta-row .btn-cta {
        width: 100%;
        max-width: 400px; /* Consistent with the card width on mobile */
        text-align: center;
        justify-content: center;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px; /* Added slight gap for stacked look */
    }
}

/* Mobile Optimizations: specific asset swap and alignment for PIDE */
@media (max-width: 630px) {
    .pide-page .dossier-paper {
        background-image: url('../assets/images/jogos/pide/pide-docs-mobile.avif');
        margin-top: -5px; /* Sobe a imagem 5px */
    }
    .pide-page .dossier-header,
    .pide-page .dossier-body {
        transform: translateY(5px); /* Baixa apenas o texto 5px */
    }
}
