/* Golden Hour Open — menus, title, yardage book, scorecards. Warm paper over the living course. */
:root {
  /* The Fire Dragon kit's credits roll, in the game's colours. */
  --fd-bg: #22190f;
  --fd-accent: #e0a44a;
  --fd-accent-2: #f3c77a;
  --fd-text: #f7eedb;
  --fd-muted: rgba(247, 238, 219, 0.66);
  --fd-font: "Inter", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --fd-title-font: "Cinzel", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --fd-focus: #f3c77a;
  --fd-glow-hue: 20deg;
  --fd-splash-bg: #2d2419;
}

.screens { position: absolute; inset: 0; pointer-events: none; z-index: 20; --ui: 1; }
/* The menu, the settings and controls panels and the yardage book grow with the window as the HUD's cards do (--ui, see
   style.css): at 1920 x 1080 the menu column was 430 px and the yardage book 330 px, the size they are on a laptop. */
@media (min-width: 1600px) and (min-height: 860px) { .screens { --ui: 1.25; } }
@media (min-width: 2200px) and (min-height: 1200px) { .screens { --ui: 1.55; } }
.screen { position: absolute; inset: 0; pointer-events: auto; opacity: 0; transition: opacity 0.35s var(--ease-out); }
.screen.in { opacity: 1; }
.screen.out { opacity: 0; pointer-events: none; }
.screen.covered { visibility: hidden; }
.screen.sheet { display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: radial-gradient(ellipse at 50% 40%, rgba(45, 36, 25, 0.18), rgba(30, 22, 12, 0.55)); overflow-y: auto; }
.screen.sheet .panel { transform: translateY(14px) scale(0.98); transition: transform 0.45s var(--ease-back); }
.screen.sheet.in .panel { transform: none; }

/* ---------------------------------------------------------------- panels */
.panel {
  position: relative; width: min(calc(560px * var(--ui, 1)), 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  /* The painted panel frame (nine-sliced, brass studs at the corners) around the parchment. */
  padding: 0 4px; border: calc(30px * var(--ui, 1)) solid transparent; border-image: url("./assets/ui/kit/panel-frame.webp") 30 / calc(30px * var(--ui, 1)) stretch; border-radius: 20px;
  background: url("./assets/ui/paper.webp") center / 512px repeat, #f7ecd0; background-blend-mode: multiply;
  filter: drop-shadow(0 24px 40px rgba(30, 18, 4, 0.45));
}
.panel.wide { width: min(calc(1040px * var(--ui, 1)), 100%); }
.sheet.small .panel { width: min(calc(420px * var(--ui, 1)), 100%); }
.panel-title { margin: 0 0 4px; font-family: var(--display); font-weight: 700; font-style: normal; letter-spacing: 0.02em; font-size: calc(clamp(22px, 2.5vw, 30px) * var(--ui, 1)); color: var(--ink); }
.panel-title.big { font-size: calc(clamp(30px, 4.4vw, 48px) * var(--ui, 1)); }
.panel-title::after { content: ""; display: block; height: 14px; margin: 6px 0 2px; background: url("./assets/ui/kit/divider.webp") left center / auto 100% no-repeat; opacity: 0.9; }
.panel-kicker { margin: 0; font-family: var(--sans); font-size: calc(12px * var(--ui, 1)); letter-spacing: 0.16em; text-transform: uppercase; color: var(--honey-deep); }
.panel-sub { margin: 0 0 14px; font-family: var(--sans); color: var(--ink-soft); font-size: calc(15px * var(--ui, 1)); }
.fine-print { font-family: var(--sans); font-size: calc(13px * var(--ui, 1)); color: var(--ink-soft); }
.panel h3::before { content: ""; display: inline-block; width: 12px; height: 13px; margin-right: 8px; vertical-align: -1px; background: url("./assets/ui/kit/bullet-diamond.webp") center / contain no-repeat; }
.panel h3 { margin: 16px 0 6px; font-family: var(--sans); font-size: calc(12px * var(--ui, 1)); letter-spacing: 0.14em; text-transform: uppercase; color: var(--honey-deep); }

/* ---------------------------------------------------------------- buttons */
.menu-list { display: grid; gap: 8px; }
/* A painted plate in three parts (left cap, right cap, stretched middle); a state swaps the set. */
.mbtn {
  --cap: 26px;
  background: url("./assets/ui/kit/plate-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/plate-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/plate-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: calc(12px * var(--ui, 1)) calc(28px * var(--ui, 1)); border: 0; border-radius: 10px; color: var(--ink);
  filter: drop-shadow(0 2px 3px rgba(40, 26, 10, 0.22));
  transition: transform 0.18s var(--ease-out), filter 0.2s;
}
.mbtn:hover, .mbtn:focus-visible {
  transform: translateX(4px); filter: drop-shadow(0 5px 10px rgba(120, 80, 20, 0.3)); outline: none;
  background: url("./assets/ui/kit/plate-focus-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/plate-focus-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/plate-focus-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
.mbtn:active {
  transform: translateX(4px) scale(0.985);
  background: url("./assets/ui/kit/plate-pressed-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/plate-pressed-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/plate-pressed-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
.mbtn-text { display: grid; gap: 1px; }
.mbtn-label { font-family: var(--display); font-weight: 500; font-size: calc(18px * var(--ui, 1)); letter-spacing: 0.04em; }
.mbtn-sub { font-family: var(--sans); font-size: calc(12.5px * var(--ui, 1)); color: var(--ink-soft); }
.mbtn-icon { width: calc(34px * var(--ui, 1)); height: calc(34px * var(--ui, 1)); object-fit: contain; }
.mbtn.accent, .mbtn.accent:hover, .mbtn.accent:focus-visible {
  background: url("./assets/ui/kit/accent-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/accent-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/accent-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
.mbtn.accent:active {
  background: url("./assets/ui/kit/accent-pressed-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/accent-pressed-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/accent-pressed-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
.mbtn.accent .mbtn-sub { color: #5b3f16; }
.mbtn.danger .mbtn-label { color: #8e3b28; }
.mbtn.small { --cap: 20px; padding: 7px 22px; border-radius: 8px; }
.mbtn.small .mbtn-label { font-size: calc(14px * var(--ui, 1)); }
.mbtn.ghost, .mbtn.ghost:hover, .mbtn.ghost:focus-visible, .mbtn.ghost:active {
  filter: none;
  background: url("./assets/ui/kit/ghost-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/ghost-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/ghost-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
.mbtn.locked, .mbtn.locked:hover, .mbtn.locked:focus-visible, .mbtn.locked:active {
  color: var(--ink-soft);
  background: url("./assets/ui/kit/plate-disabled-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/plate-disabled-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/plate-disabled-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
.mbtn.locked .mbtn-sub { color: var(--honey-deep); font-weight: 600; }
.lock { margin-left: auto; width: 20px; height: 28px; flex: none; background: url("./assets/ui/kit/padlock.webp") center / contain no-repeat; }
.confirm-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.confirm-row .mbtn { width: auto; min-width: 150px; }
.prompt-bar { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-family: var(--sans); font-size: calc(12px * var(--ui, 1)); color: var(--ink-soft); }
kbd {
  --cap: 9px;
  display: inline-block; min-width: 2.4em; padding: 3px 11px 6px; border: 0; font-family: var(--sans); font-size: calc(12px * var(--ui, 1)); line-height: 1.2; text-align: center; color: var(--ink);
  background: url("./assets/ui/kit/keycap-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/keycap-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/keycap-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
@media (pointer: coarse) { .prompt-bar { display: none; } }
/* Painted arrows (the kit's triangles and chevrons) stand where an arrow character would. */
.arrow-piece { height: 0.95em; width: auto; vertical-align: -0.12em; margin: 0 0.06em; }
kbd .arrow-piece { height: 1.05em; vertical-align: -0.2em; margin: 0 0.08em; }
.arrow-piece.arrow-up, .arrow-piece.arrow-down { height: 0.8em; }
kbd .arrow-piece.arrow-up, kbd .arrow-piece.arrow-down { height: 0.85em; vertical-align: -0.1em; }


/* ---------------------------------------------------------------- options */
.opt { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 8px 24px; border: 0; }
.opt:focus-visible, .opt:hover {
  --cap: 22px;
  outline: none; border-radius: 999px;
  background: url("./assets/ui/kit/option-row-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/option-row-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/option-row-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
.opt:focus-visible { filter: drop-shadow(0 0 5px rgba(224, 164, 74, 0.85)); }
.opt-label { font-size: calc(17px * var(--ui, 1)); }
.opt-control { display: flex; align-items: center; gap: 6px; }
.opt-arrow { width: calc(34px * var(--ui, 1)); height: calc(34px * var(--ui, 1)); padding: 0; border: 0; background: var(--glyph) center / auto 14px no-repeat, url("./assets/ui/kit/round-button.webp") center / 100% 100% no-repeat; font-size: 0; }
.opt-arrow.prev { --glyph: url("./assets/ui/kit/chevron-left.webp"); }
.opt-arrow.next { --glyph: url("./assets/ui/kit/chevron-right.webp"); }
.opt-arrow:active { background: var(--glyph) center 55% / auto 14px no-repeat, url("./assets/ui/kit/round-button-pressed.webp") center / 100% 100% no-repeat; }
.opt-value { min-width: calc(150px * var(--ui, 1)); text-align: center; font-family: var(--sans); font-size: calc(14px * var(--ui, 1)); font-weight: 600; }
.opt-value.locked { color: var(--honey-deep); }
.opt-hint { grid-column: 1 / -1; font-family: var(--sans); font-size: calc(11px * var(--ui, 1)); color: var(--honey-deep); min-height: 0; }
.opt-hint:empty { display: none; }
.opt-bar {
  --cap: 7px;
  position: relative; grid-column: 2; height: 14px; margin-right: 8px;
  background: url("./assets/ui/kit/slider-groove-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/slider-groove-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/slider-groove-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
.opt-bar i {
  position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v, 0) * 100%); transition: width 0.2s;
  background: url("./assets/ui/kit/slider-fill-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/slider-fill-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/slider-fill-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat;
}
.opt-bar i::after { content: ""; position: absolute; right: -9px; top: 50%; width: 20px; height: 20px; margin-top: -10px; background: url("./assets/ui/kit/slider-knob.webp") center / 100% 100% no-repeat; }
.settings-group { display: grid; gap: 2px; }
.settings-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
/* A short window scrolls the settings, but the action row stays in reach at the foot of the panel. */
.panel .settings-actions { position: sticky; bottom: 0; z-index: 1; margin-left: -10px; margin-right: -10px; padding: 10px 10px 4px; background: url("./assets/ui/paper.webp") center / 512px repeat, #f7ecd0; background-blend-mode: multiply; box-shadow: 0 -8px 10px -4px rgba(120, 90, 40, 0.25); }
@media (max-height: 800px) {
  .settings-group .opt { padding: 3px 10px; }
  .settings-group .opt-label { font-size: 16px; }
  .panel h3 { margin: 10px 0 2px; }
  .panel .settings-actions { margin-top: 8px; }
}

/* ---------------------------------------------------------------- title */
.title-screen { display: grid; grid-template-rows: 1fr auto auto auto; justify-items: center; padding-bottom: max(26px, env(safe-area-inset-bottom)); background: #2d2419; cursor: pointer; }
.title-art { position: absolute; inset: 0; background: url("./assets/ui/key-art.webp") center / cover no-repeat; animation: titleDrift 30s ease-in-out infinite alternate; }
.title-glow { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 12, 4, 0) 55%, rgba(20, 12, 4, 0.62)); }
/* The wordmark is painted into the key art, so a phone held upright gets the portrait cover with its own wordmark. */
@media (max-width: 640px) and (orientation: portrait) {
  .title-art { background: #1d2813; overflow: hidden; }
  .title-art::before { content: ""; position: absolute; inset: -24px; background: url("./assets/ui/box-front.webp") center / cover no-repeat; filter: blur(20px) brightness(0.72); }
  .title-art::after { content: ""; position: absolute; inset: 0 0 auto 0; aspect-ratio: 3 / 4; background: url("./assets/ui/box-front.webp") center / 100% 100% no-repeat; -webkit-mask-image: linear-gradient(180deg, #000 84%, transparent 100%); mask-image: linear-gradient(180deg, #000 84%, transparent 100%); }
}
@keyframes titleDrift { from { transform: scale(1.02); } to { transform: scale(1.07) translate(-1%, 0.5%); } }
.title-screen > :not(.title-art):not(.title-glow):not(.copyright) { position: relative; }
.title-tagline { grid-row: 2; margin: 0 0 12px; color: #fff2d8; font-style: italic; font-size: clamp(15px, 1.8vw, 21px); text-shadow: 0 2px 10px rgba(30, 12, 0, 0.8); text-align: center; padding: 0 16px; }
.press-start { grid-row: 3; border: none; background: none; color: #fff7e6; font-family: var(--sans); font-size: clamp(13px, 1.4vw, 16px); letter-spacing: 0.24em; text-transform: uppercase; text-shadow: 0 2px 8px rgba(30, 12, 0, 0.9); animation: breathe 2.6s ease-in-out infinite; padding: 10px 18px; }
@keyframes breathe { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
.title-demo { grid-row: 4; margin: 4px 0 0; font-family: var(--sans); font-size: 12px; letter-spacing: 0.1em; color: #f3c77a; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
.copyright { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); margin: 0; font-family: var(--sans); font-size: 12px; color: rgba(255, 244, 222, 0.82); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); }
.title-screen.leaving .title-art { transition: transform 0.4s ease-in, filter 0.4s; transform: scale(1.1); filter: brightness(1.2); }

/* ---------------------------------------------------------------- logo */
.logo { display: grid; place-items: center; }
.logo-img { width: 100%; height: auto; filter: drop-shadow(0 6px 18px rgba(40, 18, 0, 0.45)); }
.logo-type { margin: 0; font-weight: 600; font-style: italic; font-size: 44px; color: #f3c77a; text-shadow: 0 2px 0 #8a5a18, 0 6px 16px rgba(30, 12, 0, 0.6); text-align: center; line-height: 1; }
.logo-small { font-size: 0.5em; }
.logo-open { display: block; font-style: normal; letter-spacing: 0.3em; font-size: 0.55em; color: #fff; }

/* ---------------------------------------------------------------- main menu */
.main-menu { display: flex; align-items: stretch; }
.menu-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(34, 24, 12, 0.72) 0%, rgba(34, 24, 12, 0.35) 34%, rgba(34, 24, 12, 0) 58%); pointer-events: none; }
.menu-column { position: relative; display: flex; flex-direction: column; justify-content: safe center; gap: 18px; width: min(calc(430px * var(--ui, 1)), 92vw); padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)) max(34px, env(safe-area-inset-left)); overflow-y: auto; }
.menu-logo { width: min(calc(360px * var(--ui, 1)), 80%); margin-bottom: 4px; }
.main-menu .menu-list { animation: rise 0.6s var(--ease-out) both 0.1s; }
.main-menu .prompt-bar { color: rgba(255, 244, 222, 0.8); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- controls */
.swing-steps { margin: 6px 0 14px; padding-left: 22px; font-size: calc(16px * var(--ui, 1)); line-height: 1.45; }
.controls-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: calc(13px * var(--ui, 1)); margin-bottom: 10px; }
.controls-table th, .controls-table td { padding: 6px 8px; border-bottom: 1px dashed var(--paper-edge); text-align: left; }
.controls-table thead th { font-size: calc(12px * var(--ui, 1)); letter-spacing: 0.12em; text-transform: uppercase; color: var(--honey-deep); }
.controls-screen .panel { width: min(calc(760px * var(--ui, 1)), 100%); }

/* ---------------------------------------------------------------- quick round */
.course-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 10px 0 8px; }
.course-card { position: relative; padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; background: #3a2c1c; aspect-ratio: 16 / 10; box-shadow: 0 4px 14px rgba(30, 18, 4, 0.25); transition: transform 0.2s var(--ease-out), border-color 0.2s; }
.course-card:hover, .course-card:focus-visible { transform: translateY(-3px); }
.course-card.on { border-color: var(--honey); box-shadow: 0 0 0 3px rgba(224, 164, 74, 0.4), 0 8px 20px rgba(30, 18, 4, 0.3); }
.cc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cc-img.missing { display: none; }
.course-card.locked .cc-img { filter: saturate(0.55) brightness(0.8); }
.cc-text { position: absolute; left: 0; right: 0; bottom: 0; display: grid; padding: 18px 10px 8px; text-align: left; color: #fff6e4; background: linear-gradient(180deg, transparent, rgba(20, 12, 4, 0.78)); }
.cc-text strong { font-size: calc(16px * var(--ui, 1)); font-weight: 500; }
.cc-kind { font-family: var(--sans); font-size: calc(11px * var(--ui, 1)); opacity: 0.85; }
.cc-lock { position: absolute; top: -130%; right: 8px; padding: 3px 8px; border-radius: 10px; background: rgba(34, 24, 12, 0.8); font-family: var(--sans); font-size: 11px; color: #f3c77a; }
.qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.players { display: grid; gap: 8px; }
.player-row { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 8px; }
.pl-portrait { width: 44px; height: 44px; border-radius: 50%; object-fit: contain; border: 2px solid var(--paper-edge); background: #e9d7b1; }
.pl-portrait.missing { visibility: hidden; }
.pl-name { min-width: 0; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--paper-edge); background: #fffaf0; font: inherit; font-size: 16px; color: var(--ink); }
.pl-name:focus-visible { outline: 3px solid var(--honey); }
.player-row .opt { padding: 4px; }
.player-row .opt-label { display: none; }
.player-row .opt-value { min-width: 80px; }

/* ---------------------------------------------------------------- hole intro (yardage book) */
.hole-intro { pointer-events: auto; cursor: pointer; }
.yardage-book {
  position: absolute; left: max(22px, env(safe-area-inset-left)); top: 50%; transform: translate(-30px, -50%) rotate(-1.2deg); opacity: 0;
  width: min(calc(330px * var(--ui, 1)), 40vw); max-height: 88vh; overflow: hidden; padding: 0 4px; border: calc(26px * var(--ui, 1)) solid transparent; border-radius: 16px;
  border-image: url("./assets/ui/kit/panel-frame.webp") 30 / calc(26px * var(--ui, 1)) stretch;
  background: url("./assets/ui/paper.webp") center / 512px repeat, #f7ecd0; background-blend-mode: multiply;
  filter: drop-shadow(0 24px 40px rgba(30, 18, 4, 0.45));
  transition: transform 0.6s var(--ease-back), opacity 0.4s;
}
.hole-intro.in .yardage-book { transform: translate(0, -50%) rotate(-1.2deg); opacity: 1; }
.yb-head { display: flex; gap: 12px; align-items: center; }
.yb-no { display: grid; place-items: center; width: calc(56px * var(--ui, 1)); height: calc(56px * var(--ui, 1)); background: url("./assets/ui/kit/badge-hole.webp") center / 100% 100% no-repeat; color: var(--paper); font-size: calc(30px * var(--ui, 1)); flex: none; text-shadow: 0 1px 2px rgba(20, 30, 10, 0.55); }
.yb-name { margin: 0; font-weight: 500; font-style: italic; font-size: calc(24px * var(--ui, 1)); }
.yb-meta { margin: 0; font-family: var(--sans); font-size: calc(12px * var(--ui, 1)); color: var(--ink-soft); letter-spacing: 0.04em; }
.yb-map { margin: 12px auto 10px; display: grid; place-items: center; }
.yb-map canvas { display: block; max-width: 100%; max-height: 38vh; border-radius: 8px; box-shadow: 0 2px 8px rgba(30, 18, 4, 0.3); transform: rotate(0.6deg); }
.yb-note { margin: 0 0 8px; font-size: calc(15px * var(--ui, 1)); line-height: 1.42; }
.yb-wind, .yb-players { margin: 0 0 4px; font-family: var(--sans); font-size: calc(12px * var(--ui, 1)); color: var(--ink-soft); }
.yb-go { margin: 10px 0 0; font-family: var(--sans); font-size: calc(12px * var(--ui, 1)); color: var(--honey-deep); }
.yb-touch-text { display: none; }
@media (pointer: coarse) { .yb-key, .yb-key-text { display: none; } .yb-touch-text { display: inline; } }
/* A phone on its side (844 x 390): the map beside the note, and the wind and the tee-off line under the hole's name.
   The page now waits for that press, and in one column the wind and "Tap anywhere to tee off" fell below its clip. */
@media (max-height: 500px) {
  .yardage-book { width: min(540px, 64vw); max-height: calc(100vh - 24px); padding: 0 2px; border-width: 22px; border-image-width: 22px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start; }
  .yb-head, .yb-wind, .yb-players, .yb-go { grid-column: 1 / -1; }
  .yb-head { order: -3; }
  .yb-wind { order: -2; margin: 6px 0 0; }
  .yb-go { order: -1; margin: 4px 0 2px; }
  .yb-map { margin: 6px 0 4px; }
  .yb-map canvas { max-height: 44vh; max-width: 96px; }
  .yb-note { font-size: 15px; margin: 6px 0 4px; }
}
@media (pointer: coarse) and (max-height: 500px) { .yb-note { font-size: 16px; line-height: 1.36; } }

@media (max-width: 640px) {
  .panel { padding: 20px 18px 16px; }
  .panel .settings-actions { grid-template-columns: repeat(2, 1fr); gap: 6px; bottom: 0; }
  .settings-actions .mbtn:last-child { grid-column: 1 / -1; }
  .settings-actions .mbtn { padding: 8px 18px; }
  .settings-actions .mbtn-label { font-size: 16px; }
  .settings-actions .mbtn-sub { display: none; }
  /* A picker's label sits above its control so the right arrow is never pushed off a narrow panel. */
  .opt { grid-template-columns: 1fr; }
  .opt-control { justify-content: space-between; }
  .opt-value { min-width: 0; flex: 1; }
  .opt-bar { grid-column: 1; }
}
@media (max-width: 640px) and (orientation: portrait) {
  .yardage-book { left: 50%; width: min(360px, calc(100vw - 32px)); max-height: 86vh; padding: 0 2px; transform: translate(-50%, -46%) rotate(-1deg); }
  .hole-intro.in .yardage-book { transform: translate(-50%, -50%) rotate(-1deg); }
  .yb-map canvas { max-height: 26vh; }
  .yb-note { font-size: 14px; }
  .yb-name { font-size: 22px; }
}

/* ---------------------------------------------------------------- next golfer */
.next-golfer { display: grid; place-items: center; pointer-events: auto; background: rgba(30, 22, 12, 0.25); }
.ng-card { --cap: 46px; display: flex; align-items: center; gap: 18px; padding: 12px 44px 12px 20px; border-radius: 999px; filter: drop-shadow(0 20px 30px rgba(30, 18, 4, 0.4));
  background: url("./assets/ui/kit/pill-frame-cap-l.webp") left / var(--cap) 100% no-repeat, url("./assets/ui/kit/pill-frame-cap-r.webp") right / var(--cap) 100% no-repeat, url("./assets/ui/kit/pill-frame-mid.webp") var(--cap) 0 / calc(100% - 2 * var(--cap)) 100% no-repeat, url("./assets/ui/paper.webp") center / 512px repeat, #f6ecd2; background-blend-mode: normal, normal, normal, multiply, normal; transform: scale(0.8); transition: transform 0.45s var(--ease-back); }
.next-golfer.in .ng-card { transform: scale(1); }
.ng-portrait { width: 84px; height: 84px; border-radius: 50%; object-fit: contain; border: 3px solid var(--honey); background: #e9d7b1; }
.ng-hole { margin: 0; font-family: var(--sans); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--honey-deep); }
.ng-name { margin: 0; font-weight: 500; font-style: italic; font-size: 30px; }

/* ---------------------------------------------------------------- scorecard */
.scorecard { overflow-x: auto; margin: 8px 0 4px; border-radius: 10px; border: 1px solid var(--paper-edge); background: rgba(255, 252, 244, 0.75); }
.sc-table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 13px; text-align: center; }
.sc-table caption { padding: 6px; font-size: 12px; color: var(--ink-soft); }
.sc-table th, .sc-table td { padding: 5px 4px; border-right: 1px solid rgba(94, 70, 40, 0.12); min-width: 26px; }
.sc-table thead th { background: var(--green); color: var(--paper); font-weight: 600; }
.sc-yardrow td { font-size: 12px; color: var(--ink-soft); }
.sc-parrow td { font-weight: 700; border-bottom: 2px solid rgba(94, 70, 40, 0.3); }
.sc-name { text-align: left !important; padding-left: 10px !important; white-space: nowrap; font-weight: 600; min-width: 90px !important; }
.sc-sub, .sc-total { background: rgba(224, 164, 74, 0.14); font-weight: 700; }
.sc-table thead .sc-sub, .sc-table thead .sc-total { background: #37502e; }
.sc-table thead tr td.sc-sub, .sc-table thead tr td.sc-total { color: #f1e6c9; }
.sc-score span { display: inline-grid; place-items: center; width: 24px; height: 24px; font-weight: 600; }
.sc-score span { background-position: center; background-repeat: no-repeat; background-size: 100% 100%; }
/* The ink marks around a score are painted (kit/score-*): a ring for a birdie, two for an eagle, a box for a bogey, two for worse. */
.tone-birdie span { background-image: url("./assets/ui/kit/score-circle.webp"); color: #8e3b28; }
.tone-eagle span, .tone-ace span { background-image: url("./assets/ui/kit/score-circle-double.webp"); background-size: 128% 128%; color: #8e3b28; }
.tone-bogey span { background-image: url("./assets/ui/kit/score-square.webp"); }
.tone-worse span { background-image: url("./assets/ui/kit/score-square-double.webp"); background-size: 124% 124%; }
.sc-table tr.me th, .sc-table tr.me td { background-color: rgba(224, 164, 74, 0.12); }
.sc-topar { color: var(--green); }
.standings { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 8px; padding: 0; list-style: none; counter-reset: st; }
.standings li { display: flex; gap: 8px; align-items: baseline; font-size: 18px; counter-increment: st; }
.standings li::before { content: counter(st); font-family: var(--sans); font-size: 12px; color: var(--honey-deep); }
.st-score { font-family: var(--sans); font-weight: 700; color: var(--green); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0 12px; }
.stat-row div { padding: 8px 10px; border-radius: 10px; background: rgba(255, 252, 244, 0.7); border: 1px solid var(--paper-edge); }
.stat-row dt { font-family: var(--sans); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.stat-row dd { margin: 2px 0 0; font-size: 24px; }
.demo-facts { margin: 10px 0 0; font-family: var(--sans); font-size: calc(15px * var(--ui, 1)); line-height: 1.45; color: var(--honey-deep); text-align: center; }
.demo-cta { margin: 14px auto 0; width: min(440px, 100%); }
.demo-cta .mbtn { width: 100%; }
.badge-best { --cap: 13px; display: inline-block; margin: 0 0 10px; padding: 5px 22px; border-radius: 8px;
  background: url("./assets/ui/kit/accent-small-cap-l.webp") left / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/accent-small-cap-r.webp") right / var(--cap, 26px) 100% no-repeat, url("./assets/ui/kit/accent-small-mid.webp") var(--cap, 26px) 0 / calc(100% - 2 * var(--cap, 26px)) 100% no-repeat; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; animation: pop 0.6s var(--ease-back) both 0.3s; }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* Quick Round on a narrow phone (verifier N6): the golfer's name had 20 px beside the look picker and the Back / Tee off row sat
   below the fold. The picker drops under the name, and the row stays at the foot of the scrolling panel like the settings' actions. */
@media (max-width: 560px) {
  .player-row { grid-template-columns: 44px minmax(0, 1fr); }
  .player-row .opt { grid-column: 1 / -1; }
  .player-row > .mbtn { grid-column: 1 / -1; justify-self: end; }
  .quick-round .panel .confirm-row { position: sticky; bottom: 0; z-index: 1; margin: 12px -10px 0; padding: 10px 10px 4px; justify-content: stretch;
    background: url("./assets/ui/paper.webp") center / 512px repeat, #f7ecd0; background-blend-mode: multiply; box-shadow: 0 -8px 10px -4px rgba(120, 90, 40, 0.25); }
  .quick-round .confirm-row .mbtn { flex: 1; min-width: 0; padding-left: 8px; padding-right: 8px; }
  .quick-round .confirm-row .mbtn-label { white-space: nowrap; font-size: 16px; }
}
/* ---------------------------------------------------------------- small screens */
@media (max-width: 900px) {
  .course-cards { grid-template-columns: repeat(2, 1fr); }
  .qr-grid { grid-template-columns: 1fr; }
  .settings-actions { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
@media (min-height: 501px) and (max-height: 800px) {
  .menu-column { gap: 10px; }
  .menu-list { gap: 6px; }
  .menu-logo { width: min(320px, 80%); }
}
@media (max-height: 500px) {
  .panel { padding: 14px 18px 12px; max-height: calc(100vh - 20px); }
  .panel-title { font-size: 22px; }
  .mbtn { padding: 7px 12px; }
  .mbtn-label { font-size: 17px; }
  .menu-column { gap: 8px; width: min(660px, 78vw); }
  .menu-logo { width: min(240px, 40%); }
  .main-menu .menu-list { grid-template-columns: 1fr 1fr; }
  .mbtn-sub { font-size: 12px; }
  .course-cards { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .cc-text strong { font-size: 13px; }
}
/* Two Quick Round screens on a short window, a phone on its side (verifier Wave A r3, F3 and V2; measured at 844 x 390 touch).
   The card between holes: the panel's frame covered the lower part of "Next hole" (24 of its 44 px showed until the card
   was scrolled 32 px), so the button sits beside the title and the line, as the event card lays its board beside its
   lines: it is on screen whole when the card opens, for one golfer or four. The setup: "Tee off" took a 393 px scroll, so
   the Back / Tee off row stays at the foot of the scrolling panel (as it already does on a narrow screen). */
@media (max-height: 500px) {
  .hole-summary .panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 18px; align-items: start; }
  .hole-summary .panel > * { grid-column: 1 / -1; }
  .hole-summary .panel > .panel-title, .hole-summary .panel > .panel-sub { grid-column: 1; }
  .hole-summary .panel > .confirm-row { grid-column: 2; grid-row: 1 / span 2; margin: 0; align-self: center; }
  .quick-round .panel .confirm-row { position: sticky; bottom: 0; z-index: 1; margin: 8px -18px 0; padding: 8px 18px 2px;
    background: url("./assets/ui/paper.webp") center / 512px repeat, #f7ecd0; background-blend-mode: multiply; box-shadow: 0 -8px 10px -4px rgba(120, 90, 40, 0.25); }
}
.reduce-motion .title-art { animation: none; }

/* Touch screens (verifier Wave A r2, B2; measured on every demo screen at 844 x 390 with pointer: coarse by
   scripts/golden-hour-open-touch-floors.mjs): every control at least 44 x 44 CSS px, body text 16 px, the smallest
   label 12 px. Larger --ui sizes keep their own (max). */
@media (pointer: coarse) {
  .mbtn { min-height: 44px; }
  .opt-arrow { width: max(44px, calc(34px * var(--ui, 1))); height: max(44px, calc(34px * var(--ui, 1))); }
  .press-start { min-height: 44px; }
  .panel-sub { font-size: max(16px, calc(15px * var(--ui, 1))); }
  .cc-kind, .cc-lock { font-size: 12px; }
  /* Measured too: the golfer's name field 40 px tall; the controls page's table and notes and a picker's value
     (a sentence on the snap-timing picker) 13 and 14 px. */
  .pl-name { min-height: 44px; }
  .controls-table, .fine-print { font-size: max(16px, calc(13px * var(--ui, 1))); }
  .opt-value { font-size: max(16px, calc(14px * var(--ui, 1))); }
}
