@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 600; font-display: swap; src: url('assets/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url('assets/fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 500; font-display: swap; src: url('assets/fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 600; font-display: swap; src: url('assets/fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-style: normal; font-weight: 700; font-display: swap; src: url('assets/fonts/barlow-latin-700-normal.woff2') format('woff2'); }
/* Pin High — clubhouse greens, cream scorecards, a gold flag for the one accent */
:root {
  --ink: #08140f;
  --panel: rgba(9, 24, 18, .78);
  --board: #0f241b;
  --board-2: #163126;
  --line: rgba(255, 255, 255, .14);
  --cream: #f4f0e2;
  --muted: #a9bcb1;
  --flag: #ffd23a;
  --flag-ink: #1d1600;
  --green: #6fcf72;
  --red: #ff6b5a;
  --f-d: 'Barlow Condensed', 'Arial Narrow', Impact, sans-serif;
  --f-u: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--ink); color: var(--cream); font-family: var(--f-u); overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }
#app { position: fixed; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: flex-start; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(90deg, rgba(6,16,12,.9) 0%, rgba(6,16,12,.6) 50%, rgba(6,16,12,.15) 100%); }
.screen.center { justify-content: center; background: rgba(6,16,12,.7); }
#scrSetup, #scrShop, #scrHow { justify-content: center; align-items: flex-start; background: rgba(6,16,12,.82); }
#scrSetup .panel, #scrShop .panel, #scrHow .panel, #scrCard .panel { margin-block: auto; }
.panel { width: min(1000px, 100%); display: flex; flex-direction: column; gap: 16px; }
.board { background: var(--board); border: 1px solid var(--line); border-radius: 10px; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.board.narrow { width: min(560px, 100%); }
.title-panel { max-width: 520px; margin-left: max(0px, calc((100vw - 1040px) / 2)); }
.back { color: var(--muted); text-decoration: none; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; align-self: flex-start; }
.back:hover { color: var(--cream); }
.logo { margin: 0; font: 800 clamp(64px, 12vw, 128px)/.86 var(--f-d); letter-spacing: -.01em; }
.logo em { font-style: normal; color: var(--flag); margin-left: .08em; }
.logo span { display: block; font-size: .2em; letter-spacing: .32em; color: var(--muted); margin-top: 12px; font-weight: 700; }
.lede { margin: 0; font-size: 18px; line-height: 1.45; max-width: 36ch; color: #dfe8e1; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--flag); }
.eyebrow small { letter-spacing: .02em; text-transform: none; font-weight: 600; margin-left: 6px; }
h2 { margin: 2px 0 0; font: 800 40px/1 var(--f-d); text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two > div { display: flex; flex-direction: column; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 6px; border: 1px solid var(--line); background: var(--board-2); font: 700 19px var(--f-d); letter-spacing: .06em; text-transform: uppercase; }
.btn:hover { border-color: rgba(255,255,255,.35); }
.btn.primary { background: var(--flag); color: var(--flag-ink); border-color: var(--flag); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.menu { display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.menu.wide { max-width: none; }
.menu .btn { justify-content: space-between; min-height: 58px; font-size: 24px; }
.menu .btn small { font: 600 14px var(--f-u); letter-spacing: .02em; text-transform: none; opacity: .75; }
.cash { font: 800 24px var(--f-d); color: var(--flag); letter-spacing: .04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; align-self: flex-start; }
.seg button { border: 0; background: var(--board-2); min-height: 40px; padding: 0 16px; font: 700 17px var(--f-d); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--flag); color: var(--flag-ink); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cards.three { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ccard { position: relative; text-align: left; border: 2px solid transparent; border-radius: 8px; background: var(--board-2); padding: 0; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.ccard[aria-pressed="true"] { border-color: var(--flag); }
.ccard canvas { width: 100%; height: 120px; display: block; background: #20402f; }
.ccard .cbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; }
.ccard b { font: 800 26px/1 var(--f-d); text-transform: uppercase; }
.ccard span { font-size: 14px; color: var(--muted); }
.ccard .best { color: var(--flag); font-weight: 700; }
.gear { border: 1px solid var(--line); border-radius: 8px; background: var(--board-2); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.gear b { font: 800 24px/1 var(--f-d); text-transform: uppercase; }
.gear .stats { font-size: 14px; color: var(--muted); }
.gear .price { font: 800 20px var(--f-d); color: var(--flag); }
.gear.on { border-color: var(--flag); }
.players { display: flex; flex-direction: column; gap: 8px; }
.prow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.prow input { min-height: 42px; border-radius: 6px; border: 1px solid var(--line); background: var(--board-2); color: var(--cream); padding: 0 12px; font: 700 18px var(--f-u); min-width: 0; }
.swatches { display: flex; gap: 4px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); background: var(--c); padding: 0; }
.sw[aria-pressed="true"] { border-color: var(--cream); box-shadow: 0 0 0 2px var(--flag); }
.pnum { width: 28px; height: 28px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font: 800 15px var(--f-d); color: #08140f; }
.how { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; line-height: 1.45; color: #dfe8e1; }
.how b { color: var(--cream); }
.turn { text-align: center; align-items: center; }
.turn h2 { font-size: 56px; }

/* ---------- scorecard ---------- */
.scroll-x { overflow-x: auto; }
table.card { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--cream); color: #1b2a22; border-radius: 6px; overflow: hidden; min-width: 520px; }
table.card th, table.card td { padding: 8px 6px; text-align: center; border-bottom: 1px solid rgba(0,0,0,.08); font-size: 15px; }
table.card th { background: #1d4532; color: var(--cream); font: 700 14px var(--f-d); letter-spacing: .08em; }
table.card td.name { text-align: left; font-weight: 700; white-space: nowrap; }
table.card td.tot { font-weight: 800; background: rgba(0,0,0,.05); }
table.card tr.par td { background: #e6e0cc; font-weight: 700; color: #4b5a50; }
.sc { display: inline-grid; place-items: center; width: 28px; height: 28px; font-weight: 700; }
.sc.birdie { border: 2px solid #1d6b3c; border-radius: 50%; }
.sc.eagle { border: 2px solid #1d6b3c; border-radius: 50%; box-shadow: 0 0 0 3px #f4f0e2, 0 0 0 5px #1d6b3c; }
.sc.bogey { border: 2px solid #8a3b2e; }
.sc.dbl { border: 2px solid #8a3b2e; box-shadow: 0 0 0 3px #f4f0e2, 0 0 0 5px #8a3b2e; }
.sc.cur { background: var(--flag); border-radius: 4px; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#hud button, #hud canvas, .pad { pointer-events: auto; }
.hud-top { position: absolute; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); display: flex; gap: 8px; align-items: flex-start; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; display: flex; gap: 10px; align-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); min-height: 50px; }
.chip span { display: block; font: 800 20px/1 var(--f-d); letter-spacing: .04em; text-transform: uppercase; }
.chip small { display: block; font: 600 13px/1.2 var(--f-u); color: var(--muted); margin-top: 2px; white-space: nowrap; }
.hole-chip b { font: 800 40px/1 var(--f-d); color: var(--flag); min-width: 30px; text-align: center; }
.player-chip i { width: 14px; height: 14px; border-radius: 50%; background: #2c6fd1; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.4); }
.wind-chip svg { width: 38px; height: 38px; color: #bfe7ff; transition: transform .3s; }
.chip.icon { justify-content: center; width: 50px; font: 800 18px var(--f-d); }
.msg { position: absolute; left: 50%; top: 20%; transform: translateX(-50%); text-align: center; font: 800 clamp(44px, 9vw, 96px)/1 var(--f-d); letter-spacing: .02em; text-transform: uppercase; color: var(--cream); text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 30px rgba(0,0,0,.4); pointer-events: none; white-space: nowrap; }
.msg small { display: block; font: 700 20px var(--f-u); letter-spacing: .1em; color: var(--flag); margin-top: 6px; }
.msg.pop { animation: pop 2.2s ease-out forwards; }
@keyframes pop { 0% { opacity: 0; transform: translateX(-50%) scale(.7); } 10% { opacity: 1; transform: translateX(-50%) scale(1.06); } 18% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.toast { position: absolute; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 116px); transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: 30px; padding: 8px 18px; font: 700 17px var(--f-u); white-space: nowrap; opacity: 0; transition: opacity .25s; }
.toast.on { opacity: 1; }
.toast b { color: var(--flag); }
.hint { position: absolute; left: 50%; bottom: 40%; transform: translateX(-50%); font: 700 16px var(--f-u); color: var(--cream); text-shadow: 0 2px 8px rgba(0,0,0,.8); pointer-events: none; text-align: center; }
.hud-bottom { position: absolute; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 10px; }
.map-wrap { position: relative; }
#mini { width: 150px; height: 208px; border-radius: 8px; border: 1px solid var(--line); background: #1d3a29; display: block; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.mapbtn { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); font-size: 16px; }
.info { position: absolute; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 58px); transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
.info span { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; text-align: center; min-width: 84px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.info small, .club small { display: block; font: 700 11px var(--f-u); letter-spacing: .12em; color: var(--muted); }
.info b { font: 800 22px/1.1 var(--f-d); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shot-panel { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.clubs, .aim { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); pointer-events: auto; }
.aim { padding: 4px; gap: 4px; }
.spin { display: inline-flex; align-items: center; gap: 4px; }
.club { min-width: 132px; text-align: center; }
.club b { display: block; font: 800 24px/1 var(--f-d); text-transform: uppercase; white-space: nowrap; }
.cbtn, .abtn { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.06); font-size: 20px; }
.spin > span { font: 700 11px var(--f-u); letter-spacing: .12em; color: var(--muted); padding: 0 4px; }
.sbtn { min-height: 32px; border-radius: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.06); padding: 0 10px; font: 700 14px var(--f-d); letter-spacing: .06em; text-transform: uppercase; }
.sbtn[aria-pressed="true"] { background: var(--flag); color: var(--flag-ink); border-color: var(--flag); }
.pad { width: 128px; height: 300px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 12px 10px; touch-action: none; backdrop-filter: blur(6px); cursor: ns-resize; }
.pad.live { border-color: var(--flag); }
.meter { position: relative; width: 40px; flex: 1; border-radius: 8px; background: linear-gradient(#3a1f1f 0 9%, #24382c 9%); overflow: hidden; border: 1px solid rgba(255,255,255,.15); }
.meter .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, #43b860, #ffd23a 80%, #ff6b5a); }
.meter .over { position: absolute; left: 0; right: 0; top: 9%; height: 2px; background: #ff6b5a; }
.meter .line { position: absolute; left: -4px; right: -4px; bottom: 12%; height: 3px; background: #fff; box-shadow: 0 0 6px #fff; }
.meter .needle { position: absolute; left: -6px; right: -6px; height: 3px; background: var(--flag); bottom: 0; display: none; }
.meter span { position: absolute; right: 2px; font: 700 10px var(--f-u); color: rgba(255,255,255,.55); }
.meter .t100 { top: 9%; } .meter .t50 { top: 50%; }
.pad-label { text-align: center; margin-top: 8px; }
.pad-label b { display: block; font: 800 26px/1 var(--f-d); font-variant-numeric: tabular-nums; }
.pad-label small { font: 600 12px var(--f-u); color: var(--muted); }

@media (max-width: 760px), (max-height: 520px) {
  .chip { min-height: 42px; padding: 4px 9px; gap: 7px; }
  .chip span { font-size: 17px; }
  .chip small { font-size: 11px; }
  .hole-chip b { font-size: 30px; }
  .wind-chip svg { width: 30px; height: 30px; }
  .chip.icon { width: 42px; }
  #mini { width: 104px; height: 144px; }
  .info { top: calc(max(10px, env(safe-area-inset-top)) + 48px); }
  .info span { min-width: 62px; padding: 3px 8px; }
  .info b { font-size: 17px; }
  .club { min-width: 96px; }
  .club b { font-size: 19px; }
  .cbtn, .abtn { width: 38px; height: 38px; font-size: 17px; }
  .pad { width: 96px; height: 220px; }
  .two, .cards { grid-template-columns: minmax(0, 1fr); }
  .msg small { font-size: 15px; }
}
@media (max-height: 520px) {
  .shot-panel { gap: 4px; }
  .spin { display: none; }
  .pad { height: min(220px, 62vh); }
}
@media (max-width: 560px) and (orientation: portrait) {
  .player-chip small { display: none; }
  .hud-bottom { flex-wrap: wrap; justify-content: space-between; }
  .shot-panel { order: 3; flex-basis: 100%; }
  .info { top: calc(max(10px, env(safe-area-inset-top)) + 50px); }
}
@media (prefers-reduced-motion: reduce) { .msg.pop { animation-duration: .01s; animation-fill-mode: forwards; } }
.meter::before { content: ''; position: absolute; left: 0; right: 0; height: 3px; bottom: var(--sg, -10%); background: #6fcf72; box-shadow: 0 0 6px #6fcf72; z-index: 1; }
#scrTitle { align-items: flex-start; }
#scrTitle .panel { margin-block: auto; }
@media (max-height: 520px) {
  .logo { font-size: 62px; }
  .logo span { margin-top: 6px; }
  .lede { font-size: 15px; }
  .title-panel { gap: 10px; }
  .menu .btn { min-height: 46px; font-size: 20px; }
}
@media (max-width: 560px) and (orientation: portrait) {
  .hud-top { gap: 6px; }
  .hud-top .chip { padding: 4px 8px; min-height: 40px; gap: 6px; }
  .hole-chip small, .wind-chip small { display: none; }
  .hud-top .chip span { font-size: 16px; }
  .hole-chip b { font-size: 26px; }
  .wind-chip svg { width: 24px; height: 24px; }
  .player-chip span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chip.icon { width: 40px; }
  .info { top: calc(max(10px, env(safe-area-inset-top)) + 50px); }
}

/* ===== Pin High 2: modes, locked courses, trophies ===== */
.mode-seg{flex-wrap:wrap}
.ccard{position:relative}
.ccard.locked canvas{filter:grayscale(.5) brightness(.75)}
.ccard .lock{position:absolute;top:10px;right:10px;font-style:normal;font-weight:800;font-size:13px;background:#000b;color:#ffe2a8;padding:5px 9px;border-radius:6px}
.trophies{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px;margin-top:14px}
.trophy{display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;padding:14px 10px;border-radius:12px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.1);opacity:.75}
.trophy.got{opacity:1;background:rgba(255,210,58,.1);border-color:rgba(255,210,58,.45)}
.trophy span{font-size:34px}
.trophy b{font-size:15px}
.trophy small{font-size:12px;opacity:.75}
.trophy em{font-style:normal;font-weight:800;font-size:12px;color:#ffd23a}
