/* --- CORE STYLES (DESKTOP DEFAULT) --- */
:root {
    --nufc-black: #1a1a1a;
    --nufc-white: #ffffff;
    --nufc-gold: #C8A053;
    --love-red: #D20000;
}

body {
    margin: 0; overflow: hidden; font-family: 'Montserrat', sans-serif;
    background: #000; color: white; user-select: none; -webkit-user-select: none;
    overscroll-behavior: none;
}

/* --- BACKGROUNDS & OVERLAYS --- */
#bg-image {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #111; z-index: -5; background-size: cover; background-position: center;
}

.tv-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%; pointer-events: none; z-index: 99999; opacity: 0.6;
}

#video-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: black; z-index: 5000; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
}
#video-overlay.active { opacity: 1; pointer-events: all; }

/* --- TYPOGRAPHY --- */
h1 {
    font-family: 'Bebas Neue', Impact, sans-serif; font-size: 5rem; margin: 0;
    text-transform: uppercase; letter-spacing: 5px; text-shadow: 4px 4px 0px #000; line-height: 0.9;
}

h2 {
    color: var(--nufc-gold); text-transform: uppercase; letter-spacing: 3px;
    background: rgba(0,0,0,0.8); padding: 5px 15px; margin-bottom: 20px; display: inline-block;
}

/* --- BUTTONS --- */
.btn {
    background: var(--nufc-white); color: var(--nufc-black);
    padding: 15px 40px; font-size: 1.5rem; font-weight: 800; border: none; cursor: pointer;
    margin-top: 30px; text-transform: uppercase; font-family: 'Bebas Neue', Impact, sans-serif;
    transition: 0.3s; box-shadow: 0 0 20px rgba(255,255,255,0.3); z-index: 200; position: relative;
    text-decoration: none; display: inline-block;
}
.btn:hover { background: var(--nufc-gold); transform: scale(1.1); }

.back-btn {
    position: absolute; top: 20px; left: 20px; z-index: 500;
    background: rgba(0,0,0,0.8); color: var(--nufc-gold); border: 1px solid var(--nufc-gold);
    padding: 10px 20px; font-family: 'Bebas Neue'; cursor: pointer; text-decoration: none;
    font-size: 1.2rem; transition: 0.3s;
}
.back-btn:hover { background: var(--nufc-gold); color: black; }

/* --- SCREEN CONTAINERS --- */
.screen {
    height: 100vh; width: 100vw; display: flex; flex-direction: column;
    justify-content: center; align-items: center; position: absolute;
    top: 0; left: 0; transition: opacity 0.5s ease-in-out; text-align: center; z-index: 10;
}
.hidden { opacity: 0; pointer-events: none; z-index: -1; display: none; }

/* --- RESPONSIVE MAP CONTAINER --- */
.map-scaler-container {
    display: flex; justify-content: center; align-items: center;
    width: 100vw; height: 100vh; background: #000; overflow: hidden; position: relative;
}

.map-scaler {
    position: relative;
    aspect-ratio: 16 / 9; width: 100%; max-height: 100vh; 
    background-image: url('world_map.jpg');
    background-size: cover; background-position: center;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

.map-hotspot { position: absolute; transform: translate(-50%, -50%); cursor: pointer; z-index: 20; }
.map-marker { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; background: var(--nufc-gold); border: 2px solid #000; border-radius: 50%; box-shadow: 0 0 15px var(--nufc-gold); pointer-events: none; }
.map-marker::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; border-radius: 50%; border: 2px solid var(--nufc-gold); animation: pulse 2s infinite; opacity: 0; }
@keyframes pulse { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(2.5); opacity: 0; } }
.map-tooltip { position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.9); border: 1px solid var(--nufc-gold); color: var(--nufc-gold); padding: 8px 15px; font-family: 'Bebas Neue'; text-align: center; white-space: nowrap; opacity: 0; transition: 0.3s; pointer-events: none; }
.map-hotspot:hover .map-tooltip { opacity: 1; }

/* --- OTHER PAGES STYLES --- */
.envelope-wrapper { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 300px; height: 200px; z-index: 50; cursor: pointer; transition: opacity 0.5s; }
.envelope { width: 100%; height: 100%; background: #fdfbf7; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; border: 2px solid #ccc; }
.envelope::before { content: ""; position: absolute; top: 0; left: 0; border-left: 150px solid transparent; border-right: 150px solid transparent; border-top: 100px solid #e0dcd5; }
.stamp { position: absolute; top: 20px; right: 20px; border: 2px solid var(--love-red); color: var(--love-red); font-family: 'Bebas Neue'; padding: 5px 10px; transform: rotate(-15deg); font-size: 1.5rem; }
.envelope-text { font-family: 'Courier New', monospace; color: black; font-weight: bold; font-size: 1.2rem; margin-top: 50px; }

/* CONTRACT STYLES (Desktop Default) */
.contract-box { background-color: #fdfbf7; width: 500px; max-width: 90vw; min-height: 650px; padding: 50px; font-family: 'Playfair Display', serif; color: #222; position: relative; transform: rotate(-1deg); text-align: left; display: flex; flex-direction: column; border: 1px solid #dcdcdc; overflow: hidden; transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1); margin: 5vh auto; }
.contract-box.shifted { transform: translateX(-25vw) rotate(-2deg) scale(0.9); }
.contract-box::after { content: ""; position: absolute; top: 15px; left: 15px; right: 15px; bottom: 15px; border: 2px solid var(--nufc-gold); pointer-events: none; z-index: 0; }
.watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 15rem; color: rgba(0,0,0,0.03); z-index: 0; pointer-events: none; }

.contract-header { text-align: center; border-bottom: 2px solid #000; padding-bottom: 20px; margin-bottom: 30px; position: relative; z-index: 2; }
.contract-header h1 { font-family: 'Playfair Display', serif; font-weight: 900; font-size: 2.2rem; text-shadow: none; color: #000; margin: 0; letter-spacing: 0px; text-transform: uppercase; }

.contract-body { font-size: 1.15rem; line-height: 1.8; flex-grow: 1; position: relative; z-index: 2; }
.highlight { background: linear-gradient(120deg, #f0f0c0 0%, #f0f0c0 100%); background-repeat: no-repeat; background-size: 100% 40%; background-position: 0 80%; }

.signature-area { margin-top: 40px; position: relative; z-index: 2; }
.sign-box { width: 100%; height: 80px; border-bottom: 2px solid #000; position: relative; cursor: pointer; margin-bottom: 10px; }
.signature-svg { position: absolute; bottom: 0; left: 20px; width: 300px; height: 120px; z-index: 10; pointer-events: none; overflow: visible; }
.signature-path { fill: none; stroke: #000080; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; opacity: 0; }
.signature-svg.active .path-letters { animation: signName 2.0s ease-in-out forwards; opacity: 1; }
.signature-svg.active .path-cross { animation: signName 0.5s ease-in-out forwards; opacity: 1; animation-delay: 1.8s; }
@keyframes signName { to { stroke-dashoffset: 0; } }

.sign-prompt {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-family: 'Bebas Neue'; color: var(--nufc-gold); font-size: 1.5rem; letter-spacing: 2px;
    animation: pulseSign 1.5s infinite; pointer-events: none; white-space: nowrap;
}
@keyframes pulseSign {
    0% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.95); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
    100% { opacity: 0.3; transform: translate(-50%, -50%) scale(0.95); }
}

/* SUCCESS MESSAGE */
#success-msg { position: fixed; top: 50%; right: 15%; transform: translateY(-50%); text-align: left; z-index: 20; opacity: 0; pointer-events: none; transition: opacity 1s ease 0.5s; }
#success-msg.visible { opacity: 1; pointer-events: auto; }

.success-photo {
    background: white; padding: 10px 10px 30px 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transform: rotate(-3deg); margin-bottom: 20px;
    display: inline-block; opacity: 0;
    transition: opacity 1s ease 1s;
}
.success-photo img { width: 250px; height: 250px; object-fit: cover; border: 1px solid #eee; }
.success-photo.visible { opacity: 1; }

/* MUSEUM & STADIUM SPECIFICS */
.photo-container { position: absolute; width: 100%; height: 100%; top: 0; left: 0; pointer-events: none; }
.polaroid { background: white; padding: 10px 10px 40px 10px; width: 200px; height: 240px; position: absolute; box-shadow: 0 5px 15px rgba(0,0,0,0.5); top: 50%; left: 50%; transform: translate(-50%, -50%) scale(1); cursor: grab; transition: transform 0.2s; }
.polaroid:active { cursor: grabbing; z-index: 500; }
.polaroid img { width: 100%; height: 100%; object-fit: cover; border: 1px solid #333; pointer-events: none; filter: blur(20px); transition: filter 0.5s ease; }
.polaroid.revealed img { filter: blur(0); }

.game-container { width: 80%; max-width: 600px; text-align: center; z-index: 20; margin-top: 50px;}
.goal-area { width: 100%; height: 250px; border: 5px solid white; border-bottom: none; position: relative; background: linear-gradient(to bottom, rgba(0,100,0,0.5), rgba(0,100,0,0.8)); margin: 20px auto; overflow: hidden; }
.keeper { font-size: 3rem; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); transition: left 0.5s ease-out; }
.ball { font-size: 2rem; position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); transition: all 0.5s ease; }
.kick-buttons { display: flex; gap: 10px; justify-content: center; }
.scoreboard { display: flex; justify-content: space-between; font-family: monospace; font-weight: bold; font-size: 1.2rem; }

/* ============================================================ */
/* NEW MOBILE FIXES ONLY (For Phone Screens)                    */
/* ============================================================ */

@media (max-width: 768px) {
    /* 1. COMPACT CONTRACT: Extra padding for text */
    .contract-box {
        width: 85% !important;
        max-width: 90vw !important;
        min-height: auto !important; 
        padding: 40px 30px !important; /* FIXED: Increased inner padding */
        box-sizing: border-box !important; /* Prevents overflow */
        margin: 0 auto !important;
    }
    
    /* 2. SMALLER TEXT */
    .contract-header h1 { font-size: 1.4rem !important; margin-bottom: 5px !important; }
    .contract-header span { font-size: 0.6rem !important; }
    .contract-body { font-size: 0.85rem !important; line-height: 1.4 !important; }
    .sign-box { height: 50px !important; margin-top: 10px !important; }
    .sign-prompt { font-size: 1.1rem !important; }

    /* 3. SIGNATURE FIT */
    .signature-svg { width: 100% !important; max-width: 200px; height: 60px !important; }

    /* 4. ENVELOPE FIT */
    .envelope-wrapper { transform: translate(-50%, -50%) scale(0.65) !important; }
    
    /* 5. SUCCESS SCREEN FIXES */
    /* Hide the contract completely when signed on mobile */
    .contract-box.shifted {
        transform: translateY(-20px) scale(0.8) !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* CENTER THE PHOTO & TEXT */
    #success-msg {
        right: auto !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90% !important;
        text-align: center !important;
        display: flex !important;           /* FIXED: Force Flexbox */
        flex-direction: column !important;  /* FIXED: Stack vertically */
        align-items: center !important;     /* FIXED: Center Horizontally */
        justify-content: center !important; /* FIXED: Center Vertically */
    }
    
    .success-photo { 
        margin: 0 0 20px 0 !important; /* FIXED: Ensure only bottom margin */
        padding: 5px 5px 20px 5px !important; 
        display: block !important;
    }

    .success-photo img { 
        width: 150px !important; 
        height: 150px !important; 
        display: block;
    }

    #success-msg h1 { font-size: 2.5rem !important; margin: 0 !important; }
    #success-msg p { font-size: 1rem !important; }
}