/* The lobby is a playable horror scene, not a landing page. */
#start-screen {
    justify-content: flex-end;
    overflow: hidden;
    padding: 0;
    background: #050506;
    isolation: isolate;
}

#start-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    display: block;
    --lobby-frame: max(100vw, calc(100dvh - var(--app-head) - var(--app-nav)));
    width: 100%;
    height: 100%;
    background-color: #050506;
    background-image: url("../../assets/ghosts/umm_alsaaf_sheet.webp");
    background-repeat: no-repeat;
    background-size: calc(var(--lobby-frame) * 6) var(--lobby-frame);
    background-position: calc((100% - var(--lobby-frame)) / 2) center;
    filter: grayscale(0.28) saturate(0.72) contrast(1.32) brightness(0.58);
    transform-origin: 50% 42%;
    animation: lobby-ghost-sway 8s ease-in-out infinite alternate;
}

#start-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    display: block;
    background:
        linear-gradient(180deg, rgba(5, 5, 6, 0.04) 0%, rgba(5, 5, 6, 0.01) 37%, rgba(5, 5, 6, 0.48) 61%, #08080a 94%),
        radial-gradient(circle at 50% 26%, transparent 0 19%, rgba(0, 0, 0, 0.58) 82%);
}

.start-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 12px 16px 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    gap: 5px;
}

.start-atmosphere { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.fog {
    position: absolute;
    inset-inline-start: -35%;
    width: 170%;
    height: 18%;
    display: block;
    opacity: 0.2;
    filter: blur(18px);
    background: radial-gradient(ellipse at center, rgba(225, 227, 232, 0.28), transparent 68%);
    animation: lobby-fog-drift 15s linear infinite alternate;
}
.fog-a { top: 28%; }
.fog-b { top: 49%; opacity: 0.12; animation-duration: 21s; animation-direction: alternate-reverse; }

.hero-eye-glint {
    position: absolute;
    top: 27.3%;
    width: 3px;
    height: 2px;
    border-radius: 50%;
    background: rgba(204, 54, 54, 0.9);
    box-shadow: 0 0 8px 2px rgba(204, 54, 54, 0.5);
    opacity: 0;
    animation: lobby-eyes 7.5s steps(1, end) infinite;
}
.eye-one { left: calc(50% - 12px); }
.eye-two { left: calc(50% + 9px); animation-delay: 70ms; }

.start-topline {
    position: absolute;
    inset: 11px 14px auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.start-top-controls {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

#lobby-music-btn {
    min-width: 44px; min-height: 44px; width: auto; margin: 0;
    padding: 4px 8px; border: 1px solid var(--ap-mint); border-radius: 0;
    background: var(--ap-ink); color: var(--ap-mint); box-shadow: none;
    font-size: .75rem; line-height: 1.4; white-space: normal;
}

#encounter-context-open {
    min-width: 44px; min-height: 44px; max-width: 65%; padding: 4px 8px;
    margin: 0; border: 0; background: var(--ap-ink); color: var(--ap-mint);
    font-size: .875rem; line-height: 1.4; box-shadow: none; text-align: start;
    white-space: normal; overflow-wrap: anywhere; border-radius: 0;
}

.start-install-btn {
    width: auto !important;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 4px 7px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(23, 23, 25, 0.68);
    color: var(--ap-paper);
    box-shadow: none;
    font-size: 0.4375rem;
}
.start-install-btn svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.start-install-status {
    position: absolute;
    inset: 42px 14px auto auto;
    z-index: 3;
    max-width: min(270px, calc(100vw - 28px)) !important;
    margin: 0 !important;
    padding: 7px 9px;
    background: rgba(23, 23, 25, 0.9);
    color: var(--yuma-info) !important;
    font-size: 0.5rem !important;
    line-height: 1.45;
    text-align: start;
    backdrop-filter: blur(8px);
}

.brand-eyebrow {
    margin: 0 !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 0.5rem !important;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.roster-status {
    width: auto;
    max-width: 58%;
    min-height: 24px;
    margin: 0;
    padding: 5px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(23, 23, 25, 0.68);
    color: #b9b9bf;
    font-size: 0.4375rem;
    line-height: 1.3;
    text-align: center;
    backdrop-filter: blur(8px);
}
.connection-dot { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: var(--ap-muted); }
.roster-status[data-state="offline"] .connection-dot { background: var(--ap-gold); }
.roster-status[data-state="online"] .connection-dot { background: var(--ap-mint); }
.roster-status #roster-retry-btn { min-height: 24px; margin: 0; padding: 2px 6px; border: 0; background: transparent; color: var(--ap-paper); font-size: inherit; }

.brand-lockup {
    margin: 0;
    padding: 0;
    min-height: 0;
    display: grid;
    justify-items: start;
    gap: 1px;
    overflow: visible;
    background: none;
    text-align: start;
    text-shadow: 0 3px 26px #000;
}
.brand-lockup::before,
.brand-lockup::after,
.hunter-card::before { display: none; }

.start-game-logo {
    display: none;
}

.brand-tagline {
    margin: 0 !important;
    padding-inline-start: 9px;
    max-width: 22rem !important;
    border-inline-start: 2px solid var(--yuma-action);
    color: rgba(255, 255, 255, 0.86) !important;
    font-size: 0.6875rem !important;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.hunter-card {
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 9px 16px 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 6px 12px;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(5, 5, 6, 0.54);
    backdrop-filter: blur(10px);
    text-align: start;
}

.hunter-card p { max-width: none !important; }
.hunter-identity { min-width: 0; }
.hunter-name { margin: 0 !important; color: #a8a8ae !important; font-size: 0.5rem !important; }
.hunter-name strong { display: block; margin-top: 1px; color: var(--ap-paper) !important; font-size: 0.875rem; }
.guest-save-nudge {
    width: auto !important;
    min-height: 44px;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    border: 0;
    border-bottom: 1px solid rgba(63, 227, 207, 0.42);
    border-radius: 0;
    background: transparent;
    color: var(--yuma-info) !important;
    box-shadow: none;
    font-size: 0.5rem !important;
    font-weight: 600;
    text-align: start;
}

.hunter-progress { min-width: 126px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 9px; }
#start-pb-line.personal-best { margin: 0 !important; display: grid; justify-items: end; color: #a8a8ae !important; font-size: 0.4375rem !important; text-transform: uppercase; letter-spacing: 0.08em; }
.personal-best strong { color: var(--ap-paper); font-family: "Readex Pro", sans-serif; font-size: clamp(2.375rem, 12vw, 3.125rem); font-weight: 700; line-height: 0.82; letter-spacing: -0.07em; }
#start-title-line.hunter-title { margin: 0 0 2px !important; padding: 3px 6px; border: 1px solid rgba(255, 255, 255, 0.3); color: var(--ap-paper) !important; background: rgba(255,255,255,0.06); font-size: 0.4375rem !important; white-space: nowrap; }

.next-goal { grid-column: 1 / -1; min-width: 0; }
.next-goal-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.next-goal-copy > span { flex: 0 0 auto; color: #85858c; font-size: 0.4375rem; letter-spacing: 0.08em; text-transform: uppercase; }
#start-hunt-goal { margin: 0 !important; overflow: hidden; color: #d0d0d4 !important; font-size: 0.5rem !important; line-height: 1.45; text-align: end; text-overflow: ellipsis; white-space: nowrap; }
.goal-progress { height: 3px; margin-top: 6px; overflow: hidden; background: rgba(255, 255, 255, 0.14); }
.goal-progress i { width: 8%; height: 100%; display: block; background: var(--yuma-info); transition: width 320ms ease; }

.start-actions {
    width: 100%;
    min-height: 94px;
    padding: 4px 0 1px;
    display: grid;
    place-items: center;
}
.start-primary {
    width: 88px !important;
    min-width: 88px;
    height: 88px;
    min-height: 88px !important;
    margin: 0;
    padding: 10px 6px 8px !important;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 4px;
    border: 2px solid rgba(255, 255, 255, 0.86) !important;
    border-radius: 50%;
    background: var(--yuma-action) !important;
    color: var(--ap-paper) !important;
    box-shadow: 0 0 0 6px rgba(204, 54, 54, 0.18), 0 14px 32px rgba(0, 0, 0, 0.46) !important;
    font-family: "Readex Pro", sans-serif;
    font-size: 0.5rem !important;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    animation: lobby-cta-pulse 3.2s ease-in-out infinite;
}
.start-primary svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2; }
.start-primary:active { transform: scale(0.985); }

.start-account-actions,
.start-hidden-actions { display: none !important; }

.orientation-status {
    width: 100%;
    margin: 0;
    padding: 7px 9px;
    border: 0;
    border-inline-start: 3px solid var(--ap-gold);
    background: rgba(23, 23, 25, 0.88);
    color: var(--ap-paper);
    font-size: 0.5625rem;
}

@keyframes lobby-ghost-sway {
    from { background-position: calc((100% - var(--lobby-frame)) / 2 - 3px) center; }
    to { background-position: calc((100% - var(--lobby-frame)) / 2 + 3px) center; }
}
@keyframes lobby-fog-drift {
    from { transform: translate3d(-8%, 0, 0) scale(1); }
    to { transform: translate3d(9%, -5%, 0) scale(1.08); }
}
@keyframes lobby-eyes {
    0%, 7%, 9%, 74%, 77%, 100% { opacity: 0; }
    8%, 75%, 76% { opacity: 0.78; }
}
@keyframes lobby-cta-pulse {
    0%, 100% { box-shadow: 0 0 0 6px rgba(204, 54, 54, 0.16), 0 14px 32px rgba(0, 0, 0, 0.46); }
    50% { box-shadow: 0 0 0 11px rgba(204, 54, 54, 0), 0 18px 38px rgba(0, 0, 0, 0.56); }
}

body.round-active #ui-layer::before {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    box-shadow: inset 0 0 30px 6px rgba(23, 23, 25, 0.24);
    pointer-events: none;
}

#viewfinder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    transform: none;
}

.corner { display: none; }

#aim-reticle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(43vw, 168px);
    height: min(43vw, 168px);
    transform: translate(-50%, -50%);
    visibility: hidden;
    border: 1px solid rgba(63, 227, 207, 0.82);
    border-radius: 50%;
    filter: drop-shadow(0 0 5px rgba(63, 227, 207, 0.22));
    transition: border-color 120ms ease, transform 120ms ease;
}

body.round-active #aim-reticle { visibility: visible; }

#aim-reticle::before,
#aim-reticle::after {
    content: "";
    position: absolute;
    background: var(--ap-mint);
}

#aim-reticle::before { left: -10px; right: -10px; top: 50%; height: 1px; opacity: 0.72; }
#aim-reticle::after { top: -10px; bottom: -10px; left: 50%; width: 1px; opacity: 0.72; }
#aim-reticle.fatal { border-color: var(--yuma-action); }
#aim-reticle.fatal::before,
#aim-reticle.fatal::after { background: var(--yuma-action); }
#aim-reticle.shot-hit { transform: translate(-50%, -50%) scale(1.04); }
#aim-reticle.shot-miss { border-color: rgba(255, 255, 255, 0.34); }

#shot-confirmation { position: absolute; inset: 0; pointer-events: none; color: var(--ap-mint); z-index: 4; }
#shot-confirmation[hidden] { display: none; }
#shot-confirmation [data-impact-mark] {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    font: 600 2rem/1 sans-serif; text-shadow: 0 1px 3px #171719;
}
.impact-caption {
    position: absolute; left: 50%; top: calc(50% + min(21.5vw, 84px) + 8px);
    transform: translateX(-50%); width: max-content; max-width: min(210px, 78vw);
    padding: 5px 9px; background: rgba(23, 23, 25, .94); border-inline-start: 2px solid currentColor;
    text-align: center; font-size: .75rem; line-height: 1.35;
}
.impact-caption strong { display: block; font-weight: 600; }
[data-impact-health] { display: block; color: var(--ap-paper); font-size: .6875rem; }
[data-impact-meter] { display: block; margin-top: 4px; height: 3px; background: rgba(255,255,255,.22); }
[data-impact-meter][hidden] { display: none; }
[data-impact-meter] i { display: block; height: 100%; width: calc(var(--remaining) * 100%); background: currentColor; }
#shot-confirmation[data-kind="miss"] { color: var(--ap-paper); }
#shot-confirmation[data-kind="armored"] { color: var(--ap-gold); }
#shot-confirmation[data-kind="kill"] [data-impact-mark] { font-size: 2.3rem; }
body:not(.round-active) #shot-confirmation,
body.ritual-active #shot-confirmation { display: none; }
@media (max-height: 650px) and (orientation: portrait) {
    /* Short phones need the receipt above the reticle, away from the shutter
       and radar. Anchor its bottom so larger/localized text grows upward. */
    .impact-caption { top: calc(50% - min(21.5vw, 84px) - 8px); transform: translate(-50%, -100%); }
}
@media (max-height: 480px) and (orientation: landscape) {
    .impact-caption { top: auto; bottom: 6px; left: calc(50% + 133px); max-width: 145px; font-size: .6875rem; }
}

#capture-circle {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: 8px;
    width: 92px;
    height: 92px;
    margin: 0;
    transform: translateX(-50%);
    border: 5px solid var(--ap-mint);
    border-radius: 50%;
    background: var(--ap-paper);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.18), 0 12px 32px rgba(0,0,0,0.54);
    pointer-events: auto;
    animation: hunt-shutter-breathe 3.6s ease-in-out infinite;
}

#capture-circle::before {
    content: "";
    position: absolute;
    inset: 22px;
    width: auto;
    height: auto;
    transform: none;
    border: 0;
    border-radius: 50%;
    background: #171719;
}

#capture-circle::after { display: none; }
#capture-circle.charging,
#capture-circle.fatal { transform: translateX(-50%) scale(0.96); animation: none; }
#capture-circle.shot-hit { border-color: var(--ap-mint) !important; transform: translateX(-50%) scale(1.04); }
#capture-circle.shot-miss { border-color: rgba(255, 255, 255, 0.4) !important; }

#viewfinder::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 126px;
    z-index: -1;
    display: block;
    background: linear-gradient(180deg, transparent, rgba(7,7,9,0.94) 72%);
    border-top: 0;
}

#hud {
    position: absolute;
    top: 8px;
    inset-inline: 8px;
    width: auto;
    max-width: none;
    padding: 8px 8px 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    background: rgba(10,10,12,0.78);
    box-shadow: none;
    text-align: center;
    backdrop-filter: blur(10px);
}

#health-meter { grid-column: auto; width: auto; min-width: 0; padding: 0 7px; border-inline-end: 1px solid rgba(255,255,255,0.14); background: transparent; }
#health-label { display: grid; gap: 2px; justify-items: center; color: #8f8f97; font-size: 0.375rem; }
#health-label strong { color: var(--ap-paper); font-size: 0.5625rem; }
#health-bar-container { height: 2px; margin-top: 4px; border: 0; background: rgba(255, 255, 255, 0.2); }
#health-bar { background: var(--ap-mint); }
#health-bar[data-state="warning"] { background: var(--ap-gold); }
#health-bar[data-state="danger"] { background: var(--yuma-action); }
#score,
#tamashi,
#round-time,
#ammo-display { min-width: 0; padding: 0 7px; display: grid; place-content: center; gap: 2px; border-inline-end: 1px solid rgba(255,255,255,0.14); background: transparent; color: var(--ap-paper); font-family: ui-monospace, monospace; text-shadow: none; white-space: nowrap; }
#score span,
#tamashi span,
#round-time span { overflow: hidden; color: #85858d; font-family: "Readex Pro", sans-serif; font-size: 0.375rem; font-weight: 500; line-height: 1; text-overflow: ellipsis; }
#score strong,
#tamashi strong,
#round-time strong { color: var(--ap-paper); font-size: 0.625rem; line-height: 1.2; }
#tamashi strong { color: var(--yuma-info); }
#ammo-display { display: none; }

#level-display {
    position: absolute;
    top: 57px;
    left: 10px;
    right: auto;
    margin: 0;
    padding: 6px 8px;
    border: 0;
    border-inline-start: 2px solid var(--yuma-action);
    border-radius: 0;
    background: rgba(16, 16, 19, 0.72);
    color: var(--ap-paper) !important;
    font-size: 0.5rem;
    backdrop-filter: blur(8px);
    text-shadow: none;
}

#film-selector {
    position: absolute;
    left: 12px;
    right: auto;
    bottom: 17px;
    width: 132px;
    height: 58px;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    transform: none;
    border: 0;
    background: transparent;
    pointer-events: auto;
}

.film-slot {
    width: auto;
    min-width: 0;
    height: 54px;
    min-height: 44px;
    margin: 0;
    padding: 4px 2px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    background: rgba(16,16,19,0.82);
    color: #7e7e84;
    box-shadow: none;
    font-size: 0.5rem;
}

.film-slot small { display: block; color: inherit; font-size: 0.5625rem; }
.film-slot.active { border-color: var(--ap-paper); background: var(--yuma-action); color: var(--ap-paper); transform: translateY(-3px); }

#radar-btn {
    position: absolute;
    right: 12px;
    bottom: 86px;
    z-index: 10;
    width: 68px;
    min-width: 44px;
    min-height: 48px;
    margin: 0;
    padding: 5px;
    display: grid;
    justify-items: center;
    gap: 2px;
    border: 1px solid var(--ap-mint);
    border-radius: 3px;
    background: var(--ap-ink, #171719);
    color: var(--ap-paper);
    box-shadow: none;
    font-size: 0.625rem;
    line-height: 1.2;
    pointer-events: auto;
}
#radar-value { font-size: 0.875rem; font-variant-numeric: tabular-nums; }
#radar-btn:disabled { opacity: 1; cursor: default; }
#radar-btn[data-state="active"] { border-color: var(--ap-paper); color: var(--ap-mint); }
#radar-btn[data-state="spent"] { border-color: rgba(255,255,255,0.3); color: var(--ap-paper); }

/* Photometric only: never transform/blur the target or move the camera pixels.
   Loss is continuous; named HP bands add stable edge fractures. */
body {
    --injury-loss: 0;
    --camera-grade-strength: 1;
    --hunt-camera-saturation: 1;
    --hunt-camera-brightness: 1;
    --hunt-camera-contrast: 1;
}
body.calm-visuals { --camera-grade-strength: 0.25; }
/* A cool, camera-grade horror atmosphere for live hunting only. It stays below
   the AR scene (z=10) and HUD (z=20), leaving the target and aiming UI clear. */
#hunt-camera-atmosphere {
    --hunt-atmosphere-strength: 1;
    position: absolute;
    inset: 0;
    z-index: 6;
    display: none;
    overflow: hidden;
    pointer-events: none;
    contain: paint;
    opacity: var(--hunt-atmosphere-strength);
    background:
        radial-gradient(ellipse 76% 48% at 50% 18%, rgba(104, 135, 148, 0.1), transparent 72%),
        linear-gradient(180deg, rgba(52, 76, 87, 0.08), transparent 34%, rgba(6, 15, 22, 0.16));
}
#hunt-camera-atmosphere::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 48%, transparent 35%, rgba(8, 17, 24, 0.1) 66%, rgba(1, 5, 9, 0.38) 100%),
        linear-gradient(90deg, rgba(2, 9, 14, 0.16), transparent 16%, transparent 84%, rgba(2, 9, 14, 0.16));
}
#hunt-camera-atmosphere::after {
    content: "";
    position: absolute;
    inset: -12% -18%;
    opacity: 0.56;
    background:
        radial-gradient(ellipse 54% 20% at 16% 62%, rgba(176, 201, 208, 0.18), transparent 76%),
        radial-gradient(ellipse 48% 17% at 86% 40%, rgba(121, 158, 171, 0.16), transparent 78%);
    transform: translate3d(1%, 0, 0);
    animation: hunt-mist-veil 46s ease-in-out infinite alternate;
}
#hunt-camera-atmosphere > i {
    position: absolute;
    inset: -18% -35%;
    display: block;
    opacity: 0.62;
    background:
        radial-gradient(ellipse 43% 18% at 2% 48%, rgba(181, 205, 211, 0.35), rgba(113, 143, 153, 0.16) 42%, transparent 74%),
        radial-gradient(ellipse 46% 20% at 98% 69%, rgba(169, 196, 205, 0.31), rgba(99, 128, 140, 0.14) 47%, transparent 76%),
        linear-gradient(180deg, transparent 37%, rgba(146, 175, 184, 0.09) 53%, rgba(77, 105, 117, 0.07) 65%, transparent 78%);
    transform: translate3d(-3%, -1%, 0);
    animation: hunt-mist-drift 34s ease-in-out infinite alternate;
}
#hunt-camera-atmosphere > i::before,
#hunt-camera-atmosphere > i::after {
    content: "";
    position: absolute;
    display: block;
    pointer-events: none;
}
#hunt-camera-atmosphere > i::before {
    inset: 20% 34% 16% -2%;
    opacity: 0.62;
    background:
        radial-gradient(ellipse 62% 22% at 2% 66%, rgba(190, 211, 216, 0.34), transparent 73%),
        radial-gradient(ellipse 58% 18% at 36% 38%, rgba(132, 161, 172, 0.18), transparent 76%);
    transform: translate3d(-4%, 2%, 0);
    animation: hunt-mist-bank-left 43s ease-in-out infinite alternate;
}
#hunt-camera-atmosphere > i::after {
    inset: 12% -1% 21% 35%;
    opacity: 0.54;
    background:
        radial-gradient(ellipse 64% 23% at 100% 41%, rgba(183, 207, 215, 0.33), transparent 74%),
        radial-gradient(ellipse 54% 18% at 68% 74%, rgba(112, 143, 157, 0.19), transparent 76%);
    transform: translate3d(4%, -2%, 0);
    animation: hunt-mist-bank-right 51s ease-in-out infinite alternate;
}
@keyframes hunt-mist-drift {
    from { transform: translate3d(-3%, -1%, 0); }
    to { transform: translate3d(4%, 2%, 0); }
}
@keyframes hunt-mist-veil {
    from { transform: translate3d(1%, 0, 0); }
    to { transform: translate3d(-3%, 2%, 0); }
}
@keyframes hunt-mist-bank-left {
    from { transform: translate3d(-4%, 2%, 0); }
    to { transform: translate3d(7%, -3%, 0); }
}
@keyframes hunt-mist-bank-right {
    from { transform: translate3d(4%, -2%, 0); }
    to { transform: translate3d(-6%, 3%, 0); }
}
body[data-hunt-state="playing"]:not(.shell-panel-open) #hunt-camera-atmosphere {
    top: calc(var(--app-head) + env(safe-area-inset-top));
    bottom: calc(var(--app-nav) + env(safe-area-inset-bottom));
    height: calc(100% - var(--app-head) - var(--app-nav) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    display: block;
}
body[data-hunt-state="playing"]:not(.shell-panel-open) {
    --hunt-camera-saturation: 0.72;
    --hunt-camera-brightness: 0.95;
    --hunt-camera-contrast: 1.06;
}
/* Reduce flash removes nothing here: the fog never flashes. Reduce motion and
   the system preference freeze its slow drift while preserving the atmosphere. */
body.reduce-motion #hunt-camera-atmosphere { --hunt-atmosphere-strength: 0.78; }
body.calm-visuals #hunt-camera-atmosphere { --hunt-atmosphere-strength: 0.45; }
body.calm-visuals[data-hunt-state="playing"]:not(.shell-panel-open) {
    --hunt-camera-saturation: 0.88;
    --hunt-camera-brightness: 0.98;
    --hunt-camera-contrast: 1.02;
}
body.reduce-motion #hunt-camera-atmosphere::before,
body.reduce-motion #hunt-camera-atmosphere::after,
body.reduce-motion #hunt-camera-atmosphere > i,
body.reduce-motion #hunt-camera-atmosphere > i::before,
body.reduce-motion #hunt-camera-atmosphere > i::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
    #hunt-camera-atmosphere { --hunt-atmosphere-strength: 0.78; }
    body.calm-visuals #hunt-camera-atmosphere { --hunt-atmosphere-strength: 0.45; }
    #hunt-camera-atmosphere::before,
    #hunt-camera-atmosphere::after,
    #hunt-camera-atmosphere > i,
    #hunt-camera-atmosphere > i::before,
    #hunt-camera-atmosphere > i::after { animation: none; }
}
@media (min-width: 720px) and (min-height: 600px) {
    #hunt-camera-atmosphere {
        left: 50%;
        right: auto;
        width: min(100vw, 480px);
        transform: translateX(-50%);
    }
}
/* Short clue occlusion is below the AR scene (z=10) and HUD (z=20).
   It never shifts camera pixels or darkens the shootable sprite. */
#encounter-shadow { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 5; overflow: hidden; pointer-events: none; contain: paint; }
#encounter-shadow[hidden], body:not(.round-active) #encounter-shadow, body.shell-panel-open #encounter-shadow { display: none; }
#encounter-shadow i {
    position: absolute; left: var(--shadow-x, 50%); top: var(--shadow-y, 53%);
    width: var(--shadow-width, 36%); height: var(--shadow-height, 76%);
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at 44% 40%, rgba(23,23,25,.88) 0%, rgba(23,23,25,.56) 26%, rgba(23,23,25,.18) 51%, transparent 70%);
}
#encounter-shadow i::after {
    content: ''; position: absolute; left: -28%; bottom: 4%; width: 162%; height: 22%;
    background: radial-gradient(ellipse, rgba(23,23,25,.42), transparent 68%);
}
body.round-active #webcam-feed {
    filter: saturate(calc((1 - (0.08 + var(--injury-loss) * 0.52) * var(--camera-grade-strength)) * var(--hunt-camera-saturation)))
        brightness(calc((1 - var(--injury-loss) * 0.08 * var(--camera-grade-strength)) * var(--hunt-camera-brightness)))
        contrast(var(--hunt-camera-contrast));
    transition: filter 600ms ease;
}
#injury-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
    opacity: calc(var(--injury-loss) * var(--camera-grade-strength));
    box-shadow: inset 0 0 32px 5px rgba(23,23,25,0.65);
    border-inline: 2px solid var(--ap-magenta);
    transition: opacity 600ms ease;
}
#injury-overlay i {
    position: absolute;
    top: 18%; bottom: 23%; left: 0;
    width: 10px;
    background: var(--ap-magenta);
    clip-path: polygon(0 0, 20% 17%, 100% 29%, 25% 40%, 80% 60%, 20% 71%, 40% 92%, 0 100%);
    opacity: 0;
    transition: opacity 600ms ease;
}
#injury-overlay i + i { left: auto; right: 0; transform: rotate(180deg); }
#injury-overlay[data-state="injured"] i { opacity: 0.35; }
#injury-overlay[data-state="critical"] i { opacity: 0.7; }
body.reduce-motion #injury-overlay i { display: none; }
body.reduce-motion #webcam-feed,
body.reduce-motion #injury-overlay { transition: none; }
body.reduce-motion #capture-circle,
body.reduce-motion #aim-reticle,
body.reduce-motion.shake-hard { animation: none !important; }
body.reduce-motion #glitch-overlay { display: none !important; }

#shop-btn { display: none !important; }

#round-exit-btn {
    position: absolute;
    top: auto;
    left: auto;
    right: 14px;
    bottom: 19px;
    width: 56px;
    min-width: 56px;
    min-height: 56px;
    margin: 0;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(16,16,19,0.84);
    color: var(--ap-paper);
    box-shadow: none;
    font-size: 0.5625rem;
    pointer-events: auto;
}

#fatal-frame-alert { display: none !important; }

#encounter-trace {
    position: absolute;
    top: 88px;
    left: 50%;
    z-index: 8;
    width: 56px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    transform: translateX(-50%);
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ap-paper);
    font-size: 0.5rem;
}

#encounter-trace[data-direction="behind"] {
    top: auto;
    bottom: calc(104px + env(safe-area-inset-bottom));
}
#encounter-trace[data-direction="left"],
#encounter-trace[data-direction="right"] {
    top: 50%;
    width: 30px;
    height: 60px;
    transform: translateY(-50%);
}
#encounter-trace[data-direction="left"] { left: calc(12px + env(safe-area-inset-left)); }
#encounter-trace[data-direction="right"] { left: auto; right: calc(12px + env(safe-area-inset-right)); }
#encounter-trace-arrow { color: var(--ap-mint); font-size: 0.75rem; line-height: 1; }
#encounter-trace-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.encounter-trace-meter { position: relative; width: 30px; height: 2px; display: block; overflow: hidden; background: rgba(255,255,255,0.18); }
.encounter-trace-meter i { position: absolute; inset: 0 auto 0 0; width: 34%; height: 100%; display: block; background: var(--ap-mint); }
#encounter-trace[data-direction="left"] .encounter-trace-meter,
#encounter-trace[data-direction="right"] .encounter-trace-meter { width: 2px; height: 36px; }
#encounter-trace[data-direction="left"] .encounter-trace-meter i,
#encounter-trace[data-direction="right"] .encounter-trace-meter i { inset: auto 0 0; width: 100%; height: 34%; }
#encounter-trace[data-phase="attack"] #encounter-trace-arrow,
#encounter-trace[data-phase="attack"] .encounter-trace-meter i { color: var(--yuma-action); background: var(--yuma-action); }

.combat-feedback {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: 96px;
    width: auto;
    max-width: 74vw;
    min-width: 0;
    margin: 0;
    padding: 5px 8px;
    transform: translateX(-50%);
    border: 0;
    border-bottom: 1px solid currentColor;
    border-radius: 0;
    background: rgba(16, 16, 19, 0.52);
    color: var(--ap-paper);
    font-size: 0.625rem;
    line-height: 1.4;
    text-align: center;
    text-shadow: none;
}
.combat-feedback.kill,
.combat-feedback.hit { color: var(--ap-mint); }
.combat-feedback.fatal { color: var(--yuma-action); }
.combat-feedback.empty { color: var(--ap-gold); }

#danger-indicator { z-index: 8; }
#danger-arrow { color: var(--yuma-action); filter: none; }
#danger-indicator[data-mode="radar"] #danger-arrow { color: var(--ap-mint); }
#danger-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

#tutorial-hint.show {
    max-width: 72vw;
    padding: 7px 10px;
    border: 0;
    border-bottom: 3px solid var(--ap-gold);
    border-radius: 0;
    background: rgba(23, 23, 25, 0.84);
    color: var(--ap-paper);
    font-size: 0.625rem;
}

@keyframes hunt-shutter-breathe {
    0%, 100% { box-shadow: 0 0 0 4px rgba(255,255,255,0.17), 0 12px 32px rgba(0,0,0,0.52); }
    50% { box-shadow: 0 0 0 9px rgba(204,54,54,0), 0 16px 38px rgba(0,0,0,0.6); }
}

@media (prefers-reduced-motion: reduce) {
    #capture-circle { animation: none; }
}

@media (max-width: 350px) {
    .start-shell { padding-inline: 12px; gap: 7px; }
    .start-topline { inset-inline: 12px; }
    .start-game-logo { width: 126px; height: 70px; }
    .brand-tagline { font-size: 0.625rem !important; }
    .hunter-card { width: calc(100% + 24px); margin-inline: -12px; padding-block: 7px; padding-inline: 12px; }
    .guest-save-nudge { max-width: 18ch !important; }
    .personal-best strong { font-size: 2.125rem; }
    .start-actions { min-height: 80px; }
    .start-primary { width: 76px !important; min-width: 76px; height: 76px; min-height: 76px !important; }
    .start-primary svg { width: 29px; height: 29px; }
    #film-selector { width: 112px; }
    .film-slot { font-size: 0.4375rem; }
    #capture-circle { width: 80px; height: 80px; }
    #capture-circle::before { inset: 19px; }
    #hud { inset-inline: 6px; }
}

@media (orientation: landscape) and (max-height: 520px) {
    #start-screen::before {
        inset: 0 auto 0 0;
        width: 54%;
        min-width: 0;
        height: 100%;
        aspect-ratio: auto;
        background-size: auto 106%;
        background-position: left center;
        animation: none;
    }

    #start-screen::after {
        background: linear-gradient(90deg, rgba(5, 6, 7, 0.04) 0 35%, rgba(5, 6, 7, 0.72) 53%, #08080a 73% 100%);
    }

    .start-shell {
        width: min(54vw, 460px);
        margin-left: auto;
        padding: 6px 14px 7px;
        gap: 5px;
    }

    .start-topline { position: static; margin-bottom: auto; }
    .start-topline .roster-status { max-width: 62%; }
    .brand-eyebrow { font-size: 0.4375rem !important; }
    #aim-reticle { width: 124px; height: 124px; }
    #capture-circle { width: 62px; height: 62px; bottom: 4px; }
    #capture-circle::before { inset: 15px; }
    #viewfinder::after { height: 72px; }
    #film-selector { bottom: 7px; }
    #round-exit-btn {
        inset: auto max(8px, env(safe-area-inset-right)) 9px auto;
        width: 44px;
        height: 44px;
        min-height: 44px;
    }
    #radar-btn { right: max(8px, env(safe-area-inset-right)); bottom: 65px; }
    .start-game-logo { width: 104px; height: 58px; }
    .brand-tagline { margin-top: 3px !important; font-size: 0.5625rem !important; }
    .hunter-card { padding: 5px 0; gap: 4px 8px; }
    .hunter-card { width: calc(100% + 28px); margin-inline: -14px; padding-inline: 14px; }
    .hunter-name,
    #start-hunt-goal { font-size: 0.4375rem !important; }
    .hunter-name strong { font-size: 0.625rem; }
    .guest-save-nudge { display: none; }
    .personal-best strong { font-size: 1.375rem; }
    .next-goal-copy > span { display: none; }
    .start-actions { min-height: 66px; }
    .start-primary { width: 64px !important; min-width: 64px; height: 64px; min-height: 64px !important; font-size: 0.4375rem !important; }
    .start-primary svg { width: 24px; height: 24px; }
    .roster-status,
    .orientation-status { padding: 4px 7px; font-size: 0.4375rem; }
    .hero-eye-glint { display: none; }
}

/* R22: world-anchored controls, not another full-screen card. */
#boss-ritual { position: fixed; inset: 0; z-index: 1800; pointer-events: auto; color: var(--ap-paper); }
.ritual-copy { position: absolute; top: calc(var(--app-head) + env(safe-area-inset-top) + 64px); left: 50%; transform: translateX(-50%); width: min(340px, calc(100% - 24px)); text-align: center; pointer-events: none; }
.ritual-copy strong { color: var(--ap-mint); font-size: .875rem; }
.ritual-copy p { padding: 5px 8px; margin: 4px 0; background: #171719; font-size: .8125rem; line-height: 1.5; }
.ritual-board { position: absolute; inset: 0; touch-action: none; }
.ritual-board svg { width: 100%; height: 100%; position: absolute; inset: 0; pointer-events: none; }
.ritual-board polyline { stroke: #3FE3CF; stroke-width: 2; stroke-dasharray: 4 5; }
.ritual-point { position: absolute; transform: translate(-50%, -50%); width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; border: 2px solid #3FE3CF; border-radius: 50%; background: #171719; color: #FFFFFF; font: 600 1rem 'Readex Pro', sans-serif; touch-action: none; }
.ritual-point:disabled { opacity: 1; color: #FFFFFF; border-color: #FFFFFF; cursor: default; }
.ritual-point:not(:disabled), .ritual-point.done { background: #3FE3CF; color: #171719; }
.ritual-point.done { opacity: .65; }
.ritual-point:focus-visible { outline: 3px solid #FFE713; outline-offset: 4px; }
.ritual-board.unready { visibility: hidden; }
.ritual-actions { position: absolute; bottom: calc(var(--app-nav) + env(safe-area-inset-bottom) + 16px); left: 50%; transform: translateX(-50%); width: min(360px, calc(100% - 24px)); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ritual-actions button { min-height: 44px; padding: 8px 12px; margin: 0; border: 1px solid #FFFFFF; background: #171719; color: #FFFFFF; font-size: .8125rem; line-height: 1.4; }
body.ritual-active :is(#capture-circle, #aim-reticle, #film-selector, #radar-btn, #tutorial-hint, #fatal-frame-alert, #encounter-trace, #shop-btn, #round-exit-btn) { visibility: hidden; }
@media (orientation: landscape) and (max-height: 500px) {
    .ritual-copy { top: calc(var(--app-head) + 76px); left: auto; inset-inline-start: 16px; transform: none; width: 190px; }
    .ritual-copy strong { font-size: .75rem; }
    .ritual-actions { bottom: calc(var(--app-nav) + 24px); left: auto; inset-inline-end: 16px; transform: none; width: 170px; }
}
