:root {
  --bg: #0e1a10;
  --panel: rgba(18, 32, 20, 0.95);
  --panel-2: #213823;
  --panel-3: #2a472d;
  --line: #36583a;
  --text: #f1f7ea;
  --muted: #b3c7ad;
  --accent: #ffd257;
  --fern: #8fe06a;
  --warn: #ffb36b;
  --bad: #ff8a65;
  --radius: 12px;
  --header-h: 48px;
  /* The screen's safe areas (docs/PLATFORMS.md, "Layout"): under a notch, a
     cut-out, a rounded corner or the home indicator. The game stays inside
     them. The browser tests set these to try insets the emulators don't have. */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  /* The smallest text: 14 px on a desktop, 15 on a tablet and 13 on a phone. */
  --t-min: 14px;
  color-scheme: dark;
}

/* A tablet: a touch screen at least 600 px each way. */
@media (pointer: coarse) {
  :root {
    --t-min: 15px;
  }
}

/* A phone: a touch screen under 600 px one way or the other. */
@media (pointer: coarse) and (max-width: 599px), (pointer: coarse) and (max-height: 599px) {
  :root {
    --t-min: 13px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--accent);
}

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

.site-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.page {
  padding: 8px max(8px, var(--safe-r)) 40px max(8px, var(--safe-l));
}

/* ---------- Game layout ---------- */

/* No scrolling, zooming, selection or long-press menu mid-play
   (docs/PLATFORMS.md): the course and the HUD take no touch gestures
   (touch-action), the menus scroll (.overlay), and main.js prevents Safari's
   pinch over the course and the HUD, and the context menu. */
.game-root {
  position: relative;
  margin: 0 auto;
  width: 100%;
  background: #13241a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* The HUD's side padding, which the site's "Leave full screen" lines up with. */
  --hud-pl: 8px;
  --hud-pr: 8px;
}

.stage {
  position: relative;
  width: 100%;
  height: max(320px, calc(100vh - var(--header-h) - 20px));
  height: max(320px, calc(100dvh - var(--header-h) - 20px - var(--safe-t) - var(--safe-b)));
}

/* Full screen (the site's button takes #game-root there): the course fills
   the screen edge to edge, inside the safe areas. */
.game-root:fullscreen {
  max-width: none;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  border: 0;
  border-radius: 0;
}

.game-root:fullscreen .stage {
  height: 100%;
}

.stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ---------- HUD ---------- */

/* One row: the menu, the hole, the scores and the switches. A phone held
   upright puts the scores on a second row (see "Small screens"). */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px var(--hud-pr) 6px var(--hud-pl);
  background: linear-gradient(rgba(8, 16, 9, 0.8), rgba(8, 16, 9, 0.62));
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  touch-action: none;
}

/* Thumb-sized on every screen: 44 x 44 CSS px, 8 px apart. */
.hbtn {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

@media (hover: hover) {
  .hbtn:hover {
    background: rgba(255, 255, 255, 0.16);
  }
}

.hbtn svg {
  width: 22px;
  height: 22px;
  display: block;
}

.hbtn[aria-pressed='false'] {
  color: var(--muted);
}

.hud-hole {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.hud-hole b,
.hud-hole span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-hole b {
  font-size: max(15px, var(--t-min));
}

.hud-hole span {
  font-size: var(--t-min);
  color: var(--muted);
}

.hud-cells {
  flex: none;
  display: flex;
  gap: 6px;
}

.cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
  padding: 1px 8px 2px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
  line-height: 1.15;
}

.cell .lbl {
  font-size: var(--t-min);
  color: var(--muted);
}

.cell .val {
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cell.warn .val {
  color: var(--warn);
}

/* ---------- Tip and hole banner ---------- */

.tip {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 2;
  max-width: min(92%, 560px);
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(10, 20, 11, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: max(14px, var(--t-min));
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
}

.tip.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.banner {
  position: absolute;
  left: 50%;
  top: 30%;
  z-index: 2;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

.banner b {
  display: block;
  font-size: clamp(28px, 6vw, 46px);
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.35),
    0 0 20px rgba(0, 0, 0, 0.45);
}

.banner span {
  font-size: max(var(--t-min), clamp(14px, 2.6vw, 19px));
  font-weight: 700;
  color: #fff5d6;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

.banner.show {
  animation: banner 2s ease forwards;
}

@keyframes banner {
  0% {
    opacity: 0;
    transform: translate(-50%, -38%) scale(0.94);
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(1);
  }
}

/* ---------- Overlay and panels ---------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: manipulation;
  background: rgba(6, 12, 7, 0.28);
}

.overlay.show {
  display: flex;
}

.overlay.dim {
  background: rgba(6, 12, 7, 0.66);
}

.overlay.result {
  background: rgba(6, 12, 7, 0.4);
}

.panel {
  margin: auto;
  width: min(100%, 460px);
  padding: 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.wide-panel {
  width: min(100%, 780px);
  text-align: left;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 22px;
}

.head-stat {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.fine {
  margin: 6px 0 0;
  font-size: max(13px, var(--t-min));
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 11px;
  border: 1px solid #45704a;
  background: var(--panel-3);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

@media (hover: hover) {
  .btn:hover {
    filter: brightness(1.12);
  }
}

.btn.primary {
  border-color: #ffe39a;
  background: linear-gradient(180deg, #ffdc6e, #f0b43a);
  color: #2b1d05;
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
}

.btn.small {
  min-height: 44px;
  padding: 4px 14px;
  font-size: max(14px, var(--t-min));
}

button:focus-visible {
  outline: 3px solid #fff3b0;
  outline-offset: 2px;
}

.row-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.col-buttons {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}

.toggles {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

/* ---------- Title ---------- */

.title-panel {
  width: min(100%, 440px);
  background: rgba(14, 28, 16, 0.9);
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.logo-fern svg {
  width: 44px;
  height: 44px;
  display: block;
}

.logo h2 {
  margin: 0;
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1;
  color: #ffe9a3;
  text-shadow:
    0 3px 0 #3d6b2c,
    0 5px 14px rgba(0, 0, 0, 0.45);
}

.tagline {
  margin: 4px 0 0;
  color: var(--fern);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: max(12.5px, var(--t-min));
}

.totals {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.totals > span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.star-mark {
  color: var(--accent);
}

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.mbtn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 54px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) {
  .mbtn:hover {
    background: var(--panel-3);
  }
}

.mbtn.wide {
  grid-column: 1 / -1;
}

.mbtn b {
  font-size: 16px;
}

.mbtn span {
  font-size: var(--t-min);
  color: var(--muted);
}

.mbtn.primary {
  border-color: #ffe39a;
  background: linear-gradient(180deg, #ffdc6e, #f0b43a);
  color: #2b1d05;
}

.mbtn.primary span {
  color: #5a3e0a;
}

/* ---------- Stars and acorns ---------- */

.stars {
  display: inline-flex;
  gap: 1px;
  letter-spacing: 0;
}

.stars span {
  color: rgba(255, 255, 255, 0.2);
}

.stars span.on {
  color: var(--accent);
}

.result-panel .stars {
  font-size: 40px;
  line-height: 1.1;
  gap: 6px;
  margin: 4px 0 2px;
}

.stars.pop span.on {
  display: inline-block;
  animation: starpop 0.42s calc(0.26s + var(--i) * 0.19s) both;
}

@keyframes starpop {
  0% {
    transform: scale(0.2);
    opacity: 0;
  }
  70% {
    transform: scale(1.3);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.acorn-icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.18em;
}

.acorn-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.acorn-icon.off {
  opacity: 0.22;
  filter: grayscale(1);
}

/* ---------- Results ---------- */

.result-title {
  font-size: 34px !important;
  font-weight: 900;
  margin: 0 !important;
}

.result-title.ace,
.result-title.eagle {
  color: var(--accent);
  text-shadow: 0 0 18px rgba(255, 210, 87, 0.45);
}

.result-title.birdie {
  color: var(--fern);
}

.result-title.par {
  color: var(--text);
}

.result-title.bogey {
  color: var(--warn);
}

.result-title.double,
.result-title.over {
  color: var(--bad);
}

.result-sub {
  margin: 4px 0 2px;
  color: var(--muted);
  line-height: 1.4;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: max(13px, var(--t-min));
  font-weight: 700;
}

.chip.good {
  color: #10240d;
  background: var(--fern);
  border-color: #b9f59c;
}

.trail-line {
  margin: 8px 0 0;
  font-weight: 700;
}

.trail-line .up,
.trail-line.good {
  color: var(--fern);
}

.trail-line .down {
  color: var(--warn);
}

.unlocks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  text-align: left;
}

.unlock {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 210, 87, 0.1);
  border: 1px solid rgba(255, 210, 87, 0.35);
}

.unlock.ach {
  grid-template-columns: 1fr;
}

.unlock b {
  color: var(--accent);
}

.unlock span {
  font-size: max(13px, var(--t-min));
  color: var(--muted);
}

.unlock.ball .ball-icon {
  grid-row: span 2;
  width: 40px;
  height: 40px;
}

.scorecard-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.scorecard {
  border-collapse: collapse;
  margin: 0 auto;
  font-variant-numeric: tabular-nums;
  font-size: max(13px, var(--t-min));
}

.scorecard th,
.scorecard td {
  padding: 3px 6px;
  border: 1px solid var(--line);
  text-align: center;
  min-width: 24px;
}

.scorecard th {
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}

.scorecard tr:first-child td {
  color: var(--muted);
}

.scorecard .tot {
  font-weight: 800;
  white-space: nowrap;
}

.scorecard .sc.ace,
.scorecard .sc.eagle {
  background: rgba(255, 210, 87, 0.3);
  font-weight: 800;
}

.scorecard .sc.birdie {
  background: rgba(143, 224, 106, 0.28);
  font-weight: 800;
}

.scorecard .sc.bogey {
  background: rgba(255, 179, 107, 0.18);
}

.scorecard .sc.double {
  background: rgba(255, 138, 101, 0.28);
}

/* ---------- Courses, holes, balls, achievements ---------- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 132px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(160deg, var(--turf), var(--edge));
  color: #fff;
  text-align: left;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.course-card b {
  font-size: 18px;
}

.course-card .blurb {
  font-size: max(13px, var(--t-min));
  opacity: 0.92;
}

.course-num {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 26px;
  font-weight: 900;
  opacity: 0.35;
}

.course-stats {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: auto;
  font-size: max(13px, var(--t-min));
  font-weight: 700;
}

.course-card.locked {
  cursor: default;
  filter: grayscale(0.75) brightness(0.62);
}

.lock-text {
  margin-top: auto;
  font-size: max(13px, var(--t-min));
  font-weight: 700;
}

.round-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.round-row .fine {
  margin: 0;
}

.hole-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hole-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 10px 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) {
  .hole-tile:hover {
    background: var(--panel-3);
  }
}

.hole-tile b {
  max-width: 100%;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hole-num {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 20px;
  font-weight: 900;
  opacity: 0.3;
}

.hole-par {
  font-size: var(--t-min);
  color: var(--muted);
}

.hole-marks {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.hole-tile.locked {
  cursor: default;
  opacity: 0.42;
}

.ball-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}

.ball-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.ball-tile .ball-icon {
  width: 56px;
  height: 56px;
}

.ball-tile span {
  font-size: var(--t-min);
  color: var(--muted);
}

.ball-tile.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.ball-tile.locked {
  cursor: default;
}

.ball-tile.locked .ball-icon {
  filter: grayscale(1) brightness(0.45);
}

.ach-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}

.ach {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  opacity: 0.6;
}

.ach b {
  font-size: max(14px, var(--t-min));
}

.ach span {
  font-size: var(--t-min);
  color: var(--muted);
}

.ach.done {
  opacity: 1;
  border-color: rgba(255, 210, 87, 0.55);
}

.ach.done b::before {
  content: '★ ';
  color: var(--accent);
}

.stats-line {
  margin-top: 12px;
  line-height: 1.5;
}

.pause-panel {
  width: min(100%, 380px);
}

/* ---------- Below the game ---------- */

.ad-slot {
  max-width: 970px;
  margin: 12px auto 0;
  min-height: 0;
}

.ad-slot[data-filled='true'] {
  min-height: 90px;
}

.about {
  max-width: 820px;
  margin: 24px auto 0;
  padding: 0 8px;
  color: var(--muted);
  line-height: 1.55;
}

.about h1,
.about h2 {
  color: var(--text);
}

kbd {
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.9em;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .page {
    padding: 4px var(--safe-r) 30px var(--safe-l);
  }
  .game-root {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .hole-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel {
    padding: 14px 12px 12px;
  }
}

/* A phone held upright: the hole and the buttons on the first row, the
   scores across the second, so every control keeps its 44 px and every
   label its size. */
@media (max-width: 599px) {
  .hud-hole {
    order: 1;
    flex: 1 0 100%;
  }
  .hud-cells {
    order: 2;
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cell {
    flex-direction: row;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    padding: 2px 6px;
  }
  .cell .val {
    font-size: 17px;
  }
}

/* A short, narrow landscape phone also needs the name below its toolbar,
   especially when a notch removes space at both sides. Scores still fit
   beside the controls here, so this needs only two rows. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  .hud-hole {
    order: 1;
    flex: 1 0 100%;
  }
}

.help-panel {
  text-align: left;
}
.help-panel p {
  line-height: 1.45;
}

@media (max-width: 420px) {
  .logo h2 {
    font-size: 38px;
  }
}

@media (max-width: 340px) {
  #btn-music {
    display: none;
  }
}

/* Landscape phones: the stage fills the screen once the game is scrolled to
   the top (the game does that when a hole starts, after a turn to landscape
   and when full screen ends). Its top then meets the screen's rounded
   corners, which the HUD's buttons keep 24 px from, the page's 8 px and the
   HUD's 16 px. */
@media (orientation: landscape) and (max-height: 500px) {
  .page {
    padding-top: 0;
    padding-left: max(8px, var(--safe-l));
    padding-right: max(8px, var(--safe-r));
  }
  .game-root {
    border-radius: 0;
    border-width: 0;
  }
  .stage {
    height: calc(100vh - 2px);
    height: calc(100dvh - 2px - var(--safe-t) - var(--safe-b));
    min-height: 240px;
  }
  .menu-grid {
    grid-template-columns: 1fr 1fr 1fr;
    margin-top: 10px;
  }
  .mbtn.wide {
    grid-column: span 3;
  }
  /* The title in two short rows above the menu, so it fits below the site's
     header without scrolling. */
  .title-panel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      'logo totals toggles'
      'tag totals toggles'
      'menu menu menu';
    align-items: center;
    column-gap: 16px;
    width: min(100%, 620px);
    padding: 10px 14px;
  }
  .title-panel .logo {
    grid-area: logo;
    justify-content: flex-start;
  }
  .title-panel .tagline {
    grid-area: tag;
    margin: 2px 0 0;
    text-align: left;
  }
  .title-panel .totals {
    grid-area: totals;
    margin: 0;
  }
  .title-panel .toggles {
    grid-area: toggles;
    margin: 0;
  }
  .title-panel .menu-grid {
    grid-area: menu;
  }
  .logo h2 {
    font-size: 32px;
  }
  .logo-fern svg {
    width: 34px;
    height: 34px;
  }
  .panel {
    padding: 12px 14px;
  }
  /* The pause card's buttons two by two, under its note. */
  .col-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .col-buttons .fine {
    order: -1;
    grid-column: 1 / -1;
    margin: 0;
  }
  .result-panel .stars {
    font-size: 30px;
  }
  .result-title {
    font-size: 28px !important;
  }
}

/* ---------- Touch screens (docs/PLATFORMS.md, "Controls for each format") ----------
   The HUD's buttons sit 16 px in from the screen's edges, so a thumb on one
   never starts the system's edge gestures. Any touch screen counts, so a
   touch laptop has them from the start. */
@media (any-pointer: coarse) {
  .game-root {
    --hud-pl: 16px;
    --hud-pr: 16px;
  }
}

/* ---------- Full screen ----------
   The site's "Leave full screen" joins the HUD at its right end, where the
   HUD keeps a slot for it, instead of the top middle, where the HUD has the
   hole's name or its scores. With no HUD the menus start below it. On a touch
   screen the HUD meets the screen's rounded top corners: its buttons keep
   24 px from them. */
.game-root:fullscreen .hud::after {
  content: '';
  flex: none;
  width: 44px;
  height: 44px;
}

.game-root .am-fs-exit {
  top: calc(var(--safe-t) + 6px);
  left: auto;
  right: calc(var(--safe-r) + var(--hud-pr));
}

.game-root:fullscreen .overlay {
  padding-top: 58px;
}

@media (any-pointer: coarse) {
  .game-root:fullscreen {
    --hud-pl: max(16px, calc(24px - var(--safe-l)));
    --hud-pr: max(16px, calc(24px - var(--safe-r)));
  }
}

@media (prefers-reduced-motion: reduce) {
  .banner.show {
    animation: banner-fade 1.6s ease forwards;
  }
  .tip {
    transition: none;
  }
}

@keyframes banner-fade {
  0%, 100% { opacity: 0; }
  14%, 72% { opacity: 1; }
}
