/*
 * /xr (Blast Buddy XR). Tailwind covers layout; this file holds what is
 * particular to the page: the range in the hero (drawn by xr.js), the
 * in-headset panel look and the range-command section marks.
 *
 * The palette is the one the headset UI paints with (web app,
 * src/components/xr/vrCanvasKit.ts): warm near-black glass, bone text, ember.
 * Numbers are set in Geist Mono, the face of the clock on the gun.
 */
@font-face {
    font-family: 'Geist Mono';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('images/geist-mono.woff') format('woff');
}

.xr {
    --xr-ink: #0A0A0A;
    --xr-bone: #F7F3EF;
    --xr-muted: #A39A92;
    --xr-faint: #6E6661;
    --xr-ember: #F03A00;
    --xr-ember-hot: #FF8A4C;
    --xr-line: rgba(247, 243, 239, 0.1);
    --xr-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--xr-ink);
    color: var(--xr-bone);
    font-family: 'Inter', sans-serif;
}

.xr :focus-visible {
    outline: 2px solid var(--xr-ember-hot);
    outline-offset: 3px;
    border-radius: 6px;
}

.xr-num {
    font-family: var(--xr-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'zero' 0;
}

/* ---------- Buttons ---------- */

.xr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 3.25rem;
    padding: 0 1.5rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.xr-btn-go {
    background: var(--xr-ember);
    color: #fff;
    box-shadow: 0 0 0 1px rgba(255, 138, 76, 0.35) inset, 0 10px 40px -12px rgba(240, 58, 0, 0.8);
}
.xr-btn-go:hover { background: #FF4D12; }
.xr-btn-quiet {
    border: 1px solid rgba(247, 243, 239, 0.22);
    color: var(--xr-bone);
    background: rgba(10, 10, 10, 0.4);
}
.xr-btn-quiet:hover { border-color: rgba(247, 243, 239, 0.5); }

/* One button, two wordings: sending the page to a headset, or already in it. */
[data-headset="yes"] .xr-out-of-headset,
[data-headset="no"] .xr-in-headset { display: none; }

/* ---------- Hero: the range ---------- */

.xr-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #080707;
    isolation: isolate;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.xr-hero.is-aiming { cursor: none; }
.xr-hero.is-aiming a,
.xr-hero.is-aiming button { cursor: pointer; }

.xr-hero-copy {
    position: relative;
    z-index: 1;
    pointer-events: none;
    padding-top: 6.5rem;
}
.xr-hero-copy a,
.xr-hero-copy button { pointer-events: auto; }

/* The bay: a block under the copy on small screens. */
.xr-stage {
    position: relative;
    height: 33rem;
    margin-top: 1.5rem;
}
.xr-stage canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
/* Fades the bay into the page above it, and darkens the edges like a lens. */
.xr-stage::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, #080707 0%, rgba(8, 7, 7, 0) 22%),
        radial-gradient(120% 90% at 50% 55%, rgba(8, 7, 7, 0) 55%, rgba(8, 7, 7, 0.7) 100%);
}

@media (min-width: 1024px) {
    .xr-hero {
        justify-content: center;
        min-height: clamp(41rem, 100svh, 60rem);
    }
    .xr-hero-copy {
        padding-top: 6rem;
        padding-bottom: 3rem;
    }
    /* On a desktop the bay is the whole hero and the copy stands in it. */
    .xr-stage {
        position: absolute;
        inset: 0;
        height: auto;
        margin: 0;
    }
    .xr-stage::after {
        background:
            linear-gradient(90deg, rgba(8, 7, 7, 0.95) 0%, rgba(8, 7, 7, 0.82) 28%, rgba(8, 7, 7, 0) 50%),
            radial-gradient(90% 100% at 67% 50%, rgba(8, 7, 7, 0) 55%, rgba(8, 7, 7, 0.75) 100%);
    }
}

.xr-wordmark {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.2;
    color: var(--xr-ember-hot);
}
.xr-wordmark::before {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--xr-ember);
    box-shadow: 0 0 12px 2px rgba(240, 58, 0, 0.7);
}

.xr-h1 {
    font-size: clamp(2.625rem, 11.5vw, 4rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.035em;
    color: #fff;
}
.xr-h1 span { display: block; }
@media (min-width: 1024px) {
    .xr-h1 { font-size: clamp(3.25rem, 4.7vw, 4.875rem); }
    .xr-h1 span { white-space: nowrap; }
}

/* The readout over the bay: the clock, the hits, the last call. */
.xr-hud {
    position: absolute;
    z-index: 2;
    top: 1.25rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem 0.75rem 0.75rem 1.125rem;
    border-radius: 1.125rem;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
@media (min-width: 1024px) {
    .xr-hud {
        top: 6.75rem;
        left: 67%;
        right: auto;
        gap: 1.75rem;
        transform: translateX(-50%);
    }
}
.xr-hud-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--xr-muted);
}
.xr-hud-clock {
    display: block;
    min-width: 7.1ch;
    margin-top: 0.125rem;
    font-size: 1.625rem;
    font-weight: 600;
    line-height: 1.1;
    color: #fff;
}
.xr-hero[data-phase="run"] .xr-hud-clock { color: var(--xr-ember-hot); }
.xr-hud dl {
    display: flex;
    gap: 1.125rem;
    margin: 0;
}
@media (min-width: 1024px) {
    .xr-hud dl { gap: 1.5rem; }
}
.xr-hud dd {
    margin: 0.125rem 0 0;
    min-width: 2.6ch;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--xr-bone);
}
.xr-hud dd[data-call="MISS"] { color: #F0524A; }
.xr-hud-tools {
    display: flex;
    gap: 0.375rem;
    margin-left: auto;
}
.xr-hud-tools button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    font-size: 0.9375rem;
    color: var(--xr-muted);
    transition: color 0.18s ease, background-color 0.18s ease;
}
.xr-hud-tools button:hover { color: #fff; background: rgba(247, 243, 239, 0.08); }
.xr-hud-tools button[aria-pressed="true"] { color: var(--xr-ember-hot); }
.xr-hero[data-phase="idle"] [data-xr-restart] { visibility: hidden; }
@media (max-width: 419px) {
    .xr-hud { gap: 0.875rem; }
    [data-xr-restart] { display: none !important; }
}

/* The beep: one ember flash around the readout. */
.xr-hero.is-beep .xr-hud { animation: xr-beep 0.45s ease-out; }
@keyframes xr-beep {
    0% { box-shadow: 0 0 0 2px var(--xr-ember-hot), 0 0 60px 0 rgba(240, 58, 0, 0.9); }
    100% { box-shadow: 0 0 0 2px rgba(255, 138, 76, 0), 0 0 60px 0 rgba(240, 58, 0, 0); }
}

/* What to do next, said under the targets. */
.xr-cue {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 1.75rem;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 2rem);
    margin: 0;
    padding: 0.625rem 1.125rem;
    border: 1px solid var(--xr-line);
    border-radius: 999px;
    background: rgba(10, 9, 9, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    color: var(--xr-bone);
    pointer-events: none;
}
.xr-cue:empty { display: none; }
@media (min-width: 1024px) {
    .xr-cue { left: 67%; bottom: 7.5rem; }
}
.xr-hero[data-phase="idle"] .xr-cue::before {
    content: '';
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.625rem;
    border-radius: 50%;
    background: var(--xr-ember);
    vertical-align: 0.05em;
    animation: xr-pulse 1.6s ease-in-out infinite;
}
@keyframes xr-pulse {
    50% { opacity: 0.25; }
}

/* ---------- The headset panel look (results, and the panels further down) ---------- */

.xr-panel {
    border: 1px solid var(--xr-line);
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(32, 28, 27, 0.96), rgba(16, 14, 15, 0.96));
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}

.xr-result {
    position: absolute;
    z-index: 3;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    padding: 1.5rem;
    -webkit-user-select: text;
    user-select: text;
    animation: xr-rise 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.xr-result[hidden] { display: none; }
/* On a phone the card has to fit inside the bay: tighter, and without the aside. */
@media (max-width: 1023px) {
    .xr-result { padding: 1.25rem; }
    .xr-result .xr-result-aside { display: none; }
    .xr-result .xr-btn { min-height: 2.75rem; padding: 0 1.125rem; font-size: 0.9375rem; }
    .xr-result .xr-score > div { padding: 0.5rem 0.75rem; }
    .xr-result .xr-score dd { font-size: 1.25rem; }
}
@media (min-width: 1024px) {
    .xr-result {
        left: 67%;
        right: auto;
        bottom: auto;
        top: 54%;
        width: 26rem;
        padding: 2rem;
        transform: translate(-50%, -50%);
        animation-name: xr-rise-centered;
    }
}
@keyframes xr-rise {
    from { opacity: 0; transform: translateY(14px); }
}
@keyframes xr-rise-centered {
    from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)); }
}
.xr-result-time {
    font-size: clamp(3.25rem, 15vw, 4.5rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    background: linear-gradient(100deg, #FF8A4C, #E66B33 50%, #993826);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.xr-chip {
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: linear-gradient(100deg, #FF8A4C, #E66B33 50%, #993826);
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}
.xr-chip[hidden] { display: none; }

/* The run played by the page: a wide frame on a desktop, a tall one on a phone. */
.xr-reel { aspect-ratio: 4 / 5; }
@media (min-width: 640px) {
    .xr-reel { aspect-ratio: 16 / 9; }
}
.xr-reel canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.xr-reel-hud {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: flex-end;
    gap: 1.25rem;
    padding: 0.625rem 1rem;
    border: 1px solid var(--xr-line);
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(32, 28, 27, 0.9), rgba(16, 14, 15, 0.9));
    font-size: 1rem;
    font-weight: 600;
    color: var(--xr-bone);
}
.xr-reel-hud > div { min-width: 2.2ch; }
.xr-reel-hud { transition: opacity 0.3s ease; }
.xr-reel.is-results .xr-reel-hud { opacity: 0; }
.xr-reel-clock { display: block; min-width: 7.1ch; font-size: 1.375rem; line-height: 1.2; color: #fff; }
.xr-reel.is-running .xr-reel-clock { color: var(--xr-ember-hot); }
.xr-reel-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 3.5rem 4.5rem 1.125rem 1.25rem;
    background: linear-gradient(180deg, rgba(8, 7, 7, 0), rgba(8, 7, 7, 0.88));
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: #fff;
    pointer-events: none;
}
@media (min-width: 1024px) {
    .xr-reel-hud { top: 1.5rem; left: 1.5rem; }
    .xr-reel-caption { padding: 5rem 6rem 1.5rem 1.75rem; font-size: 1.5rem; }
}
.xr-film.xr-reel button {
    width: 2.75rem;
    padding: 0;
    justify-content: center;
}
.xr-reel-result {
    position: absolute;
    top: 46%;
    left: 50%;
    width: min(19rem, calc(100% - 2rem));
    padding: 1.25rem;
    opacity: 0;
    transform: translate(-50%, calc(-50% + 14px));
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
    pointer-events: none;
}
.xr-reel-result .xr-result-time { font-size: 3rem; }
.xr-reel-result .xr-score > div { padding: 0.5rem 0.75rem; }
.xr-reel-result .xr-score dd { font-size: 1.25rem; }
.xr-reel.is-results .xr-reel-result { opacity: 1; transform: translate(-50%, -50%); }
@media (min-width: 1024px) {
    .xr-reel-result { left: auto; right: 2.5rem; width: 21rem; padding: 1.5rem; transform: translate(0, calc(-50% + 14px)); }
    .xr-reel.is-results .xr-reel-result { transform: translate(0, -50%); }
    .xr-reel-result .xr-result-time { font-size: 3.75rem; }
}

/* Stat tiles and zone counts, as on the headset's results. */
.xr-score {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0;
}
.xr-score > div,
.xr-zones > div {
    padding: 0.75rem 0.875rem;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.045);
}
.xr-score dt { font-size: 0.8125rem; font-weight: 500; color: var(--xr-muted); }
.xr-score dd { margin: 0.25rem 0 0; font-size: 1.5rem; font-weight: 600; line-height: 1.1; color: var(--xr-bone); }
.xr-score small { font-size: 0.9375rem; font-weight: 500; color: var(--xr-faint); }
.xr-zones {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0;
}
.xr-zones > div { display: flex; align-items: center; justify-content: space-between; }
.xr-zones dt {
    min-width: 1.875rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    font-size: 0.8125rem;
    font-weight: 700;
    text-align: center;
    color: var(--xr-bone);
}
.xr-zones dt.is-a { background: linear-gradient(100deg, #FF8A4C, #E66B33 50%, #993826); color: #fff; }
.xr-zones dd { margin: 0; font-size: 1.25rem; font-weight: 600; color: var(--xr-bone); }

/* ---------- Sections ---------- */

/* A range officer's command opens each part of the page, in the order it is
   given on the line. It is speech, so it is set as speech. */
.xr-command {
    display: block;
    margin-bottom: 1rem;
    font-family: var(--xr-mono);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--xr-ember-hot);
}
.xr-h2 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    line-height: 1.03;
    letter-spacing: -0.03em;
    color: #fff;
}
.xr-lede {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--xr-muted);
    max-width: 38rem;
}
.xr-lede strong,
.xr-body strong { color: var(--xr-bone); font-weight: 600; }
.xr-body { color: var(--xr-muted); line-height: 1.65; }

.xr-rule { border-top: 1px solid var(--xr-line); }

/* Steps: a real sequence, numbered in the clock's face. */
.xr-steps { counter-reset: xr-step; }
.xr-steps > li { counter-increment: xr-step; }
.xr-steps > li::before {
    content: counter(xr-step);
    display: block;
    margin-bottom: 1rem;
    font-family: var(--xr-mono);
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1;
    color: var(--xr-ember);
}

/* The stage plan: the hero's bay seen from above. */
.xr-plan {
    flex: none;
    width: min(16rem, 52vw);
    height: auto;
    overflow: visible;
}
.xr-plan-grid line { stroke: rgba(247, 243, 239, 0.07); stroke-width: 0.3; }
.xr-plan-bay { fill: none; stroke: rgba(247, 243, 239, 0.22); stroke-width: 0.5; }
.xr-plan-fault { stroke: var(--xr-ember); stroke-width: 0.6; opacity: 0.55; }
.xr-plan-box { fill: rgba(240, 58, 0, 0.12); stroke: var(--xr-ember); stroke-width: 0.8; }
.xr-plan-paper rect { fill: #D2AC74; }
.xr-plan-steel circle { fill: #F4F1EC; }
.xr-plan-text text {
    font-family: var(--xr-mono);
    font-size: 5.5px;
    font-weight: 500;
    fill: var(--xr-muted);
}

/* The address, as typed into the headset's browser. */
.xr-url {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--xr-line);
    border-radius: 0.75rem;
    background: rgba(247, 243, 239, 0.045);
    font-family: var(--xr-mono);
    font-size: 0.9375rem;
    font-weight: 500;
    color: #fff;
}

/* Fact rows: a term and what it means on the range. */
.xr-facts > div {
    display: grid;
    gap: 0.25rem 2rem;
    padding-block: 1.25rem;
    border-top: 1px solid var(--xr-line);
}
.xr-facts > div:last-child { border-bottom: 1px solid var(--xr-line); }
@media (min-width: 768px) {
    .xr-facts > div { grid-template-columns: 13rem 1fr; }
}
.xr-facts dt { font-weight: 700; color: #fff; }
.xr-facts dd { margin: 0; color: var(--xr-muted); line-height: 1.6; }

/* The controller key: what each button does, as the headset's hint card lists it. */
.xr-keys {
    display: grid;
    gap: 0.5rem;
    margin: 0;
}
.xr-keys > div {
    display: grid;
    grid-template-columns: 6.25rem 1fr;
    align-items: baseline;
    gap: 0.75rem;
}
.xr-keys dt {
    font-family: var(--xr-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--xr-bone);
}
.xr-keys dd { margin: 0; font-size: 0.9375rem; color: var(--xr-muted); }

/* The calls, set the size they are shouted. */
.xr-calls {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}
.xr-calls span { font-size: clamp(3rem, 11vw, 7rem); }
.xr-calls .is-a { color: #F7F3EF; }
.xr-calls .is-c { color: #FFB27A; }
.xr-calls .is-d { color: #FF8A4C; }
.xr-calls .is-steel { color: #F7F3EF; }
.xr-calls .is-miss { color: #F0524A; }

/* Film and stills from the headset. */
.xr-film {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--xr-line);
    border-radius: 1.5rem;
    background: #000;
}
.xr-film video,
.xr-film img {
    display: block;
    width: 100%;
    height: auto;
}
.xr-film button {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid rgba(247, 243, 239, 0.25);
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.7);
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.xr-splits {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 4.5rem;
}
.xr-splits i {
    flex: 1;
    min-width: 0;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #FF8A4C, #993826);
}

.xr-faq summary { list-style: none; cursor: pointer; }
.xr-faq summary::-webkit-details-marker { display: none; }
.xr-faq details { border-top: 1px solid var(--xr-line); }
.xr-faq details:last-child { border-bottom: 1px solid var(--xr-line); }
.xr-faq details[open] .xr-faq-mark { transform: rotate(45deg); }
.xr-faq-mark { transition: transform 0.2s ease; }

.mobile-menu { display: none; }
.mobile-menu.active { display: block; }

.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(20, 20, 20, 0.95); backdrop-filter: blur(10px); padding: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); display: none; z-index: 9999; }
.cookie-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.cookie-content p { margin: 0; color: #E0E0E0; font-size: 14px; }
.cookie-content a { color: #F03A00; text-decoration: underline; }
.cookie-content button { padding: 10px 24px; background: #F03A00; color: white; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-family: 'Inter', sans-serif; white-space: nowrap; }
.cookie-content button:hover { background: #e63e00; }

@media (prefers-reduced-motion: reduce) {
    .xr-cue::before,
    .xr-result,
    .xr-hero.is-beep .xr-hud { animation: none !important; }
    .xr-reel-result { transition: none; }
}

.xr-launch-film { scroll-margin-top: 5rem; }
.xr-launch-film iframe, .xr-film-cover {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 1rem;
    background: #111;
}
.xr-film-cover { position: relative; overflow: hidden; }
.xr-film-cover img { width: 100%; height: 100%; object-fit: cover; }
.xr-film-play {
    position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
    width: 4rem; height: 4rem; border-radius: 50%; background: #131313e6;
    display: grid; place-items: center; border: 2px solid white;
}
.xr-film-play::after {
    content: ''; margin-left: .2rem;
    border-block: .55rem solid transparent; border-left: .85rem solid white;
}
.xr-film-cover:is(:hover, :focus-visible) .xr-film-play { background: #bd3600; }
.xr-film-cover:focus-visible { outline: 3px solid #ff9f78; outline-offset: 4px; }
