/* Mini Golf - aplexotools.com/golf. The course (a three.js canvas) fills the window and everything here lies over
   it. The look: a sunny toy course, candy colours on dark glass panels, big friendly buttons. `calm` on <html> (the
   site's Motion setting) stills the wobbles and bounces. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-style: normal; font-weight: 600 800; font-display: swap; src: url('/fonts/sora-latin.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #0f1a24; --panel: rgba(13, 22, 33, .9); --panel-2: rgba(28, 40, 56, .92); --line: rgba(255, 255, 255, .12); --line-2: rgba(255, 255, 255, .22);
  --text: #f4f7fb; --muted: #b5c2d0; --dim: #7f8fa0;
  --mint: #5fe0a0; --mint-2: #2fb97a; --sunny: #ffd166; --cherry: #ff5a6e; --sky: #3fa7ff; --grape: #a66bff;
  --display: Sora, Inter, system-ui, sans-serif; --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1); --bounce: cubic-bezier(.34, 1.56, .64, 1);
  /* glass: every panel over the course shares one look */
  --glass: rgba(10, 18, 30, .58); --glass-2: rgba(12, 22, 36, .74); --glass-line: rgba(255, 255, 255, .16);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 10px 30px rgba(0, 0, 0, .32); --blur: blur(14px) saturate(140%);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; height: 100%; }
body { margin: 0; height: 100%; overflow: hidden; color: var(--text); font: 14px/1.5 var(--font); background: var(--bg); overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sunny); outline-offset: 2px; border-radius: 8px; }
.ic { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- the course ---------- */
.stage { position: fixed; inset: 0; z-index: 0; background: #9fd3ef; touch-action: none; user-select: none; -webkit-user-select: none; }
/* a soft vignette while playing: the picture reads as a picture */
.stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s; background: radial-gradient(ellipse 80% 70% at 50% 45%, transparent 55%, rgba(4, 10, 20, .34) 100%); }
body[data-screen="play"] .stage::after { opacity: 1; }
.golf-canvas { display: block; width: 100%; height: 100%; }
body[data-screen="play"] .stage { cursor: grab; }
.tags { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c) 78%, #000); color: #fff; font: 700 11px/1.5 var(--font); white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 8px rgba(0, 0, 0, .35); opacity: .85; transition: opacity .2s; }
.tag.on { opacity: 1; font-size: 12px; box-shadow: 0 0 0 2px #fff, 0 3px 10px rgba(0, 0, 0, .35); }
body:not([data-screen="play"]) .tags { visibility: hidden; }

/* ---------- the top ---------- */
.top { position: fixed; left: 0; right: 0; top: 0; z-index: 30; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); background: linear-gradient(180deg, rgba(8, 16, 26, .78), rgba(8, 16, 26, .35) 70%, transparent); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font: 700 14px var(--display); color: var(--text); flex: none; }
.brand img { display: block; border-radius: 8px; }
.crumb { font: 700 14px var(--display); color: var(--sunny); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crumb .sep { color: var(--dim); margin-right: 8px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--glass-line); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--glass-shadow); color: var(--text); padding: 0; font-size: 16px; transition: border-color .15s, color .15s, transform .15s var(--bounce); }
.icon-btn:hover { border-color: var(--sunny); color: var(--sunny); }
.icon-btn:active { transform: scale(.94); }
.icon-btn[aria-pressed="true"] { border-color: var(--sunny); color: var(--sunny); }
.icon-btn.small { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
#soundBtn .off, #soundBtn[aria-pressed="true"] .on { display: none; }
#soundBtn[aria-pressed="true"] .off { display: block; }

/* ---------- while playing ---------- */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hole-chip { position: absolute; left: max(12px, env(safe-area-inset-left)); top: 60px; display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: baseline; padding: 9px 16px 10px 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--glass-shadow); pointer-events: none; overflow: hidden; }
.hole-chip::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sunny); box-shadow: 0 0 10px var(--sunny); }
.hole-chip b { font: 800 15px var(--display); color: var(--sunny); }
.hole-chip span { font: 700 14px var(--display); }
.hole-chip em { grid-column: 1 / -1; font-style: normal; color: var(--muted); font-size: 12px; }
.turn-chip { position: absolute; left: 50%; top: 60px; transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 8px 18px 8px 10px; border-radius: 999px; background: var(--glass-2); border: 2px solid var(--c, var(--mint)); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--glass-shadow), 0 0 22px color-mix(in srgb, var(--c, var(--mint)) 40%, transparent); pointer-events: none; white-space: nowrap; }
.turn-chip .dot { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--c) 22%); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.turn-chip b { font: 800 15px var(--display); }
.turn-chip span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cam-btns { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.round-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--glass-shadow); color: var(--text); font-size: 18px; transition: transform .15s var(--bounce), border-color .15s; }
.round-btn:hover { border-color: var(--sunny); }
.round-btn:active { transform: scale(.92); }
.hint { position: absolute; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; max-width: min(520px, calc(100% - 140px)); padding: 9px 18px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--glass-shadow); font-weight: 600; text-align: center; pointer-events: none; }
.hint:empty { display: none; }
body[data-screen="card"] .hint, body[data-screen="card"] .cam-btns { display: none; }

/* the power meter (golf-input.js draws it here) */
.meter-host { position: absolute; right: max(18px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); pointer-events: none; }
.putter-meter { --p: 0; position: relative; width: 26px; height: min(260px, 40vh); border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--glass-shadow); }
.putter-meter::after { content: ''; position: absolute; inset: 4px; border-radius: 999px; background: repeating-linear-gradient(180deg, transparent 0 calc(25% - 1px), rgba(255, 255, 255, .22) calc(25% - 1px) 25%); pointer-events: none; }
.putter-fill { position: absolute; inset: 4px; background: linear-gradient(0deg, #5fe0a0, #ffd166 55%, #ff5a6e); border-radius: 999px; clip-path: inset(calc((1 - var(--p)) * 100%) 0 0 0 round 999px); transform: none !important; box-shadow: 0 0 14px color-mix(in srgb, var(--sunny) 60%, transparent); }
.putter-num { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); padding: 2px 9px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--glass-line); font: 800 13px var(--display); color: #fff; font-variant-numeric: tabular-nums; }

/* a hole's title card, and whose turn it is */
.banner { position: fixed; left: 50%; top: 34%; z-index: 20; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 20px 34px 22px; min-width: min(440px, calc(100% - 32px)); max-width: calc(100% - 32px); border-radius: 26px; background: linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 40%), var(--glass-2); border: 1px solid var(--glass-line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--glass-shadow), 0 24px 70px rgba(0, 0, 0, .45), 0 0 0 2px color-mix(in srgb, var(--c, var(--mint)) 55%, transparent); text-align: center; pointer-events: none; }
.banner small { font: 700 12px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--c, var(--mint)); }
.banner b { font: 800 clamp(26px, 5vw, 40px)/1.1 var(--display); }
.banner span { color: var(--muted); max-width: 46ch; }
.banner span:empty { display: none; }
.banner.go { animation: pop .5s var(--bounce) both; }
.skip-btn { pointer-events: auto; margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .06); font-weight: 700; }
.skip-btn:hover { border-color: var(--sunny); color: var(--sunny); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.7); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* the big words */
.shouts { position: fixed; inset: 0; z-index: 25; pointer-events: none; display: grid; place-items: center; }
.shout { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transform: translateY(-12vh); animation: shout-in .5s var(--bounce) both; padding: 0 16px; }
.shout b { display: block; font: 800 clamp(34px, 8vw, 84px)/1 var(--display); color: #fff; -webkit-text-stroke: 2px rgba(0, 0, 0, .35); paint-order: stroke fill; text-shadow: 0 5px 0 color-mix(in srgb, var(--c, var(--cherry)) 70%, #000), 0 10px 30px rgba(0, 0, 0, .35); white-space: pre-wrap; }
.shout b span { display: inline-block; animation: wobble 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * -.09s); }
.shout small { font: 700 clamp(14px, 2.4vw, 18px) var(--display); color: #fff; background: var(--glass-2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); padding: 5px 14px; border-radius: 999px; border: 1px solid var(--glass-line); }
.shout.small b { font-size: clamp(24px, 5vw, 44px); }
.shout.small { transform: translateY(-22vh); }
.shout.ace b { font-size: clamp(42px, 11vw, 120px); color: var(--sunny); text-shadow: 0 6px 0 #c2410c, 0 14px 40px rgba(0, 0, 0, .4); }
.shout.ace b span { animation: wobble-big .8s ease-in-out infinite; animation-delay: calc(var(--i) * -.07s); }
.shout.under b { color: var(--mint); }
.shout.over b { color: #ffe1e5; }
.shout.out { animation: shout-out .4s ease-in both; }
@keyframes shout-in { from { opacity: 0; transform: translateY(-12vh) scale(.4) rotate(-6deg); } to { opacity: 1; transform: translateY(-12vh) scale(1) rotate(0); } }
@keyframes shout-out { to { opacity: 0; transform: translateY(-16vh) scale(1.15); } }
@keyframes wobble { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes wobble-big { 0%, 100% { transform: translateY(0) rotate(-7deg) scale(1); } 50% { transform: translateY(-16px) rotate(7deg) scale(1.12); } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 26; pointer-events: none; }

/* ---------- screens over the course ---------- */
.screen { position: fixed; inset: 0; z-index: 15; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 64px 16px 16px; overflow-y: auto; background: radial-gradient(120% 90% at 50% 40%, rgba(8, 16, 26, .15), rgba(8, 16, 26, .55)); }
.panel { width: min(560px, 100%); min-width: 0; max-width: 100%; padding: 24px; border-radius: 26px; background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 30%), rgba(10, 18, 30, .74); border: 1px solid var(--glass-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 30px 80px rgba(0, 0, 0, .5); backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); }
.logo { margin: 0 0 6px; display: flex; gap: 14px; align-items: baseline; justify-content: center; font: 800 clamp(48px, 12vw, 76px)/1 var(--display); letter-spacing: -.02em; }
.logo .w1 { color: var(--sunny); text-shadow: 0 5px 0 #b45309; display: inline-block; animation: bob 2.4s ease-in-out infinite; }
.logo .w2 { color: var(--mint); text-shadow: 0 5px 0 #0f766e; display: inline-block; animation: bob 2.4s ease-in-out infinite; animation-delay: -1.2s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
.tagline { margin: 0 0 18px; text-align: center; color: var(--muted); }
.seg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 14px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; flex-direction: column; gap: 1px; height: 100%; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; transition: border-color .15s, background .15s; }
.seg span b { font: 800 15px var(--display); }
.seg span small { color: var(--muted); font-size: 12px; }
.seg input:checked + span { border-color: var(--mint); background: rgba(95, 224, 160, .1); }
.seg input:focus-visible + span { outline: 2px solid var(--sunny); outline-offset: 2px; }
.seg.small span { padding: 7px 12px; align-items: center; font-weight: 700; }
.players { display: flex; flex-direction: column; gap: 8px; }
.player-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.player-row:focus-within { border-color: var(--c); }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; flex: none; background: radial-gradient(circle at 35% 30%, #fff 0 16%, var(--c) 20%); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22), 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent); transition: transform .2s var(--bounce); }
.swatch:hover { transform: rotate(25deg) scale(1.08); }
.player-row input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid transparent; background: rgba(0, 0, 0, .25); font-weight: 700; font-size: 16px; }
.player-row input:focus { outline: none; border-color: var(--c); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--mint); font-weight: 700; padding: 8px 4px; }
.link-btn:hover { color: var(--sunny); }
.add { margin: 4px 0 2px; }
.practice-pick { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; font-weight: 700; }
.practice-pick select { flex: 1; height: 40px; border-radius: 11px; border: 1px solid var(--line-2); background: #142130; padding: 0 10px; }
.play { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 16px; height: 56px; border: 0; border-radius: 18px; background: linear-gradient(180deg, #7ff0b8, var(--mint-2)); color: #06281a; font: 800 19px var(--display); box-shadow: 0 6px 0 #17805a, 0 14px 30px rgba(47, 185, 122, .35); transition: transform .12s, box-shadow .12s; }
.play:hover { transform: translateY(-1px); }
.play:active { transform: translateY(5px); box-shadow: 0 1px 0 #17805a, 0 6px 16px rgba(47, 185, 122, .3); }
.play .ic { font-size: 20px; }
.fine { margin: 14px 0 0; text-align: center; color: var(--dim); font-size: 12px; }
.ghost-btn { height: 48px; padding: 0 18px; border-radius: 15px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); font-weight: 700; }
.ghost-btn:hover { border-color: var(--sunny); color: var(--sunny); }
.ghost-btn.danger { color: #ffb3bd; margin-top: 14px; width: 100%; }

/* the scorecard */
.card-panel, .end-panel { width: min(760px, 100%); }
.card-panel h2, .end-title { margin: 0 0 4px; font: 800 26px var(--display); text-align: center; }
.card-note { margin: 0 0 14px; text-align: center; color: var(--muted); }
.card-note:empty { display: none; }
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .18); }
.scores { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.scores th, .scores td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); min-width: 30px; }
.scores thead th { font: 700 12px var(--display); color: var(--muted); }
.scores thead th.now { color: var(--sunny); }
.scores th.name { text-align: left; padding-left: 12px; min-width: 96px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scores tbody th.name { font-weight: 800; border-left: 4px solid var(--c, transparent); }
.scores .par-row td, .scores .par-row th { color: var(--muted); font-size: 12px; }
.scores tr:last-child > * { border-bottom: 0; }
.scores td.ace { color: var(--sunny); font-weight: 800; }
.scores td.ace::after { content: '★'; font-size: 10px; vertical-align: super; }
.scores td.under { color: var(--mint); font-weight: 800; }
.scores td.over { color: #ffb38a; }
.scores td.pick { color: #ff8796; text-decoration: underline dotted; }
.scores td.empty { color: var(--dim); font-size: 12px; }
.scores td:nth-last-child(-n+2) { font-weight: 800; }
.card-actions { display: flex; gap: 10px; margin-top: 16px; }
.card-actions .play { margin-top: 0; flex: 1; }
.podium { list-style: none; margin: 10px 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.podium li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 2px solid color-mix(in srgb, var(--c) 60%, transparent); }
.podium li.place-1 { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 28%, transparent), transparent); border-color: var(--c); }
.podium .place { font: 800 14px var(--display); color: var(--muted); width: 36px; }
.podium li.place-1 .place { color: var(--sunny); }
.podium b { font: 800 18px var(--display); flex: 1; }
.podium .score { font-weight: 800; font-variant-numeric: tabular-nums; }

/* dialogs */
.dlg { width: min(460px, calc(100% - 32px)); padding: 20px; border-radius: 22px; border: 1px solid var(--line-2); background: #111d2a; color: var(--text); box-shadow: 0 24px 70px rgba(0, 0, 0, .5); }
.dlg::backdrop { background: rgba(4, 10, 18, .55); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dlg-head h2 { margin: 0; font: 800 20px var(--display); }
.how { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.how b { color: var(--text); }
.row-head { display: flex; justify-content: space-between; margin: 6px 0 8px; }
.lbl { font-weight: 700; }
.lbl-hint { color: var(--dim); font-size: 12px; }
.row-note { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-weight: 700; }
.check input { width: 18px; height: 18px; accent-color: var(--mint); }

/* loading */
.loading { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(circle at 50% 40%, #1d3a4f, var(--bg)); font: 700 16px var(--display); }
.spinner { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, #e8eef5 22% 60%, #b9c6d3 100%); box-shadow: 0 10px 0 -4px rgba(0, 0, 0, .3); animation: hop .8s var(--ease) infinite alternate; }
@keyframes hop { from { transform: translateY(0) scaleY(.92); } to { transform: translateY(-26px) scaleY(1.04); } }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; background: var(--bg); }

/* ---------- the course picker, the switches ---------- */
.start-panel { width: min(620px, 100%); }
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 12px; }
.course { position: relative; min-width: 0; }
.course input { position: absolute; opacity: 0; pointer-events: none; }
.course-card { display: flex; flex-direction: column; height: 100%; border-radius: 16px; overflow: hidden; border: 2px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; transition: border-color .15s, transform .15s var(--bounce); }
.course-card:hover { transform: translateY(-2px); }
.course input:checked + .course-card { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(95, 224, 160, .18); }
.course input:focus-visible + .course-card { outline: 2px solid var(--sunny); outline-offset: 2px; }
.course-map { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; }
.course-words { display: flex; flex-direction: column; padding: 6px 10px 8px; min-width: 0; }
.course-words b { font: 800 14px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.course-words small { color: var(--muted); font-size: 11.5px; }
.link-btn.small { padding: 2px 0; font-size: 12.5px; text-decoration: none; }
.share-note { margin: -4px 0 12px; padding: 8px 12px; border-radius: 12px; background: rgba(95, 224, 160, .1); border: 1px solid rgba(95, 224, 160, .4); font-weight: 600; font-size: 13px; }
.share-note.bad { background: rgba(255, 90, 110, .12); border-color: rgba(255, 90, 110, .5); color: #ffd3d9; }
.toggles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin: 0 0 14px; }
.switch { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); cursor: pointer; min-width: 0; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .16); transition: background .15s; }
.switch i::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--bounce); }
.switch input:checked + i { background: var(--mint-2); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--sunny); outline-offset: 2px; }
.switch span { display: flex; flex-direction: column; min-width: 0; }
.switch b { font: 800 14px var(--display); }
.switch small { color: var(--muted); font-size: 11.5px; }
.swatch { position: relative; }
.swatch-hat { position: absolute; left: 50%; bottom: 52%; width: 26px; height: 26px; transform: translateX(-50%); pointer-events: none; }
.swatch-hat svg { width: 100%; height: 100%; display: block; }

/* ---------- a player's look ---------- */
.look-dlg { width: min(520px, calc(100% - 24px)); }
.look-preview { --c: #ff5a6e; position: relative; height: 92px; margin: 0 0 6px; border-radius: 16px; background: radial-gradient(120% 120% at 50% 100%, #3f8f4a, #1d4a26); display: grid; place-items: center; overflow: hidden; }
.look-ball { position: relative; width: 46px; height: 46px; border-radius: 50%; margin-top: 18px; background: radial-gradient(circle at 34% 30%, #fff 0 14%, var(--c) 20% 62%, color-mix(in srgb, var(--c) 65%, #000) 100%); box-shadow: 0 6px 10px rgba(0, 0, 0, .35); z-index: 1; }
.look-hat { position: absolute; left: 50%; bottom: 55%; width: 40px; height: 40px; transform: translateX(-50%); }
.look-hat svg, .pick-ic svg { width: 100%; height: 100%; display: block; }
.look-preview .trail-pic.big { position: absolute; left: 12%; right: 55%; top: 62%; width: auto; height: 22px; transform: translateY(-50%); }
.pick-lbl { display: block; margin: 10px 0 6px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-size: 11px; }
.pick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-swatch { --c: #fff; width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; background: radial-gradient(circle at 34% 30%, #fff 0 14%, var(--c) 20% 62%, color-mix(in srgb, var(--c) 65%, #000) 100%); box-shadow: 0 2px 5px rgba(0, 0, 0, .35); transition: transform .15s var(--bounce); }
.pick-swatch.on { box-shadow: 0 0 0 3px #111d2a, 0 0 0 6px #fff; transform: scale(1.06); }
.pick-swatch:disabled { opacity: .22; cursor: default; }
.pick-tile { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 70px; padding: 6px 4px; border-radius: 13px; border: 2px solid var(--line); background: rgba(255, 255, 255, .04); font-size: 11.5px; font-weight: 700; }
.pick-tile.on { border-color: var(--sunny); background: rgba(255, 209, 102, .14); }
.pick-ic { width: 32px; height: 32px; }
.trail-pic { display: block; position: relative; width: 44px; height: 20px; border-radius: 10px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.trail-pic::after { content: ''; position: absolute; inset: 0; }
.t-dots .trail-pic::after, .trail-pic.t-dots::after { background: radial-gradient(circle, #e8eef5 0 3px, transparent 4px) 4px 50% / 11px 100% repeat-x; }
.t-sparkle .trail-pic::after, .trail-pic.t-sparkle::after { background: radial-gradient(circle, #ffd166 0 2px, transparent 3px) 2px 30% / 9px 60% repeat, radial-gradient(circle, #fff 0 1.5px, transparent 2.5px) 6px 70% / 10px 60% repeat; }
.t-bubbles .trail-pic::after, .trail-pic.t-bubbles::after { background: radial-gradient(circle, transparent 0 3px, #bfeaff 3.5px 4.5px, transparent 5px) 0 50% / 13px 100% repeat-x; }
.t-hearts .trail-pic::after, .trail-pic.t-hearts::after { content: '\2665 \2665 \2665'; color: #ff6b9a; font-size: 12px; line-height: 20px; text-align: center; letter-spacing: 1px; }
.t-fire .trail-pic::after, .trail-pic.t-fire::after { background: linear-gradient(90deg, transparent, #ff5a1f 40%, #ffb030 75%, #fff3b0); filter: blur(1px); border-radius: 10px; }
.t-rainbow .trail-pic::after, .trail-pic.t-rainbow::after { background: linear-gradient(90deg, #ff5a6e, #ffd166, #5fe0a0, #3fa7ff, #a66bff); opacity: .9; }
.look-dlg .play { margin-top: 14px; height: 48px; }

/* ---------- the power-up button while playing ---------- */
.item-btn { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px)); display: flex; align-items: center; gap: 10px; max-width: min(340px, calc(100% - 140px)); padding: 8px 14px 8px 8px; border-radius: 18px;
  border: 2px solid var(--sunny); background: linear-gradient(135deg, rgba(70, 50, 12, .78), rgba(60, 18, 30, .78)); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); color: #fff8e8; text-align: left; box-shadow: var(--glass-shadow); animation: item-glow 1.6s ease-in-out infinite; }
.item-btn .item-ic { width: 42px; height: 42px; flex: none; }
.item-btn .item-ic svg { width: 100%; height: 100%; display: block; }
.item-btn .item-words { display: flex; flex-direction: column; min-width: 0; }
.item-btn b { font: 800 15px var(--display); }
.item-btn small { color: #e8dcc0; font-size: 12px; }
.item-btn.armed { border-color: var(--mint); animation: none; background: rgba(13, 22, 33, .9); cursor: default; }
@keyframes item-glow { 50% { box-shadow: 0 10px 26px rgba(0, 0, 0, .35), 0 0 0 5px rgba(255, 209, 102, .25); } }
.calm .item-btn { animation: none; }
@media (max-width: 640px) {
  .item-btn { bottom: max(130px, calc(env(safe-area-inset-bottom) + 122px)); max-width: calc(100% - 24px); }
  .toggles { grid-template-columns: minmax(0, 1fr); }
  .courses { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ---------- Calm: nothing wobbles or bounces ---------- */
.calm .logo .w1, .calm .logo .w2, .calm .shout b span, .calm .spinner { animation: none; }
.calm .shout, .calm .shout.out, .calm .banner.go { animation-duration: .01ms; }
.calm .swatch:hover { transform: none; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .brand span, .crumb .sep { display: none; }
  .top { height: 50px; gap: 8px; }
  .icon-btn { width: 36px; height: 36px; }
  .hole-chip { top: 56px; padding: 6px 11px; border-radius: 14px; }
  .hole-chip b { font-size: 13px; } .hole-chip span { font-size: 12px; } .hole-chip em { font-size: 11px; }
  .turn-chip { top: auto; bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px)); padding: 6px 14px 6px 8px; }
  .turn-chip b { font-size: 14px; }
  .hint { bottom: max(20px, env(safe-area-inset-bottom)); left: 12px; transform: none; max-width: calc(100% - 136px); font-size: 12px; border-radius: 14px; text-align: left; }
  .round-btn { width: 46px; height: 46px; }
  .meter-host { right: 14px; top: 46%; }
  .putter-meter { height: min(200px, 32vh); width: 20px; }
  .panel { padding: 18px; border-radius: 22px; }
  .seg span { padding: 8px 10px; }
  .banner { top: 30%; padding: 14px 18px 16px; }
  .scores th, .scores td { padding: 7px 4px; min-width: 26px; font-size: 13px; }
  .scores th.name { min-width: 72px; padding-left: 8px; }
}
