@font-face { font-family: 'PJS'; src: url('fonts/pjs-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PJS'; src: url('fonts/pjs-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'PJS'; src: url('fonts/pjs-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'PJS'; src: url('fonts/pjs-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'PJS'; src: url('fonts/pjs-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  --bg: #1D2B2A; --surf: #263837; --bd: #354A49; --bd2: #4B6260; --line: #2E4342;
  --tx: #F1F6F2; --tx2: #DCE5E2; --mut: #AEBFBB; --faint: #7F918C;
  --acc: #A9D18E; --onacc: #1D2B2A; --acc-soft: rgba(169,209,142,0.12); --acc-line: rgba(169,209,142,0.55);
  --card: #F7FAF8; --cardtx: #1D2B2A; --cardmut: #4D5E54; --cardtx2: #33443A; --cardline: #DDE5E1; --club: #2A6B4A; --cardbd: transparent;
  --amber: #E8B76A; --ice: #8CC4EA; --red: #F2B8A0;
  --tog: #6DB389; --togoff: #3E5654;
  --nav: #F7FAF8; --navtx: #4D5E54; --navact: #1D2B2A; --navacttx: #F1F6F2; --navbd: transparent;
  --btn: #1D2B2A; --btntx: #F1F6F2; --path: #36524E; --hole: #4A6B64; --pole: #F1F6F2;
  --primary: #F7FAF8; --primarytx: #1D2B2A;
}
body.sun {
  --bg: #EEF2F0; --surf: #FFFFFF; --bd: #CBD5D0; --bd2: #A8B6B0; --line: #E1E7E4;
  --tx: #0F1A17; --tx2: #24312D; --mut: #4A5753; --faint: #6B7874;
  --acc: #1F6B43; --onacc: #FFFFFF; --acc-soft: rgba(31,107,67,0.10); --acc-line: rgba(31,107,67,0.55);
  --card: #FFFFFF; --cardbd: #CBD5D0;
  --amber: #B45F06; --ice: #1F6FB2; --red: #B3261E;
  --tog: #1F6B43; --togoff: #B9C6C0;
  --nav: #FFFFFF; --navtx: #4A5753; --navact: #13201D; --navacttx: #FFFFFF; --navbd: #CBD5D0;
  --btn: #FFFFFF; --btntx: #0F1A17; --path: #DCE7E1; --hole: #9DB7A9; --pole: #0F1A17;
  --primary: #13201D; --primarytx: #FFFFFF;
}
body.sun .mod.on { color: #FFFFFF; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { font-family: 'PJS', system-ui, -apple-system, sans-serif; color: var(--tx); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, textarea { font-family: inherit; }
button { cursor: pointer; color: inherit; }
a { color: var(--acc); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 480px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 20px 12px; }
.page-head { padding: 10px 20px 0; }
.back { display: inline-flex; align-items: center; height: 44px; font-size: 14px; font-weight: 700; color: var(--acc); text-decoration: none; background: none; border: 0; padding: 0; }
.h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.6px; margin: 0; }
.sub { font-size: 13px; color: var(--mut); margin-top: 4px; line-height: 1.45; }
.label { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; color: var(--mut); margin: 14px 4px 6px; text-transform: uppercase; }

/* Tab bar */
.tabs { flex: none; margin: 0 16px calc(8px + env(safe-area-inset-bottom)); height: 58px; border-radius: 32px; background: var(--nav); border: 1px solid var(--navbd); display: flex; justify-content: space-around; align-items: center; }
.tab { width: 44px; height: 44px; border: 0; background: none; display: flex; align-items: center; justify-content: center; color: var(--navtx); position: relative; padding: 0; }
.tab.on { width: auto; padding: 0 16px; border-radius: 22px; background: var(--navact); color: var(--navacttx); gap: 6px; font-size: 13px; font-weight: 700; }
.tab .dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 4px; background: var(--amber); }
.tab.on .dot { top: 6px; right: 10px; }

/* Player chips */
.players { flex: none; padding: 8px 20px 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.players::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; border-radius: 20px; border: 1px solid var(--bd); background: var(--surf); color: var(--tx2); font-size: 14px; font-weight: 500; padding: 0 14px 0 4px; display: flex; align-items: center; gap: 8px; }
.chip .av { width: 32px; height: 32px; border-radius: 16px; background: var(--bd); color: var(--tx); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.chip.on { background: var(--card); color: var(--cardtx); border-color: var(--card); font-weight: 700; }
body.sun .chip.on { background: #13201D; color: #FFFFFF; border-color: #13201D; }
.chip.on .av { color: #1D2B2A; font-weight: 800; }
.chip.add { width: 40px; padding: 0; justify-content: center; border-style: dashed; border-color: var(--bd2); background: transparent; color: var(--mut); }

/* Distance box */
.hero { position: relative; margin-top: 12px; height: 136px; border-radius: 22px; background: var(--surf); border: 1px solid var(--bd); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.hero:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.hero svg.art { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.hero .cap { position: absolute; left: 18px; top: 14px; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; color: var(--mut); display: flex; align-items: center; gap: 6px; }
.hero .row { position: absolute; left: 0; right: 0; top: 28px; bottom: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; }
.round { width: 46px; height: 46px; border-radius: 23px; border: 1px solid var(--bd2); background: var(--btn); color: var(--btntx); padding: 0; display: flex; align-items: center; justify-content: center; flex: none; }
.dist { width: 170px; padding: 0; margin: 0; background: transparent; border: 0; border-radius: 0; color: var(--tx); caret-color: var(--acc); font-size: 72px; font-weight: 800; letter-spacing: -3px; line-height: 0.95; text-align: center; outline: none; font-variant-numeric: tabular-nums; }
.plays { position: absolute; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; pointer-events: none; transition: opacity .2s; }
.plays span { background: var(--acc-soft); border: 1px solid var(--acc-line); color: var(--acc); border-radius: 10px; padding: 2px 10px; font-size: 12px; font-weight: 800; letter-spacing: 0.4px; }

/* Conditions */
.cond { margin-top: 12px; background: var(--surf); border: 1px solid var(--bd); border-radius: 16px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.crow { display: grid; grid-template-columns: 40px repeat(4, minmax(0, 1fr)); align-items: center; gap: 4px; }
.crow > span { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; color: var(--mut); }
.opt { min-width: 0; height: 46px; border-radius: 10px; border: 0; background: transparent; color: var(--tx2); font-size: 11px; font-weight: 500; padding: 0 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; line-height: 1; }
.opt.on { background: var(--acc); color: var(--onacc); font-weight: 700; }
.mod { border: 1px dashed var(--modc); }
.mod.on { background: var(--modc); color: #1D2B2A; border-color: var(--modc); font-weight: 700; }
.mod.dis { opacity: 0.35; }

/* Club card */
.card { margin-top: 12px; background: var(--card); color: var(--cardtx); border: 1px solid var(--cardbd); border-radius: 22px; padding: 14px 18px; }
.card .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .meta { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; flex-wrap: wrap; }
.shot { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; color: var(--cardmut); }
.swap { height: 24px; padding: 0 8px; border-radius: 12px; border: 1px dashed #A7B8B0; background: #EEF3F0; color: var(--cardtx2); font-size: 11px; font-weight: 800; letter-spacing: 1.2px; display: flex; align-items: center; gap: 5px; }
.whybtn { height: 24px; padding: 0 9px; border-radius: 12px; border: 1px solid #C9D6CE; background: #FFFFFF; color: var(--club); font-size: 11px; font-weight: 800; }
.club { font-size: 36px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; color: var(--club); }
.club.long { font-size: 28px; }
.ring { flex: none; width: 60px; height: 60px; border-radius: 30px; border: 3px solid #A9D18E; display: flex; flex-direction: column; align-items: center; justify-content: center; }
body.sun .ring { border-color: #1F6B43; }
.ring b { font-size: 22px; font-weight: 800; line-height: 1; }
.ring b.word { font-size: 16px; }
.ring small { font-size: 11px; color: var(--cardmut); }
.tip { font-size: 14px; color: var(--cardtx2); margin-top: 8px; line-height: 1.4; }
.also { border-top: 1px solid var(--cardline); margin-top: 10px; padding-top: 8px; }
.also .h { font-size: 11px; font-weight: 800; letter-spacing: 1.4px; color: var(--cardmut); margin-bottom: 8px; }
.alt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; padding: 3px 0; }
.alt b { white-space: nowrap; }
.alt span { color: var(--cardmut); text-align: right; }

/* Feedback */
.fbbox { margin-top: 12px; background: var(--surf); border: 1px solid var(--bd); border-radius: 18px; padding: 12px; }
.fbh { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.fbh.saved { color: var(--acc); }
.fbrow { display: flex; gap: 8px; }
.fbb { flex: 1; height: 42px; border-radius: 12px; border: 1px solid var(--bd2); background: var(--btn); color: var(--btntx); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.fbb.on { background: var(--acc); color: var(--onacc); border-color: var(--acc); font-weight: 700; }

/* Sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(10,18,17,0.55); display: flex; flex-direction: column; justify-content: flex-end; z-index: 10; animation: fade .2s; }
.sheet { max-width: 480px; width: 100%; margin: 0 auto; background: var(--card); color: var(--cardtx); border-radius: 28px 28px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 90dvh; overflow-y: auto; animation: up .25s cubic-bezier(.2,.8,.2,1); }
.grab { width: 40px; height: 4px; border-radius: 2px; background: #C9D6CE; margin: 0 auto 14px; }
.tbl { margin-top: 12px; background: #FFFFFF; border: 1px solid var(--cardline); border-radius: 16px; padding: 4px 14px; }
.tbl > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #EDF2EF; font-size: 14px; }
.tbl > div:last-child { border-bottom: 0; }
.tbl span { color: var(--cardmut); }
.dec { margin-top: 10px; background: #E8F1EC; border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* Lists / settings */
.group { background: var(--surf); border: 1px solid var(--bd); border-radius: 18px; padding: 0 14px; }
.item { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; padding: 0; text-align: left; color: var(--tx); font-size: 15px; font-weight: 600; text-decoration: none; }
.item:last-child { border-bottom: 0; }
.item .t { flex: 1; min-width: 0; }
.item .t small { display: block; font-size: 12px; font-weight: 500; color: var(--mut); margin-top: 2px; }
.item.red { color: var(--red); font-weight: 700; }
.tile { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--bd); color: var(--acc); display: flex; align-items: center; justify-content: center; }
body.sun .tile { background: #E3EBE7; }
.tile.red { background: rgba(242,184,160,0.14); color: var(--red); }
.switch { flex: none; width: 46px; height: 28px; border: 0; border-radius: 14px; padding: 3px; background: var(--togoff); display: flex; justify-content: flex-start; transition: background .15s; }
.switch.on { background: var(--tog); justify-content: flex-end; }
.switch span { width: 22px; height: 22px; border-radius: 11px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.seg { flex: none; display: flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { height: 34px; padding: 0 10px; border-radius: 8px; border: 0; background: transparent; color: var(--tx2); font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--acc); color: var(--onacc); font-weight: 700; }
.seg.wide { width: 100%; }
.seg.wide button { flex: 1; }
.stepper { flex: none; display: flex; align-items: center; gap: 6px; }
.stepper .round { width: 34px; height: 34px; }
.stepper b { min-width: 58px; text-align: center; font-size: 15px; font-weight: 800; white-space: nowrap; }
.stepper b.chg { color: var(--acc); }

/* Update card */
.upd { background: var(--card); color: var(--cardtx); border: 1px solid var(--cardbd); border-radius: 22px; padding: 16px; }
.upd .row1 { display: flex; align-items: center; gap: 14px; }
.appicon { width: 56px; height: 56px; border-radius: 16px; background: #1D2B2A; display: flex; align-items: center; justify-content: center; flex: none; color: #A9D18E; }
.upd .row2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; min-height: 40px; }
.dark-btn { flex: none; height: 40px; padding: 0 14px; border-radius: 12px; border: 0; background: #1D2B2A; color: #F1F6F2; font-size: 13px; font-weight: 700; white-space: nowrap; }
.light-btn { flex: none; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid #C9D6CE; background: #FFFFFF; color: #1D2B2A; font-size: 13px; font-weight: 700; white-space: nowrap; }
.spin { width: 18px; height: 18px; border-radius: 9px; border: 2px solid #C9D6CE; border-top-color: #2A6B4A; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.newbox { margin-top: 14px; background: #E8F1EC; border-radius: 14px; padding: 12px 14px; }
.bar { height: 6px; border-radius: 3px; background: #DDE5E1; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 6px; background: #2A6B4A; animation: grow 1.6s ease-out forwards; }
@keyframes grow { from { width: 8%; } to { width: 100%; } }

/* Forms / buttons */
.field { width: 100%; border-radius: 14px; border: 1px solid var(--bd2); background: var(--surf); color: var(--tx); font-size: 16px; outline: none; padding: 0 14px; height: 50px; }
textarea.field { height: 128px; padding: 12px 14px; line-height: 1.45; resize: none; }
.field:focus { border-color: var(--acc); }
.field::placeholder { color: var(--faint); }
.primary { width: 100%; height: 54px; border-radius: 16px; border: 0; background: var(--primary); color: var(--primarytx); font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; }
.primary[disabled] { opacity: 0.4; }
.ghost { flex: 1; height: 48px; border-radius: 14px; border: 1px solid var(--bd2); background: transparent; color: var(--tx); font-size: 14px; font-weight: 700; }
.note { font-size: 12px; color: var(--mut); line-height: 1.5; text-align: center; margin-top: 10px; }

/* Bag */
.club-row { display: flex; align-items: center; gap: 12px; height: 50px; border-bottom: 1px solid var(--line); }
.club-row:last-child { border-bottom: 0; }
.club-row .info { flex: 1; min-width: 0; }
.club-row .info.off { opacity: 0.45; }
.club-row .nm { display: flex; justify-content: space-between; font-size: 14px; }
.club-row .nm b { font-weight: 700; }
.club-row .nm span { color: var(--tx2); font-weight: 600; }
.learn { font-size: 10px; font-weight: 800; color: var(--acc); margin-left: 6px; }
.gauge { height: 5px; background: var(--bd); border-radius: 3px; margin-top: 6px; }
.gauge i { display: block; height: 5px; border-radius: 3px; background: var(--acc); }
.badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 10px; background: var(--surf); color: var(--mut); }
.badge.over { background: var(--red); color: #1D2B2A; }

/* Players */
.pcard { background: var(--surf); border: 1px solid var(--bd); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; }
.pcard.active { border-color: var(--acc-line); }
.phead { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; color: var(--tx); text-align: left; }
.pav { flex: none; width: 44px; height: 44px; border-radius: 22px; color: #1D2B2A; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; }
.tag { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; color: var(--acc); border: 1px solid var(--acc-line); border-radius: 8px; padding: 1px 6px; }
.pedit { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.mini { font-size: 10px; font-weight: 700; letter-spacing: 1.4px; color: var(--mut); margin-bottom: 6px; }
.swatch { width: 32px; height: 32px; border-radius: 16px; border: 0; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor; }
.danger { flex: 1; height: 44px; border-radius: 12px; border: 1px solid rgba(242,184,160,0.45); background: transparent; color: var(--red); font-size: 14px; font-weight: 700; }
.light { flex: 1; height: 44px; border-radius: 12px; border: 0; background: var(--primary); color: var(--primarytx); font-size: 14px; font-weight: 700; }

/* How it works */
.how { background: var(--surf); border: 1px solid var(--bd); border-radius: 18px; padding: 16px; margin-bottom: 16px; }
.how h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; font-weight: 800; }
.how h3 i { font-style: normal; width: 26px; height: 26px; border-radius: 13px; background: var(--acc); color: var(--onacc); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.how p { font-size: 13px; color: var(--tx2); margin: 8px 0 6px; line-height: 1.5; }
.how .r { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.how .r:last-child { border-bottom: 0; }
.how .r span { display: flex; align-items: center; gap: 8px; color: var(--tx); }
.how .r span svg { color: var(--acc); }
.how .r em { font-style: normal; color: var(--tx2); text-align: right; }

/* Setup */
.setup { flex: 1; display: flex; flex-direction: column; padding: 16px 24px calc(24px + env(safe-area-inset-bottom)); }
.steps { display: flex; gap: 6px; margin-top: 4px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--bd); }
.steps i.on { background: var(--acc); }
.quick { width: 100%; height: 50px; border-radius: 14px; border: 1px solid var(--bd); background: var(--surf); color: var(--tx); font-size: 14px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.quick.on { background: var(--acc); color: var(--onacc); border-color: var(--acc); }
.setcard { width: 100%; text-align: left; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; color: var(--tx); background: var(--surf); border: 2px solid var(--bd); }
.setcard.on { border-color: var(--acc); }
.tick { width: 24px; height: 24px; border-radius: 12px; border: 2px solid var(--bd2); display: flex; align-items: center; justify-content: center; color: transparent; }
.setcard.on .tick { background: var(--acc); border-color: var(--acc); color: var(--onacc); }

.typeb { height: 58px; border-radius: 12px; border: 1px solid var(--bd); background: var(--surf); color: var(--tx2); font-size: 12px; font-weight: 500; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.typeb.on { background: var(--acc); color: var(--onacc); border-color: var(--acc); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--card); color: var(--cardtx); border-radius: 14px; padding: 10px 16px; font-size: 14px; font-weight: 700; box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 20; animation: up .25s; max-width: 90vw; text-align: center; }

@keyframes nudge { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* Install screen: one page on any iPhone, scrolls only if it truly must */
.inst { overflow-y: auto; gap: 20px; }
.inst-main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.inst-h { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; margin-top: 32px; }
.inst-p { font-size: 15px; line-height: 1.5; margin-top: 8px; }
.inst-steps { margin-top: 22px; padding: 0 16px; }
.stepi { padding: 12px 0; }
.stepi:last-child { border-bottom: 0 !important; }
.inst-foot { flex: none; }
@media (max-height: 700px) {
  .inst { padding-top: 8px; gap: 14px; }
  .inst-h { font-size: 21px; margin-top: 18px; }
  .inst-p { font-size: 14px; margin-top: 6px; }
  .inst-steps { margin-top: 14px; }
  .stepi { padding: 8px 0; font-size: 14px; }
  .inst-note { display: none; }
}
@media (max-height: 600px) {
  .inst-p { display: none; }
  .inst img { width: 48px; height: 48px; }
}
