/* Granite Links kiosk — designed for 7–10" touchscreens (800×480 and up) */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0b1d12;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: #fff;
  user-select: none; touch-action: none; }

#gl { position: fixed; inset: 0; display: block; }

.hidden { display: none !important; }

/* ---------- loading ---------- */
#loading { position: fixed; inset: 0; background: #0b1d12; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 12px; z-index: 50; }
.load-title { font-size: 34px; font-weight: 800; letter-spacing: 6px; color: #e8f5e9; }
.load-sub { font-size: 14px; letter-spacing: 3px; color: #7fa88a; margin-bottom: 18px; }
.load-bar { width: 260px; height: 6px; border-radius: 3px; background: #1e3a28; overflow: hidden; }
#load-fill { width: 0%; height: 100%; background: #58c472; border-radius: 3px; transition: width .25s; }
#load-msg { font-size: 12px; color: #7fa88a; }

/* ---------- home ---------- */
#home { position: fixed; inset: 0; display: flex; flex-direction: column;
  justify-content: space-between; z-index: 10; pointer-events: none; }
.home-title { text-align: center; padding-top: 4vh;
  text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.home-title h1 { font-size: clamp(26px, 5vw, 44px); font-weight: 800; letter-spacing: 8px; }
.home-title p { font-size: clamp(11px, 1.8vw, 15px); letter-spacing: 3px; color: #cfe8d6; }

.credits { position: absolute; right: 10px; top: 8px; font-size: 9px;
  color: rgba(255,255,255,.45); letter-spacing: .5px; }

.course-pick-btn { position: absolute; left: 12px; top: 12px; pointer-events: auto;
  padding: 11px 16px; border: 1px solid rgba(255,255,255,.25); border-radius: 20px;
  background: rgba(8,20,13,.7); backdrop-filter: blur(6px); color: #e8f5e9;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; }
.course-pick-btn:active { background: #58c472; color: #06170c; }

.account-btn { left: auto; right: 12px; top: 34px; }

/* shot tracking in the score modal */
.track-h { font-size: 12px; letter-spacing: 2px; color: #9fc7ab;
  margin: 14px 0 6px; text-transform: uppercase; }
.track-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-bottom: 8px; }
.track-row.pal { gap: 4px; }
.tr-label { font-size: 10px; letter-spacing: 2px; color: #9fc7ab;
  font-weight: 700; min-width: 62px; }
.track-chip { padding: 8px 12px; border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px; background: rgba(255,255,255,.07); color: #fff;
  font-size: 12px; font-weight: 700; }
.track-chip.on { background: #58c472; color: #06170c; }
.track-row.pal .track-chip { padding: 7px 9px; font-size: 11px; }
.track-step { display: inline-flex; align-items: center; gap: 8px; margin-right: 14px; }
.track-step b { font-size: 20px; min-width: 22px; text-align: center; }
.track-step button { width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08);
  color: #fff; font-size: 18px; }

/* account modal */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 12px 0; }
.stat-cell { background: rgba(255,255,255,.06); border-radius: 12px;
  padding: 10px 6px; text-align: center; display: flex; flex-direction: column; }
.stat-v { font-size: 20px; font-weight: 800; }
.stat-l { font-size: 9px; letter-spacing: 1px; color: #9fc7ab; margin-top: 2px; }
.account-bias { font-size: 12px; color: #ffd54f; margin-bottom: 6px; }
.round-list { max-height: 30vh; overflow-y: auto; }
.round-row { display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 4px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.round-row small { color: #9fc7ab; font-size: 11px; }
.account-cloud { margin-top: 10px; font-size: 11px; color: #9fc7ab; }

.course-search { width: 100%; margin-bottom: 10px; padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.2); border-radius: 12px;
  background: rgba(255,255,255,.08); color: #fff; font-size: 15px; }
.course-list { max-height: 52vh; overflow-y: auto; }
.course-row { display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 13px 12px; border: 0; border-bottom: 1px solid
  rgba(255,255,255,.08); background: transparent; color: #fff; text-align: left; }
.course-row:active { background: rgba(88,196,114,.18); }
.course-row .cr-name { font-size: 15px; font-weight: 700; }
.course-row .cr-sub { font-size: 11px; color: #9fc7ab; }
.course-row .cr-holes { font-size: 12px; color: #ffd54f; font-weight: 700;
  white-space: nowrap; margin-left: 10px; }
.course-row.current { border-left: 3px solid #58c472; }
.sheet { pointer-events: auto; background: rgba(8, 20, 13, .82);
  backdrop-filter: blur(10px); border-top: 1px solid rgba(255,255,255,.12);
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }
.tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.tab { flex: 1; padding: 10px 0; border: 0; border-radius: 10px; font-size: 15px;
  font-weight: 700; letter-spacing: 1px; background: rgba(255,255,255,.08); color: #cfe8d6; }
.tab.active { background: #58c472; color: #06170c; }
.hole-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 8px; margin-bottom: 10px; }
.hole-btn { aspect-ratio: 1; min-height: 52px; border: 0; border-radius: 12px;
  background: rgba(255,255,255,.10); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; }
.hole-btn:active { background: #58c472; color: #06170c; }
.hole-btn .n { font-size: 20px; font-weight: 800; line-height: 1; }
.hole-btn .p { font-size: 10px; color: #9fc7ab; }
.hole-btn:active .p { color: #06170c; }
.home-actions { display: flex; gap: 8px; }
.explore-btn { width: 100%; padding: 12px 0; border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px; background: transparent; color: #e8f5e9; font-size: 14px;
  font-weight: 600; letter-spacing: 2px; }
.explore-btn:active { background: rgba(255,255,255,.15); }
.explore-btn.primary { background: #58c472; color: #06170c; border-color: #58c472; }

/* ---------- hole view ---------- */
#holeview { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#holeview button { pointer-events: auto; }

.round-btn { position: absolute; top: 12px; width: 56px; height: 56px; border: 0;
  border-radius: 50%; background: rgba(8,20,13,.75); color: #fff; font-size: 22px;
  backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.15); }
.round-btn:active { background: #58c472; color: #06170c; }
.round-btn.back { left: 12px; }
.round-btn.next { right: 12px; }

.hole-info { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(8,20,13,.75); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.15); border-radius: 16px;
  padding: 8px 22px; text-align: center; }
.hi-name { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.hi-stats { display: flex; gap: 14px; justify-content: center; font-size: 12px;
  color: #9fc7ab; font-weight: 600; letter-spacing: 1px; }
#hi-elev { color: #ffd54f; }

/* view tools live behind one gear button: tap to expand, tap to collapse */
.round-btn.tools { top: auto; left: auto; right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom)); }
.round-btn.tools.open { background: #58c472; color: #06170c; }
.hole-actions { position: absolute; right: 12px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  transition: opacity .18s, transform .18s; }
.hole-actions.collapsed { opacity: 0; transform: translateY(12px); pointer-events: none; }
.hole-actions .play-only { display: none; }
body.playing .hole-actions .play-only { display: block; }
.pill-btn { padding: 13px 20px; border: 1px solid rgba(255,255,255,.2); border-radius: 24px;
  background: rgba(8,20,13,.75); color: #fff; font-size: 14px; font-weight: 700;
  backdrop-filter: blur(6px); }
.pill-btn:active, .pill-btn.on { background: #58c472; color: #06170c; }

.club-row { position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; gap: 6px;
  flex-wrap: wrap; justify-content: center; max-width: 92vw; pointer-events: auto;
  background: rgba(8,20,13,.85); backdrop-filter: blur(8px); padding: 10px;
  border-radius: 16px; border: 1px solid rgba(255,255,255,.15); }
.club-row button { min-width: 46px; padding: 10px 8px; border: 1px solid
  rgba(255,255,255,.2); border-radius: 10px; background: rgba(255,255,255,.08);
  color: #fff; font-size: 13px; font-weight: 700; }
.club-row button:active { background: #58c472; color: #06170c; }
.club-row button.skip { border-color: transparent; color: #9fc7ab; }

.game-status { position: absolute; top: 76px; left: 50%; transform: translateX(-50%);
  background: rgba(8,20,13,.75); backdrop-filter: blur(6px); border: 1px solid
  rgba(255,255,255,.15); border-radius: 14px; padding: 6px 16px; font-size: 12px;
  font-weight: 700; letter-spacing: 1px; color: #ffd54f; white-space: nowrap; }

/* broadcast lower-third for the Play-it cinematic */
.cine-caption { position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(64px + env(safe-area-inset-bottom)); display: flex; gap: 14px;
  align-items: baseline; background: rgba(6, 16, 10, .82); backdrop-filter: blur(8px);
  border-left: 4px solid #58c472; border-radius: 4px 14px 14px 4px;
  padding: 12px 22px; white-space: nowrap; }
.cine-caption .cc-shot { font-size: 13px; font-weight: 800; letter-spacing: 3px;
  color: #9fc7ab; }
.cine-caption .cc-yds { font-size: 24px; font-weight: 800; color: #fff; }
.cine-caption .cc-plays { font-size: 15px; font-weight: 800; color: #ffd54f; }

.hint { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%); font-size: 11px; letter-spacing: 1px; color: rgba(255,255,255,.55);
  background: rgba(8,20,13,.5); padding: 6px 14px; border-radius: 14px;
  transition: opacity 1s; white-space: nowrap; }
.hint.fade { opacity: 0; }

@media (max-height: 500px) {
  .home-title { padding-top: 2vh; }
  .hole-btn { min-height: 44px; }
  .hole-btn .n { font-size: 17px; }
  /* short screens: compact pills */
  .pill-btn { padding: 8px 13px; font-size: 12px; }
  .play-actions { gap: 6px; }
  .hole-actions { gap: 6px; }
  .d-val { font-size: 21px; }
  .d-item.center .d-val { font-size: 30px; }
}

/* ---------- play mode HUD ---------- */
#play { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
#play button { pointer-events: auto; }

.dist-panel { position: absolute; left: 12px; top: 84px;
  background: rgba(8,20,13,.8); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15); border-radius: 16px;
  padding: 10px 14px; pointer-events: auto; }
.gps-row { display: flex; align-items: center; gap: 8px; font-size: 11px;
  letter-spacing: 2px; color: #9fc7ab; font-weight: 700; margin-bottom: 6px; }
.gps-dot { width: 9px; height: 9px; border-radius: 50%; }
.gps-dot.on { background: #58c472; box-shadow: 0 0 8px #58c472; }
.gps-dot.wait { background: #ffd54f; animation: blink 1s infinite; }
.gps-dot.off { background: #e57373; }
@keyframes blink { 50% { opacity: .3; } }
.dist-grid { display: flex; gap: 16px; }
.d-item { display: flex; flex-direction: column; align-items: center; }
.d-label { font-size: 10px; letter-spacing: 2px; color: #9fc7ab; font-weight: 700; }
.d-val { font-size: 26px; font-weight: 800; line-height: 1.1; }
.d-item.center .d-val { font-size: 40px; color: #58c472; }

.d-plays { text-align: center; margin-top: 6px; font-size: 15px; font-weight: 800;
  color: #ffd54f; letter-spacing: 1px; }
.d-plays .club-chip { display: inline-block; margin-left: 8px; padding: 2px 10px;
  border-radius: 10px; background: #58c472; color: #06170c; font-size: 12px; }
.d-plays .blind { display: inline-block; margin-left: 8px; padding: 2px 8px;
  border-radius: 8px; background: #e64a3c; color: #fff; font-size: 11px;
  letter-spacing: 1px; }
.d-extra { margin-top: 4px; font-size: 11px; color: #cfe8d6; text-align: center;
  letter-spacing: .5px; }

.hole-suggest { position: absolute; top: 84px; left: 50%; transform: translateX(-50%);
  background: #ffd54f; color: #33290a; border: 0; border-radius: 20px;
  padding: 10px 18px; font-size: 13px; font-weight: 700; }

.play-actions { position: absolute; right: 12px; top: 84px; display: flex;
  flex-direction: column; gap: 10px; align-items: flex-end; }
.play-nav { position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.pill-btn.big { background: #58c472; color: #06170c; border-color: #58c472; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: #10241a; border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px; padding: 18px 20px; width: min(560px, 94vw);
  max-height: 92vh; overflow-y: auto; }
.modal-box.wide { width: min(900px, 96vw); }
.modal-box h2 { font-size: 20px; letter-spacing: 1px; margin-bottom: 10px; }
.modal-box h3 { font-size: 12px; letter-spacing: 2px; color: #9fc7ab;
  margin: 14px 0 6px; text-transform: uppercase; }
.modal-box h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.seg-row { display: flex; gap: 8px; }
.seg-row.wrap { flex-wrap: wrap; }
.seg { border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06);
  color: #e8f5e9; border-radius: 10px; padding: 10px 12px; font-size: 13px;
  font-weight: 700; flex: 1; min-width: 100px; }
.seg small { display: block; font-weight: 400; font-size: 10px; color: #9fc7ab; }
.seg.on { background: #58c472; color: #06170c; }
.seg.on small { color: #234; }

.player-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.player-row input { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px; color: #fff; padding: 11px 12px; font-size: 15px; }
.player-row .pname { flex: 1; min-width: 0; }
.player-row .pindex { width: 78px; }
.player-row .pgender { flex: 0 0 46px; min-width: 46px; }
.player-row .pdel { flex: 0 0 40px; background: transparent; border: 0;
  color: #e57373; font-size: 16px; }

/* score entry */
.score-row { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08); }
.sr-name { flex: 1; font-size: 16px; font-weight: 600; }
.sr-dots { color: #58c472; font-size: 11px; letter-spacing: 2px; }
.sr-minus, .sr-plus { width: 52px; height: 52px; border-radius: 50%; border: 1px solid
  rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 24px; }
.sr-val { width: 44px; text-align: center; font-size: 28px; font-weight: 800; }

/* scorecard table */
.card-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#card-table table { border-collapse: collapse; font-size: 13px; min-width: 720px; }
#card-table th, #card-table td { border: 1px solid rgba(255,255,255,.14);
  padding: 6px 7px; text-align: center; min-width: 30px; }
#card-table th { background: rgba(255,255,255,.08); font-size: 11px; letter-spacing: 1px; }
#card-table .sticky { position: sticky; left: 0; background: #10241a; text-align: left;
  font-weight: 700; min-width: 90px; }
#card-table .meta td { color: #9fc7ab; font-size: 11px; }
#card-table .tot { background: rgba(255,255,255,.06); font-weight: 700; }
#card-table td span { display: inline-flex; width: 22px; height: 22px; align-items: center;
  justify-content: center; }
#card-table td.birdie span { border: 1.5px solid #58c472; border-radius: 50%; }
#card-table td.eagle span { border: 1.5px solid #58c472; border-radius: 50%;
  box-shadow: 0 0 0 3px #10241a, 0 0 0 4.5px #58c472; }
#card-table td.bogey span { border: 1.5px solid #e5a373; }
#card-table td.dbogey span { border: 1.5px solid #e57373;
  box-shadow: 0 0 0 3px #10241a, 0 0 0 4.5px #e57373; }
.card-game { margin-bottom: 10px; padding: 8px 12px; border-radius: 10px;
  background: rgba(255,213,79,.12); color: #ffd54f; font-size: 13px;
  font-weight: 700; letter-spacing: 1px; }

/* while the play HUD is up, its own nav replaces the hole-view extras */
body.playing #next-btn, body.playing .hint { display: none; }

#toast { position: fixed; bottom: calc(70px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); z-index: 40; background: rgba(8,20,13,.92);
  border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 12px 18px;
  font-size: 13px; max-width: 90vw; text-align: center; }
