:root {
  --gold: #ffd23f;
  --navy: #1b2a4d;
  --red: #e0392b;
  --cyan: #3ee6ff;
  --green: #4ade80;
  --bg: #07090f;
  --panel: rgba(10, 14, 26, 0.92);
  --line: #2b3a5c;
  --text: #eef2fb;
  --muted: #98a3bf;
  --font: 'Press Start 2P', 'Courier New', Courier, monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
html { height: 100%; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0; padding: 0; width: 100%;
  background: var(--bg); color: var(--text); font-family: var(--font);
  overflow: hidden; touch-action: none; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
body { position: fixed; inset: 0; height: 100%; height: 100dvh; }
button { -webkit-touch-callout: none; font-family: inherit; }
.hidden { display: none !important; }
#safeProbe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none; padding: var(--sat) var(--sar) var(--sab) var(--sal); }

.kbd-only, .touch-only { display: none; }
body.is-desktop .kbd-only { display: block; }
body.is-touch .touch-only { display: block; }

#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 3; background: #fff; opacity: 0; transition: opacity .1s; }
#flash.on { opacity: .35; }
#flash.red { background: var(--red); }

/* ---- HUD */
#hud { position: fixed; inset: 0; z-index: 4; pointer-events: none; font-size: clamp(8px, 2vmin, 12px); }
.hudbox { background: rgba(5,8,16,.74); border: 2px solid var(--line); border-radius: 4px; padding: 6px 9px; letter-spacing: 1px; white-space: nowrap; line-height: 1.5; }
#clockBox { position: absolute; left: 50%; transform: translateX(-50%); top: calc(44px + var(--sat)); text-align: center; background: rgba(5,8,16,.74); border: 2px solid var(--line); border-radius: 4px; padding: 4px 12px; min-width: 96px; }
#clockTxt { display: block; color: #fff; font-size: 1.7em; letter-spacing: 2px; }
#clockSub { display: block; color: var(--muted); font-size: .7em; margin-top: 2px; letter-spacing: 1px; min-height: 1em; }
#clockBox.warn { border-color: var(--red); }
#clockBox.warn #clockTxt { color: #ff5a4a; animation: blink 1s steps(2) infinite; }
#clockBox.ot { border-color: #ff5a4a; background: rgba(60,8,6,.8); }
#clockBox.ot #clockSub { color: #ff5a4a; }
@keyframes blink { 50% { opacity: .35; } }
/* race bar (2026-11-22): everyone's ball on one line from tee (left) to flag (right): who is winning the race, at a glance */
#raceBar { position: absolute; left: 50%; transform: translateX(-50%); top: calc(16px + var(--sat)); width: min(36vw, 420px); height: 18px; pointer-events: none; }
#raceBar .track { position: absolute; left: 0; right: 10px; top: 6px; height: 5px; background: rgba(255,255,255,.85); border: 2px solid #000; border-radius: 3px; }
#raceBar .flag { position: absolute; right: 0; top: -4px; width: 2px; height: 22px; background: #fff; box-shadow: 0 0 0 1px #000; }
#raceBar .flag::after { content: ''; position: absolute; left: 2px; top: 0; border-left: 10px solid #ff3b30; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
#raceBar .rb { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; border: 2px solid #000; border-radius: 50%; }
#raceBar .rb.you { top: 0; width: 16px; height: 16px; margin-left: -8px; border-color: var(--gold); z-index: 2; }
#raceBar .rb.done { opacity: .55; }
#standings { position: absolute; left: 50%; transform: translateX(-50%); top: calc(96px + var(--sat)); display: flex; gap: 6px; max-width: calc(100% - 20px); }
.st { background: rgba(5,8,16,.74); border: 2px solid var(--line); border-radius: 4px; padding: 4px 7px; display: flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .85em; }
.st .dot { width: 10px; height: 10px; border: 1px solid #000; }
.st .n { color: var(--text); }
.st .s { color: var(--gold); }
.st .t { color: var(--muted); }
.st .p { color: var(--cyan); }
.st .p::after { content: 'P'; font-size: .75em; margin-left: 1px; }
.st .k { color: #ff5a4a; font-size: .8em; }
.st.you { border-color: var(--gold); }
.st.done .n { color: var(--green); }
.st.down .n { color: #ff5a4a; }
#holeBox { position: absolute; left: calc(10px + var(--sal)); top: calc(48px + var(--sat)); color: var(--cyan); }
#distBox { position: absolute; right: calc(10px + var(--sar)); top: calc(48px + var(--sat)); text-align: right; }
#distTxt { color: var(--gold); display: block; font-size: 1.25em; }
#lieTxt { color: var(--muted); display: block; font-size: .8em; margin-top: 3px; }
#windBox { position: absolute; right: calc(10px + var(--sar)); top: calc(112px + var(--sat)); text-align: center; min-width: 64px; }
#windArrow { font-size: 1.6em; color: var(--cyan); line-height: 1; display: inline-block; transform-origin: 50% 55%; }
#windTxt { display: block; font-size: .8em; color: var(--muted); margin-top: 3px; }
body.is-touch #holeBox, body.is-touch #distBox { top: calc(58px + var(--sat)); }
body.is-touch #clockBox { top: calc(52px + var(--sat)); }
body.is-touch #standings { top: calc(104px + var(--sat)); }
body.is-touch #windBox { top: calc(124px + var(--sat)); }
#prompt { position: absolute; left: 50%; transform: translateX(-50%); top: calc(140px + var(--sat)); background: rgba(5,8,16,.74); border: 2px solid var(--gold); border-radius: 4px; padding: 6px 10px; color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
body.is-touch #prompt { top: calc(148px + var(--sat)); }
#banner {
  position: absolute; left: 6%; right: 6%; top: 30%; text-align: center;   /* inset: the pop animation scales to 1.12, a full-width box poked off screen */
  font-size: clamp(22px, 7vmin, 56px); color: var(--gold); letter-spacing: 3px;
  text-shadow: 3px 3px 0 #1b4d2a, 6px 6px 0 #000, 0 0 30px rgba(255,210,63,.6);
  animation: pop .35s ease-out; pointer-events: none;
}
#banner.red { color: #ff5a4a; text-shadow: 3px 3px 0 #3a0a06, 6px 6px 0 #000; }
#banner.blue { color: var(--cyan); text-shadow: 3px 3px 0 #0a3a4a, 6px 6px 0 #000; }
#banner.big { font-size: clamp(40px, 14vmin, 110px); }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
#subBanner { position: absolute; left: 0; right: 0; top: calc(30% + clamp(36px, 9vmin, 70px)); text-align: center; font-size: clamp(9px, 2.4vmin, 14px); color: #fff; text-shadow: 2px 2px 0 #000; letter-spacing: 1px; line-height: 1.7; }
#shotMsg { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--sab)); background: rgba(5,8,16,.74); border: 2px solid var(--line); border-radius: 4px; padding: 6px 10px; color: var(--text); letter-spacing: 1px; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; }
body.is-touch #shotMsg { bottom: auto; top: calc(176px + var(--sat)); }
#stamWrap { position: absolute; left: calc(10px + var(--sal)); bottom: calc(12px + var(--sab)); width: 140px; height: 12px; background: rgba(0,0,0,.55); border: 2px solid #fff; border-radius: 3px; }
#stamBar { height: 100%; width: 100%; background: linear-gradient(90deg, #3ee6ff, #4ade80); transition: width .08s linear; }
#stamWrap.low #stamBar { background: #e0392b; }
#stamWrap span { position: absolute; left: 0; top: -15px; font-size: 8px; color: var(--muted); letter-spacing: 1px; text-shadow: 1px 1px 0 #000; }

#stunWrap { position: absolute; left: calc(10px + var(--sal)); bottom: calc(40px + var(--sab)); width: 140px; height: 10px; background: rgba(0,0,0,.55); border: 2px solid #fff; border-radius: 3px; }
#stunBar { height: 100%; width: 0; background: linear-gradient(90deg, #ffd23f, #e0392b); transition: width .1s linear; }
#stunWrap span { position: absolute; left: 0; top: -14px; font-size: 8px; color: var(--muted); letter-spacing: 1px; text-shadow: 1px 1px 0 #000; }

body.at-ball #stamWrap { bottom: calc(112px + var(--sab)); }
body.at-ball #stunWrap { bottom: calc(140px + var(--sab)); }
body.at-ball #fxRow { bottom: calc(170px + var(--sab)); }
#fxRow { position: absolute; left: calc(10px + var(--sal)); bottom: calc(70px + var(--sab)); display: flex; flex-direction: column; gap: 4px; }
#fxRow .fx.red { border-color: #ff5a4a; color: #ff5a4a; }
#fxRow .fx { background: rgba(5,8,16,.74); border: 2px solid var(--cyan); border-radius: 4px; padding: 4px 8px; color: var(--cyan); font-size: .8em; letter-spacing: 1px; }


/* ---- at-ball controls (club / aim) bottom-left, items above */
#ctl { position: absolute; left: calc(10px + var(--sal)); bottom: calc(10px + var(--sab)); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#clubRow, #aimRow { display: flex; gap: 6px; align-items: stretch; }
.cbtn { pointer-events: auto; font: inherit; font-size: 1.1em; min-width: 40px; min-height: 40px; background: rgba(5,8,16,.8); border: 2px solid var(--line); border-radius: 4px; color: var(--text); cursor: pointer; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; }
.cbtn.wide { font-size: .8em; letter-spacing: 1px; flex: 1; }
.cbtn:hover { border-color: var(--gold); color: var(--gold); }
.cbtn:active { transform: translateY(1px); }
#clubBox { pointer-events: auto; background: rgba(5,8,16,.8); border: 2px solid var(--gold); border-radius: 4px; padding: 4px 10px; text-align: center; min-width: 110px; display: flex; flex-direction: column; justify-content: center; }
#clubName { color: var(--gold); letter-spacing: 1px; }
#clubDist { color: var(--muted); font-size: .8em; margin-top: 3px; }
#itemRow { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(40px + var(--sab)); display: flex; gap: 6px; pointer-events: none; }
#itemRow:empty { display: none; }
body.is-touch #itemRow { bottom: auto; top: calc(262px + var(--sat)); left: calc(10px + var(--sal)); transform: none; flex-direction: column; }
body.compact.is-touch #itemRow { top: auto; bottom: calc(10px + var(--sab)); left: 50%; transform: translateX(-50%); flex-direction: row; }
.ibtn i { display: inline-block; width: 9px; height: 9px; border: 1px solid #000; margin-right: 5px; vertical-align: -1px; }
.ibtn { pointer-events: auto; font: inherit; font-size: .75em; min-height: 36px; background: rgba(20,30,50,.9); border: 2px solid var(--cyan); border-radius: 4px; color: var(--cyan); cursor: pointer; padding: 0 8px; letter-spacing: 1px; }
.ibtn:hover, .ibtn:active { background: var(--cyan); color: #04202a; }
body.is-touch .cbtn { min-height: 44px; min-width: 44px; }
body.is-touch .ibtn { min-height: 44px; }

/* ---- swing pad bottom-right (only at your ball) */
#swingWrap { position: absolute; right: calc(10px + var(--sar)); bottom: calc(10px + var(--sab)); display: flex; align-items: flex-end; gap: 8px; pointer-events: none; }
#swingZone { pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; width: 132px; height: 132px; border: 3px solid rgba(255,255,255,.7); border-radius: 50%; background: radial-gradient(circle at 50% 40%, rgba(255,210,63,.28), rgba(5,8,16,.6) 70%); position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 5px 0 rgba(0,0,0,.45); }
#swingZone.on { border-color: var(--gold); background: radial-gradient(circle at 50% 40%, rgba(255,210,63,.6), rgba(60,40,0,.7) 70%); transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.45); }
#swingBall { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #c9d2e2 65%, #8a93a6); border: 2px solid #1a1200; position: relative; box-shadow: 0 3px 0 rgba(0,0,0,.5); }
#swingHint { color: #fff; font-size: .62em; line-height: 1.6; text-align: center; margin-top: 8px; letter-spacing: 1px; text-shadow: 1px 1px 0 #000; }
#swingZone.on #swingHint { color: var(--gold); }
#meter { width: 26px; height: 200px; border: 2px solid #fff; border-radius: 4px; background: rgba(0,0,0,.6); position: relative; overflow: hidden; }
#meterOver { position: absolute; left: 0; right: 0; top: 0; height: 13.04%; background: repeating-linear-gradient(45deg, rgba(255,59,48,.55) 0 4px, rgba(120,10,10,.55) 4px 8px); border-bottom: 2px solid #ff3b30; }
#meterFill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, #4ade80, #ffd23f 70%, #ff8a3d 86%, #e0392b 88%); }
#meter.over { border-color: #ff3b30; box-shadow: 0 0 10px #ff3b30; }
#meterMark { position: absolute; left: -2px; right: -2px; height: 4px; margin-bottom: -2px; background: #fff; bottom: 50%; box-shadow: 0 0 0 1px #000; }
#shotBtns { display: flex; flex-direction: column; gap: 6px; }
#spinBtn, #lowBtn { pointer-events: auto; font: inherit; font-size: .7em; line-height: 1.6; text-align: center; letter-spacing: 1px; color: var(--muted); background: rgba(5,8,16,.8); border: 2px solid var(--line); border-radius: 4px; padding: 6px 6px; min-width: 52px; cursor: pointer; user-select: none; -webkit-user-select: none; }
#spinBtn.on { border-color: var(--cyan); }
#lowBtn.on { border-color: var(--gold); color: var(--gold); background: rgba(60,40,0,.85); }
#spinTxt { color: var(--cyan); }
/* ---- minimap (always on) + the big overview */
#mmWrap { position: absolute; left: calc(10px + var(--sal)); top: calc(84px + var(--sat)); width: 128px; height: 156px; border: 2px solid rgba(255,255,255,.8); border-radius: 6px; overflow: hidden; background: #0b1430; pointer-events: auto; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.4); }
#mmCan { width: 100%; height: 100%; display: block; }
#mmTag { position: absolute; left: 3px; bottom: 2px; font-size: 7px; letter-spacing: 1px; color: #fff; text-shadow: 1px 1px 0 #000; opacity: .8; pointer-events: none; }
#mmBig { position: absolute; inset: 0; background: rgba(2,4,12,.72); pointer-events: auto; z-index: 30; display: flex; align-items: center; justify-content: center; cursor: pointer; }
#mmBig.hidden { display: none; }
#mmBigCan { width: min(92vw, 70vh); height: min(86vh, 112vw); border: 3px solid var(--gold); border-radius: 8px; background: #0b1430; }
body.is-touch #mmWrap { top: calc(94px + var(--sat)); }
body.compact #mmWrap { width: 92px; height: 104px; top: calc(92px + var(--sat)); }
#skipWrap { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(74px + var(--sab)); pointer-events: none; }   /* above #itemRow (40px + ~28px tall) */
body.is-touch #skipWrap { bottom: calc(50px + var(--sab)); }   /* touch: items sit top-left, keep it low */
#skipBtn { pointer-events: auto; font: inherit; font-size: .9em; background: var(--gold); color: #1a1200; border: 2px solid #1a1200; border-radius: 4px; padding: 10px 12px; cursor: pointer; letter-spacing: 1px; }

body.compact #swingZone { width: 112px; height: 112px; }
body.compact #meter { height: 140px; }
body.compact #swingBall { width: 28px; height: 28px; }
body.compact #swingHint { font-size: .58em; margin-top: 6px; }
body.compact #spinBtn, body.compact #lowBtn { padding: 4px 4px; min-width: 46px; font-size: .62em; }
body.compact #clubBox { min-width: 90px; }
body.compact #standings { gap: 4px; }
body.compact .st { padding: 3px 5px; font-size: .78em; gap: 4px; }
body.compact .st .t { display: none; }
body.compact #clockTxt { font-size: 1.4em; }

/* ---- touch controls (running) */
#touchUI { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#hudTop { position: fixed; inset: 0; z-index: 5; pointer-events: none; font-size: clamp(8px, 2vmin, 12px); }
#hud.hidden ~ #hudTop { display: none; }
#joyZone { position: absolute; left: 0; top: 30%; bottom: 0; width: 45%; pointer-events: auto; touch-action: none; }
#lookZone { position: absolute; right: 0; top: 30%; bottom: 0; width: 55%; pointer-events: auto; touch-action: none; }
#joyBase { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: rgba(255,255,255,.08); display: none; }
#joyBase.on { display: block; }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,210,63,.85); border: 2px solid #1a1200; }
#tbtns { position: absolute; right: calc(12px + var(--sar)); bottom: calc(12px + var(--sab)); display: grid; grid-template-columns: auto auto; gap: 10px; align-items: end; justify-items: end; pointer-events: none; }
.tbtn {
  pointer-events: auto; touch-action: none; border-radius: 50%; cursor: pointer;
  font-size: 10px; letter-spacing: 1px; color: var(--text); background: rgba(5,8,16,.7); border: 2px solid rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
}
.tbtn.big { width: 84px; height: 84px; background: rgba(255,210,63,.9); color: #1a1200; border: 3px solid #1a1200; font-size: 12px; box-shadow: 0 5px 0 #7a5c00, 0 8px 18px rgba(0,0,0,.5); }
.tbtn.mid { width: 64px; height: 64px; }
.tbtn.small { width: 54px; height: 54px; font-size: 9px; }
.tbtn.on { background: rgba(62,230,255,.85); color: #04202a; }
.tbtn:active { transform: translateY(2px); filter: brightness(1.1); }

/* ---- chrome */
#chrome { position: fixed; left: 0; right: 0; top: 0; z-index: 7; display: flex; align-items: flex-start; gap: 8px; padding: calc(6px + var(--sat)) calc(8px + var(--sar)) 0 calc(8px + var(--sal)); pointer-events: none; }
#chrome .spacer { flex: 1; }
.cornerbtn {
  pointer-events: auto; height: 36px; min-width: 36px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(5,8,16,.8); border: 2px solid var(--line); border-radius: 4px;
  color: var(--text); text-decoration: none; font: inherit; font-size: 10px; letter-spacing: 1px; cursor: pointer; text-transform: uppercase; white-space: nowrap;
}
.cornerbtn:hover { border-color: var(--gold); color: var(--gold); }
body.is-touch .cornerbtn { height: 44px; }
body.compact .cornerbtn { padding: 0 8px; font-size: 9px; }
body.compact #backBtn { width: 44px; padding: 0; font-size: 13px; }

/* ---- menus */
#overlay { position: fixed; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; padding: calc(54px + var(--sat)) calc(12px + var(--sar)) calc(12px + var(--sab)) calc(12px + var(--sal)); background: rgba(4,7,14,.55); font-size: clamp(9px, 2.2vmin, 13px); pointer-events: auto; }
#overlay.hidden { display: none; }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 6px; padding: 1.4em 1.6em; max-width: 720px; width: 100%; max-height: 100%; overflow-y: auto; touch-action: pan-y; pointer-events: auto; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.logo { font-size: 2.6em; line-height: 1.05; color: var(--gold); text-shadow: 3px 3px 0 #1b4d2a, 6px 6px 0 #1b2a4d; letter-spacing: .06em; }
.logo span { color: #fff; }
.sub { color: var(--cyan); letter-spacing: 3px; margin: .9em 0 1.1em; font-size: .85em; }
.sub2 { color: var(--muted); margin-top: 1em; line-height: 1.8; }
.h2 { font-size: 1.6em; color: var(--gold); letter-spacing: 2px; }
.modes { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: .6em 0; }
.mbtn { flex: 1 1 150px; min-height: 56px; background: #121a2c; color: var(--text); border: 2px solid var(--line); border-radius: 4px; cursor: pointer; font-size: .95em; letter-spacing: 1px; padding: 10px 8px; line-height: 1.5; }
.mbtn small { display: block; font-size: .7em; color: var(--muted); margin-top: 4px; }
.mbtn:hover { border-color: var(--gold); color: var(--gold); }
.mbtn.primary { background: var(--gold); color: #1a1200; border-color: var(--gold); }
.mbtn.primary small { color: #5a4300; }
.mbtn.shopbtn { flex: 0 0 auto; min-height: 40px; padding: 6px 14px; border-color: var(--cyan); color: var(--cyan); }
.row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: .7em 0; flex-wrap: wrap; }
.lbl { color: var(--muted); letter-spacing: 2px; }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { background: #121a2c; color: var(--muted); border: 0; padding: 10px 12px; min-height: 40px; cursor: pointer; font-size: .85em; letter-spacing: 1px; }
.seg button.on { background: var(--cyan); color: #04202a; }
.seg button.locked { opacity: .45; }
.best { color: var(--muted); font-size: .8em; margin: .4em 0 .8em; letter-spacing: 1px; line-height: 1.7; }
.howto { text-align: left; border-top: 2px solid var(--line); padding-top: .9em; font-size: .78em; line-height: 1.9; color: var(--muted); }
.howto .h { color: var(--gold); letter-spacing: 2px; margin-bottom: .4em; }
.howto b { color: var(--text); }
.howto div + div { margin-top: .4em; }
#holeBody, #endBody, #scoreBody { margin: 1em 0; line-height: 2; color: var(--text); }
.tbl { margin: 0 auto; border-collapse: collapse; font-size: .85em; }
.tbl td, .tbl th { padding: 3px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: normal; font-size: .85em; }
.tbl td.n { text-align: left; }
.tbl .dot { display: inline-block; width: 10px; height: 10px; border: 1px solid #000; margin-right: 6px; vertical-align: middle; }
.tbl tr.you td { color: var(--gold); }
.tbl td.under { color: #ff5a4a; }
.tbl td.over { color: var(--cyan); }
.podium { display: flex; justify-content: center; gap: 10px; align-items: flex-end; margin: .6em 0 1em; }
.pod { background: #121a2c; border: 2px solid var(--line); border-radius: 4px; padding: 8px 10px; min-width: 110px; }
.pod .pl { font-size: 1.3em; color: var(--gold); }
.pod.p1 { border-color: var(--gold); min-height: 96px; }
.pod.p2 { min-height: 80px; }
.pod.p3 { min-height: 68px; }
.pod .nm { margin-top: 6px; font-size: .9em; }
.pod .sc { color: var(--muted); font-size: .8em; margin-top: 4px; }
.coins { color: var(--gold); font-size: 1.1em; margin: .4em 0; }
.shoprow { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding: 8px 0; text-align: left; font-size: .9em; }
.shoprow .sn { color: var(--text); }
.shoprow .sn small { display: block; color: var(--muted); font-size: .75em; margin-top: 4px; }
.shoprow .bars { display: flex; gap: 3px; }
.shoprow .bars i { display: block; width: 14px; height: 12px; background: #27344f; border: 1px solid #000; }
.shoprow .bars i.on { background: var(--gold); }
.shoprow button { font: inherit; font-size: .85em; min-height: 40px; padding: 0 10px; background: var(--gold); color: #1a1200; border: 2px solid #1a1200; border-radius: 4px; cursor: pointer; letter-spacing: 1px; }
.shoprow button:disabled { background: #222c44; color: var(--muted); border-color: var(--line); cursor: default; }
body.is-touch .mbtn, body.is-touch .seg button { min-height: 44px; }
body.compact .card { padding: .9em 1em; }
body.compact .logo { font-size: 2em; }
body.compact .howto { font-size: .72em; line-height: 1.7; }

/* ---- portrait phones */
@media (orientation: portrait) {
  body #standings, body.is-touch #standings { flex-wrap: wrap; justify-content: center; top: calc(172px + var(--sat)); width: calc(100% - 20px); }
  body #clockBox, body.is-touch #clockBox { top: calc(114px + var(--sat)); }
  body #windBox, body.is-touch #windBox { top: auto; bottom: calc(190px + var(--sab)); right: calc(10px + var(--sar)); }
  body.compact #windBox { bottom: calc(240px + var(--sab)); }
  body #prompt, body.is-touch #prompt { top: calc(244px + var(--sat)); white-space: normal; max-width: calc(100% - 20px); text-align: center; }
  body #ctl { bottom: calc(222px + var(--sab)); }
  body.compact #ctl { bottom: calc(172px + var(--sab)); }
  body #shotMsg, body.is-touch #shotMsg { bottom: auto; top: calc(284px + var(--sat)); }
  body.is-touch #itemRow, body.compact.is-touch #itemRow { top: calc(320px + var(--sat)); bottom: auto; left: calc(10px + var(--sal)); transform: none; flex-direction: column; }
  body #skipWrap { bottom: calc(74px + var(--sab)); }
  body.is-touch #skipWrap { bottom: calc(60px + var(--sab)); }
  body.at-ball #stamWrap { bottom: calc(330px + var(--sab)); }
  body.at-ball #stunWrap { bottom: calc(358px + var(--sab)); }
  body.at-ball #fxRow { bottom: calc(388px + var(--sab)); }
  body.compact.at-ball #stamWrap { bottom: calc(280px + var(--sab)); }
  body.compact.at-ball #stunWrap { bottom: calc(308px + var(--sab)); }
  body.compact.at-ball #fxRow { bottom: calc(338px + var(--sab)); }
  body #mmWrap, body.is-touch #mmWrap, body.compact #mmWrap { left: auto; right: calc(10px + var(--sar)); top: calc(104px + var(--sat)); width: 96px; height: 116px; }
  body #standings, body.is-touch #standings { left: calc(10px + var(--sal)); right: calc(116px + var(--sar)); width: auto; transform: none; }
  #joyZone { top: 40%; }
  #lookZone { top: 40%; }
}

/* ---- rotate hint (off by default: golf plays in both orientations) */
#rotateHint {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 18px;
  background: #07090f; color: var(--gold); text-align: center;
  font-size: clamp(12px, 3.6vw, 16px); line-height: 1.9; padding: 24px;
}
#rotateHint small { display: block; color: var(--muted); font-size: .7em; margin-top: 6px; }
#rotateHint .phone { width: 38px; height: 66px; border: 3px solid var(--gold); border-radius: 7px; animation: rot 1.6s ease-in-out infinite; }
@keyframes rot { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(90deg); } }

/* ---- kill feed (top right) */
#feed { position: absolute; right: calc(10px + var(--sar)); top: calc(172px + var(--sat)); display: flex; flex-direction: column; align-items: flex-end; gap: 3px; max-width: 46%; pointer-events: none; }
#feed:empty { display: none; }
#feed .fd { background: rgba(5,8,16,.78); border-left: 3px solid var(--line); padding: 3px 7px; font-size: .72em; letter-spacing: 1px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; animation: pop .25s ease-out; }
#feed .fd.me { border-left-color: var(--gold); }
#feed .fd.ko { border-left-color: #ff5a4a; color: #ffb0a8; }
#feed .fd.rev { border-left-color: var(--green); color: var(--green); }
#feed .fd.dom { border-left-color: #ff3b30; color: #ff5a4a; }
#feed .fd.amb { border-left-color: #b46cff; color: #d6b4ff; }
body.is-touch #feed { top: calc(184px + var(--sat)); }
body.compact #feed { top: calc(172px + var(--sat)); right: calc(10px + var(--sar)); max-width: 38%; }
body.compact #feed .fd { font-size: .62em; padding: 2px 5px; }

/* ---- spectate bar (after you hole out) */
#specBar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(88px + var(--sab)); display: flex; gap: 6px; align-items: center; pointer-events: none; background: rgba(5,8,16,.74); border: 2px solid var(--gold); border-radius: 4px; padding: 4px; }
#specTxt { color: var(--gold); letter-spacing: 1px; padding: 0 6px; white-space: nowrap; font-size: .85em; }
#specBar .cbtn { font-size: .85em; }

/* touch buttons: 3 columns (dance / dodge / sprint) over (tackle / whack / shove) */
#tbtns { grid-template-columns: auto auto auto; }
.tbtn.tiny { width: 44px; height: 44px; font-size: 7px; }
.tbtn.whack { background: rgba(224,57,43,.92); color: #fff; border-color: #3a0a06; box-shadow: 0 5px 0 #6a120a, 0 8px 18px rgba(0,0,0,.5); }
body.compact .tbtn.big { width: 70px; height: 70px; font-size: 11px; }
body.compact .tbtn.mid { width: 56px; height: 56px; }
body.compact .tbtn.small { width: 48px; height: 48px; }
body.compact #tbtns { gap: 8px; }
.tbl td, .tbl th { white-space: nowrap; }
.sub2.rules { font-size: .72em; line-height: 1.8; }
@media (orientation: portrait) {
  body #feed, body.is-touch #feed, body.compact #feed { top: calc(232px + var(--sat)); right: calc(10px + var(--sar)); max-width: 60%; }
}
/* keep the shot message clear of the minimap on short landscape phones */
@media (orientation: landscape) { body.compact #shotMsg { max-width: calc(100% - 240px); } }

#lockBtn { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(74px + var(--sab));   /* above #itemRow (40px + ~28px): was 52px and sat under the item buttons */
   font-size: .75em; letter-spacing: 1px; padding: 0 14px; border-color: var(--gold); color: var(--gold); }
#lockBtn:active { transform: translateX(-50%) translateY(1px); }

/* SIMPLE controls (default): the game picks the club; no spin / low-shot / lock buttons */
body.simple #clubRow, body.simple #spinBtn, body.simple #lowBtn, body.simple.is-desktop #lockBtn { display: none !important; }   /* phones keep WALK OFF: the stick is hidden at the ball */

/* in the golf cart: always-visible way out (David 2026-11-22: "i got stuck in a cart") */
#cartWrap { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(74px + var(--sab)); pointer-events: none; }   /* lives in #hudTop so it sits above the phone touch zones */
#cartBtn { pointer-events: auto; font: inherit; font-size: .9em; background: #f4f4f4; color: #1a1200; border: 2px solid #1a1200; border-radius: 4px; padding: 10px 14px; cursor: pointer; letter-spacing: 1px; }
body.is-touch #cartWrap { bottom: calc(50px + var(--sab)); }

/* in the cup: the rest of the hole runs at 2x */
#ffTag { position: absolute; right: calc(10px + var(--sar)); bottom: calc(10px + var(--sab)); background: rgba(5,8,16,.74); border: 2px solid var(--cyan); color: var(--cyan); border-radius: 4px; padding: 4px 8px; letter-spacing: 1px; pointer-events: none; }

/* phones: show where the left thumb moves you (David on his iPhone: "i cannot move" - the joystick was invisible
   until you touched the right spot). Ghost stick in the move zone; hidden while the real stick is in use. */
#joyZone::after {
  content: 'MOVE'; position: absolute; left: 24px; bottom: 24px; width: 104px; height: 104px; border-radius: 50%;
  border: 2px dashed rgba(255,255,255,.7); background: rgba(5,8,16,.5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: inherit; font-size: 12px; letter-spacing: 1px;
  pointer-events: none; animation: joyGhost 1.6s ease-in-out infinite;
}
#joyZone:has(#joyBase.on)::after { display: none; }
@keyframes joyGhost { 50% { opacity: .45; } }
#joyZone::after { left: 150px; bottom: 14px; width: 80px; height: 80px; font-size: 10px; }   /* beside the STUN / STAMINA bars, below the mini-map */
