:root {
  color-scheme: dark;
  --ink: #102d2b;
  --cream: #f3eed9;
  --muted: #a3b7a9;
  --gold: #edc679;
  --mint: #a8d4ad;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  overscroll-behavior: none;
  width: 100%;
  height: 100%;
  background: #102724;
}
body {
  color: var(--cream);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.app {
  max-width: 1440px;
  height: 100vh;
  height: 100dvh;
  margin: auto;
  padding: 0 30px;
  display: flex;
  flex-direction: column;
}
.masthead {
  height: 78px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  letter-spacing: -0.8px;
  color: var(--cream);
  text-decoration: none;
  font-weight: bold;
}
.wordmark svg {
  width: 29px;
  fill: var(--gold);
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
}
.wordmark-light {
  font-weight: normal;
}
.edition {
  font-size: 10px;
  letter-spacing: 2.1px;
  color: #97afa0;
}
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
.icon-button,
.sound-button {
  border: 1px solid #68857866;
  color: var(--cream);
  background: #29443b66;
  border-radius: 24px;
  height: 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.icon-button {
  width: 37px;
  font-size: 18px;
}
.icon-button:disabled {
  opacity: 0.35;
  cursor: default;
}
.sound-button {
  padding: 0 14px;
  font-size: 11px;
}
.sound-button #sound-icon {
  color: var(--gold);
  font-size: 19px;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #62817170;
  border-radius: 19px;
  background: #2a4b43;
  box-shadow: 0 12px 40px #0016114d;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 110px #061e2080;
  z-index: 1;
}
.hud {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 25px 29px 33px;
  background: linear-gradient(#102d2bea, #102d2b6b 72%, transparent);
  pointer-events: none;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: #c0cbbb;
  font-weight: bold;
}
.height-block > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
  height: 45px;
}
.height-block strong {
  font:
    46px Georgia,
    serif;
  letter-spacing: -2px;
}
.unit {
  font:
    italic 23px Georgia,
    serif;
  color: var(--gold);
}
.best {
  display: block;
  font-size: 9px;
  letter-spacing: 1.6px;
  color: #afbeb1;
  margin-top: 5px;
}
.best b {
  font-weight: normal;
  color: var(--cream);
}
.grip-block {
  width: 230px;
  padding-top: 3px;
}
.grip-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.grip-label b {
  font-size: 11px;
  color: var(--mint);
}
.grip-track {
  height: 9px;
  background: #091e1b99;
  border: 1px solid #90ab9066;
  border-radius: 20px;
  padding: 2px;
}
.grip-track > div {
  height: 100%;
  width: 100%;
  background: var(--mint);
  border-radius: 20px;
  transition: background 0.3s;
}
#grip-caption {
  display: block;
  margin-top: 9px;
  font-size: 10px;
  color: #b1c2af;
}
.weather-block {
  display: flex;
  gap: 10px;
  min-width: 122px;
  justify-content: flex-end;
}
.weather-block > span {
  font-size: 27px;
  line-height: 1;
  color: var(--gold);
}
.weather-block > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.weather-block .eyebrow {
  font-size: 9px;
}
.weather-block strong {
  font:
    23px Georgia,
    serif;
  color: var(--gold);
}
.weather-block.warning .eyebrow,
.weather-block.warning strong {
  color: #ffd185;
}
.weather-block.rain strong {
  color: #c5deeb;
}
.announcement {
  position: absolute;
  z-index: 4;
  top: 126px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 19px;
  border-radius: 8px;
  background: #112c25e8;
  border: 1px solid #a9c9a650;
  white-space: nowrap;
  font-size: 12px;
  color: #e8efcf;
  opacity: 0;
  transition: opacity 0.2s;
}
.announcement.visible {
  opacity: 1;
}
.announcement.danger {
  color: #ffe0a1;
  background: #423827ed;
  border-color: #d1a567a1;
}
.announcement.storm {
  color: #d7e9ef;
  background: #173743ef;
}
.overlay {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #10272440;
  padding: 100px 20px 132px;
  backdrop-filter: blur(2px);
  transition: opacity 0.2s;
}
.hidden {
  display: none !important;
}
.intro-card {
  text-align: center;
  max-width: 460px;
}
.chapter {
  color: var(--gold);
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 3px;
}
.intro-card h1 {
  font:
    normal 78px/0.87 Georgia,
    "Times New Roman",
    serif;
  letter-spacing: -3px;
  margin: 21px 0 21px;
  text-shadow: 0 5px 30px #07251a66;
}
.intro-card h1 em {
  font-weight: normal;
  color: var(--gold);
}
.intro {
  color: #d3decb;
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 24px;
}
.rules {
  display: flex;
  gap: 24px;
  justify-content: center;
  text-align: left;
  margin-bottom: 27px;
}
.rules > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rule-icon {
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 24px;
  width: 24px;
}
.rule-icon.hole {
  font-size: 26px;
  color: #132c26;
  text-shadow:
    0 0 2px #e9c984,
    1px 1px 0 #e9c984,
    -1px -1px 0 #e9c984;
}
.rules span {
  font-size: 9px;
  color: #bacbb7;
  line-height: 1.7;
  white-space: nowrap;
}
.rules b {
  display: block;
  font-size: 11px;
  color: var(--cream);
  font-weight: normal;
}
.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
  margin: auto;
  width: 270px;
  padding: 16px 21px;
  border: 1px solid #ffe1a2;
  background: var(--gold);
  color: #183c30;
  border-radius: 7px;
  font-size: 14px;
  font-weight: bold;
  box-shadow:
    0 4px 0 #88754c,
    0 8px 24px #10282055;
  transition:
    transform 0.12s,
    background 0.12s;
}
.primary-button:hover {
  background: #ffdaa0;
  transform: translateY(-2px);
}
.primary-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #88754c;
}
.primary-button > span {
  font-size: 22px;
  line-height: 17px;
}
.control-note {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  color: #b7c7b2;
  font-size: 10px;
  margin: 17px 0 0;
}
.control-note > span:last-child {
  margin-left: 5px;
}
kbd {
  font:
    8px Arial,
    sans-serif;
  padding: 3px 4px;
  border: 1px solid #9ab1996b;
  border-radius: 3px;
}
.keyline {
  display: flex;
  gap: 3px;
}
.bottom-ui {
  position: absolute;
  z-index: 7;
  bottom: 22px;
  left: 26px;
  right: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}
.joystick-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  pointer-events: auto;
}
.joystick {
  position: relative;
  width: 116px;
  height: 116px;
  border: 1px solid #c0d5b652;
  border-radius: 50%;
  background: radial-gradient(circle, #142f27b0, #15322780);
  box-shadow: inset 0 0 0 12px #122f272e;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.joystick:active {
  cursor: grabbing;
  border-color: #ebd196;
}
.joystick-knob {
  position: absolute;
  width: 45px;
  height: 45px;
  top: 35px;
  left: 35px;
  border: 1px solid #e4dcb894;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #98ae83, #5c7c63);
  box-shadow: 0 3px 12px #071b1b80;
  pointer-events: none;
}
.joy-arrow {
  position: absolute;
  color: #aebea1;
  font-size: 14px;
  line-height: 16px;
  pointer-events: none;
}
.north {
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
}
.south {
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
}
.west {
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
}
.east {
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
}
.joystick-label {
  font-size: 8px;
  font-weight: bold;
  letter-spacing: 1.8px;
  color: #b7c7a9;
}
.field-note {
  position: absolute;
  left: 50%;
  bottom: 1px;
  transform: translateX(-50%);
  text-align: center;
}
.note-number {
  font-size: 8px;
  letter-spacing: 2px;
  color: #c4b784;
}
.field-note p {
  font:
    italic 17px/1.5 Georgia,
    serif;
  margin: 8px 0 0;
  color: #d2dbc3;
}
.control-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  color: #acbea9;
  font-size: 10px;
  line-height: 1.8;
}
.keys {
  text-align: center;
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 2px;
  border: 1px solid #9ab19966;
  border-radius: 5px;
  padding: 4px 7px;
}
.control-hint b {
  font-weight: normal;
  color: #dfdec0;
}
.end-card,
.pause-card {
  text-align: center;
  max-width: 450px;
  padding: 30px;
  background: #14342eea;
  border: 1px solid #a3b68b59;
  border-radius: 16px;
  box-shadow: 0 15px 70px #081e1d80;
}
h2 {
  font:
    42px Georgia,
    serif;
  letter-spacing: -1.4px;
  margin: 14px 0;
}
.end-card > p,
.pause-card > p {
  font-size: 12px;
  line-height: 1.6;
  color: #c3d0b9;
}
.end-height {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 10px 0 22px;
}
.end-height strong {
  font:
    80px Georgia,
    serif;
  color: var(--gold);
  letter-spacing: -5px;
}
.end-height > span {
  font-size: 10px;
  color: #c3d0b9;
  letter-spacing: 1.5px;
}
.end-stats {
  display: flex;
  justify-content: space-around;
  font-size: 9px;
  letter-spacing: 1px;
  gap: 22px;
  border-top: 1px solid #9ab19938;
  padding-top: 17px;
  margin-bottom: 25px;
  color: #aabda4;
}
.end-stats b {
  display: block;
  font-size: 16px;
  font-weight: normal;
  color: var(--cream);
  margin-top: 7px;
}
.end-card .small-note {
  font:
    italic 13px Georgia,
    serif;
  margin: 18px 0 0;
  color: #a7be9e;
}
.pause-card .primary-button {
  margin-top: 25px;
}
.toast {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  pointer-events: none;
  background: #ecce87;
  color: #163b2e;
  box-shadow: 0 3px 15px #10282066;
  border-radius: 30px;
  padding: 12px 22px;
  font-size: 12px;
  transition: 0.2s;
  white-space: nowrap;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.shelter-arrow {
  display: none;
  position: absolute;
  z-index: 4;
  right: 22px;
  top: 46%;
  padding: 8px 10px;
  background: #183329e8;
  color: #edce8d;
  border: 1px solid #d6ba7f77;
  border-radius: 7px;
  font-size: 8px;
  letter-spacing: 1px;
  pointer-events: none;
}
.shelter-arrow span {
  font-size: 22px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
footer {
  height: 36px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #819c88;
  font-size: 8px;
  letter-spacing: 1.5px;
}
footer > span:last-child {
  letter-spacing: 0.5px;
}
.footer-star {
  color: #c5bc7e;
  font-size: 16px;
  margin-left: 9px;
}
.stage.is-playing .field-note {
  display: none;
}
.stage.is-playing .vignette {
  box-shadow: inset 0 0 80px #061e2050;
}
.stage.low-grip {
  border-color: #dd9769;
}
.stage.low-grip .grip-label b {
  color: #ffc787;
}
@media (min-width: 1000px) and (min-height: 800px) {
  .intro-card h1 {
    font-size: 94px;
  }
  .intro-card {
    max-width: 510px;
  }
  .intro {
    font-size: 14px;
  }
  .rules {
    margin-bottom: 30px;
  }
}
@media (max-width: 700px) {
  .app {
    padding: 0 10px;
  }
  .masthead {
    height: 59px;
    gap: 10px;
  }
  .wordmark {
    font-size: 17px;
    gap: 5px;
  }
  .wordmark svg {
    width: 25px;
  }
  .edition {
    display: none;
  }
  .sound-button {
    padding: 0 10px;
    height: 34px;
  }
  .icon-button {
    height: 34px;
    width: 34px;
  }
  .header-actions {
    gap: 6px;
  }
  .stage {
    border-radius: 13px;
  }
  .hud {
    padding: 19px 16px 26px;
    gap: 12px;
  }
  .height-block strong {
    font-size: 37px;
  }
  .height-block > div {
    height: 36px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.4px;
  }
  .unit {
    font-size: 20px;
  }
  .best {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .grip-block {
    width: 135px;
    flex: 1;
    max-width: 180px;
    padding-top: 2px;
  }
  .grip-label {
    margin-bottom: 9px;
  }
  .grip-label b {
    font-size: 10px;
  }
  #grip-caption {
    font-size: 8px;
    line-height: 1.4;
    max-width: 140px;
  }
  .weather-block {
    gap: 5px;
    min-width: 85px;
  }
  .weather-block > span {
    font-size: 21px;
  }
  .weather-block .eyebrow {
    font-size: 7px;
    letter-spacing: 0.8px;
  }
  .weather-block strong {
    font-size: 19px;
  }
  .weather-block > div {
    gap: 6px;
  }
  .announcement {
    top: 110px;
    font-size: 10px;
    padding: 9px 12px;
    max-width: 95%;
    white-space: normal;
    text-align: center;
    width: max-content;
  }
  .overlay {
    padding: 109px 15px 148px;
  }
  .intro-card h1 {
    font-size: 60px;
    margin: 16px 0;
  }
  .chapter {
    font-size: 8px;
    letter-spacing: 2.1px;
  }
  .intro {
    font-size: 12px;
    margin-bottom: 18px;
  }
  .rules {
    gap: 14px;
    margin-bottom: 21px;
  }
  .rules > div {
    gap: 4px;
  }
  .rules b {
    font-size: 10px;
  }
  .rules span {
    font-size: 8px;
  }
  .rule-icon {
    width: 20px;
    font-size: 22px;
  }
  .primary-button {
    width: 252px;
    padding: 14px 19px;
  }
  .control-note {
    font-size: 9px;
    margin-top: 15px;
  }
  .bottom-ui {
    left: 17px;
    right: 17px;
    bottom: 18px;
  }
  .joystick {
    width: 116px;
    height: 116px;
  }
  .control-hint {
    display: none;
  }
  .field-note {
    left: auto;
    right: 1px;
    transform: none;
    text-align: right;
    bottom: 19px;
  }
  .field-note p {
    font-size: 15px;
  }
  .note-number {
    font-size: 7px;
  }
  .end-card {
    padding: 23px 18px;
  }
  .end-card h2,
  .pause-card h2 {
    font-size: 35px;
  }
  .end-card > p {
    font-size: 11px;
    max-width: 260px;
  }
  .end-height strong {
    font-size: 62px;
  }
  .end-height {
    margin: 4px 0 18px;
  }
  .end-stats {
    padding-top: 13px;
    margin-bottom: 19px;
  }
  .end-card .small-note {
    font-size: 11px;
    margin-top: 15px;
  }
  .toast {
    bottom: 45px;
    left: auto;
    right: 15px;
    transform: translateY(10px);
    padding: 10px 14px;
    font-size: 10px;
  }
  .toast.visible {
    transform: translateY(0);
  }
  footer {
    height: 28px;
    font-size: 6px;
    letter-spacing: 1px;
  }
  footer > span:last-child {
    font-size: 7px;
    letter-spacing: 0;
  }
  .shelter-arrow {
    right: 12px;
    max-width: 125px;
    font-size: 7px;
  }
}
@media (max-height: 700px) {
  .intro-card h1 {
    font-size: 48px;
    margin: 12px 0;
  }
  .intro {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 12px;
  }
  .rules {
    margin-bottom: 16px;
  }
  .chapter {
    font-size: 8px;
  }
  .control-note {
    margin-top: 12px;
  }
  .overlay {
    padding-top: 93px;
    padding-bottom: 132px;
  }
  .end-card {
    padding: 17px 20px;
  }
  .end-card h2 {
    font-size: 31px;
    margin: 8px 0;
  }
  .end-card > p {
    margin: 8px 0;
  }
  .end-height {
    margin: 2px 0 12px;
  }
  .end-height strong {
    font-size: 52px;
  }
  .end-stats {
    padding-top: 10px;
    margin-bottom: 15px;
  }
  .end-card .small-note {
    margin-top: 12px;
  }
  .bottom-ui {
    bottom: 12px;
  }
}
@media (max-height: 500px) and (min-width: 600px) {
  .app {
    padding: 0 10px;
  }
  .masthead {
    height: 45px;
  }
  footer {
    height: 20px;
  }
  .hud {
    padding: 12px 20px;
  }
  .overlay {
    padding: 60px 150px 15px;
  }
  .intro-card h1 {
    font-size: 38px;
    margin: 8px 0;
  }
  .intro {
    font-size: 10px;
    margin-bottom: 8px;
  }
  .rules {
    margin-bottom: 10px;
  }
  .chapter {
    font-size: 7px;
  }
  .primary-button {
    padding: 10px 17px;
  }
  .control-note {
    margin-top: 9px;
  }
  .field-note {
    display: none;
  }
  .intro-card h1 br {
    display: none;
  }
  .end-card {
    padding: 12px 20px;
  }
  .end-height {
    float: left;
    margin: 4px 25px 10px 0;
  }
  .end-height strong {
    font-size: 45px;
  }
  .end-stats {
    padding-top: 5px;
    margin-bottom: 12px;
    gap: 15px;
  }
  .end-card .small-note {
    display: none;
  }
  .end-card h2 {
    font-size: 29px;
    margin: 6px;
  }
  .end-card > p {
    font-size: 10px;
  }
  .end-card .primary-button {
    clear: both;
  }
  .announcement {
    top: 97px;
  }
}

/* Keep controls clear of phone home indicators and display cutouts. */
.app {
  padding-left: max(10px, env(safe-area-inset-left));
  padding-right: max(10px, env(safe-area-inset-right));
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 701px) {
  .app {
    padding-left: max(30px, env(safe-area-inset-left));
    padding-right: max(30px, env(safe-area-inset-right));
  }
}
@media (max-width: 600px) and (max-height: 610px) {
  .start-screen {
    padding-bottom: 151px;
  }
  .intro-card h1 {
    font-size: 44px;
    margin: 10px 0;
  }
  .intro-card .control-note {
    display: none;
  }
  .intro-card .intro {
    margin-bottom: 11px;
  }
  .intro-card .rules {
    margin-bottom: 14px;
  }
  .field-note p {
    font-size: 13px;
  }
  .field-note .note-number {
    font-size: 6px;
  }
}
@media (max-width: 600px) and (max-height: 610px) {
  #end-screen {
    align-items: flex-start;
    padding: 18px 12px 145px;
  }
  .end-card {
    padding: 14px 18px;
    width: 100%;
  }
  .end-card h2 {
    font-size: 28px;
    margin: 7px 0;
  }
  .end-card .chapter {
    font-size: 7px;
  }
  .end-height strong {
    font-size: 42px;
  }
  .end-height > span {
    font-size: 9px;
  }
  .end-height {
    margin: 2px 0 9px;
  }
  .end-stats {
    padding-top: 8px;
    margin-bottom: 12px;
  }
  .end-stats b {
    margin-top: 4px;
  }
  .end-card .small-note {
    display: none;
  }
}
@media (max-width: 600px) and (max-height: 610px) {
  .start-screen {
    align-items: flex-end;
    padding-bottom: 164px;
  }
}
