* {
  box-sizing: border-box;
}

:root {
  --ink: var(--color-ink);
  --ink-muted: var(--color-muted);
  --paper: var(--color-surface);
  --paper-raised: var(--color-surface-raised);
  --line: var(--color-border);
  --lime: var(--color-primary);
  --blue: var(--color-secondary);
  --coral: var(--color-attention);
  --course-turf: #dfe9bd;
  --course-sand: #f2d6bd;
}

html {
  min-width: 320px;
  color-scheme: light;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background-color: var(--color-canvas);
  background-image:
    linear-gradient(var(--color-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button:focus-visible,
input:focus-visible + label,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.home-link {
  position: fixed;
  z-index: 5;
  top: 18px;
  left: 18px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 8%, transparent);
  backdrop-filter: blur(8px);
  transition: color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.home-link:hover {
  color: var(--blue);
  border-color: var(--blue);
  transform: translateX(-2px);
}

.home-link svg,
.icon-button svg,
.primary-button svg,
.text-button svg,
.setup-option svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-link svg {
  width: 21px;
  height: 21px;
}

.page-decoration {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.page-decoration--lime {
  right: -190px;
  bottom: -210px;
  width: 430px;
  height: 430px;
  border: 75px solid color-mix(in srgb, var(--lime) 17%, transparent);
}

.page-decoration--blue {
  top: 12%;
  left: -170px;
  width: 300px;
  height: 300px;
  border: 56px solid color-mix(in srgb, var(--blue) 8%, transparent);
}

.app-shell {
  width: min(1110px, calc(100% - 48px));
  min-height: 100dvh;
  display: flex;
  align-items: center;
  margin-inline: auto;
  padding: 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  display: block;
  overflow: hidden;
  border-radius: 13px;
  background: var(--ink);
}

.brand-mark::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 21px;
  width: 3px;
  height: 22px;
  border-radius: 4px;
  background: var(--lime);
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 23px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 12px solid var(--coral);
}

.brand-mark__ball {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
}

.brand-mark__cup {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 17px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lime) 32%, transparent);
}

.start-screen {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 476px);
  align-items: center;
  gap: clamp(42px, 7vw, 96px);
}

.eyebrow {
  margin: 54px 0 0;
  color: color-mix(in srgb, var(--coral) 78%, var(--ink));
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.17em;
}

.start-copy h1 {
  max-width: 600px;
  margin: 10px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 7.2vw, 6.7rem);
  font-weight: 500;
  line-height: 0.87;
  letter-spacing: -0.065em;
}

.start-copy h1 em {
  color: var(--blue);
  font-weight: inherit;
}

.start-lead {
  max-width: 450px;
  margin: 24px 0 0;
  color: var(--ink-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.course-sketch {
  position: relative;
  width: 262px;
  height: 78px;
  margin-top: 38px;
  border: 5px solid var(--ink);
  border-radius: 40px 18px 38px 24px;
  background: color-mix(in srgb, var(--lime) 34%, var(--color-canvas));
  rotate: -3deg;
}

.course-sketch__tee {
  position: absolute;
  top: 15px;
  left: 20px;
  width: 40px;
  height: 40px;
  border: 2px dashed color-mix(in srgb, var(--ink) 32%, transparent);
  border-radius: 50%;
}

.course-sketch__ball {
  position: absolute;
  left: 33px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.course-sketch__ball--one {
  top: 23px;
  background: var(--coral);
}

.course-sketch__ball--two {
  top: 39px;
  background: var(--blue);
}

.course-sketch__bumper {
  position: absolute;
  top: 22px;
  left: 124px;
  width: 31px;
  height: 31px;
  border: 6px solid var(--ink);
  border-radius: 50%;
  background: var(--lime);
}

.course-sketch__cup {
  position: absolute;
  right: 24px;
  bottom: 16px;
  width: 27px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
}

.course-sketch__flag {
  position: absolute;
  right: 35px;
  bottom: 23px;
  width: 3px;
  height: 41px;
  background: var(--blue);
}

.course-sketch__flag::after {
  content: "";
  position: absolute;
  top: 0;
  left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 22px solid var(--coral);
}

.setup-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: color-mix(in srgb, var(--paper-raised) 94%, transparent);
  box-shadow: var(--shadow-raised);
}

.setup-card__header {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.setup-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--ink);
  background: var(--lime);
  font-size: 1.25rem;
}

.setup-label,
.setup-hint {
  margin: 0;
}

.setup-label {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.setup-hint {
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.68rem;
}

.setup-fieldset {
  min-width: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.setup-fieldset legend {
  margin-bottom: 7px;
  color: var(--ink-muted);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

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

.setup-option {
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.setup-option:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--blue) 46%, transparent);
}

.btn-check:checked + .setup-option {
  border-color: color-mix(in srgb, var(--lime) 70%, var(--ink));
  background: color-mix(in srgb, var(--lime) 38%, var(--paper));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lime) 58%, transparent);
}

.setup-option svg {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  color: var(--blue);
}

.setup-option strong,
.setup-option small {
  display: block;
}

.setup-option strong {
  font-size: 0.72rem;
  font-weight: 850;
}

.setup-option small {
  margin-top: 1px;
  color: var(--ink-muted);
  font-size: 0.57rem;
}

.setup-option--wide {
  justify-content: flex-start;
  min-height: 62px;
}

.setup-option--level {
  justify-content: flex-start;
}

.setup-option--compact {
  min-height: 43px;
}

.level-bars {
  height: 19px;
  display: inline-flex;
  align-items: end;
  gap: 3px;
}

.level-bars i {
  width: 4px;
  border-radius: 4px;
  background: var(--blue);
  opacity: 0.2;
}

.level-bars i:nth-child(1) { height: 7px; }
.level-bars i:nth-child(2) { height: 12px; }
.level-bars i:nth-child(3) { height: 18px; }
.level-bars--one i:nth-child(1),
.level-bars--two i:nth-child(-n + 2),
.level-bars--three i { opacity: 1; }

.primary-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 17px;
  padding: 5px 6px 5px 18px;
  border: 0;
  border-radius: 15px;
  color: var(--ink);
  background: var(--lime);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--lime) 30%, transparent);
  transition: transform 160ms ease, background-color 160ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: var(--color-primary-hover);
}

.primary-button__arrow {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--ink) 9%, transparent);
}

.primary-button svg {
  width: 21px;
  height: 21px;
}

.game-dialog {
  align-items: center;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 27px;
  color: var(--ink);
  background: var(--paper-raised);
  box-shadow: var(--shadow-raised);
  text-align: center;
}

.dialog-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  color: var(--ink);
  background: var(--lime);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 700;
}

.dialog-icon--pause {
  grid-template-columns: repeat(2, 6px);
  gap: 7px;
}

.dialog-icon--pause i {
  height: 25px;
  border-radius: 4px;
  background: var(--ink);
}

.dialog-icon--result.is-player-two {
  color: var(--color-canvas);
  background: var(--blue);
}

.dialog-kicker {
  margin: 18px 0 0;
  color: var(--blue);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.game-dialog h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 7vw, 3.5rem);
  font-weight: 500;
  letter-spacing: -0.05em;
}

.game-dialog > p:not(.dialog-kicker) {
  max-width: 360px;
  margin: 10px 0 0;
  color: var(--ink-muted);
  line-height: 1.55;
}

.game-dialog .primary-button {
  max-width: 330px;
  margin-top: 23px;
}

.dialog-text-button {
  min-height: 44px;
  margin-top: 7px;
  padding: 8px 14px;
  border: 0;
  color: var(--ink-muted);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 800;
}

.dialog-text-button:hover {
  color: var(--blue);
}
