/* --- RESET & GLOBAL --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%;
    background-color: #222;
    overflow: hidden;
    display: flex; justify-content: center; align-items: center;
    touch-action: none; 
    user-select: none; -webkit-user-select: none;
}

/* --- GAME CONTAINER --- */
#game-container {
    position: relative;
    /*height: 100vh; */
    height: 100%; 
	width: auto;
    aspect-ratio: 9/16;
    max-width: 100%;
    background-color: white;
    overflow: hidden;
    /*box-shadow: 0 0 40px rgba(0,0,0,0.5);*/
}

@media (max-aspect-ratio: 9/16) {
    #game-container {
        width: 100%; height: 100%;
        max-width: none; max-height: none;
        aspect-ratio: unset;
        box-shadow: none;
    }
}

/* --- HOTSPOTS --- */
.hotspot {
    position: absolute;
    border-radius: 50%;
    /* Invisible until found */
    opacity: 0; 
    background: rgba(173, 216, 230, 0.5); 
    border: 2px dashed rgba(70, 130, 180, 0.6); 
    cursor: pointer;
    z-index: 10;
    transform: translate(-50%, -50%);
    pointer-events: auto; 
}

/* --- TOP PANELS --- */
#top-panels-container {
    position: absolute;
    /* FIX: Use safe-area-inset for notch/status bar protection */
    top: 10px;
    top: max(10px, env(safe-area-inset-top)); 
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 100;
    pointer-events: none; 
    padding: 0 10px; 
}

.panel-wrapper { pointer-events: auto; }

#found-counter, #level-indicator, #headline {
    background-color: rgba(240, 240, 240, 0.5);
    color: black; padding: 5px 12px;
    border-radius: 20px; font-family: sans-serif; font-size: 14px; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    height: 30px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
#headline { 
	visibility: visible; 
	animation: pulse-text 2s infinite ease-in-out;
}

/* --- MEDIA OVERLAY --- */
#media-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: white; display: none;
    justify-content: center; align-items: center; z-index: 20;
}

#overlay-video, #overlay-image {
    width: 100%; height: 100%; object-fit: cover;
    display: block; background: white;
}

/* THE VIDEO TITLE STYLE */
#video-title {
    /* Critical: Absolute position keeps it from breaking the Flexbox layout */
    position: absolute; 
    bottom: 10px; 
    left: 10px; 
    color: white; 
    font-size: 13px; 
    font-family: sans-serif; 
    font-weight: bold; 
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8); 
    z-index: 25; 
    pointer-events: none; /* Let clicks pass through */
}

/* --- RIPPLE --- */
.tap-ripple {
    position: absolute; width: 40px; height: 40px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: ripple-effect 0.5s ease-out forwards;
    z-index: 5;
    border: 2px solid rgba(255,255,255,0.5); 
}
@keyframes ripple-effect {
    0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}

/* --- MODALS --- */
#game-modal, #barrier-modal {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    z-index: 2000; padding: 20px; text-align: center;
}
#modal-title, #barrier-title { font-size: 24px; font-weight: bold; margin-bottom: 15px; color: #333; }
#modal-text { font-size: 16px; color: #666; margin-bottom: 30px; }
#start-btn, #barrier-submit {
    background-color: #4682B4; color: white; border: none;
    padding: 15px 40px; font-size: 18px; border-radius: 30px;
    cursor: pointer; margin-top: 10px;
}
#barrier-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; width: 100%; max-width: 400px; }
.barrier-option {
    padding: 15px; border: 2px solid #ddd; background: white;
    border-radius: 10px; cursor: pointer; user-select: none;
}
.barrier-option.selected { border-color: #4682B4; background-color: #e6f2ff; font-weight: bold; }
.barrier-option.wrong { border-color: #ff4d4d; background-color: #ffe6e6; }
.barrier-option.correct { border-color: #4CAF50; background-color: #e8f5e9; }
#barrier-feedback { height: 20px; color: #d9534f; font-weight: bold; margin-bottom: 10px; }

@keyframes pulse-text {
    0% { opacity: 0; transform: scale(1); }
    20% { opacity: 0.2; transform: scale(1); }
    100% { opacity: 1; transform: scale(1); color: red;}
}

/* Hide scrollbars */
body::-webkit-scrollbar { display: none; }
body { -ms-overflow-style: none; scrollbar-width: none; }