/* The windmill hole: a mini golf hole seen from above in a slight perspective. The putter follows the pointer, winds
   up and strikes; the ball rolls with real physics through the windmill, over the bridge and the ramp, circles the
   rim and drops, and the flag jumps. */
:root {
  --fondo: #f3ead7;
  --fondo-luce: #fbf6ea;
  --testo: #1d2a22;
  --testo-tenue: #5f6b5f;
  --accento: #d9482b;
  --prato: #3f9a4c;
  --prato-chiaro: #4fae5a;
  --prato-scuro: #2d7a3b;
  --selciato: #e4d6bb;
  --selciato-scuro: #cdbb98;
  --legno: #b8743c;
  --legno-chiaro: #dca067;
  --legno-scuro: #7c4521;
  --muro: #f4ead6;
  --tetto: #b8462f;
  --vela: #fffaf0;
  --acqua: #3fa7c4;
  --acqua-scura: #237d9c;
  --cespuglio: #2f7f45;
  --pallina: #ffffff;
  --bandiera: #e2442a;
  --tappeto: #2b6a39;
  /* the elastic curve of the button: it overshoots, then settles */
  --molla: cubic-bezier(0.34, 1.8, 0.45, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(ellipse 70% 55% at 50% 55%, var(--fondo-luce), transparent 72%),
    var(--fondo);
  color: var(--testo);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.campo {
  min-height: 100svh;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 3vh, 32px) 16px clamp(16px, 3vh, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vh, 16px);
}

.testa {
  text-align: center;
}

.sopra {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accento);
}

.titolo {
  margin: 0;
  font-family: 'Bricolage Grotesque Variable', system-ui, sans-serif;
  font-weight: 760;
  font-size: clamp(30px, 5.2vw, 54px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.riga {
  margin: 8px auto 0;
  max-width: 48ch;
  font-size: 14px;
  line-height: 1.45;
  color: var(--testo-tenue);
}

.buca {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  cursor: crosshair;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.buca__svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100svh - 230px);
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

.buca__svg text {
  font-family: 'Bricolage Grotesque Variable', system-ui, sans-serif;
  pointer-events: none;
}

.piede {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
}

.conti {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 22px;
}

.conto,
.stato {
  margin: 0;
  font-size: 13px;
  color: var(--testo-tenue);
}

.conto__nome {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 650;
}

.conto__num {
  display: inline-block;
  min-width: 1.3ch;
  font-family: 'Bricolage Grotesque Variable', system-ui, sans-serif;
  font-size: 24px;
  font-weight: 760;
  color: var(--testo);
  font-variant-numeric: tabular-nums;
}

.stato {
  overflow: hidden;
  height: 1.6em;
  min-width: 14ch;
}

.stato__testo {
  display: inline-block;
  color: var(--accento);
  font-family: 'Bricolage Grotesque Variable', system-ui, sans-serif;
  font-weight: 650;
  font-size: 16px;
}

.tiro {
  position: relative;
  isolation: isolate;
  min-height: 50px;
  min-width: 150px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--fondo-luce);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tiro__fondo {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--testo);
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / 0.25);
  transition: inset 0.6s var(--molla), background-color 0.3s ease;
}

.tiro__testo {
  display: inline-block;
  font-stretch: 100%;
  transition: font-stretch 0.6s var(--molla);
}

.tiro:active .tiro__fondo {
  inset: 3px;
  transition-duration: 0.12s;
}

.tiro[aria-disabled='true'] {
  cursor: default;
}

.tiro[aria-disabled='true'] .tiro__fondo {
  background: color-mix(in srgb, var(--testo) 45%, var(--fondo));
}

.tiro:focus-visible {
  outline: 2px solid var(--accento);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .tiro:not([aria-disabled='true']):hover .tiro__fondo {
    inset: -5px -8px;
    background: var(--accento);
  }

  .tiro:not([aria-disabled='true']):hover .tiro__testo {
    font-stretch: 125%;
  }
}

@media (max-width: 700px) {
  .buca__svg {
    max-height: none;
    overflow: hidden;
  }

  .riga {
    font-size: 13px;
  }

  .conti {
    gap: 2px 16px;
  }

  .stato {
    flex-basis: 100%;
  }

  .tiro {
    min-width: 0;
    padding: 0 22px;
  }
}
