/*
VOICE: clubhouse banter, a rules official with a sense of humour.
IDEA: a scorecard and a rules sheet: each scenario is a hole on the card.
PICTURE: a putting green with flag and bunker; the golf-ball mascot reacts to every ruling.
COLOUR and TYPE: fairway green dominant, scorecard white, flag yellow accent; Young Serif + Public Sans.
LAYOUT: one 660px column; a green hero band, then the card, the choices and the ruling.
*/
:root {
  color-scheme: light dark;
  --bg: light-dark(#f7f8f3, #0e1a14);
  --card: light-dark(#ffffff, #15251c);
  --ink: light-dark(#10291d, #e9f1ea);
  --muted: light-dark(#5a6b61, #9fb3a6);
  --line: light-dark(#d6ddd5, #2a3d31);
  --green: light-dark(#1d6b40, #2f8a56);
  --green-2: light-dark(#258050, #389962);
  --deep: light-dark(#0f3d26, #0a2a1a);
  --flag: #f4c430;
  --sand: light-dark(#ecd9a8, #8f7b4c);
  --good: light-dark(#1a7a45, #5cc98a);
  --bad: light-dark(#b8281d, #f07a6e);
  --good-bg: light-dark(#e5f4ea, #173a26);
  --bad-bg: light-dark(#fbe8e5, #3d1c18);
  --serif: "Young Serif", Georgia, serif;
  --sans: "Public Sans", system-ui, sans-serif;
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }
* { box-sizing: border-box; min-width: 0; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); overflow-x: clip; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }
.wrap { max-width: 660px; margin: 0 auto; padding: 18px 16px 64px; }
.hidden { display: none !important; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 24px; font-size: 14px; color: var(--muted); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.brand .ball { width: 30px; height: 30px; margin: -6px 0; }
.brand b { font: 400 18px/1 var(--serif); }
.pips { display: flex; gap: 5px; flex: none; }
.pip { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font: 700 11px var(--sans); color: var(--muted); }
.pip.on { border-color: var(--ink); color: var(--ink); }
.pip.good { background: var(--good); border-color: var(--good); color: #fff; }
.pip.bad { background: var(--bad); border-color: var(--bad); color: #fff; }

h1 { font: 400 clamp(42px, 10vw, 60px)/1.02 var(--serif); margin: 6px 0 14px; text-wrap: balance; }
h2 { font: 400 clamp(28px, 6vw, 36px)/1.08 var(--serif); margin: 0 0 14px; text-wrap: balance; }
.dayline { font-size: 14px; font-weight: 600; color: var(--green); }
.lede { font-size: 19px; max-width: 36ch; margin: 0 0 12px; }
.how { color: var(--muted); max-width: 46ch; margin: 0 0 24px; }

.hero { margin: 0 -16px 22px; background: var(--deep); }
.hero svg { display: block; width: 100%; height: auto; }
@media (min-width: 692px) { .hero { margin: 0 0 22px; border-radius: 14px; overflow: hidden; } }

.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; background: var(--green); color: #fff; border: 0; border-radius: 999px; padding: 12px 24px; font-weight: 700; font-size: 16px; text-decoration: none; transition: background .15s, transform .08s; }
.btn:hover { background: var(--deep); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* The scorecard */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; margin-bottom: 22px; }
.card-head { display: grid; grid-template-columns: auto 1fr; background: var(--green); color: #fff; }
.card-head .hole { padding: 10px 16px; border-right: 2px solid rgba(255,255,255,.35); text-align: center; }
.card-head .hole small { display: block; font-size: 12px; opacity: .85; }
.card-head .hole b { font: 400 30px/1 var(--serif); }
.card-head .meta { padding: 10px 16px; display: flex; flex-direction: column; justify-content: center; font-size: 14px; }
.card-head .meta b { font-size: 15px; }
.card-body { padding: 16px 18px 18px; }
.card-title { font: 400 clamp(26px, 6vw, 32px)/1.1 var(--serif); margin: 0 0 8px; }
.card-scene { margin: 0; font-size: 18px; }
.card-foot { border-top: 1.5px dashed var(--line); padding: 8px 18px; font-size: 13px; color: var(--muted); }

.q { font-weight: 700; font-size: 19px; margin: 0 0 12px; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 10px; padding: 14px 16px; min-height: 48px; font-size: 17px; line-height: 1.35; display: flex; gap: 14px; align-items: baseline; transition: border-color .12s, background .12s; }
.opt:hover:not(:disabled) { border-color: var(--green); }
.opt:disabled { cursor: default; }
.opt .k { font-weight: 700; font-size: 14px; color: var(--muted); flex: none; }
.opt.right { border-color: var(--good); background: var(--good-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.dim { opacity: .45; }

/* The ruling */
.reveal { margin-top: 24px; }
.verdict { display: flex; align-items: center; gap: 10px; font: 400 34px/1 var(--serif); margin: 0 0 8px; }
.verdict .ball { width: 56px; height: 56px; flex: none; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.quip { font-size: 18px; margin: 0 0 18px; }
.tip { border-left: 5px solid var(--flag); background: var(--card); padding: 12px 16px; margin-bottom: 14px; border-radius: 0 10px 10px 0; }
.tip b, .rulebox b.lbl { display: block; font-size: 14px; color: var(--green); margin-bottom: 4px; }
.tip p { margin: 0; font-size: 16px; }
.rulebox { border: 2px solid var(--ink); border-radius: 10px; padding: 12px 16px; margin-bottom: 20px; background: var(--card); }
.rulebox .rn { font: 400 24px/1.15 var(--serif); margin: 0 0 4px; }
.rulebox p { margin: 0; font-size: 15px; }
.rulebox .src { margin-top: 8px; font-size: 13px; color: var(--muted); }
.rulebox a, .foot a, .aware a { color: inherit; }

/* Results */
.scorerow { display: flex; align-items: center; gap: 10px; }
.score { font: 400 clamp(84px, 24vw, 132px)/.9 var(--serif); }
.score span { color: var(--muted); font-size: .42em; }
.scorerow .ball { width: clamp(90px, 24vw, 128px); height: auto; aspect-ratio: 1; }
.rank { font: 800 22px/1.2 var(--sans); margin: 4px 0 6px; }
.subhead { font: 400 26px/1.1 var(--serif); margin: 32px 0 12px; }
.next { font-size: 15px; color: var(--muted); margin: 18px 0 0; }
.next b { color: var(--ink); font-size: 18px; margin-left: 6px; font-variant-numeric: tabular-nums; }
.recap { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.recap li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.recap .m { font-weight: 800; }
.recap .m.good { color: var(--good); }
.recap .m.bad { color: var(--bad); }
.statgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 2px solid var(--ink); border-radius: 10px; background: var(--card); overflow: hidden; }
.statgrid div { padding: 12px 6px 10px; text-align: center; border-left: 1px solid var(--line); }
.statgrid div:first-child { border-left: 0; }
.statgrid b { display: block; font: 400 30px/1 var(--serif); }
.statgrid span { font-size: 13px; color: var(--muted); }
.statgrid.slim { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; }
.dist { margin-top: 12px; display: grid; gap: 4px; }
.dist .bar { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.dist .bar span { width: 12px; color: var(--muted); }
.dist .bar i { font-style: normal; background: var(--line); padding: 2px 6px; text-align: right; min-width: 24px; border-radius: 3px; }
.dist .bar.me i { background: var(--green); color: #fff; }
.archive { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ink); }
.archive a { display: flex; justify-content: space-between; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 15px; }
.archive a:hover span { text-decoration: underline; }
.archive b { font-size: 14px; color: var(--muted); }
.sharebox { width: 100%; font: 15px/1.4 var(--sans); padding: 10px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); color: var(--ink); resize: none; }

/* About */
.aware { border-top: 2px solid var(--ink); padding-top: 14px; margin: 8px 0 24px; }
.aware b { display: block; color: var(--green); margin-bottom: 6px; }
.aware p, #about > p { margin: 0 0 12px; max-width: 60ch; }
.pillars { display: grid; margin: 0 0 28px; border-top: 1px solid var(--line); }
.pillars div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pillars dt { font-weight: 800; margin-bottom: 4px; }
.pillars dd { margin: 0; font-size: 15px; color: var(--muted); max-width: 60ch; }
.foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.foot a[href="#about"] { color: var(--ink); font-weight: 700; }
.aware-line { margin: 30px 0 0; padding-top: 14px; border-top: 2px solid var(--ink); font-size: 15px; }
.aware-line a { color: var(--ink); font-weight: 700; white-space: nowrap; }

/* Golf-ball mascot */
.ball { display: block; overflow: visible; }
.ball .shell { fill: #fff; stroke: #10291d; stroke-width: 3.5; }
.ball .dimple { fill: #dfe5df; }
.ball .shadow { fill: rgba(0,0,0,.18); }
.ball .ink { fill: #10291d; }
.ball .line { fill: none; stroke: #10291d; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ball .thin { stroke-width: 1.9; }
.ball .spark { fill: var(--flag); stroke: #10291d; stroke-width: 1; }
.ball .drop { fill: #cfe3ef; stroke: #10291d; stroke-width: 1.4; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { animation: rise .35s ease both; }
  .reveal .ball, .scorerow .ball { animation: bounce .7s cubic-bezier(.3,1.6,.5,1) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } }
  @keyframes bounce { from { transform: translateY(-18px) scale(.7); opacity: 0; } }
}
@media (max-width: 420px) { .statgrid b { font-size: 26px; } .statgrid span { font-size: 12px; } .brand b { font-size: 16px; } .pip { width: 18px; height: 18px; font-size: 10px; } }
