/* Hull Golf Club (Kirk Ella) — chrome only (UK12, from bay-hill). The
   course is the interface; this stays out of its way. Palette: a deep fairway
   green for the panels, with the red of Palmer's umbrella as the accent
   (src/course.js `palette`). Logo = the club's own artwork on a white card.
   The variable NAMES (--navy, --taupe, --silver, --paper) are kept from the
   Oubaai template so every shared rule keeps working; only the values change.
   Type: Cinzel headings, Montserrat body, self-hosted (assets/fonts/LICENSE.txt). */

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/cinzel-latin-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/montserrat-latin-var.woff2') format('woff2');
}

:root {
  /* Also declared inline in index.html's pre-stylesheet <style> (that copy
     is the one that actually matters for pre-paint — this one just keeps
     the real stylesheet in sync with it once it loads). See the meta
     name="color-scheme" tag in <head> for the fuller story: the browser's
     OWN pre-paint frame, before any CSS at all has parsed, is white by
     default and this is the only lever that reaches it. */
  color-scheme: dark;
  --navy:   #1A4A37;
  --navy-d: #123A2B;
  --taupe:  #B3C4B8;
  --silver: #D2DBD5;
  --paper:  #F4F2EA;

  /* Triplets, so a translucent panel is driven by the palette instead of a
     hardcoded literal. The chrome carries this navy as a raw
     rgba(18, 58, 43, ...) in a dozen places, which is why changing --navy
     alone did almost nothing: the variables were only ever used for opaque
     fills. --navy-rgb IS --navy-d, the colour every panel already uses. */
  --navy-rgb:   18, 58, 43;
  --silver-rgb: 210, 219, 213;
   /* Electric blue, estate-wide 2026-08-01 on Luke's instruction — he liked
      it on St Andrews and wanted every course to read the same: "more
      professional, and you can see it more". It is also the most legible
      accent of the set: white on this measures 6.0:1, against 4.2:1 on
      Augusta's old azalea and 2.2:1 on Cypress Point's dune gold, both of
      which failed the 4.5:1 floor. Each course's LOADING EMBLEM and place
      palette are untouched — this is the UI selection colour only. */
  --accent: #C8262E;
  --accent-rgb: 200, 38, 46;

  --pad: clamp(14px, 3.2vw, 26px);
  --serif: Cinzel, "Trajan Pro", "Iowan Old Style", Georgia, serif;
  --sans: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--navy-d);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;   /* the rig owns all gestures */
}

/* ------------------------------------------------------------------ loading */

/* Floating chrome waits for the arrival view (Luke, 2026-08-19: the GPS pill
   and the bot "have to load when that view comes into place, not before, not
   while the terrain is loading"). #loading precedes every appended control in
   the DOM, so the sibling combinator gates them all until boot adds `.gone` —
   the same instant the high opening view is revealed. No JS involved. */
#loading:not(.gone) ~ #cg-root,
#loading:not(.gone) ~ #tools-pill,
#loading:not(.gone) ~ #tools-pop,
#loading:not(.gone) ~ #rf-gps,
#loading:not(.gone) ~ #rf-card,
#loading:not(.gone) ~ #rf-hint,
#loading:not(.gone) ~ #enq-cta,
#loading:not(.gone) ~ #enq-scrim,
#loading:not(.gone) ~ #ps-offer-card,
#loading:not(.gone) ~ #hole-pill,
#loading:not(.gone) ~ #hole-pop,
#loading:not(.gone) ~ #compass-pop,
#loading:not(.gone) ~ #me-pick,
#loading:not(.gone) ~ #rf-me,
#loading:not(.gone) ~ #cd-pill,
#loading:not(.gone) ~ #cd-splash,
#loading:not(.gone) ~ #cd-sheet,
#loading:not(.gone) ~ #cd-scrim {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  background: var(--navy-d);
  /* ease-out, not ease (2026-08-06): the loader->scene handoff fix asked
     specifically for an ease-out crossfade — most of the fade happens
     early, then eases off, rather than the slow-fast-slow curve `ease`
     gives. The actual class-timing fix (why this transition runs at all
     instead of skipping straight to the end state) is in main.js, where
     `.gone` is applied via a double rAF, well after the opening camera
     move already has real velocity — see the comment there. */
  transition: opacity .8s ease-out, visibility .8s ease-out;
}
/* pointer-events:none is NOT in the transition list above, so it applies
   the instant `.gone` lands, not 0.8s later — belt-and-braces against the
   real bug a click-through test caught 2026-08-06: if transitionend never
   fires (headless timing, a backgrounded tab, anything), an invisible
   full-viewport #loading with its default pointer-events:auto silently
   swallows every tap forever. The JS fallback in main.js that forces
   display:none on a timeout is the other half of this fix. */
#loading.gone { opacity: 0; visibility: hidden; pointer-events: none; }

/* THE PLATE BEHIND THE LOCKUP (Luke, 2026-09-05): "when it loads on Oubaai,
   where it's just got the blue background — I want that to be a very nice
   image, or the picture of the grounds, like we do with Fancourt or whatever
   else." The Arabella pattern (arabella/css/app.css § loading, 2026-08-21):
   ONE pseudo-element, scrims listed BEFORE the photograph because the first
   background layer paints on top, and the picture is OUR MODEL shot from
   above by tools/capture_loading_aerial.py — not a stock aerial, not the raw
   drape. z-index:-1 keeps it under the wordmark and the text (#loading is a
   fixed, z-indexed stacking context, so -1 still sits above its own navy).

   The grade is Oubaai's: the club navy (--navy-d) as the vignette, and one
   warm band low in the frame — the same dusk the model opens in — so the
   plate reads as this course at this hour rather than as a dimmed photo.
   The vignette also does real work: it buries the terrain tile's edge and
   the ocean horizon, and a visible edge of the ground is the one thing that
   makes a model read as a prop. */
#loading::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 95% at 50% 46%,
                    rgba(18, 58, 43, .06) 0%,
                    rgba(18, 58, 43, .48) 56%,
                    rgba(10, 9, 8, .92) 100%),
    linear-gradient(180deg,
                    rgba(18, 58, 43, .40) 0%,
                    rgba(18, 58, 43, .14) 40%,
                    rgba(176, 118, 54, .20) 62%,
                    rgba(10, 9, 8, .76) 100%),
    url('../assets/brand/loading-aerial.jpg') center / cover no-repeat;
  /* Fades UP from the flat navy rather than popping in when the JPEG decodes;
     then a very slow settle (3% over 26 s) that never loops — a loading
     screen that keeps moving advertises how long it has been up. */
  animation: plate-in 1.1s ease-out both, plate-drift 26s ease-out both;
}
@media (max-width: 700px) {
  #loading::before {
    background-image:
      radial-gradient(120% 95% at 50% 46%,
                      rgba(18, 58, 43, .06) 0%,
                      rgba(18, 58, 43, .48) 56%,
                      rgba(10, 9, 8, .92) 100%),
      linear-gradient(180deg,
                      rgba(18, 58, 43, .40) 0%,
                      rgba(18, 58, 43, .14) 40%,
                      rgba(176, 118, 54, .20) 62%,
                      rgba(10, 9, 8, .76) 100%),
      url('../assets/brand/loading-aerial-sm.jpg');
  }
}
@keyframes plate-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes plate-drift { from { transform: scale(1.035); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  #loading::before { animation: plate-in .4s ease-out both; }
}
/* The wordmark and the words now sit on a photograph, not on flat navy: a soft
   dark halo under the wordmark and a hair of shadow on the type keep them
   legible over the bright estate roofs, whatever the plate happens to show
   behind them. */
#loading .mark { filter: drop-shadow(0 6px 22px rgba(6, 6, 5, .75)) drop-shadow(0 1px 2px rgba(6, 6, 5, .6)); }
#loading .loading-course, #loading #status, #loading #substatus { text-shadow: 0 1px 2px rgba(6, 6, 5, .7), 0 6px 18px rgba(6, 6, 5, .55); }

/* The second loading line, with a hairline progress bar drawn by ::after off a
   --p custom property main.js sets. A bar rather than a spinner: a spinner says
   "busy", a bar says "this much of it is done", which is the actual question
   someone on mobile data is asking. */
#substatus {
  --p: 0%;
  position: relative;
  max-width: min(78vw, 340px);
  padding-bottom: 12px;
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--silver);
  opacity: .74;
  line-height: 1.5;
}
#substatus::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background:
    linear-gradient(to right, currentColor 0 var(--p), transparent var(--p) 100%),
    linear-gradient(to right, currentColor 0 100%);
  background-size: 100% 100%, 100% 100%;
  opacity: .5;
}

/* Typographic wordmark (no club artwork on this course): the club name set in
   Cinzel, the way the loading screen of every typographic course reads. */
.mark {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 7.4vw, 44px);
  letter-spacing: .16em;
  text-indent: .16em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.1;
  color: var(--paper);
  animation: mark-in .5s ease-out both;
}

.loading-course {
  margin-top: -.35rem;
  font-family: var(--serif);
  font-size: clamp(15px, 3.4vw, 19px);
  letter-spacing: .34em;
  text-indent: .34em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: .92;
  animation: mark-in .5s ease-out both;
  animation-delay: .12s;
}

@keyframes mark-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

#status {
  min-height: 1.2em;
  font-size: 13px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--silver);
}

/* ------------------------------------------------------------------- chrome */

#chrome {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  /* LOGO TOP CENTRE (Luke, 2026-10-18). The brand sits in the middle of the header; the dev
     readout (#hud) is taken out of the flow and pinned to the right so it cannot push it off-centre. */
  justify-content: center;
  gap: 16px;
  padding: max(var(--pad), env(safe-area-inset-top)) var(--pad) var(--pad);
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(18, 58, 43,.62), transparent);
}

.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
/* On a narrow phone the name earns its space more than the metadata does —
   and with the metadata gone the rule would trail off after the name
   pointing at nothing, so it goes too. */
@media (max-width: 420px) {
  .brand .meta, .brand .rule { display: none; }
}
.brand { align-items: center; }
/* The club logo on its white card (assets/brand/mark.png, tools/make_brand_uk.py). Id is the template's. */
#dolphin {
  height: clamp(30px, 6vw, 40px);
  width: auto;
  align-self: center;
  filter: drop-shadow(0 1px 3px rgba(8, 8, 7, .55));
  flex: 0 0 auto;
  border-radius: 50%;
}
.brand .name {
  font-family: var(--serif);
  font-size: clamp(19px, 4.4vw, 25px);
  /* Cinzel is an all-capitals face, as the club's site sets its headings — so
     it takes a little open tracking, the way inscriptional capitals are set. */
  letter-spacing: .08em;
  white-space: nowrap;
}
.brand .rule {
  flex: 0 0 26px;
  height: 1px;
  background: var(--taupe);
  opacity: .8;
}
.brand .meta {
  font-size: 11px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--silver);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hud {
  position: absolute;
  right: var(--pad);
  top: max(var(--pad), env(safe-area-inset-top));
  flex: none;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: .09em;
  color: var(--silver);
  opacity: .62;
}

/* --------------------------------------------------------------------- foot */

#foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 10;
  padding: var(--pad) var(--pad) max(var(--pad), env(safe-area-inset-bottom));
  pointer-events: none;
  /* Lighter than it was: the hole row carries its own surface now, so a strong
     scrim underneath it only muddied the bottom of the course twice over. */
  background: linear-gradient(to top, rgba(18, 58, 43, .34), transparent);
}
.fidelity {
  margin: 0;
  font-size: 11px;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: .72;
}

/* --------------------------------------------------------- hole selector */

/* The hole row as a panel, not eighteen circles floating over the course. It was
   too transparent to read as a control and too loose to read as tidy: a defined
   surface with a hairline top edge and a standing label gives it somewhere to sit.
   Kept to the club's navy so it reads as chrome, never as part of the ground. */
#holebar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px 9px 16px;
  margin-bottom: 10px;
  border: 1px solid rgba(207, 201, 191, .17);
  border-radius: 10px;
  background: rgba(18, 58, 43, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(7, 7, 6, .34);
  pointer-events: auto;
  min-width: 0;
}
.holebar-label {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: .26em;
  text-indent: .26em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: .72;
}

#holes {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
  pointer-events: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
#holes::-webkit-scrollbar { display: none; }

/* OUT and IN — the two nines, named the way a card names them. */
.nine-tag {
  flex: 0 0 auto;
  align-self: center;
  padding: 0 8px 0 2px;
  font-size: 9.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--taupe);
  white-space: nowrap;
}
/* A hairline before IN, so the break between the nines is visible at a glance
   even when the row is scrolled and the label has gone past. */
.nine-tag + .hbtn { margin-left: 0; }
#holes .nine-tag:not(:first-child) {
  border-left: 1px solid rgba(207, 201, 191, .20);
  margin-left: 6px;
  padding-left: 12px;
}

.hbtn {
  flex: 0 0 auto;
  width: 44px;                     /* tap target floor, not a suggestion */
  height: 44px;
  border: 1px solid rgba(207, 201, 191, .34);
  border-radius: 50%;
  background: rgba(18, 58, 43, .52);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  color: var(--paper);
  font: inherit;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.hbtn:hover { border-color: var(--silver); }
.hbtn:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.hbtn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* ------------------------------------------------------------- hole panel */

#holeinfo {
  position: fixed;
  left: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 26px 18px 20px;
  border-radius: 4px;
  /* The course is busy and light in places; without a scrim the panel is
     unreadable over a bunker. Kept as a soft gradient so it never reads as a box. */
  background: linear-gradient(100deg,
    rgba(18, 58, 43, .80) 0%, rgba(18, 58, 43, .58) 62%, rgba(18, 58, 43, 0) 100%);
  opacity: 0;
  transition: opacity .45s ease;
}
body.in-hole #holeinfo { opacity: 1; }

.hnum {
  flex: none;
  font-family: var(--serif);
  font-size: clamp(54px, 12vw, 96px);
  line-height: 1;
  color: var(--paper);
}
.hmeta { display: grid; gap: 8px; min-width: 0; }
.hpar {
  font-size: clamp(14px, 3.4vw, 17px);
  letter-spacing: .15em;
  text-transform: uppercase;
}
.hsi { color: var(--silver); }
.htees { display: flex; flex-wrap: wrap; gap: 10px; }
.tee {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}
.tee i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.hnote {
  font-size: 10px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: .78;
}

/* Tee-to-green ground profile. Sampled off the same heightmap the camera uses, so
   it is the real ground, not an illustration. Sits under the distances because it
   answers the question the distances raise: 373 m, but up or down? */
.hprof { margin-top: 12px; }
.hprof svg {
  display: block;
  width: 100%;
  max-width: 176px;
  height: auto;
  overflow: visible;
}
.hprof-fill { fill: var(--paper); opacity: .10; }
.hprof-line {
  fill: none;
  stroke: var(--paper);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .82;
}
.hprof-dot { fill: var(--silver); }
/* The green end takes the pin colour, so the card and the model agree. */
.hprof-green { fill: #00A6FF; }
.hprof-label {
  display: block;
  margin-top: 5px;
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: .7;
}
/* "Plays like" — one number, the card's own voice. Sits between the tee
   distances and the profile because it is the answer to the question those
   two raise together: 481 to the front, 9 m downhill, wind helping — so? */
.hplays {
  margin-top: 2px;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}
.hplays b { font-weight: 600; }
.hplays-why { font-size: 12px; color: var(--silver); }
/* ---------------------------------------------------- hole panel — caddie */
/* Caddie numbers (src/caddie.js): the tee-shot facts under the profile, in
   the card's own voice — a dot and a tabular number, exactly like the tee
   distances above them. The colours name the thing: sand, water, short
   grass. The same three colours draw two thin rails under the profile line,
   so the row and the picture agree. */
.tee[role="button"] {
  pointer-events: auto;        /* the card around it stays a see-through */
  cursor: pointer;
  border-radius: 12px;
}
.tee[role="button"]:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
/* The chosen tee: a ring on its dot, nothing else — the numbers stay equal. */
.tee.on i { box-shadow: 0 0 0 1.5px var(--navy-d), 0 0 0 3px var(--paper); }
@media (pointer: coarse) {
  .tee[role="button"] { padding: 8px 6px; margin: -8px -6px; }
}
.hcaddie { display: grid; gap: 6px; margin-top: 12px; }
.hcaddie-k {
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: .7;
}
.hcaddie-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hc {
  display: inline-flex;
  flex-wrap: wrap;             /* the trailing "· pinch 202" may drop a line */
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
  white-space: nowrap;
}
.hc i { flex: none; width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.hc em { font-style: normal; color: var(--silver); }
.hc b { font-weight: 600; }
.hc-bunker i { background: #E6D3A3; }
.hc-water i  { background: #7FC6E8; }
.hc-fw i     { background: #8CCB6E; }
.hc-clear i  { background: #8CCB6E; }
.hrail { fill: none; stroke-width: 2; stroke-linecap: round; }
.hrail-fw     { stroke: #8CCB6E; opacity: .8; }
.hrail-bunker { stroke: #E6D3A3; opacity: .95; }
.hrail-water  { stroke: #7FC6E8; opacity: .95; }

/* --------------------------------------------------- hole panel — collapse */
/* Luke, 2026-08-13: the full card blocks part of the view while looking
   around — desktop's own version of the complaint the phone card's
   `.hchev`/`.open` pair (above) already solved for its tee/profile DETAIL.
   This is a second, independent control: it folds the WHOLE card — desktop's
   big centred version included — down to a hole-number-and-par chip, on
   every breakpoint, docked bottom-left above the hole bar. `#holeinfo`
   itself stays pointer-events:none (a drag over the panel must still orbit
   the camera underneath it) so only this button, and the collapsed chip
   itself, opt back into pointer-events. */
.hcollapse {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  margin: -4px -6px -4px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--silver);
  cursor: pointer;
  pointer-events: auto;    /* clickable even though the card around it is not */
  transition: color .15s ease, background .15s ease;
}
.hcollapse:hover { color: var(--paper); background: rgba(240, 243, 246, .08); }
.hcollapse:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.hcollapse svg { width: 18px; height: 18px; display: block; }

#holeinfo.collapsed {
  pointer-events: auto;    /* the whole chip is the "bring it back" target */
  cursor: pointer;
  align-items: center;
  left: var(--pad);
  right: auto;
  top: auto;
  /* Same clearance the phone-collapsed card already proved safe above the
     hole bar (see the max-width:560px block below) — reused rather than a
     fresh guess, so the desktop chip sits in the same tested pocket. */
  bottom: calc(var(--pad) + 122px);
  transform: none;
  gap: 10px;
  padding: 10px 16px;
}
#holeinfo.collapsed .hsi,
#holeinfo.collapsed .htees,
#holeinfo.collapsed .hnote,
#holeinfo.collapsed .hprof,
#holeinfo.collapsed .hdetail,
#holeinfo.collapsed .hchev { display: none; }
#holeinfo.collapsed .hnum { font-size: clamp(26px, 7vw, 34px); }
/* The shot-in-flight readout docks bottom-left too (#shotinfo, ~7vh up) —
   the two are never meant to be read at once, so the collapsed chip steps
   aside for it rather than risk the two panels overlapping mid-shot. */
body.shooting #holeinfo.collapsed { opacity: 0; pointer-events: none; }

/* Desktop-only feature, Luke 2026-08-13: "on the phone it's fine" — main.js's
   boot-time MOBILE flag already keeps this button out of the DOM and never
   applies `.collapsed` to #holeinfo on a phone. This is a pure CSS backstop
   so the corner-chip control can never appear even if that gate is bypassed. */
/* TPC Louisiana (Luke 2026-10-23, "I cant pop it down"): the fold is on EVERY device now, so the
   phone backstop that hid it is gone; and the button is a visible chip, not a bare glyph. */
.hcollapse {
  background: rgba(240, 243, 246, .12);
  box-shadow: inset 0 0 0 1px rgba(240, 243, 246, .28);
  color: var(--paper);
}
.hcollapse:hover { background: rgba(240, 243, 246, .22); }
@media (pointer: coarse), (max-width: 720px) {
  .hcollapse { width: 40px; height: 40px; margin: -6px 4px -6px 0; }
  .hcollapse svg { width: 20px; height: 20px; }
}

/* ---------------------------------------------------------------- back btn */

#backbtn {
  position: fixed;
  left: var(--pad);
  top: calc(var(--pad) + 46px);
  z-index: 11;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(207, 201, 191, .34);
  border-radius: 22px;
  background: rgba(18, 58, 43, .55);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  letter-spacing: .1em;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
body.in-hole #backbtn { opacity: 1; visibility: visible; }
#backbtn:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

/* On a phone the brand line alone is enough; the dev HUD is noise. */
@media (max-width: 560px) {
  #hud { display: none; }
  .brand .meta, .brand .rule { display: none; }
  /* the big numeral would sit on top of the course; move the panel down */
  #holeinfo {
    top: auto;
    /* Clears the hole bar, which grew when it became a panel — measured at an 8 px
       overlap at 96px, so this is the panel's own height plus a real gap rather
       than a number that happened to work before. */
    bottom: calc(var(--pad) + 122px);
    transform: none;
    right: var(--pad);
  }

  /* "HOLES" costs 49 px of a 373 px row on a phone. OUT and IN carry the meaning
     between them, so the standing label goes and the nines keep their names. */
  .holebar-label { display: none; }
  #holebar { gap: 0; padding-left: 12px; }
  .hnum { font-size: clamp(46px, 13vw, 68px); }
}

@media (prefers-reduced-motion: reduce) {
  .hbtn, #holeinfo, #backbtn, .hcollapse { transition: none; }
}

@media (prefers-reduced-motion: reduce) {
  #loading { transition: none; }
  /* `both` holds the from-state, so the animation has to be cancelled rather
     than zeroed — otherwise the mark stays at opacity 0. */
  .mark { animation: none; }
}

/* ------------------------------------------------------- place mode */
/* Hand placement beats a fourth automated guess. Two clicks a hole. */

#placebar {
  position: fixed;
  right: var(--pad);
  top: calc(var(--pad) + 46px);
  z-index: 11;
  display: flex;
  gap: 8px;
  /* Three buttons overflow a 390 px phone on one line. Wrap and stay pinned
     right rather than running off the edge. */
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(440px, calc(100vw - var(--pad) * 2));
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
body.in-hole #placebar { opacity: 1; visibility: visible; }

#placebar button {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid rgba(207, 201, 191, .34);
  border-radius: 22px;
  background: rgba(18, 58, 43, .55);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
#placebar button:hover { border-color: var(--silver); }
#placebar button:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

/* Golf bag. Sits at the end of the hole row as part of the dashboard rather than
   as a floating decoration — it shares the row's baseline and its ink. */
#bagbtn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;                 /* the 44px touch minimum, same as the hole pips */
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(207, 201, 191, .28);
  border-radius: 22px;
  background: rgba(18, 58, 43, .5);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  color: var(--silver);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
#bagbtn svg { width: 22px; height: 30px; display: block; }
#bagbtn:hover { color: var(--paper); border-color: var(--silver); }
#bagbtn:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
#bagbtn.on { background: var(--paper); color: var(--navy); border-color: var(--paper); }

/* Fly is the primary action on a hole — everything else is authoring. */
#flybtn { background: rgba(30, 28, 25, .88); border-color: var(--silver); }
#flybtn:hover { background: var(--paper); color: var(--navy); }

/* While filming, get out of the way completely: no chrome, no selector, no
   hints. Only the Stop button stays, because you need a way out. */
body.filming #chrome,
body.filming #holeinfo,
body.filming #foot,
body.filming #backbtn { opacity: 0; visibility: hidden; }
/* Stop must sit ABOVE the letterbox and BELOW the top bar. The bars are z-index
   40 and this bar was 11, so the only way out of a flyover was being painted
   over by the very thing that made it look cinematic. */
body.filming #placebar {
  opacity: 1; visibility: visible;
  z-index: 50;
  top: calc(7vh + var(--pad));
}
/* Letterbox. A flyover reads as film rather than as an app with the chrome off. */
body.filming::before,
body.filming::after {
  content: '';
  position: fixed; left: 0; right: 0; height: 7vh;
  background: #000; z-index: 40; pointer-events: none;
}
body.filming::before { top: 0; }
body.filming::after { bottom: 0; }

/* ------------------------------------------------------------- the scorecard */

/* What the golf bag opens. Laid out like a card rather than a data grid: numerals
   set in the serif, tee colours as the column heads with no words, and OUT/IN/TOTAL
   ruled off the way they are on paper. */
#card {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--pad);
  background: rgba(7, 7, 6, .58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
#card[hidden] { display: none; }

.card-panel {
  width: min(560px, 100%);
  border: 1px solid rgba(207, 201, 191, .17);
  border-radius: 10px;
  background: rgba(18, 58, 43, .96);
  box-shadow: 0 24px 70px rgba(7, 7, 6, .55);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(207, 201, 191, .18);
}
#card-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: .16em;
  text-indent: .16em;
  text-transform: uppercase;
  color: var(--paper);
}
#card-close {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  margin: -8px -8px -8px 0;
  border: 0;
  background: none;
  color: var(--silver);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
#card-close:hover { color: var(--paper); }
#card-close:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

#card-body {
  max-height: min(74vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
#card-body table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
#card-body thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 8px;
  background: var(--navy);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--silver);
}
#card-body thead i {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
}
#card-body td,
#card-body tbody th {
  padding: 9px 8px;
  text-align: center;
  font-size: 14px;
  color: var(--paper);
  border-bottom: 1px solid rgba(207, 201, 191, .08);
}
#card-body tbody th {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  color: var(--paper);
}
.c-par { color: var(--silver); }
.c-si { color: var(--taupe); font-size: 12px; }

/* OUT, IN and TOTAL: ruled off above, no hairline below, set in the serif. */
#card-body tr.c-total th,
#card-body tr.c-total td {
  border-top: 1px solid rgba(207, 201, 191, .30);
  border-bottom: 0;
  padding-top: 11px;
  padding-bottom: 13px;
  font-family: var(--serif);
  font-size: 16px;
  color: var(--paper);
}
#card-body tr.c-total th {
  font-size: 12px;
  font-family: var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--silver);
}

/* The hole you are standing on. */
#card-body tr.on td,
#card-body tr.on th { background: rgba(137, 110, 75, .22); }
#card-body tr.on th { color: #FF8A73; }

.card-note {
  margin: 0;
  padding: 12px 20px 16px;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: .6;
}

/* Visually hidden, still read aloud — the tee columns are colour swatches. */
.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ----------------------------------------------------------------- the shot */

/* Club, distance, wind and the aim the solver aimed. Sits opposite the hole card
   so the two never collide, and only exists while a shot is in the air. */
#shotinfo {
  position: fixed;
  left: var(--pad);
  bottom: calc(7vh + var(--pad));
  z-index: 50;                 /* above the letterbox, like the Stop button */
  padding: 12px 18px;
  /* Hairline all round, matching the hole bar — NOT a coloured tab down one side.
     This carried a 2 px blue left border for about an hour and it was wrong twice
     over: nothing else in this interface has a side accent (the hole card is a soft
     scrim, the hole bar is an even hairline), and the blue was decorating a panel
     whose blue already means something specific one line below. The aim figure is
     the accent; the container should not compete with it. */
  border: 1px solid rgba(207, 201, 191, .17);
  border-radius: 8px;
  background: rgba(18, 58, 43, .80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  pointer-events: none;
  max-width: min(340px, calc(100vw - var(--pad) * 2));
}
body.shooting #shotinfo { opacity: 1; visibility: visible; }

.shot-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.shot-n {
  font-size: 15px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--paper);
}
.shot-of { color: var(--silver); opacity: .65; }
.shot-club {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--paper);
}
.shot-dist {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  color: var(--silver);
}
.shot-wind {
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: .82;
}
/* The aim is the answer, so it is the one line that gets the pin's colour. */
.shot-aim {
  margin-top: 4px;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #00A6FF;
}

/* The shot's Stop button has to survive `filming`, exactly as the flight's does. */
body.filming #shotbtn { opacity: 1; visibility: visible; display: inline-flex; }

@media (max-width: 560px) {
  #shotinfo {
    left: var(--pad);
    right: var(--pad);
    max-width: none;
    padding: 10px 14px;
  }
  .shot-club { font-size: 17px; }
}

/* ------------------------------------------------- collapsing chrome (phone) */

/* Desktop: the chevron does not exist and the detail is simply the card. Every
   rule that makes this fold is inside the phone query below, so nothing here
   changes the desktop layout that was already signed off. */
.hchev { display: none; }

/* Hide-the-interface button. Sits on the right edge, clear of the top bar and the
   hole row, and is the one thing that survives `minimal` — it is the way back. */
#uibtn {
  position: fixed;
  right: var(--pad);
  top: 50%;
  transform: translateY(-50%);
  z-index: 12;
  display: none;              /* phone only; a desktop has room for its chrome */
  place-items: center;
  width: 44px; height: 44px;  /* Luke's minimum touch target */
  padding: 0;
  border: 1px solid rgba(240, 243, 246, .22);
  border-radius: 50%;
  background: rgba(18, 58, 43, .62);
  backdrop-filter: blur(6px);
  color: var(--paper);
  cursor: pointer;
}
#uibtn svg { width: 21px; height: 21px; display: block; }
#uibtn .eye-shut { opacity: 0; }
body.minimal #uibtn .eye-open { opacity: .45; }
body.minimal #uibtn .eye-shut { opacity: 1; }
#uibtn:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; }
/* The eye sits mid-right; the rangefinder sheet and the Tools pill it lifts
   sweep through that band (measured 2026-09-05: 20–44 px of overlap on
   390x844 and 430x932 with GPS on). The sheet is the interface a golfer is
   using at that moment, so the hide-the-interface button steps aside while
   it is open and returns with the cross. rangefinder.js sets the class. */
body.rf-open #uibtn { opacity: 0; pointer-events: none; }

/* The clear-the-screen state. Same set filming hides, minus the letterbox. */
body.minimal #holeinfo,
body.minimal #foot,
body.minimal #placebar,
body.minimal #backbtn { opacity: 0; visibility: hidden; }
/* A flyover owns the screen, so its Stop button must beat `minimal`. */
body.filming #placebar { opacity: 1; visibility: visible; }
/* And the eye gets out of the way of the letterbox. */
body.filming #uibtn { display: none; }

@media (max-width: 560px) {
  #uibtn { display: grid; }

  /* The hole card folds. Collapsed it is a slim bar: the number, the par, and a
     chevron. Everything else — the four tee distances, the note and the elevation
     profile — is behind the tap. Luke's note was the whole card, and the numeral in
     particular, blocking the view while looking around. */
  #holeinfo {
    pointer-events: auto;      /* it has a control in it now */
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px 12px 14px;
    max-width: calc(100vw - var(--pad) * 2);
  }
  .hnum { font-size: 34px; line-height: 1; }
  #holeinfo.open .hnum { font-size: clamp(40px, 11vw, 58px); }
  .hdetail { display: none; }
  #holeinfo.open .hdetail { display: block; margin-top: 8px; }
  /* The Tools pill docks bottom-right, level with the open card's last rows
     (it sits over the card's transparent tail on purpose). The caddie chips
     stop short of it — 52 px pill + 8 px air — so a long chip wraps rather
     than runs under the button. */
  .hcaddie { padding-right: 60px; }

  .hchev {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    margin: -6px -6px -6px 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--silver);
    cursor: pointer;
  }
  .hchev svg {
    width: 20px; height: 20px;
    transition: transform .22s ease;
  }
  #holeinfo.open .hchev svg { transform: rotate(180deg); }
  .hchev:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

  /* Place controls live at the TOP on a phone, not above the hole card.
     They used to sit at bottom + 152px while the card sits at bottom + 96px and
     grows UPWARD, so the two-row button bar landed on top of the par and the tee
     distances — the card only has to be about 60px tall for them to touch, and it
     is far taller than that. Nothing about that collision was computable in CSS
     because the card's height depends on its contents.
     The top-right corner is deterministic and empty: the back button is top-LEFT,
     and on a phone the HUD and the strapline are both hidden. */
  #placebar {
    top: calc(var(--pad) + 52px);
    bottom: auto;
    right: var(--pad);
    /* Keep the row right-aligned as it wraps, so it never reaches the back button. */
    max-width: calc(100vw - var(--pad) * 2 - 96px);
  }
}


/* ── The robot's berth in the masthead (2026-09-04) ──────────────────────────
   He is position:fixed at the top-right corner the Book flag used to own, so
   the header does not know he is there — and the fps/draw-call readout (#hud)
   is the last thing in that row, which put it underneath him. Measured before
   this rule at 1440x900: #hud x1403-1414 inside the bot's x1360-1414. The
   readout ships deliberately ("a number nobody can see is a number nobody
   defends"), so it is moved rather than hidden.
   Phone-safe: #hud is already display:none at the narrow breakpoint, and the
   bot is 40px there, so this rule only ever does work on desktop.
   ⚠️ Drop this if the bot is ever moved off dock: 'book'. */
#hud { margin-right: 64px; }

/* The fps / draw-call readout is dev-only — never shown to visitors. */
#hud { display: none !important; }


/* ---- Luke 2026-10-18 (standing rule): only the logo, centred at the top; no words that do not need to be there ---- */
#chrome { justify-content: center; }
#chrome .brand { justify-content: center; }
#chrome .brand .name, #chrome .brand .rule, #chrome .brand .meta, #hud { display: none !important; }
#loading .loading-name, #loading .loading-course, #loading #substatus { display: none !important; }
.holebar-label { display: none; }

/* ---- the club logo, baked onto its own white rounded card by tools/make_brand_uk.py (UK12) ---- */
#dolphin { height: clamp(40px, 8vw, 54px); border-radius: 0; filter: drop-shadow(0 1px 4px rgba(4, 10, 7, .5)); }
#loading .mark { width: min(72vw, 380px); height: auto; border-radius: 0; filter: drop-shadow(0 2px 10px rgba(4, 10, 7, .45)); }
