:root {
    --bg: #f7efe6;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--bg);
    -webkit-tap-highlight-color: transparent;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
}

.page {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.page.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.page-img {
    width: 100%;
    height: 100%;
    object-position: center;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.page-img.cover {
    object-fit: cover;
}

.page-img.contain {
    object-fit: contain;
}

.hotspot {
    position: absolute;
    z-index: 3;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Material-style tap ripple, spawned by JS on any hotspot/back-btn/fs-btn */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    pointer-events: none;
    transform: scale(0);
    opacity: 0.5;
}

/* CTA outline with a light segment running around the button's edge.
   rx/ry are set from JS to half the button height, so the stroke hugs
   the pill shape of the button drawn in the artwork. */
.cta-trace {
    position: absolute;
    inset: -3px;
    pointer-events: none;
}

/* The CTA box hugs the drawn button exactly; this keeps the tap target
   comfortably larger than the visible pill. */
.cta::before {
    content: '';
    position: absolute;
    inset: -10px -6px;
}

.ripple-clip {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    overflow: hidden;
    pointer-events: none;
}

.cta-trace svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.cta-trace rect {
    fill: none;
    stroke-linecap: round;
}

.cta-trace .trace-base {
    stroke: var(--trace-dim);
    stroke-width: 1.5;
}

.cta-trace .trace-run {
    stroke: var(--trace-lit);
    stroke-width: 2.5;
    stroke-dasharray: 20 80;
    filter: drop-shadow(0 0 5px var(--trace-glow));
    animation: trace-run 2.4s linear infinite;
}

.cta-trace.cta-wa {
    --trace-dim: rgba(30, 200, 95, 0.3);
    --trace-lit: #25d366;
    --trace-glow: rgba(37, 211, 102, 0.9);
}

.cta-trace.cta-ig {
    --trace-dim: rgba(224, 158, 47, 0.3);
    --trace-lit: #e8a13a;
    --trace-glow: rgba(232, 161, 58, 0.9);
}

@keyframes trace-run {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -100; }
}

@media (prefers-reduced-motion: reduce) {
    .cta-trace .trace-run {
        animation: none;
        stroke-dasharray: none;
    }
}

.back-btn {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #a7535c;
    box-shadow: 0 4px 14px rgba(90, 40, 30, 0.32);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.back-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fs-btn {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    z-index: 20;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    margin: 0;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 14px rgba(90, 40, 30, 0.18);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.fs-btn svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #7a4a45;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fs-btn.hidden {
    display: none;
}

.tap-hint {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    font-family: "Segoe UI", sans-serif;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 600;
    color: #7a4a45;
    background: rgba(255, 255, 255, 0.72);
    padding: 8px 18px;
    border-radius: 30px;
    box-shadow: 0 6px 16px rgba(90, 40, 30, 0.18);
    z-index: 10;
    opacity: 0;
    animation: hint-pulse 1.8s ease-in-out infinite;
    pointer-events: none;
}

.tap-hint.hidden {
    opacity: 0 !important;
    animation: none;
}

@keyframes hint-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .tap-hint {
        animation: none;
        opacity: 0.85;
    }
}
