/* Interaction Overlay Styles */
#page-target-overlay, #drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Allow clicks to pass through to the book by default */
    z-index: 100;
}

#drawing-canvas {
    pointer-events: auto; /* Enable drawing on the canvas */
}

/* Interaction Points */
.interaction-point {
    position: absolute;
    transform: translate(-50%, -50%); /* Center the point on its coordinates */
    cursor: pointer;
    pointer-events: auto;
    z-index: 101;
}

/* Makes image pop-up hotspots visibly clickable. */
.image-modal-click-hint {
    position: absolute;
    left: 50%;
    bottom: 6%;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    max-width: 92%;
    padding: 0.42em 0.8em;
    transform: translateX(-50%);
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ef5350;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: clamp(10px, 1.35vw, 18px);
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    animation: image-modal-hint-pulse 1.35s ease-in-out infinite;
}

.image-modal-click-hand {
    font-size: 1.25em;
}

@keyframes image-modal-hint-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.08); }
}

/* Mobile Orientation Warning */
#orientation-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    color: white;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: Arial, sans-serif;
}

#orientation-warning .icon {
    font-size: 48px;
    margin-bottom: 20px;
    animation: rotate-phone 2s infinite ease-in-out;
}

#orientation-warning .message {
    font-size: 18px;
    padding: 0 20px;
}

@keyframes rotate-phone {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

/* Helper to show warning only on mobile portrait */
@media screen and (orientation: portrait) and (max-width: 768px) {
    body.is-mobile #orientation-warning {
        display: flex;
    }
}


#drawing-canvas, #page-target-overlay, .interaction-zone {
    touch-action: none !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}
