@font-face { font-family: "Barlow"; src: url(../fonts/barlow-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(../fonts/barlow-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url(../fonts/barlow-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Built for direct sunlight: white paper, dark ink, one deep fairway green. */
  --fairway: #1E5A3A;
  --fairway-deep: #143F28;
  --rough: #E4EBE6;
  --sand: #D9CB9C;
  --flag: #D7263D;
  --ink: #16201A;
  --ink-2: #4A574F;
  --paper: #FFFFFF;

  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, sans-serif;

  --tabs-h: 64px;
  --r-big: 14px;
  --r-small: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 17px/1.45 var(--body);
  color: var(--ink);
  background: var(--paper);
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom));
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 20px 10px;
  background: var(--fairway); color: #fff;
}
.brand { font: 700 22px/1 var(--display); letter-spacing: .01em; }
.top-status { font-size: 14px; opacity: .9; text-align: right; }

main { max-width: 560px; margin: 0 auto; padding: 0 20px; }
.view { padding: 18px 0 28px; }
h1 { font: 700 34px/1.05 var(--display); margin: 6px 0 6px; }
.lede, .hint { color: var(--ink-2); }
.hint { font-size: 15px; margin: 8px 0 0; }

/* Yardage input */
.yardage { display: grid; grid-template-columns: 48px 48px 1fr 48px 48px; gap: 6px; align-items: center; }
.step {
  height: 52px; border: 2px solid var(--rough); background: var(--paper); border-radius: var(--r-small);
  font: 600 18px/1 var(--display); color: var(--fairway); cursor: pointer;
}
.step:active { background: var(--rough); }
.yd { display: flex; flex-direction: column; align-items: center; }
.yd input {
  width: 100%; text-align: center; border: 0; background: transparent;
  font: 700 56px/1 var(--display); color: var(--ink); padding: 0; -moz-appearance: textfield;
}
.yd input::-webkit-outer-spin-button, .yd input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.yd span { font-size: 14px; color: var(--ink-2); margin-top: 2px; }

/* The answer: the one loud thing on the screen */
.answer { margin: 22px 0 8px; min-height: 180px; }
.answer .club { font: 700 clamp(64px, 20vw, 96px)/.9 var(--display); color: var(--fairway); margin: 0; }
.answer .why { font-size: 19px; margin: 10px 0 12px; }
.answer .why strong { font-weight: 600; }
.split { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--rough); }
.split span { display: block; height: 100%; }
.split .s { background: var(--sand); }
.split .i { background: var(--fairway); }
.split .l { background: #9FB3A6; }
.split-key { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.backup-club { margin: 14px 0 0; font-size: 17px; }
.warn { margin: 12px 0 0; padding: 10px 12px; border-left: 4px solid var(--flag); background: #FBEFF1; font-size: 15px; }
.empty { padding: 18px 0; }
.empty p { margin: 0 0 14px; font-size: 18px; }

/* Landing zone */
.zone { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid var(--rough); border-bottom: 1px solid var(--rough); margin: 10px 0 16px; }
.zone-ctl { display: flex; align-items: center; gap: 10px; }
.zone output { font: 600 20px/1 var(--display); min-width: 64px; text-align: center; }
.mini { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--rough); background: var(--paper); font-size: 20px; cursor: pointer; }

/* Bag chart: each club as a carry range on one shared yardage scale */
.bag { margin: 0; }
.bag figcaption { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.chart { position: relative; }
.row { display: grid; grid-template-columns: 76px 1fr 40px; align-items: center; height: 30px; }
.row .nm { font: 600 17px/1 var(--display); }
.row .md { font: 600 17px/1 var(--display); text-align: right; }
.row.pick .nm, .row.pick .md { color: var(--fairway); }
.track { position: relative; height: 100%; }
.track .w { position: absolute; top: 14px; height: 2px; background: var(--sand); }
.track .q { position: absolute; top: 9px; height: 12px; border-radius: 6px; background: #8FA798; }
.row.pick .track .q { background: var(--fairway); }
.track .m { position: absolute; top: 6px; width: 2px; height: 18px; background: var(--ink); }
.axis { display: grid; grid-template-columns: 76px 1fr 40px; height: 20px; }
.axis .scale { position: relative; font-size: 12px; color: var(--ink-2); }
.axis .scale span { position: absolute; transform: translateX(-50%); }
.flagline { position: absolute; top: 0; bottom: 20px; width: 2px; background: var(--flag); pointer-events: none; }
.flagline::before { content: ""; position: absolute; top: -2px; left: 2px; border-left: 12px solid var(--flag); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }

/* Club list */
.club-list { margin-top: 18px; }
.club { padding: 14px 0; border-top: 1px solid var(--rough); }
.club-head { display: flex; justify-content: space-between; align-items: baseline; }
.club-head h2 { font: 700 26px/1 var(--display); margin: 0; }
.club-head .big { font: 700 30px/1 var(--display); }
.club-head .big small { font: 500 15px/1 var(--body); color: var(--ink-2); margin-left: 3px; }
.club dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 8px 0 0; font-size: 15px; }
.club dt { color: var(--ink-2); }
.club dd { margin: 0; }
.conf-thin { color: #8A5A00; }
.conf-very { color: var(--flag); }

/* Sessions */
.import { margin: 12px 0 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px;
  border-radius: var(--r-small); border: 2px solid var(--fairway); background: var(--paper); color: var(--fairway);
  font: 600 17px/1 var(--body); cursor: pointer;
}
.btn.primary { background: var(--fairway); color: #fff; }
.btn.danger { border-color: var(--rough); color: var(--flag); min-height: 40px; padding: 0 12px; font-size: 15px; }
.settings { padding: 14px 0; border-top: 1px solid var(--rough); }
.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; }
.field select, .field input { min-height: 44px; border: 2px solid var(--rough); border-radius: var(--r-small); padding: 0 10px; background: var(--paper); }
.session-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rough); }
.session-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rough); }
.session-list .d { font: 600 20px/1.1 var(--display); }
.session-list .meta { font-size: 15px; color: var(--ink-2); }
.session-list li.off .d { color: var(--ink-2); text-decoration: line-through; }
.s-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.s-actions .btn { width: 108px; white-space: nowrap; }
.btn.quiet { border-color: var(--rough); min-height: 40px; padding: 0 12px; font-size: 15px; }
.backup { margin-top: 22px; }

/* Tabs */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper); border-top: 1px solid var(--rough);
}
.tabs button { border: 0; background: none; font: 600 19px/1 var(--display); color: var(--ink-2); cursor: pointer; position: relative; }
.tabs button[aria-current="page"] { color: var(--fairway); }
.tabs button[aria-current="page"]::after { content: ""; position: absolute; left: 30%; right: 30%; top: 0; height: 3px; background: var(--fairway); border-radius: 0 0 3px 3px; }

@media (prefers-reduced-motion: no-preference) {
  .answer .club { transition: opacity .15s; }
}
