.golf-hero {
  --hero-inset: clamp(28px, 3vw, 70px);
  --hero-title-size: clamp(76px, min(13vw, 23.5svh), 232px);
  --hero-top: clamp(80px, 13.5svh, 145px);
  min-height: 540px;
}

.golf-intro {
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
}

.golf-heading {
  position: absolute;
  top: var(--hero-top);
  left: var(--hero-inset);
}

.golf-hero .golf-title {
  display: block;
  position: relative;
  inset: auto;
  width: max-content;
  max-width: none;
  margin: 0;
  font-weight: 400;
  font-size: var(--hero-title-size);
  line-height: .9;
  letter-spacing: .022em;
  opacity: 0;
}

.golf-hero .golf-title > span {
  display: block;
  padding-right: .025em;
  white-space: nowrap;
}

.golf-tee-prompt {
  position: absolute;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 2px;
  background: #dcf13a;
  color: #183a22;
  box-shadow: 0 2px 7px #0a2f2266;
  font: 700 10px/1.25 "Microsoft YaHei", sans-serif;
  letter-spacing: .03em;
  pointer-events: none;
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: var(--tee-prompt-opacity, 1);
}

.golf-hero button,
.golf-hero .golf-settings summary,
.golf-scroll-cue {
  touch-action: manipulation;
}

.golf-hero #golf-ball-control { touch-action: none; }

.golf-hero .golf-hole-state {
  position: static;
  display: grid;
  gap: 6px;
  max-width: none;
  margin-top: 13px;
  color: #eeecd8;
  text-shadow: 0 1px 4px #002d20;
  font: 13px/1.25 Arial, "Microsoft YaHei", sans-serif;
}

.golf-round, .golf-hole-meta { display: flex; align-items: center; gap: 10px; }
.golf-round { font-size: 14px; font-weight: 700; }
.golf-round b { font: 400 18px/1 Impact, "Arial Narrow", sans-serif; }
.golf-round mark {
  padding: 4px 7px;
  font-size: 13px;
  font-weight: 750;
  text-shadow: none;
}
.golf-hole-meta { font-size: 12px; color: #eeecd8; }
.golf-hole-meta span + span { border-left: 1px solid #eef0db55; padding-left: 10px; }

.golf-hero .caddie-card .golf-hole-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 5px 9px;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid #78816b42;
  background: none;
  color: #173b2b;
  text-shadow: none;
  transform: none;
}
.caddie-card .golf-hole-meta {
  order: -1;
  gap: 5px;
  color: #315744;
  font-size: 10px;
}
.caddie-card .golf-hole-meta span + span { border-color: #36574742; padding-left: 5px; }
.caddie-card .golf-round { gap: 5px; font-size: 10px; }
.caddie-card :is(.golf-round, .golf-hole-meta) { white-space: nowrap; }
.caddie-card .golf-round b { font-size: 13px; }
.caddie-card .golf-round mark { padding: 3px 5px; font-size: 11px; }

.golf-hero .caddie-card {
  z-index: auto;
  inset: auto auto 38px var(--hero-inset);
  box-sizing: border-box;
  width: clamp(302px, 25vw, 374px);
  max-width: none;
  padding: 10px 15px;
  border-radius: 5px;
  box-shadow: 0 10px 26px #002a2045;
  color: #173b2b;
  pointer-events: auto;
}

.caddie-card > header { padding-bottom: 5px; }
.caddie-card > header h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font: 750 12px/1.3 Arial, "Microsoft YaHei", sans-serif;
}
.caddie-card > header h2 i { margin-right: 1px; }
.caddie-card > header #caddie-entry {
  min-height: 30px;
  padding: 4px 0;
  color: #29563a;
  font-size: 12px;
  white-space: nowrap;
}
#caddie-entry:hover { color: #0b3524; border-color: currentColor; }
.golf-edition.golf-caddie-visible .assistant-launcher { visibility: hidden; }

.golf-caddie-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1.12fr;
  margin: 0;
  border-bottom: 1px solid #78816b42;
}
.golf-caddie-stats > div { min-width: 0; padding: 5px 9px; border-right: 1px solid #78816b42; }
.golf-caddie-stats > div:first-child { padding-left: 0; }
.golf-caddie-stats > div:last-child { border: 0; padding-right: 0; }
.golf-caddie-stats dt { color: #4d6253; font-size: 11px; }
.golf-caddie-stats dd { margin: 3px 0 0; font-size: 15px; font-weight: 700; line-height: 1.35; }
.golf-caddie-stats dd b { font: 400 19px/1.05 Impact, "Arial Narrow", sans-serif; }
.golf-caddie-stats dd small { margin-left: 4px; font-size: 10px; }

.golf-welcome {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 8px;
  padding-top: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.golf-welcome > span { margin-left: auto; color: #4c604e; font-size: 11px; white-space: nowrap; }
#golf-visit-time { margin-left: 3px; font-variant-numeric: tabular-nums; font-weight: 700; color: #24583f; }
.golf-hero .caddie-card #caddie-advice { margin: 0; font: inherit; font-weight: 700; }
.golf-welcome:has(#caddie-advice:not(:empty)) #golf-welcome-title { display: none; }

.golf-card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.golf-card-actions :is(#golf-hit, #golf-next-hole) {
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 12px;
  white-space: nowrap;
}
.golf-in-cup .golf-card-actions { justify-content: flex-end; }
.golf-in-cup .golf-card-actions :is(.golf-settings, #golf-hit) { display: none; }
.golf-card-actions #golf-after-hole { border: 0; padding: 0; }

.golf-settings summary {
  position: relative;
  width: max-content;
  padding: 9px 15px 9px 0;
  list-style: none;
  color: #405847;
  font-size: 12px;
  cursor: pointer;
}
.golf-settings summary::-webkit-details-marker { display: none; }
.golf-settings summary::after {
  position: absolute;
  right: 3px;
  top: 13px;
  width: 5px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
  content: "";
}
.golf-settings[open] summary::after { transform: translateY(3px) rotate(225deg); }
.golf-settings .golf-controls {
  position: absolute;
  inset: auto 0 calc(100% + 7px);
  padding: 12px;
  border-radius: 5px;
  background: #eeecd8 var(--golf-paper);
  box-shadow: 0 5px 24px #002a2055;
}
.golf-settings .club-selector button { padding: 6px 3px; font-size: 11px; }
.golf-settings .golf-power-row label { font-size: 11px; }
.golf-shot-context { display: flex; justify-content: flex-end; margin-top: 10px; font-size: 11px; }
.golf-shot-context button {
  border: 0;
  border-bottom: 1px solid #40584772;
  padding: 2px 0;
  background: none;
  color: inherit;
  font: inherit;
}

.golf-hero .shot-feedback { z-index: 8; }
.golf-hero .shot-feedback:is([data-surface=water], [data-surface=out]) { left: 66%; top: 31%; }
.no-golf-canvas .golf-intro { display: none; }

.golf-hero[data-golf-entry]:not([data-golf-entry="hud"]) .golf-intro,
.golf-hero[data-golf-entry]:not([data-golf-entry="hud"]) :is(.golf-bottom-controls, .golf-rules-toggle, .golf-scroll-cue),
.golf-edition:has(.golf-hero[data-golf-entry]:not([data-golf-entry="hud"])) :is(.golf-header, .assistant-launcher) {
  visibility: hidden;
}

.golf-hero[data-golf-entry="hud"] .golf-hole-state,
.golf-edition:has([data-golf-entry="hud"]) .golf-header {
  animation: golf-hud-stamp 300ms cubic-bezier(.25,.75,.25,1) both;
}

.golf-hero[data-golf-entry="hud"] .caddie-card {
  animation: golf-hud-stamp 320ms 150ms cubic-bezier(.25,.75,.25,1) both;
}

.golf-hero[data-golf-entry="hud"] :is(.golf-bottom-controls, .golf-rules-toggle, .golf-scroll-cue),
.golf-edition:has([data-golf-entry="hud"]) .assistant-launcher {
  animation: golf-hud-stamp 290ms 290ms cubic-bezier(.25,.75,.25,1) both;
}

@keyframes golf-hud-stamp {
  0% { opacity: 0; scale: 1.045; filter: blur(.6px); }
  27% { opacity: 1; scale: .987; filter: blur(0); }
  61% { scale: 1.006; }
  100% { opacity: 1; scale: 1; }
}

@media (min-width: 761px) and (max-height: 660px) {
  .golf-hero {
    --hero-title-size: clamp(72px, min(13vw, 19svh), 126px);
    --hero-top: 78px;
  }
  .golf-edition .club-intro::before { height: 64px; }
}

@media (max-width: 760px) {
  .golf-hero {
    --hero-inset: 6%;
    --hero-title-size: clamp(49px, min(17.2vw, 10.6svh), 94px);
    --hero-top: clamp(65px, 9.8svh, 90px);
  }
  .golf-hero .golf-title { visibility: inherit; }
  .golf-hero .golf-hole-state { gap: 5px; margin-top: 8px; }
  .golf-overview .golf-heading .golf-hole-state {
    transform: translateY(calc(-1.8 * var(--hero-title-size) - 8px));
  }
  .golf-round { font-size: 12px; }
  .golf-round mark { font-size: 11px; padding: 3px 6px; }
  .golf-hole-meta { font-size: 11px; }
  .golf-hero .caddie-card { bottom: 102px; width: min(88%, 355px); padding: 8px 13px; }
  .golf-hero .golf-bottom-controls, .golf-hero .golf-rules-toggle { bottom: 59px; }
  .golf-hero .golf-scroll-cue { bottom: 16px; }
  .golf-hero .shot-feedback:is([data-surface=water], [data-surface=out]) { left: 50%; top: 43%; }
  .golf-edition .club-intro::before {
    height: 18px;
    background: linear-gradient(177deg, transparent 0 47%, #dcf13a 47% 65%, #eeecd8 65%);
  }
}

@media (max-width: 760px) and (max-height: 670px) {
  .golf-hero .caddie-card { bottom: 78px; }
  .golf-hero .golf-bottom-controls, .golf-hero .golf-rules-toggle { bottom: 39px; }
  .golf-hero .golf-scroll-cue { bottom: 13px; width: 28px; height: 28px; font-size: 18px; }
  .golf-welcome { padding-top: 6px; }
}

@media (max-height: 539px) {
  .golf-hero {
    --hero-top: 65px;
    --hero-title-size: clamp(34px, min(13.5vw, 12svh), 66px);
    min-height: 410px;
  }
  .golf-hero .caddie-card { bottom: 23px; }
  .golf-hero .golf-bottom-controls, .golf-hero .golf-rules-toggle { bottom: 55px; }
  .golf-hero .golf-scroll-cue { bottom: 10px; width: 28px; height: 28px; font-size: 18px; }
  .golf-edition .club-intro::before { height: 12px; }
}

@media (max-width: 760px) and (max-height: 539px) {
  .golf-hero .caddie-card { bottom: 45px; padding-block: 5px; }
  .golf-hero .golf-bottom-controls, .golf-hero .golf-rules-toggle { bottom: 8px; }
  .golf-hero .golf-scroll-cue { left: 61%; }
}

@media (prefers-reduced-motion: reduce) {
  .golf-hero[data-golf-entry="hud"] :is(.golf-hole-state, .caddie-card, .golf-bottom-controls, .golf-rules-toggle, .golf-scroll-cue),
  .golf-edition:has([data-golf-entry="hud"]) :is(.golf-header, .assistant-launcher) {
    animation: none;
  }
}
