:root {
  color-scheme: dark;
  --green-950: #071712;
  --green-900: #0b211a;
  --green-850: #102a22;
  --green-800: #15372d;
  --green-700: #205343;
  --green-500: #4d8c6d;
  --green-300: #a6c9b5;
  --cream: #f4f0e5;
  --cream-2: #e9e2d2;
  --ink: #14221c;
  --muted-ink: #68756e;
  --lime: #cce578;
  --lime-bright: #dbf58a;
  --amber: #f1c96f;
  --danger: #b5483f;
  --white: #fffef8;
  --line-light: rgba(244, 240, 229, 0.2);
  --glass: rgba(7, 23, 18, 0.66);
  --shadow: 0 22px 70px rgba(1, 12, 8, 0.32);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--green-950);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--green-950);
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
output {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(219, 245, 138, 0.9);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
  fill: currentColor;
}

.app-shell {
  min-height: 100svh;
}

.welcome-screen {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  overflow: hidden;
  padding: calc(22px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background:
    linear-gradient(180deg, rgba(25, 62, 50, 0.2), transparent 34%),
    radial-gradient(circle at 50% 35%, #173b30 0, var(--green-900) 46%, var(--green-950) 100%);
}

.welcome-screen::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 62%);
}

.welcome-glow {
  position: absolute;
  z-index: -1;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  opacity: 0.22;
  filter: blur(70px);
  pointer-events: none;
}

.welcome-glow--one {
  top: -80px;
  right: -120px;
  background: var(--lime);
}

.welcome-glow--two {
  bottom: 12%;
  left: -140px;
  background: #2c8061;
}

.brand-lockup,
.camera-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(219, 245, 138, 0.36);
  border-radius: 50%;
  background: rgba(219, 245, 138, 0.08);
}

.brand-mark__ball {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime-bright);
  box-shadow: 0 0 12px rgba(219, 245, 138, 0.65);
}

.brand-mark__line {
  position: absolute;
  bottom: 7px;
  left: 8px;
  width: 15px;
  height: 1px;
  background: rgba(244, 240, 229, 0.55);
}

.welcome-copy {
  width: min(100%, 470px);
  margin: clamp(44px, 9vh, 84px) auto 0;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--lime);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.eyebrow--dark {
  color: var(--green-700);
}

.welcome-copy h1 {
  margin: 0;
  color: var(--white);
  font-family: var(--font-serif);
  font-size: clamp(2.65rem, 12vw, 4.7rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.91;
}

.welcome-copy h1 em {
  color: var(--lime-bright);
  font-weight: 400;
}

.welcome-lede {
  max-width: 390px;
  margin: 23px auto 0;
  color: rgba(244, 240, 229, 0.72);
  font-size: 0.98rem;
  line-height: 1.55;
}

.tempo-visual {
  width: min(100%, 430px);
  margin: clamp(32px, 6vh, 62px) auto clamp(28px, 5vh, 48px);
  padding: 20px 22px 16px;
  border: 1px solid rgba(244, 240, 229, 0.12);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 20px 50px rgba(2, 14, 10, 0.24);
  backdrop-filter: blur(18px);
}

.tempo-visual__track {
  position: relative;
  height: 62px;
  border-bottom: 1px solid rgba(244, 240, 229, 0.18);
}

.tempo-visual__track::before,
.tempo-visual__track::after {
  position: absolute;
  bottom: -3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(244, 240, 229, 0.32);
  content: "";
}

.tempo-visual__track::before {
  left: 3%;
}

.tempo-visual__track::after {
  right: 3%;
}

.tempo-visual__trail {
  position: absolute;
  right: 18%;
  bottom: 8px;
  left: 8%;
  height: 21px;
  border-top: 1px dashed rgba(219, 245, 138, 0.34);
  border-radius: 50%;
}

.tempo-visual__putter {
  position: absolute;
  bottom: 2px;
  left: 64%;
  width: 32px;
  height: 55px;
  transform: rotate(-7deg);
  transform-origin: 16px 52px;
}

.tempo-visual__shaft {
  position: absolute;
  top: 0;
  left: 15px;
  width: 2px;
  height: 47px;
  border-radius: 2px;
  background: linear-gradient(to right, #9baaa1, #edf4ef, #79877f);
}

.tempo-visual__head {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 29px;
  height: 7px;
  border-radius: 5px 4px 3px 3px;
  background: var(--lime-bright);
  box-shadow: 0 0 16px rgba(219, 245, 138, 0.28);
}

.tempo-visual__ball {
  position: absolute;
  right: 13%;
  bottom: 3px;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(12, 31, 24, 0.35);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22);
}

.tempo-visual__stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding-top: 14px;
  color: rgba(244, 240, 229, 0.54);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tempo-visual__stats strong {
  margin-right: 3px;
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
}

.tempo-visual__divider {
  width: 1px;
  height: 17px;
  background: rgba(244, 240, 229, 0.18);
}

.welcome-actions {
  width: min(100%, 430px);
  margin: auto auto 0;
}

.button {
  display: flex;
  width: 100%;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.015em;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.button:active {
  transform: scale(0.985);
}

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

.button--primary {
  background: var(--lime-bright);
  color: var(--green-950);
  box-shadow: 0 14px 36px rgba(126, 165, 57, 0.19);
}

.button--primary:hover {
  background: #e5fa9d;
  box-shadow: 0 16px 40px rgba(126, 165, 57, 0.25);
}

.button--secondary {
  min-height: 49px;
  margin-top: 5px;
  background: transparent;
  color: rgba(244, 240, 229, 0.78);
  font-weight: 700;
}

.button--secondary:hover {
  color: var(--white);
}

.button--dark {
  background: var(--green-900);
  color: var(--cream);
}

.button--dark:hover {
  background: var(--green-800);
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 0 0;
  color: rgba(244, 240, 229, 0.38);
  font-size: 0.71rem;
}

.privacy-note svg {
  width: 13px;
  height: 13px;
}

/* Camera experience */
.camera-screen,
.camera-stage {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #07110e;
}

.camera-stage {
  isolation: isolate;
}

.camera-stage.is-demo {
  background:
    radial-gradient(circle at 50% 42%, rgba(50, 111, 84, 0.6), transparent 38%),
    linear-gradient(155deg, #173b30, #06130e 72%);
}

.camera-stage.is-demo::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 30px 30px;
  content: "";
}

.camera-feed {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-feed.is-mirrored {
  transform: scaleX(-1);
}

.motion-canvas {
  position: absolute;
  z-index: -4;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.camera-shade {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3, 15, 10, 0.72) 0, rgba(3, 15, 10, 0.1) 28%, rgba(3, 15, 10, 0.03) 55%, rgba(3, 15, 10, 0.92) 100%),
    linear-gradient(90deg, rgba(3, 15, 10, 0.15), transparent 28%, transparent 72%, rgba(3, 15, 10, 0.15));
  pointer-events: none;
}

.camera-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}

.camera-brand {
  gap: 7px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.61rem;
  letter-spacing: 0.16em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.camera-brand__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime-bright);
  box-shadow: 0 0 0 4px rgba(219, 245, 138, 0.13), 0 0 12px rgba(219, 245, 138, 0.45);
}

.camera-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.target-chip,
.icon-button {
  border: 1px solid rgba(255, 255, 255, 0.17);
  color: var(--white);
  background: rgba(4, 19, 14, 0.58);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 6px 22px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(16px);
}

.target-chip {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 13px;
  cursor: pointer;
}

.target-chip span {
  color: rgba(255, 255, 255, 0.53);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.target-chip strong {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border-radius: 13px;
  cursor: pointer;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.camera-status {
  position: relative;
  z-index: 5;
  display: flex;
  width: max-content;
  max-width: calc(100% - 32px);
  align-items: center;
  gap: 11px;
  margin: 5px auto 0;
  padding: 9px 14px 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(4, 19, 14, 0.69);
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(18px);
  transition: background-color 180ms ease, border-color 180ms ease;
}

.camera-status__signal {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 50%;
  background: rgba(244, 240, 229, 0.1);
}

.camera-status__signal span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(241, 201, 111, 0.45);
}

.camera-status__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.camera-status__copy strong {
  overflow: hidden;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-status__copy small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-status--ready {
  border-color: rgba(219, 245, 138, 0.3);
  background: rgba(20, 53, 42, 0.82);
}

.camera-status--ready .camera-status__signal span {
  background: var(--lime-bright);
  box-shadow: 0 0 0 0 rgba(219, 245, 138, 0.42);
  animation: ready-pulse 1.65s ease-out infinite;
}

.camera-status--moving .camera-status__signal span {
  background: var(--white);
  box-shadow: 0 0 13px rgba(255, 255, 255, 0.72);
}

.camera-status--moving .camera-status__signal {
  animation: signal-beat 480ms ease-in-out infinite alternate;
}

@keyframes ready-pulse {
  0% { box-shadow: 0 0 0 0 rgba(219, 245, 138, 0.42); }
  70% { box-shadow: 0 0 0 9px rgba(219, 245, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(219, 245, 138, 0); }
}

@keyframes signal-beat {
  to { transform: scale(1.12); }
}

.alignment-guide {
  position: absolute;
  z-index: 1;
  top: clamp(132px, 18vh, 182px);
  right: max(15px, env(safe-area-inset-right));
  bottom: clamp(218px, 29vh, 280px);
  left: max(15px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.alignment-guide__instruction {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  text-transform: uppercase;
}

.stroke-zone {
  position: relative;
  width: min(100%, 480px);
  height: 100%;
  min-height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.015);
  box-shadow: inset 0 0 45px rgba(6, 27, 19, 0.12), 0 10px 40px rgba(0, 0, 0, 0.05);
}

.stroke-zone::before,
.stroke-zone::after {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: rgba(219, 245, 138, 0.83);
  content: "";
}

.stroke-zone::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
  border-radius: 24px 0 0;
}

.stroke-zone::after {
  top: -1px;
  right: -1px;
  border-top: 2px solid;
  border-right: 2px solid;
  border-radius: 0 24px 0 0;
}

.stroke-zone__edge {
  position: absolute;
  bottom: -1px;
  width: 26px;
  height: 26px;
  border-bottom: 2px solid rgba(219, 245, 138, 0.83);
}

.stroke-zone__edge--left {
  left: -1px;
  border-left: 2px solid rgba(219, 245, 138, 0.83);
  border-radius: 0 0 0 24px;
}

.stroke-zone__edge--right {
  right: -1px;
  border-right: 2px solid rgba(219, 245, 138, 0.83);
  border-radius: 0 0 24px;
}

.stroke-zone__baseline {
  position: absolute;
  right: 8%;
  bottom: 17%;
  left: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42) 12%, rgba(255, 255, 255, 0.42) 88%, transparent);
}

.stroke-zone__baseline::after {
  position: absolute;
  inset: -8px 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.25) 1px, transparent 1.5px);
  background-position: 0 7px;
  background-size: 14px 4px;
  content: "";
  opacity: 0.55;
}

.stroke-zone__address {
  position: absolute;
  top: 12%;
  bottom: 11%;
  left: 50%;
  border-left: 1px dashed rgba(219, 245, 138, 0.58);
}

.stroke-zone__address::before {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime-bright);
  box-shadow: 0 0 12px rgba(219, 245, 138, 0.55);
  content: "";
}

.stroke-zone__putter {
  position: absolute;
  top: 15%;
  bottom: 17%;
  left: 50%;
  width: 42px;
  opacity: 0.72;
  transform: translateX(calc(-50% + var(--putter-offset, 0px)));
  transition: transform 34ms linear;
}

.stroke-zone__shaft {
  position: absolute;
  top: 0;
  bottom: 6px;
  left: calc(50% - 1px);
  width: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.25));
}

.stroke-zone__head {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 9px;
  border: 1px solid rgba(219, 245, 138, 0.9);
  border-radius: 5px 5px 3px 3px;
  background: rgba(219, 245, 138, 0.1);
  box-shadow: 0 0 16px rgba(219, 245, 138, 0.18);
}

.stroke-zone__label {
  position: absolute;
  bottom: 8%;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.stroke-zone__label--back {
  left: 7%;
}

.stroke-zone__label--through {
  right: 7%;
}

.alignment-guide > p {
  margin: 9px 0 0;
  color: rgba(255, 255, 255, 0.63);
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.camera-hud {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.motion-meter {
  width: min(100%, 480px);
  margin: 0 auto 12px;
  padding: 11px 13px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  background: rgba(4, 19, 14, 0.61);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.13);
  backdrop-filter: blur(15px);
}

.motion-meter__topline {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.motion-meter__topline output {
  color: rgba(255, 255, 255, 0.82);
}

.motion-meter__track {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.motion-meter__fill {
  display: block;
  width: var(--motion-level);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-300), var(--lime-bright));
  box-shadow: 0 0 14px rgba(219, 245, 138, 0.42);
  transition: width 90ms linear;
}

.motion-meter__ready-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 13.5%;
  width: 1px;
  background: rgba(255, 255, 255, 0.62);
}

.recent-panel {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 14px 14px 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(5, 22, 16, 0.76);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.17);
  backdrop-filter: blur(20px);
}

.recent-panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.recent-panel__heading h2 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.recent-panel__heading > span {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.62rem;
}

.recent-putts {
  display: flex;
  min-height: 36px;
  gap: 7px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.recent-putts::-webkit-scrollbar {
  display: none;
}

.recent-putts__empty {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.36);
  font-size: 0.65rem;
}

.recent-putt {
  display: flex;
  min-width: 72px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-serif);
  font-size: 0.91rem;
  font-weight: 600;
}

.recent-putt::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime-bright);
  content: "";
}

.recent-putt--off::before {
  background: var(--amber);
}

/* Result sheet */
.sheet-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  background: rgba(2, 13, 9, 0.54);
  backdrop-filter: blur(4px);
}

.result-sheet {
  position: fixed;
  z-index: 31;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: calc(100svh - 44px);
  padding: 11px max(21px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(21px, env(safe-area-inset-left));
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  background: var(--cream);
  color: var(--ink);
  box-shadow: 0 -24px 70px rgba(1, 13, 9, 0.28);
  animation: sheet-up 260ms cubic-bezier(0.2, 0.75, 0.3, 1) both;
}

@keyframes sheet-up {
  from { transform: translateY(35px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.result-sheet__handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 21px;
  border-radius: 999px;
  background: rgba(20, 34, 28, 0.16);
}

.result-sheet__heading {
  display: flex;
  max-width: 520px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin: 0 auto 22px;
}

.result-sheet__heading h2,
.settings-dialog h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.confidence-badge {
  flex: 0 0 auto;
  margin-top: 3px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(32, 83, 67, 0.1);
  color: var(--green-700);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ratio-result {
  position: relative;
  display: grid;
  max-width: 520px;
  grid-template-columns: auto 1fr 84px;
  align-items: center;
  gap: 14px;
  margin: 0 auto 17px;
  padding: 17px 15px;
  overflow: hidden;
  border-radius: 20px;
  background: var(--green-900);
  color: var(--cream);
}

.ratio-result::before {
  position: absolute;
  top: -50px;
  left: -50px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(219, 245, 138, 0.07);
  content: "";
}

.ratio-result__value {
  display: flex;
  align-items: baseline;
}

.ratio-result__value strong {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 14vw, 4.3rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.85;
}

.ratio-result__value span {
  margin-left: 3px;
  color: var(--lime-bright);
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

.ratio-result__target {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ratio-result__target > span {
  color: rgba(244, 240, 229, 0.48);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ratio-result__target small {
  color: rgba(244, 240, 229, 0.72);
  font-size: 0.67rem;
}

.ratio-result__target small strong {
  color: var(--cream);
}

.ratio-arc {
  position: relative;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--lime-bright) var(--score), rgba(255, 255, 255, 0.11) 0);
}

.ratio-arc::before {
  position: absolute;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--green-900);
  content: "";
}

.ratio-arc span {
  z-index: 1;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime-bright);
  box-shadow: 0 0 11px rgba(219, 245, 138, 0.55);
}

.timing-grid {
  display: grid;
  max-width: 520px;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0 auto 17px;
}

.timing-grid > div {
  padding: 14px 15px;
  border: 1px solid rgba(20, 34, 28, 0.09);
  border-radius: 16px;
  background: rgba(255, 254, 248, 0.5);
}

.timing-grid dt {
  margin-bottom: 6px;
  color: var(--muted-ink);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.timing-grid dd {
  margin: 0;
  color: var(--green-900);
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
}

.timing-grid dd span {
  margin-left: 2px;
  color: var(--muted-ink);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
}

.result-feedback {
  max-width: 520px;
  margin: 0 auto 18px;
  padding-left: 13px;
  border-left: 2px solid var(--green-500);
  color: #526059;
  font-size: 0.82rem;
  line-height: 1.55;
}

.result-sheet .button {
  max-width: 520px;
  margin: 0 auto;
}

/* Settings */
.settings-dialog {
  width: min(calc(100% - 24px), 500px);
  max-height: calc(100svh - 36px);
  margin: auto;
  padding: 0;
  overflow: hidden auto;
  border: 0;
  border-radius: 26px;
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.settings-dialog::backdrop {
  background: rgba(2, 13, 9, 0.7);
  backdrop-filter: blur(6px);
}

.settings-dialog form {
  padding: 23px 21px calc(20px + env(safe-area-inset-bottom));
}

.settings-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.close-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(20, 34, 28, 0.1);
  border-radius: 12px;
  background: rgba(20, 34, 28, 0.04);
  color: var(--ink);
  cursor: pointer;
}

.close-button svg {
  width: 19px;
  height: 19px;
}

.settings-group {
  margin: 0 0 21px;
  padding: 0;
  border: 0;
}

.settings-group legend,
.setting-label-row label {
  margin-bottom: 10px;
  color: var(--muted-ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(20, 34, 28, 0.07);
}

.segmented-control label {
  position: relative;
  cursor: pointer;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;
  min-height: 41px;
  place-items: center;
  border-radius: 10px;
  color: var(--muted-ink);
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 600;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.segmented-control input:checked + span {
  background: var(--white);
  color: var(--green-900);
  box-shadow: 0 3px 10px rgba(20, 34, 28, 0.09);
}

.segmented-control input:focus-visible + span {
  outline: 3px solid var(--green-500);
  outline-offset: 1px;
}

.setting-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.setting-label-row label {
  margin: 0;
}

.setting-label-row output {
  color: var(--green-700);
  font-size: 0.69rem;
  font-weight: 800;
}

.range-control {
  width: 100%;
  height: 5px;
  margin: 8px 0 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(90deg, var(--green-500) 0 50%, rgba(20, 34, 28, 0.13) 50%);
}

.range-control::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  border: 4px solid var(--white);
  border-radius: 50%;
  appearance: none;
  background: var(--green-700);
  box-shadow: 0 2px 8px rgba(20, 34, 28, 0.24);
}

.range-control::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 4px solid var(--white);
  border-radius: 50%;
  background: var(--green-700);
  box-shadow: 0 2px 8px rgba(20, 34, 28, 0.24);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: rgba(20, 34, 28, 0.42);
  font-size: 0.61rem;
}

.settings-group--rows {
  overflow: hidden;
  border: 1px solid rgba(20, 34, 28, 0.09);
  border-radius: 16px;
}

.toggle-row {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 14px;
  cursor: pointer;
}

.toggle-row + .toggle-row {
  border-top: 1px solid rgba(20, 34, 28, 0.08);
}

.toggle-row > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toggle-row strong {
  font-size: 0.81rem;
}

.toggle-row small {
  color: var(--muted-ink);
  font-size: 0.65rem;
}

.switch {
  position: relative;
  width: 43px;
  height: 25px;
  flex: 0 0 43px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch > span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(20, 34, 28, 0.17);
  transition: background-color 150ms ease;
}

.switch > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 6px rgba(20, 34, 28, 0.2);
  content: "";
  transition: transform 150ms ease;
}

.switch input:checked + span {
  background: var(--green-700);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.switch input:focus-visible + span {
  outline: 3px solid var(--green-500);
  outline-offset: 2px;
}

.text-button {
  display: block;
  margin: 14px auto 0;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 800;
}

.text-button--danger {
  color: var(--danger);
}

/* Alerts */
.toast {
  position: fixed;
  z-index: 50;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  display: grid;
  max-width: 500px;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: #18251f;
  color: var(--cream);
  box-shadow: 0 18px 50px rgba(1, 13, 9, 0.34);
  animation: toast-in 220ms ease-out both;
}

@keyframes toast-in {
  from { transform: translateY(15px); opacity: 0; }
}

.toast__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: rgba(241, 201, 111, 0.13);
  color: var(--amber);
}

.toast__icon svg {
  width: 19px;
  height: 19px;
}

.toast__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.toast__copy strong {
  font-size: 0.75rem;
}

.toast__copy small {
  color: rgba(244, 240, 229, 0.56);
  font-size: 0.62rem;
  line-height: 1.4;
}

.toast > button {
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--lime-bright);
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 800;
}

noscript {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 14px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  text-align: center;
}

@media (min-width: 700px) {
  .welcome-screen {
    padding-right: 40px;
    padding-left: 40px;
  }

  .welcome-copy {
    margin-top: clamp(50px, 8vh, 90px);
  }

  .alignment-guide {
    right: 8vw;
    left: 8vw;
  }

  .result-sheet {
    right: 50%;
    bottom: 18px;
    left: auto;
    width: min(calc(100% - 32px), 570px);
    border-radius: 28px;
    transform: translateX(50%);
    animation: sheet-up-tablet 260ms cubic-bezier(0.2, 0.75, 0.3, 1) both;
  }

  @keyframes sheet-up-tablet {
    from { transform: translate(50%, 35px); opacity: 0; }
    to { transform: translate(50%, 0); opacity: 1; }
  }
}

@media (max-height: 700px) {
  .welcome-copy {
    margin-top: 28px;
  }

  .welcome-copy h1 {
    font-size: clamp(2.35rem, 10vw, 3.5rem);
  }

  .welcome-lede {
    margin-top: 15px;
  }

  .tempo-visual {
    margin-top: 20px;
    margin-bottom: 16px;
    padding-top: 13px;
    padding-bottom: 10px;
  }

  .tempo-visual__track {
    height: 51px;
  }

  .tempo-visual__putter {
    height: 45px;
  }

  .tempo-visual__shaft {
    height: 37px;
  }

  .alignment-guide {
    top: 125px;
    bottom: 204px;
  }

  .recent-panel {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .result-sheet__handle {
    margin-bottom: 14px;
  }

  .result-sheet__heading {
    margin-bottom: 14px;
  }

  .ratio-result {
    margin-bottom: 10px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .timing-grid,
  .result-feedback {
    margin-bottom: 10px;
  }
}

@media (max-width: 370px) {
  .welcome-screen {
    padding-right: 17px;
    padding-left: 17px;
  }

  .welcome-copy h1 {
    font-size: 2.52rem;
  }

  .camera-brand span:last-child {
    display: none;
  }

  .target-chip span {
    display: none;
  }

  .ratio-result {
    grid-template-columns: auto 1fr 64px;
    gap: 9px;
  }

  .ratio-arc {
    width: 60px;
    height: 60px;
  }

  .ratio-arc::before {
    width: 49px;
    height: 49px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
