:root {
  --paper: #f8f7f0;
  --cream: #fffef9;
  --forest: #294e40;
  --ink: #30463a;
  --muted: #75816c;
  --line: #dde3d2;
  --sage: #edf0e5;
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  color: var(--ink);
  background: #b6c68e;
  font: 13px var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button,
input,
canvas {
  outline-offset: 3px;
}
:focus-visible {
  outline: 3px solid #789857;
}
svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.svg-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
#game {
  position: relative;
  width: 100%;
  height: 100dvh;
  isolation: isolate;
  --play-top: 130px;
  --play-center-x: 50%;
  --play-center-y: 50%;
  --play-height: 70dvh;
}
.course-scene {
  position: absolute;
  inset: 0;
}
#course {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.surface {
  background: #fffef1ed;
  border: 1px solid #ffffffa6;
  border-radius: 16px;
  box-shadow: 0 5px 24px #243f2920;
}
.game-header {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: start;
  pointer-events: none;
  z-index: 10;
}
.game-header > * {
  pointer-events: auto;
}
.course-info {
  width: fit-content;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 17px;
}
.wordmark {
  font: 500 20px var(--serif);
  letter-spacing: -0.7px;
}
.hole-heading h2 {
  font: 500 17px var(--serif);
  margin: 0;
}
.course-badges {
  display: flex;
  gap: 10px;
  font-size: 10px;
  color: var(--muted);
}
.game-actions {
  display: flex;
  padding: 4px;
  gap: 2px;
}
.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0;
}
.icon-button:hover:not(:disabled) {
  background: #e4ebd7;
}
.game-actions button > span {
  display: none;
}
.game-actions button[aria-pressed="true"] {
  background: #dfe9cc;
}
.editor-toggle {
  width: auto;
  padding: 0 10px;
  color: #6e7f4c;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.drone-toggle {
  width: auto;
  padding: 0 9px;
  color: #6e7f4c;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.editor-toggle > span {
  display: inline !important;
}
.editor-toggle[aria-pressed="true"] {
  background: #dfe9cc;
}
#editor-hint {
  display: block;
  margin-top: 7px;
  color: #9b7a3a;
}
.editor-action {
  width: auto;
  padding: 0 8px;
  color: #6e7f4c;
  font-size: 9px;
  text-transform: uppercase;
}
.editor-action[hidden] {
  display: none;
}
.course-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 340px;
  max-width: 100%;
  gap: 8px 16px;
  padding: 11px 18px;
}
.difficulty-control {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  min-width: 0;
}
.difficulty-control .control-label {
  flex-direction: row;
  font-size: 10px;
}
.difficulty-detail {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  color: var(--muted);
}
.stat-label {
  display: block;
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 4px;
}
.status-item strong {
  display: block;
  font: 500 22px/1 var(--serif);
}
.status-item small {
  font: 10px var(--sans);
  color: var(--muted);
}
.lie-status strong {
  font: 500 12px/22px var(--sans);
}
.scene-topline,
.flight-announcement,
.field-note {
  background: var(--cream);
  border-radius: 8px;
}
.scene-topline {
  position: absolute;
  top: var(--play-top);
  left: max(24px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  color: #344f34;
  padding: 4px 8px;
}
.scene-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
}
.wind-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
}
.wind-chip svg {
  width: 16px;
  height: 16px;
}
.flight-announcement {
  position: absolute;
  top: calc(var(--play-top) + 26px);
  left: 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  padding: 6px 10px;
  pointer-events: none;
}
.little-spinner {
  width: 12px;
  height: 12px;
  border: 1px solid #a5b28a;
  border-top-color: var(--forest);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.planning-column {
  --hud-dock: right;
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 316px;
  padding: 18px;
  max-height: calc(100% - 150px);
  overflow: auto;
  overscroll-behavior: contain;
  z-index: 8;
  scrollbar-width: thin;
}
.selected-disc-main {
  display: flex;
  align-items: center;
  gap: 11px;
}
.disc-art {
  --disc-color: #d4a1a2;
  width: 59px;
  height: 59px;
  flex-shrink: 0;
  border-radius: 50%;
  color: #794e506b;
  background: var(--disc-color);
  border: 3px solid #ffffff40;
  box-shadow:
    inset 0 0 0 1px #68523016,
    inset 0 0 0 5px #ffffff1f,
    inset 0 0 0 6px #70433620,
    2px 6px 10px #694d3014;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-16deg);
}
.disc-art::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.35;
}
.disc-art svg {
  width: 27px;
  height: 27px;
  stroke-width: 1.2;
  color: #473a32;
  opacity: 0.65;
}
.stamp {
  font-size: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #493f33;
}
.disc-rim-label {
  position: absolute;
  bottom: 3px;
  font-size: 3px;
  letter-spacing: 0.5px;
}
.disc-art.bounce {
  animation: select-bounce 0.3s ease-out;
}
.disc-heading {
  min-width: 0;
}
.disc-stability {
  font-size: 8px;
  letter-spacing: 0.8px;
  color: #62794f;
}
.disc-heading h3 {
  font: 500 25px/1.2 var(--serif);
  margin: 1px 0;
}
#disc-category {
  font-size: 9px;
  color: var(--muted);
}
.bag-button {
  margin-left: auto;
  border: 1px solid #d5dfc5;
  background: #edf2e2;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px;
  font-size: 10px;
  white-space: nowrap;
}
.bag-button small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}
.bag-button:hover:not(:disabled) {
  background: #dfe9cc;
}
.disc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 13px;
}
.disc-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.disc-stat strong {
  font-size: 14px;
  font-weight: 500;
}
.disc-stat > span {
  font-size: 8px;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.disc-description {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  margin: 12px 0;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 12px;
}
.panel-heading h2 {
  font: 500 18px var(--serif);
  margin: 10px 0;
}
.panel-heading .icon-button {
  width: 36px;
  height: 36px;
}
.panel-heading svg {
  width: 16px;
  height: 16px;
}
fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.throw-style-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  gap: 4px;
  background: #e9eedf;
  border-radius: 9px;
}
.throw-style-options label {
  position: relative;
  cursor: pointer;
}
.throw-style-options input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.throw-style-options label > span {
  display: grid;
  place-items: center;
  min-height: 33px;
  border-radius: 7px;
  font-size: 11px;
}
.throw-style-options input:checked + span {
  background: var(--cream);
  box-shadow: 0 1px 4px #294e4018;
}
.throw-style-options input:focus-visible + span {
  outline: 3px solid #789857;
}
fieldset:disabled {
  opacity: 0.6;
}
#style-description {
  font-size: 9px;
  color: var(--muted);
  margin: 7px 0 0;
}
.disc-tuning {
  margin-top: 13px;
  padding: 10px 12px 9px;
  border: 1px solid #d7dfcf;
  border-radius: 11px;
  background: linear-gradient(135deg, #f4f6ea, #e7eddd);
}
.disc-tuning-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--forest);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.disc-tuning-reset {
  border: 0;
  padding: 2px 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.disc-tuning-reset:hover {
  color: var(--forest);
}
.disc-tuning-reset:focus-visible,
.disc-tuning-handle:focus-visible {
  outline: 2px solid #789857;
  outline-offset: 2px;
}
.disc-tuning-stage {
  position: relative;
  height: 112px;
  margin: 4px 20px 0;
  perspective: 420px;
  touch-action: none;
}
.disc-tuning-stage::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 20px;
  bottom: 14px;
  border-left: 1px dashed #9caf8f;
  transform: translateX(-50%);
}
.disc-tuning-travel {
  position: absolute;
  top: 0;
  left: 50%;
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.16em;
  transform: translateX(-50%);
}
.disc-tuning-disc {
  --disc-color: #e1a779;
  position: absolute;
  left: 50%;
  top: 59%;
  width: 86px;
  height: 64px;
  border: 5px solid color-mix(in srgb, var(--disc-color), #fff 28%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 43% 37%, #ffffff66 0 5%, transparent 6%),
    radial-gradient(circle, transparent 0 47%, #ffffff70 48% 51%, transparent 52%),
    var(--disc-color);
  box-shadow: 0 9px 13px #294e4030, inset 0 0 0 2px #ffffff55;
  transform: translate(-50%, -50%) rotateZ(calc(var(--hyzer-angle) * 1deg)) rotateX(calc(var(--nose-angle) * 1deg)) scaleY(var(--nose-scale));
  transform-style: preserve-3d;
  transition: transform 100ms ease-out;
  pointer-events: none;
}
.disc-tuning-disc::after {
  content: "";
  position: absolute;
  inset: 13px;
  border: 1px solid #ffffff80;
  border-radius: 50%;
}
.disc-tuning-disc-mark {
  position: absolute;
  top: 5px;
  left: 50%;
  width: 3px;
  height: 11px;
  border-radius: 3px;
  background: #fff9;
  transform: translateX(-50%);
}
.disc-tuning-handle {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid #a7b997;
  border-radius: 50%;
  color: var(--forest);
  background: #f8faef;
  box-shadow: 0 2px 5px #294e4020;
  font-size: 15px;
  line-height: 1;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}
.disc-tuning-handle:hover {
  border-color: var(--forest);
  background: #fff;
}
.disc-tuning-nose {
  left: 50%;
  top: 25px;
  transform: translateX(-50%);
}
.disc-tuning-hyzer-left {
  left: 0;
  top: 56%;
  transform: translateY(-50%);
}
.disc-tuning-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: -1px;
  color: var(--forest);
  font-size: 10px;
  text-align: center;
}
.disc-tuning-readout output {
  white-space: nowrap;
}
.disc-tuning-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}
.control-group {
  margin-top: 13px;
  min-width: 0;
}
.control-label {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  font-size: 11px;
}
.control-label output {
  color: #4e693d;
  white-space: nowrap;
}
.control-label output span {
  font-size: 9px;
  color: var(--muted);
}
input[type="range"] {
  --progress: 50%;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 28px;
  display: block;
  margin: 0;
  border: 0;
  background: linear-gradient(
      to right,
      #7c9563 var(--progress),
      #dfe5d3 var(--progress)
    )
    center / 100% 4px no-repeat;
  cursor: pointer;
  touch-action: none;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 3px solid var(--cream);
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 0 1px #8b9e77;
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid var(--cream);
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 0 1px #8b9e77;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: var(--muted);
}
.preview-key {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  color: #587149;
  margin: 13px 0 9px;
}
#preview-range {
  white-space: nowrap;
  font-weight: 600;
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 11px 16px;
  background: var(--forest);
  color: #f5f6e9;
  font-size: 12px;
}
.primary-button:hover:not(:disabled) {
  background: #3d6550;
}
.throw-button {
  width: 100%;
  justify-content: flex-start;
}
.key-hint {
  margin-left: auto;
  border: 1px solid #89a18266;
  border-radius: 4px;
  padding: 3px 5px;
  color: #c5d2b8;
  font-size: 8px;
  letter-spacing: 1px;
}
.throw-footnote {
  text-align: center;
  font: italic 10px var(--serif);
  color: var(--muted);
  margin: 9px 0 0;
}
.field-note {
  position: absolute;
  left: max(24px, env(safe-area-inset-left));
  top: calc(var(--play-top) + 30px);
  width: min(360px, calc(100% - 400px));
  pointer-events: none;
  font-size: 11px;
  padding: 10px;
}
.field-note strong {
  font-weight: 500;
}
.field-note p {
  font-size: 10px;
  line-height: 1.5;
  color: #67765a;
  margin: 5px 0;
}
#game[data-busy="true"] .field-note {
  visibility: hidden;
}
#aim-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: #67765a;
}
#aim-hint svg {
  width: 13px;
  height: 13px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.success-overlay {
  position: absolute;
  z-index: 20;
  left: var(--play-center-x);
  top: calc(var(--play-top) + 8px);
  transform: translateX(-50%);
  width: min(355px, calc(100% - 24px));
  max-height: calc(var(--play-height) * 0.5 - 16px);
  overflow: auto;
  padding: 20px;
  border-radius: 20px;
  text-align: center;
  background: #fffdf1fa;
  box-shadow: 0 16px 55px #31493730;
}
.success-badge {
  margin: 0 auto 12px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9efd4;
  color: #7d9657;
}
.success-overlay h2 {
  font: 400 30px/1.15 var(--serif);
  margin: 12px 0;
}
.success-overlay p {
  color: var(--muted);
  font-size: 12px;
}
.success-overlay .primary-button {
  margin: 18px auto 0;
}
dialog {
  border: 1px solid #e0e5d5;
  box-shadow: 0 24px 100px #172f3740;
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  padding: 26px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 32px);
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #183b326b;
  backdrop-filter: blur(5px);
}
dialog[open] {
  animation: dialog-in 0.2s ease-out;
}
.bag-dialog {
  width: 775px;
}
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.dialog-heading h2 {
  font: 400 30px var(--serif);
  margin: 8px 0 0;
}
.dialog-heading h2 > span {
  font: 11px var(--sans);
  color: var(--muted);
  display: block;
  margin-top: 7px;
}
.close-dialog.icon-button {
  background: #e9eddf;
  flex-shrink: 0;
}
.bag-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 10px 12px;
}
.bag-legend > span {
  font-size: 8px;
  color: var(--muted);
}
.bag-legend b {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #567444;
  margin-top: 4px;
}
.bag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.bag-disc {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 13px 11px;
  border: 1px solid #dce3cf;
  border-radius: 12px;
  background: #fffdf6;
}
.bag-disc:hover {
  background: #eef3e3;
  border-color: #8ea776;
}
.bag-disc[aria-pressed="true"] {
  border-color: #718d55;
  box-shadow: 0 0 0 1px #718d55;
  background: #edf2e2;
}
.bag-disc .disc-art {
  width: 46px;
  height: 46px;
  border-width: 2px;
}
.bag-disc .disc-art::after {
  inset: 6px;
}
.bag-disc .disc-art svg {
  width: 21px;
  height: 21px;
}
.bag-disc .disc-rim-label {
  display: none;
}
.bag-disc strong {
  display: block;
  font: 500 17px var(--serif);
  margin-bottom: 3px;
}
.bag-category {
  display: block;
  font-size: 9px;
  color: var(--muted);
}
.bag-profile {
  display: block;
  font-size: 8px;
  color: var(--muted);
  margin-top: 5px;
}
.bag-selected-mark {
  position: absolute;
  right: 6px;
  top: 5px;
  color: #65804d;
}
.bag-selected-mark svg {
  width: 13px;
  height: 13px;
}
.bag-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: var(--muted);
  padding-top: 18px;
}
.help-dialog {
  width: 530px;
  padding: 30px;
}
.help-dialog > .close-dialog {
  position: absolute;
  right: 18px;
  top: 18px;
}
.help-illustration {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e8efdb;
  margin-bottom: 16px;
  color: #7d9862;
}
.help-dialog h2 {
  font: 400 30px/1.15 var(--serif);
  margin: 12px 0;
}
.help-dialog > p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.help-steps {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}
.help-steps li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 18px;
}
.help-steps li > span {
  font: 400 17px var(--serif);
  padding: 7px;
  border-radius: 8px;
  background: #e9eedc;
}
.help-steps h3 {
  font-size: 13px;
  margin: 2px 0 5px;
}
.help-steps p {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}
.help-tip {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 10px;
  background: #edf0e0;
  padding: 13px;
  font-size: 11px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.help-dialog > .primary-button {
  width: 100%;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes select-bounce {
  0% {
    transform: rotate(-16deg) scale(0.9);
  }
  60% {
    transform: rotate(-10deg) scale(1.05);
  }
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 1050px) {
  .course-info {
    gap: 10px;
  }
  .wordmark {
    display: none;
  }
}
@media (max-height: 840px), (max-width: 700px) {
  .planning-column {
    padding: 12px;
  }
  .disc-art {
    width: 45px;
    height: 45px;
  }
  .disc-art::after {
    inset: 6px;
  }
  .disc-art svg {
    width: 22px;
    height: 22px;
  }
  .disc-rim-label {
    display: none;
  }
  .disc-heading h3 {
    font-size: 21px;
  }
  .disc-stats {
    margin-top: 8px;
  }
  .disc-stat {
    flex-direction: row;
    align-items: baseline;
    gap: 5px;
  }
  .disc-stat strong {
    font-size: 12px;
  }
  .disc-stat > span {
    font-size: 7px;
  }
  .disc-description,
  .throw-footnote,
  .range-labels {
    display: none;
  }
  .panel-heading {
    border: 0;
    margin: 4px 0;
  }
  .panel-heading h2 {
    font-size: 15px;
    margin: 0;
  }
  .panel-heading .icon-button {
    height: 30px;
  }
  #throw-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
  }
  .throw-style-control {
    grid-column: 1 / -1;
  }
  #style-description {
    margin: 5px 0 0;
    font-size: 8px;
  }
  .control-group {
    margin-top: 7px;
  }
  .control-label {
    flex-direction: row;
    gap: 3px;
    font-size: 10px;
  }
  .control-label output,
  .control-label output span {
    font-size: 9px;
  }
  .preview-key {
    margin: 5px 0 8px;
  }
  .key-hint {
    display: none;
  }
  .field-note {
    font-size: 10px;
    padding: 10px;
  }
  .field-note p,
  #aim-hint {
    display: none;
  }
  .disc-tuning {
    margin-top: 7px;
    padding: 7px 9px 6px;
  }
  .disc-tuning-stage {
    height: 100px;
    margin-left: 20px;
    margin-right: 20px;
  }
  .disc-tuning-disc {
    width: 68px;
    height: 50px;
  }
  .disc-tuning-handle {
    width: 21px;
    height: 21px;
    font-size: 12px;
  }
  .disc-tuning-help {
    display: none;
  }
}
@media (max-height: 500px) {
  .game-header {
    top: 10px;
    left: 12px;
    right: 12px;
  }
  .planning-column {
    right: 12px;
    bottom: 10px;
    width: 340px;
    padding: 10px;
    max-height: calc(100% - 70px);
  }
  #style-description {
    display: none;
  }
  #throw-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 8px;
  }
  .control-label {
    flex-direction: column;
  }
  .control-label output span {
    font-size: 8px;
  }
  .panel-heading {
    margin: 2px 0;
  }
  .game-actions .icon-button {
    width: 36px;
    height: 36px;
  }
  .course-info {
    padding: 12px;
  }
  .course-status {
    gap: 16px;
    padding: 9px 12px;
  }
  .scene-topline {
    left: 14px;
  }
  .wind-chip,
  .field-note,
  .success-badge {
    display: none;
  }
  .success-overlay {
    padding: 16px;
    width: min(300px, 90%);
  }
  .success-overlay h2 {
    font-size: 25px;
  }
}
@media (max-width: 600px), (max-width: 700px) and (min-height: 501px) {
  .game-header {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
    gap: 8px;
  }
  .course-info {
    display: block;
    padding: 9px 11px;
    min-width: 0;
    width: 100%;
  }
  .hole-heading h2 {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .course-badges {
    font-size: 9px;
    gap: 7px;
    margin-top: 5px;
  }
  .game-actions {
    gap: 0;
    padding: 3px;
  }
  .game-actions .icon-button {
    width: 36px;
    height: 44px;
  }
  .game-actions svg {
    width: 18px;
    height: 18px;
  }
  .course-status {
    grid-column: 1 / -1;
    width: 100%;
    padding: 9px 12px;
    justify-content: space-between;
    gap: 12px;
  }
  .status-item strong {
    font-size: 19px;
  }
  .lie-status strong {
    font-size: 11px;
    line-height: 19px;
  }
  .stat-label {
    font-size: 7px;
    margin-bottom: 3px;
  }
  .scene-topline {
    left: 14px;
    gap: 8px;
  }
  .scene-label {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  .wind-chip {
    font-size: 9px;
  }
  .planning-column {
    --hud-dock: bottom;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    max-height: 60%;
    border-radius: 16px;
  }
  .field-note {
    left: 14px;
    bottom: auto;
    top: calc(var(--play-top) + 30px);
    width: calc(100% - 28px);
    pointer-events: none;
  }
  .bag-dialog {
    padding: 16px;
  }
  .dialog-heading h2 {
    font-size: 26px;
  }
  .dialog-heading .eyebrow {
    font-size: 7px;
  }
  .bag-legend {
    padding: 0 0 10px;
    gap: 7px;
  }
  .bag-legend > span {
    font-size: 6px;
  }
  .bag-legend b {
    font-size: 9px;
  }
  .bag-grid {
    gap: 7px;
  }
  .bag-disc {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 12px 4px 9px;
    gap: 7px;
  }
  .bag-disc strong {
    font-size: 16px;
  }
  .bag-category {
    font-size: 8px;
  }
  .bag-profile {
    font-size: 7px;
  }
  .help-dialog {
    padding: 23px;
  }
  .success-overlay {
    padding: 18px;
  }
  .success-overlay h2 {
    font-size: 27px;
  }
}

/* Keep the result above the golfer, including when the HUD leaves little room. */
@media (max-width: 700px), (max-height: 700px) {
  .success-overlay {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 12px;
    width: min(460px, calc(var(--play-center-x) * 2 - 24px));
    padding: 10px 12px;
    text-align: left;
  }
  .success-overlay .success-badge,
  .success-overlay .eyebrow {
    display: none;
  }
  .success-overlay h2 {
    margin: 0;
    font-size: 20px;
  }
  .success-overlay p {
    grid-column: 1;
    margin: 0;
    font-size: 11px;
  }
  .success-overlay .primary-button {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
    padding: 10px;
    min-height: 44px;
    max-width: 120px;
    font-size: 11px;
  }
}

/* The editor owns its scroll areas; the course behind the native dialog stays put. */
.game-actions .character-button {
  width: auto;
  min-width: 40px;
  display: inline-flex;
  gap: 7px;
  padding: 0 10px;
}
.game-actions .character-button > span {
  display: block;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.character-dialog {
  width: 1080px;
  height: min(780px, calc(100dvh - 40px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}
.character-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.character-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 19px 24px 17px;
  border-bottom: 1px solid var(--line);
}
.character-heading h2 {
  margin: 3px 0 4px;
  font: 400 29px var(--serif);
}
.character-heading p {
  margin: 0;
  color: #67755f;
  font-size: 11px;
}
.character-heading > button {
  flex-shrink: 0;
  background: var(--sage);
}
.character-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1fr);
  min-height: 0;
}
.character-preview {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #e7ece3;
}
.character-preview-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
#character-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
#character-preview-canvas.is-rotating {
  cursor: grabbing;
}
#character-preview-canvas:focus-visible {
  outline-offset: -5px;
}
.character-preview-name {
  position: absolute;
  top: 15px;
  left: 18px;
  right: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 18px var(--serif);
  pointer-events: none;
}
.character-preview-hint {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  text-align: center;
  font-size: 10px;
  color: #5d705d;
  pointer-events: none;
}
.character-preview-tools {
  padding: 10px 18px 13px;
  background: #f1f3eb;
  border-top: 1px solid #d7dfce;
}
.character-tool-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.character-tool-row + .character-tool-row {
  margin-top: 7px;
}
.character-tool-row label {
  font-size: 11px;
}
.character-segmented {
  display: flex;
  padding: 3px;
  border: 1px solid #d0dbc6;
  border-radius: 9px;
  background: #e2e8da;
  flex: 1;
}
.character-segmented button {
  flex: 1;
  padding: 6px 8px;
  min-height: 31px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
}
.character-segmented button[aria-pressed="true"] {
  background: var(--cream);
  box-shadow: 0 1px 3px #25372c1a;
}
.character-text-button,
.character-small-button,
.character-secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 11px;
  background: var(--cream);
  font-size: 11px;
  white-space: nowrap;
}
.character-text-button {
  border-color: transparent;
  background: transparent;
  padding-left: 7px;
  padding-right: 7px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.character-text-button:hover,
.character-small-button:hover:not(:disabled),
.character-secondary-button:hover {
  background: #e4ebd7;
}
.character-zoom-row input {
  width: 100%;
  min-width: 40px;
  flex: 1;
  accent-color: var(--forest);
}
.character-zoom-row button {
  min-width: 38px;
  font-size: 19px;
  line-height: 1;
}
.character-motion-row select {
  flex: 1;
  width: 0;
  min-width: 85px;
  min-height: 34px;
  padding: 5px 8px;
  font: 11px var(--sans);
  color: var(--ink);
  background: var(--cream);
  border: 1px solid #d0dbc6;
  border-radius: 7px;
}
.character-options {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.character-tabs {
  display: flex;
  flex-shrink: 0;
  gap: 3px;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}
.character-tab {
  flex: 1;
  min-height: 41px;
  padding: 7px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}
.character-tab[aria-selected="true"] {
  color: var(--forest);
  font-weight: 700;
  border-bottom-color: var(--forest);
}
.character-tab:focus-visible {
  outline-offset: -3px;
}
.character-panels {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #bac9ab transparent;
  padding: 18px 20px 24px;
}
.character-panel {
  min-width: 0;
}
.character-field {
  padding: 0;
  margin: 0 0 23px;
  border: 0;
  min-width: 0;
}
.character-field:last-child {
  margin-bottom: 0;
}
.character-field legend,
.character-name-label {
  padding: 0;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
}
.character-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.character-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  border: 1px solid #d9dfcf;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--cream);
  min-width: 0;
}
.character-choice input,
.character-swatch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.character-choice:hover {
  border-color: #8da67c;
}
.character-choice:has(input:checked) {
  border-color: var(--forest);
  box-shadow: inset 0 0 0 1px var(--forest);
  background: #e9efdd;
}
.character-choice:has(input:focus-visible),
.character-swatch:has(input:focus-visible) {
  outline: 3px solid #789857;
  outline-offset: 2px;
}
.character-choice-art {
  display: grid;
  place-items: center;
  height: 70px;
  padding: 5px 4px 0;
}
.character-choice-art svg,
.character-preset svg {
  width: 100%;
  height: 100%;
  max-width: 88px;
  stroke: none;
}
.character-choice-label {
  padding: 5px 4px 8px;
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
}
.character-hand {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #9dad8d;
  border-radius: 50%;
  font: 500 24px var(--serif);
}
.character-colours {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.character-swatch {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
}
.character-swatch > span {
  display: block;
  width: 29px;
  height: 29px;
  border: 1px solid #263e302e;
  border-radius: 50%;
  background: var(--swatch);
}
.character-swatch:has(input:checked) > span {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
  box-shadow: inset 0 0 0 2px #ffffffa0;
}
.character-custom-colour {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 3px;
  font-size: 10px;
}
.character-custom-colour input {
  width: 35px;
  height: 35px;
  padding: 3px;
  border: 1px solid #becbb3;
  border-radius: 7px;
  background: var(--cream);
  cursor: pointer;
}
.character-height {
  display: flex;
  align-items: center;
  gap: 14px;
}
.character-height input {
  flex: 1;
  min-width: 0;
  accent-color: var(--forest);
}
.character-height output {
  min-width: 38px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.character-field-note {
  margin: 9px 0 0;
  color: #67755f;
  font-size: 11px;
  line-height: 1.5;
}
.character-name-label {
  display: block;
}
.character-name-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #becbb3;
  border-radius: 8px;
  padding: 9px 12px;
  background: var(--cream);
}
.character-name-input + .character-field-note {
  margin-bottom: 23px;
}
.character-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.character-preset {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  padding: 9px 5px;
  border: 1px solid #d5decb;
  border-radius: 10px;
  background: var(--cream);
  font-size: 11px;
}
.character-preset:hover {
  background: #e9efdd;
  border-color: #8da67c;
}
.character-preset svg {
  height: 66px;
}
.character-footer {
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.character-footer-actions,
.character-draft-actions,
.character-confirm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.character-footer-actions {
  justify-content: space-between;
}
.character-error {
  margin: 0 0 10px;
  color: #923c30;
  font-size: 11px;
  line-height: 1.45;
}
@media (max-width: 1050px) {
  .game-actions .character-button > span {
    display: none;
  }
}
@media (max-width: 600px) and (min-height: 501px) {
  .character-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 15px;
  }
  .character-heading {
    padding: 12px 14px;
  }
  .character-heading h2 {
    font-size: 23px;
  }
  .character-heading p {
    font-size: 9px;
  }
  .character-heading .eyebrow {
    font-size: 7px;
  }
  .character-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(180px, 29dvh) minmax(0, 1fr);
  }
  .character-preview {
    grid-template-columns: minmax(0, 1fr) 118px;
    grid-template-rows: minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .character-preview-tools {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 7px;
    border-top: 0;
    border-left: 1px solid #d7dfce;
  }
  .character-tool-row {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .character-segmented {
    width: 100%;
    flex-basis: 100%;
  }
  .character-segmented button {
    font-size: 9px;
    padding: 4px;
  }
  .character-preview-tools .character-text-button {
    min-height: 25px;
    padding: 3px;
    font-size: 10px;
  }
  .character-zoom-row label {
    display: none;
  }
  .character-zoom-row button {
    min-width: 28px;
    min-height: 29px;
    padding: 3px;
  }
  .character-zoom-row input {
    order: -1;
    flex-basis: 100%;
    min-height: 22px;
  }
  .character-motion-row > label {
    display: none;
  }
  .character-motion-row select {
    width: 100%;
    font-size: 10px;
    min-height: 29px;
  }
  .character-motion-row button {
    min-height: 29px;
    width: 100%;
    padding: 4px;
    font-size: 10px;
  }
  .character-preview-name {
    font-size: 15px;
    left: 12px;
    top: 10px;
  }
  .character-preview-hint {
    font-size: 8px;
    margin-bottom: 6px;
  }
  .character-tabs {
    padding: 3px 5px 0;
    gap: 0;
  }
  .character-tab {
    font-size: 10px;
    padding: 6px;
    min-height: 40px;
  }
  .character-panels {
    padding: 14px 13px 20px;
  }
  .character-choice-grid {
    gap: 6px;
  }
  .character-choice-art {
    height: 61px;
  }
  .character-footer {
    padding: 9px;
  }
  .character-footer-actions,
  .character-draft-actions,
  .character-confirm-actions {
    gap: 4px;
  }
  .character-footer .primary-button {
    padding: 10px;
    min-height: 41px;
    font-size: 11px;
  }
  .character-footer .character-secondary-button {
    padding: 8px;
    font-size: 10px;
  }
  .character-footer .character-text-button {
    padding: 6px;
    font-size: 10px;
  }
}
@media (max-height: 500px) {
  .character-dialog {
    width: calc(100vw - 20px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    max-width: calc(100vw - 20px);
    border-radius: 13px;
  }
  .character-heading {
    padding: 6px 14px;
  }
  .character-heading h2 {
    font-size: 21px;
    margin: 0;
  }
  .character-heading .eyebrow,
  .character-heading p {
    display: none;
  }
  .character-heading > button {
    width: 32px;
    height: 32px;
  }
  .character-workspace {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
  }
  .character-preview {
    grid-template-columns: minmax(0, 1fr) 116px;
    grid-template-rows: minmax(0, 1fr);
  }
  .character-preview-tools {
    padding: 7px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 0;
    border-left: 1px solid #d7dfce;
  }
  .character-tool-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .character-segmented {
    flex-basis: 100%;
  }
  .character-segmented button {
    font-size: 9px;
    padding: 4px;
  }
  .character-preview-tools .character-text-button {
    min-height: 26px;
    padding: 3px;
    font-size: 10px;
  }
  .character-zoom-row label,
  .character-motion-row > label {
    display: none;
  }
  .character-zoom-row input {
    flex-basis: 100%;
    order: -1;
  }
  .character-zoom-row button {
    min-width: 30px;
    min-height: 28px;
    padding: 3px;
  }
  .character-motion-row select {
    min-height: 29px;
    font-size: 10px;
  }
  .character-motion-row button {
    width: 100%;
    min-height: 29px;
    padding: 4px;
    font-size: 10px;
  }
  .character-tabs {
    padding-top: 0;
  }
  .character-tab {
    min-height: 35px;
    font-size: 10px;
  }
  .character-panels {
    padding: 12px 14px 18px;
  }
  .character-preview-name {
    font-size: 14px;
    top: 8px;
    left: 10px;
  }
  .character-preview-hint {
    font-size: 8px;
  }
  .character-footer {
    padding: 6px 12px;
  }
  .character-footer .primary-button {
    min-height: 36px;
    padding: 8px 12px;
  }
}

/* The editor occupies the planning panel area, preserving the shared camera viewport. */
#world-editor {
  position: absolute;
  z-index: 15;
  right: 18px;
  top: 185px;
  width: 300px;
  max-height: calc(100% - 205px);
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  font-size: 13px;
  background: #faf9ed;
}
#world-editor[hidden] { display: none; }
#world-editor label { display: grid; gap: 4px; margin: 9px 0; }
#world-editor select, #world-editor input { width: 100%; padding: 7px; border: 1px solid #abb59b; border-radius: 6px; background: #fff9e9; color: #304c3c; }
.editor-buttons { display: flex; gap: 5px; margin: 8px 0; }
.editor-buttons button { flex: 1; padding: 8px 4px; background: #e1e6ce; color: #304c3c; border: 1px solid #a4b297; border-radius: 6px; }
#game[data-editing="true"] .field-note { visibility: hidden; }
@media (max-width: 700px) {
  #world-editor { top: auto; bottom: 10px; left: 10px; right: 10px; width: auto; max-height: 42%; }
}

#game[data-editing="true"] .planning-column { visibility: hidden; }

#game[data-drone="true"] .course-status { display: none; }
#game[data-drone="true"] .planning-column,
#game[data-drone="true"] .field-note,
#game[data-drone="true"] .scene-topline { visibility: hidden; }
@media (max-width: 600px) {
  .game-header { grid-template-columns: 1fr; }
  .game-actions { justify-content: space-between; }
  .course-info { display: flex; align-items: center; gap: 10px; }
  .hole-heading { flex: 1; min-width: 0; }
  .course-badges { flex-shrink: 0; margin: 0; white-space: nowrap; }
}
@media (min-width: 701px) and (max-height: 500px) {
  #world-editor { top: 68px; right: 12px; width: 340px; max-height: calc(100% - 80px); }
}
