@font-face { font-family: 'Rubik'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/rubik-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/rubik-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 600; font-display: swap; src: url('../vendor/fonts/rubik-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Rubik'; font-weight: 700; font-display: swap; src: url('../vendor/fonts/rubik-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/fredoka-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 600; font-display: swap; src: url('../vendor/fonts/fredoka-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fredoka'; font-weight: 700; font-display: swap; src: url('../vendor/fonts/fredoka-latin-700-normal.woff2') format('woff2'); }

:root {
  --ink: #123c46;
  --ink-2: #2b5a63;
  --foam: #f7fbf6;
  --foam-2: #e6f3ee;
  --coral: #ff5a48;
  --coral-deep: #d9402f;
  --sun: #ffc42e;
  --shallow: #47e0d0;
  --grass: #6dbd45;
  --silver: #c9d6dc;
  --bronze: #d88a4e;
  --glass: rgba(14, 52, 60, 0.62);
  --glass-line: rgba(255, 255, 255, 0.16);
  --display: 'Fredoka', 'Rubik', system-ui, sans-serif;
  --ui: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --gutter: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #9fd8f6;
  overscroll-behavior: none; touch-action: none;
  font-family: var(--ui); color: var(--foam);
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
}
#game { position: fixed; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#aim-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui * { pointer-events: auto; }
#ui .passive, #ui .passive * { pointer-events: none; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 4;
  background: radial-gradient(120% 90% at 50% 45%, rgba(0,0,0,0) 60%, rgba(8,40,48,0.28) 100%); }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 16px;
  font-weight: 600; font-size: 17px; letter-spacing: 0.01em;
  background: var(--foam); color: var(--ink);
  box-shadow: 0 4px 0 rgba(10, 45, 52, 0.28);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .2s;
}
.btn:hover { background: #ffffff; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(10, 45, 52, 0.28); }
.btn.primary { background: var(--coral); color: #fff; box-shadow: 0 4px 0 var(--coral-deep); }
.btn.primary:hover { background: #ff6b5a; }
.btn.primary:active { box-shadow: 0 1px 0 var(--coral-deep); }
.btn.quiet { background: rgba(255,255,255,0.14); color: var(--foam); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.28); }
.btn.quiet:hover { background: rgba(255,255,255,0.22); }
.btn.quiet:active { transform: translateY(1px); }
.btn.wide { width: 100%; }

.icon-btn {
  width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px var(--glass-line);
  transition: transform .12s var(--ease), background .2s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.on { background: rgba(255,196,46,0.92); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- screens */
.screen { position: fixed; inset: 0; display: none; }
.screen.show { display: block; }
.fade-in { animation: fadeIn .35s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

/* ---------- title: logo on top, actions centred at the bottom */
#title { background: linear-gradient(180deg, rgba(10,50,60,0.38) 0%, rgba(10,50,60,0) 26%, rgba(10,50,60,0) 52%, rgba(10,50,60,0.6) 100%); }
.title-wrap {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(4vh + var(--sat)) calc(var(--gutter) + var(--sar)) calc(3.5vh + var(--sab)) calc(var(--gutter) + var(--sal));
}
.title-head { display: flex; flex-direction: column; align-items: center; text-align: center; animation: rise .6s var(--ease) both; }
.wordmark { display: block; width: min(560px, 82vw); height: auto; max-height: 24vh; filter: drop-shadow(0 8px 22px rgba(5,40,50,.4)); }
.tagline { font-family: var(--display); font-weight: 600; font-size: clamp(19px, 2.4vw, 26px); margin: 8px 0 0; color: #fffbe9; -webkit-text-stroke: 5px #123c46; paint-order: stroke fill; }
.title-foot { width: min(540px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; animation: rise .6s .12s var(--ease) both; }
.title-actions { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.title-actions .row { display: flex; gap: 12px; }
.title-actions .row > * { flex: 1; min-width: 0; }
.btn.big { min-height: 70px; font-family: var(--display); font-size: 27px; border-radius: 22px; box-shadow: 0 6px 0 var(--coral-deep), 0 14px 30px rgba(120,30,20,.28); gap: 12px; }
.btn.big svg { width: 26px; height: 26px; }
.btn.big:active { box-shadow: 0 2px 0 var(--coral-deep); }
.btn.mid { min-height: 60px; padding: 0 14px; border-radius: 18px; font-family: var(--display); font-size: 19px; font-weight: 600; gap: 10px;
  background: rgba(255,255,255,0.94); color: var(--ink); box-shadow: 0 5px 0 rgba(10,45,52,0.3); }
.btn.mid svg { width: 24px; height: 24px; flex: none; color: var(--coral-deep); }
.btn.mid .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 72px; border-radius: 18px;
  background: rgba(14,52,60,0.55); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.28); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff; font-weight: 600; font-size: 14px; transition: transform .12s var(--ease), background .2s; }
.tile:hover { background: rgba(14,52,60,0.7); }
.tile:active { transform: scale(.95); }
.tile svg { width: 27px; height: 27px; }
.tile span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; padding: 0 4px; }
.title-best { font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.9); min-height: 20px; text-shadow: 0 1px 4px rgba(0,0,0,.4); text-align: center; }

/* ---------- panels (holes / settings / pause) */
.backdrop { position: absolute; inset: 0; background: rgba(9, 44, 52, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.panel {
  position: absolute; inset: 0; margin: auto; height: fit-content;
  width: min(560px, calc(100% - 2 * var(--gutter))); max-height: calc(100% - 2 * var(--gutter) - var(--sat) - var(--sab));
  overflow: auto; background: var(--foam); color: var(--ink); border-radius: 26px; padding: 26px 24px 24px;
  box-shadow: 0 24px 60px rgba(4, 30, 36, 0.35);
  animation: rise .35s var(--ease) both;
}
.panel h2 { font-family: var(--display); font-weight: 600; font-size: 30px; margin: 0 0 4px; }
.panel .sub { margin: 0 0 20px; color: var(--ink-2); font-size: 15px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.close-btn { width: 44px; height: 44px; border-radius: 14px; background: var(--foam-2); display: grid; place-items: center; flex: none; }
.close-btn svg { width: 20px; height: 20px; }

.holes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hole-card {
  position: relative; text-align: left; padding: 14px 14px 12px; border-radius: 18px; background: #fff;
  box-shadow: inset 0 0 0 1.5px #d5e6e2; min-height: 118px; display: flex; flex-direction: column; gap: 4px;
  transition: transform .12s var(--ease), box-shadow .2s;
}
.hole-card:hover:not(.locked) { box-shadow: inset 0 0 0 2px var(--shallow); }
.hole-card:active:not(.locked) { transform: scale(.97); }
.hole-card .num { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--ink); }
.hole-card .name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.hole-card .meta { font-size: 13px; color: var(--ink-2); margin-top: auto; }
.hole-card .coin { position: absolute; right: 12px; top: 12px; }
.hole-card.locked { background: var(--foam-2); color: #7d989c; cursor: not-allowed; box-shadow: none; }
.hole-card.locked .num { color: #9db3b6; }

.coin { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 14px; color: rgba(0,0,0,0.45);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.14), 0 2px 4px rgba(0,0,0,0.12); }
.coin.gold { background: radial-gradient(circle at 35% 30%, #fff1b0, var(--sun) 55%, #e6a515); }
.coin.silver { background: radial-gradient(circle at 35% 30%, #ffffff, var(--silver) 60%, #9fb2ba); }
.coin.bronze { background: radial-gradient(circle at 35% 30%, #ffd3ad, var(--bronze) 60%, #a85e2b); }
.coin.none { background: #e8efed; box-shadow: inset 0 0 0 2px #d0dfdc; }

.settings-list { display: flex; flex-direction: column; gap: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px; border-bottom: 1px solid #e1ece9; min-height: 56px; }
.set-row:last-child { border-bottom: 0; }
.set-row label, .set-row .lbl { font-weight: 500; font-size: 16px; }
.set-row .hint { display: block; font-size: 13px; color: var(--ink-2); font-weight: 400; margin-top: 2px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 170px; height: 32px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--shallow) var(--fill, 50%), #d9e7e4 var(--fill, 50%)); }
input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; background: #d9e7e4; }
input[type=range]::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--shallow); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25), inset 0 0 0 2px var(--ink); }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
.toggle { position: relative; width: 56px; height: 32px; border-radius: 16px; background: #cfdedb; flex: none; transition: background .2s; }
.toggle::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.toggle[aria-checked=true] { background: var(--grass); }
.toggle[aria-checked=true]::after { transform: translateX(24px); }
.seg { display: inline-flex; background: var(--foam-2); border-radius: 13px; padding: 3px; }
.seg button { padding: 8px 13px; border-radius: 10px; font-size: 14px; font-weight: 500; min-height: 38px; }
.seg button[aria-pressed=true] { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }
.swatches { display: flex; gap: 10px; }
.swatch { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255,255,255,.9), 0 0 0 2px transparent; transition: box-shadow .15s; }
.swatch[aria-pressed=true] { box-shadow: inset 0 0 0 3px rgba(255,255,255,.9), 0 0 0 3px var(--ink); }
.danger { color: var(--coral-deep); font-weight: 600; padding: 10px 0; }

.pause-actions { display: flex; flex-direction: column; gap: 10px; }
.pause-actions .btn { width: 100%; }
.pause-actions .btn.ghost { background: var(--foam-2); box-shadow: none; }

/* ---------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud.show { display: block; }
.hud-top {
  position: absolute; top: calc(12px + var(--sat)); left: calc(var(--gutter) + var(--sal)); right: calc(var(--gutter) + var(--sar));
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.hole-tag { padding: 9px 16px 10px 14px; border-radius: 16px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px var(--glass-line); display: flex; align-items: center; gap: 12px; min-width: 0; }
.hole-tag .n { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--sun); }
.hole-tag .t { display: flex; flex-direction: column; min-width: 0; }
.hole-tag .k { font-size: 12px; color: rgba(255,255,255,.72); }
.hole-tag .name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-right { display: flex; gap: 8px; align-items: flex-start; }
.score {
  display: flex; align-items: stretch; border-radius: 16px; overflow: hidden; background: var(--glass);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px var(--glass-line);
}
.score > div { padding: 7px 14px 8px; display: flex; flex-direction: column; align-items: center; min-width: 62px; }
.score .v { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; }
.score .k { font-size: 12px; color: rgba(255,255,255,.72); margin-top: 3px; }
.score .par { background: rgba(255,255,255,0.08); }
.score .v.bump { animation: pop .38s var(--ease); }
.hud-buttons { display: flex; gap: 8px; }

/* Hints: plain outlined text near the top, never a card where the thumb rests. */
.outlined { font-family: var(--display); font-weight: 600; color: #fffbe9; -webkit-text-stroke: 5px #123c46; paint-order: stroke fill; text-wrap: balance; }
.hint {
  position: absolute; left: 50%; top: calc(88px + var(--sat)); transform: translateX(-50%);
  font-size: 20px; text-align: center; width: max-content; max-width: calc(100% - 2 * var(--gutter)); white-space: normal;
  opacity: 0; transition: opacity .3s var(--ease); pointer-events: none;
}
.hint.show { opacity: 1; animation: hintBreath 2.4s ease-in-out infinite; }
@keyframes hintBreath { 0%, 100% { opacity: 1; } 50% { opacity: .85; } }
.hint .drag-demo { display: inline-block; width: 26px; height: 14px; margin-right: 8px; vertical-align: -2px; position: relative; }
.hint .drag-demo::before { content: ''; position: absolute; left: 0; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: dragdemo 1.6s var(--ease) infinite; }
@keyframes dragdemo { 0%, 15% { transform: translateX(14px); opacity: 1; } 70% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(0); opacity: 0; } }

.toast-wrap { position: absolute; top: calc(136px + var(--sat)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 10px 18px; border-radius: 14px; background: var(--foam); color: var(--ink); font-weight: 600; font-size: 16px;
  box-shadow: 0 8px 24px rgba(4, 30, 36, 0.25); animation: toastIn .3s var(--ease) both; display: flex; gap: 10px; align-items: center; }
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast .pill { background: var(--coral); color: #fff; padding: 2px 8px; border-radius: 8px; font-size: 14px; }
.toast.celebrate { background: var(--sun); font-family: var(--display); font-size: 24px; padding: 10px 22px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- results */
.sheet {
  position: absolute; left: 0; right: 0; margin: 0 auto; bottom: calc(var(--gutter) + var(--sab));
  width: min(460px, calc(100% - 2 * var(--gutter))); background: var(--foam); color: var(--ink); border-radius: 28px;
  padding: 22px 22px 20px; box-shadow: 0 24px 60px rgba(4, 30, 36, 0.35); animation: rise .4s var(--ease) both;
}
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.res-head .k { font-size: 14px; color: var(--ink-2); }
.res-head h3 { font-family: var(--display); font-weight: 600; font-size: 26px; margin: 2px 0 0; }
.res-main { display: flex; align-items: center; gap: 18px; margin: 16px 0 14px; }
.res-strokes { font-family: var(--display); font-weight: 700; font-size: 76px; line-height: .9; color: var(--ink); }
.res-desc { display: flex; flex-direction: column; gap: 4px; }
.res-desc .score-name { font-family: var(--display); font-weight: 600; font-size: 26px; color: var(--coral-deep); }
.res-desc .par-line { font-size: 15px; color: var(--ink-2); }
.res-medal { margin-left: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.res-medal .coin { width: 64px; height: 64px; font-size: 26px; animation: pop .5s .25s var(--ease) both; }
.res-medal .ml { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; min-height: 0; }
.badge { padding: 6px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; background: var(--foam-2); animation: pop .4s .4s var(--ease) both; }
.badge.pb { background: #fff0c2; color: #8a5a00; }
.badge.ace { background: var(--coral); color: #fff; }
.res-actions { display: flex; gap: 10px; }
.res-actions .btn { flex: 1; }

.course-table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-size: 15px; }
.course-table th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 13px; padding: 6px 4px; }
.course-table td { padding: 9px 4px; border-top: 1px solid #e1ece9; }
.course-table td.num { font-family: var(--display); font-weight: 600; font-size: 18px; text-align: right; }
.course-table th.num { text-align: right; }
.course-table .coin { width: 22px; height: 22px; display: inline-block; vertical-align: middle; }
.course-total { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 6px; }
.course-total .big { font-family: var(--display); font-weight: 700; font-size: 64px; line-height: 1; }
.course-total .rel { font-family: var(--display); font-size: 24px; color: var(--coral-deep); }

/* ---------- loading */
#loading { background: linear-gradient(180deg, #57b7ea, #bfe8f8); display: none; place-items: center; }
#loading.show { display: grid; }
#loading .ld { display: flex; flex-direction: column; align-items: center; gap: 18px; font-family: var(--display); font-size: 20px; color: #fff; }
#loading .ball { width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: inset -4px -4px 0 rgba(0,0,0,.08); animation: hop 0.9s ease-in-out infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }
.err { max-width: 420px; text-align: center; font-family: var(--ui); font-size: 16px; line-height: 1.5; padding: 0 var(--gutter); }

/* ---------- responsive */
@media (max-width: 640px) {
  .holes-grid { grid-template-columns: repeat(2, 1fr); }
  input[type=range] { width: 130px; }
}
@media (max-width: 480px) {
  .hole-tag { padding: 8px 12px 9px 11px; gap: 9px; }
  .hole-tag .n { font-size: 26px; }
  .hole-tag .name { font-size: 15px; max-width: 48vw; }
  .score > div { min-width: 50px; padding: 6px 10px 7px; }
  .score .v { font-size: 22px; }
  .icon-btn { width: 44px; height: 44px; }
  .hud-right { flex-direction: column-reverse; align-items: flex-end; }
  .res-strokes { font-size: 64px; }
  .hint { font-size: 18px; top: calc(118px + var(--sat)); }
  .panel { padding: 22px 18px 18px; border-radius: 22px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .sheet { bottom: calc(10px + var(--sab)); padding: 16px 18px; }
  .res-main { margin: 8px 0; }
  .res-strokes { font-size: 54px; }
  .toast-wrap { top: calc(70px + var(--sat)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }

#fade { position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: 0; transition: opacity .25s var(--ease);
  background: radial-gradient(120% 100% at 50% 40%, #d6eefa, #8fd0ef); }
#fade.on { opacity: 1; }

/* ---------- tap to start */
.tap-start { display: none; }
#title.splash { cursor: pointer; }
#title.splash .title-actions, #title.splash .title-best { display: none; }
#title.splash .tap-start {
  display: inline-flex; align-items: center; gap: 14px; min-height: 68px; padding: 0 34px 0 26px; border-radius: 999px;
  background: rgba(255,255,255,0.95); color: var(--ink); font-family: var(--display); font-weight: 600; font-size: 26px;
  box-shadow: 0 6px 0 rgba(10,45,52,0.25), 0 12px 30px rgba(5,40,50,.25);
  animation: rise .6s .24s var(--ease) both, tapPulse 1.8s 1s ease-in-out infinite;
}
.tap-dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px var(--ink), 0 0 0 0 rgba(255,90,72,.6); animation: tapRing 1.8s 1s ease-out infinite; }
@keyframes tapPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes tapRing { 0% { box-shadow: inset 0 0 0 3px var(--ink), 0 0 0 0 rgba(255,90,72,.7); } 80%, 100% { box-shadow: inset 0 0 0 3px var(--ink), 0 0 0 16px rgba(255,90,72,0); } }
#title.reveal .title-actions > *, #title.reveal .title-actions .row > * { animation: rise .45s var(--ease) both; }
#title.reveal .title-actions .row > *:nth-child(2) { animation-delay: .06s; }
.select { font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); background: var(--foam-2); border: 0; border-radius: 12px; padding: 9px 12px; min-height: 42px; }
.sheet.ace .res-strokes { color: var(--coral); }

/* ---------- juice */
.icon-btn.hidden { display: none; }
.hand-hint { position: absolute; left: 0; top: 0; width: 46px; height: 46px; margin: -6px 0 0 -14px; opacity: 0; transition: opacity .3s; pointer-events: none; }
.hand-hint.show { opacity: 1; }
.hand-hint svg { width: 46px; height: 46px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); animation: handPull 2.2s var(--ease) infinite; }
@keyframes handPull {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  12% { opacity: 1; transform: translate(0, 0) scale(.92); }
  55% { transform: translate(18px, 70px) scale(.92); opacity: 1; }
  66% { transform: translate(18px, 70px) scale(1.04); opacity: 1; }
  85%, 100% { transform: translate(18px, 70px) scale(1); opacity: 0; }
}
.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floater { position: absolute; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 700; font-size: 22px; color: #fffbe9;
  text-shadow: 0 2px 0 #123c46, 0 0 10px rgba(18,60,70,.5); white-space: nowrap; animation: floatUp 1.25s var(--ease) both; }
.floater.gold { color: var(--sun); font-size: 26px; }
.floater.almost { color: #fff; font-size: 26px; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.12); } 30% { transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1); } }
.letterbox .lb { position: absolute; left: 0; right: 0; height: 0; background: #0b2329; transition: height .35s var(--ease); }
.letterbox .top { top: 0; }
.letterbox .bottom { bottom: 0; display: flex; align-items: center; justify-content: flex-end; padding: 0 calc(var(--gutter) + 8px); }
.letterbox.show .lb { height: 9vh; }
.lb-label { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--sun); opacity: 0; transition: opacity .3s .2s; display: inline-flex; gap: 8px; align-items: center; }
.lb-label::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); animation: rec 1s steps(2) infinite; }
@keyframes rec { 50% { opacity: .2; } }
.letterbox.show .lb-label { opacity: 1; }
.score.cheer { animation: cheer .7s var(--ease); }
@keyframes cheer { 0% { transform: scale(1); } 25% { transform: scale(1.12) rotate(-3deg); } 50% { transform: scale(1.05) rotate(3deg); } 75% { transform: scale(1.08) rotate(-1deg); } 100% { transform: none; } }
.res-strokes.landed, .course-total .big.landed { animation: pop .35s var(--ease); }
.coin.flip { animation: coinFlip 1s .2s var(--ease) both !important; position: relative; overflow: hidden; }
.coin.flip::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.85) 50%, transparent 60%); transform: translateX(-100%); animation: shine 1.4s 1.1s ease-out both; }
@keyframes coinFlip { 0% { transform: rotateY(90deg) scale(.4); opacity: 0; } 40% { transform: rotateY(540deg) scale(1.15); opacity: 1; } 70% { transform: rotateY(720deg) scale(.95); } 100% { transform: rotateY(720deg) scale(1); opacity: 1; } }
@keyframes shine { to { transform: translateX(100%); } }
.res-main { position: relative; }
.stamp { position: absolute; right: 86px; top: -6px; transform: rotate(-12deg); padding: 4px 12px; border: 3px solid var(--coral); border-radius: 10px;
  color: var(--coral); font-family: var(--display); font-weight: 700; font-size: 20px; background: rgba(255,255,255,.7); animation: stampIn .45s .7s cubic-bezier(.3,1.6,.5,1) both; }
.course-total { position: relative; }
.course-total .stamp { position: static; margin-left: auto; align-self: center; }
@keyframes stampIn { 0% { opacity: 0; transform: rotate(-12deg) scale(2.4); } 100% { opacity: 1; transform: rotate(-12deg) scale(1); } }
.course-panel { width: min(640px, calc(100% - 2 * var(--gutter))); }
.scorecard-wrap { overflow-x: auto; margin: 4px 0 18px; border-radius: 16px; box-shadow: inset 0 0 0 2px #d5e6e2; }
.scorecard { width: 100%; border-collapse: collapse; font-size: 15px; text-align: center; min-width: 420px; }
.scorecard th, .scorecard td { padding: 8px 4px; border-left: 1px solid #e1ece9; }
.scorecard tr > :first-child { border-left: 0; text-align: left; padding-left: 12px; font-weight: 500; color: var(--ink-2); font-size: 13px; }
.scorecard .sc-head { background: var(--ink); color: #fff; }
.scorecard .sc-head th { color: #fff; font-weight: 600; font-size: 13px; }
.scorecard .sc-strokes td span { display: inline-grid; place-items: center; width: 30px; height: 30px; font-family: var(--display); font-weight: 700; font-size: 17px; }
.scorecard td.under span { border-radius: 50%; box-shadow: inset 0 0 0 2px var(--coral); color: var(--coral-deep); }
.scorecard td.ace span { border-radius: 50%; background: var(--coral); color: #fff; }
.scorecard td.over span { box-shadow: inset 0 0 0 2px #9ab3b6; border-radius: 6px; }
.scorecard tr > th:last-child { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink); background: var(--foam-2); }
.scorecard .sc-head > th:last-child { background: var(--coral); color: #fff; font-size: 13px; }
.scorecard .coin { width: 22px; height: 22px; display: inline-block; }
.btn.quiet-dark { background: var(--foam-2); box-shadow: 0 4px 0 #c4d8d3; color: var(--ink); padding: 0 16px; }
.btn.quiet-dark svg { flex: none; }
@media (max-width: 480px) { .btn.quiet-dark span { display: none; } .stamp { right: 76px; font-size: 17px; } }

body.has-post .vignette { display: none; }

/* ---------- title extras */
.title-top { position: absolute; top: calc(14px + var(--sat)); right: calc(var(--gutter) + var(--sar)); display: flex; gap: 8px; }
#title.splash .title-top { display: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px 7px 9px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); font-family: var(--display); font-weight: 600; font-size: 18px; color: #fff; }
.chip.dark { background: var(--foam-2); color: var(--ink); box-shadow: none; margin-left: auto; margin-right: 8px; align-self: center; }
.coin-ico { width: 20px; height: 20px; border-radius: 50%; display: inline-block; flex: none; background: radial-gradient(circle at 35% 30%, #fff1b0, var(--sun) 55%, #e09b12); box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); }
.star-ico { display: inline-grid; width: 20px; height: 20px; }
.star-ico svg { width: 100%; height: 100%; fill: var(--sun); stroke: #8a5a00; stroke-width: 1.2; }
.title-actions [data-a=daily] { gap: 8px; }
.title-actions .streak { font-size: 16px; flex: none; }
.title-actions .streak.done { color: #2c9a46; font-weight: 700; }

/* ---------- course picker */
.panel.wide { width: min(720px, calc(100% - 2 * var(--gutter))); }
.panel.narrow { width: min(440px, calc(100% - 2 * var(--gutter))); }
.course-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.course-card { border-radius: 20px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1.5px #d5e6e2; display: flex; flex-direction: column; }
.course-card .cc-art { height: 150px; background: #5fb6ec url(../img/course-ruins.jpg) center / cover no-repeat; position: relative; }
.course-card.pier .cc-art { background-color: #0c143c; background-image: url(../img/course-pier.jpg); }
.course-card .cc-art::after { content: ''; position: absolute; inset: auto 0 0 0; height: 36%; background: linear-gradient(transparent, rgba(255,255,255,.18)); pointer-events: none; }
.course-card.locked .cc-art { filter: grayscale(.55) brightness(.8); }
.course-card .cc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-card h3 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 0; }
.course-card .sub { margin: 0; font-size: 14px; }
.course-card .cc-meta { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; margin-top: auto; }
.course-card .btn { width: 100%; }
.course-card.locked { background: var(--foam-2); }
.course-card.locked .cc-art { filter: grayscale(.7) brightness(.8); }
.cc-lock { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 500; }

/* ---------- tabs */
.tabs { display: flex; gap: 6px; background: var(--foam-2); padding: 4px; border-radius: 14px; margin: 0 0 14px; overflow-x: auto; }
.tab { flex: 1; min-height: 40px; padding: 0 12px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.tab.locked { opacity: .55; cursor: not-allowed; }
.tab svg { width: 15px; height: 15px; }

/* ---------- stars */
.stars { display: inline-flex; gap: 2px; }
.stars .st { width: 22px; height: 22px; display: inline-grid; }
.stars.small .st { width: 16px; height: 16px; }
.stars .st svg { width: 100%; height: 100%; fill: #dbe7e4; stroke: #b9cecb; stroke-width: 1.2; }
.stars .st.on svg { fill: var(--sun); stroke: #b77f00; }
.hole-card .stars { margin-top: 2px; }
.res-stars { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 14px; padding: 10px 6px; border-radius: 16px; background: var(--foam-2); }
.res-stars .rs { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.res-stars .st { width: 38px; height: 38px; display: grid; }
.res-stars .st svg { width: 100%; height: 100%; fill: #d3e1de; stroke: #b4c9c6; stroke-width: 1.2; }
.res-stars .rs.on .st svg { fill: var(--sun); stroke: #b77f00; }
.res-stars .rs.on .st { animation: starPop .5s var(--d) cubic-bezier(.3,1.6,.5,1) both; }
.res-stars .rs.new .st { filter: drop-shadow(0 0 8px rgba(255,196,46,.9)); }
.res-stars .sl { font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: center; }
.res-stars .rs.new .sl { color: #8a5a00; }
@keyframes starPop { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.badge.coins { display: inline-flex; align-items: center; gap: 6px; background: #fff0c2; color: #8a5a00; }
.badge .coin-ico { width: 16px; height: 16px; }
.unlock-note { margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: linear-gradient(90deg, #22306e, #6d4b8f); color: #fff; font-weight: 600; animation: pop .5s .9s var(--ease) both; }
.floater .coin-ico { width: 20px; height: 20px; vertical-align: -3px; }
.score.coin-bump { animation: cheer .5s var(--ease); }

/* ---------- locker */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1.5px #d5e6e2; transition: transform .12s var(--ease); }
.item:active { transform: scale(.96); }
.item.on { box-shadow: inset 0 0 0 3px var(--shallow); }
.item.locked { opacity: .65; }
.item .nm { font-weight: 600; font-size: 14px; text-align: center; }
.item .tag { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 8px; background: var(--foam-2); display: inline-flex; align-items: center; gap: 5px; }
.item .tag.eq { background: var(--shallow); color: var(--ink); }
.item .tag.price { background: #fff0c2; color: #8a5a00; }
.item .tag.price.short { background: #f1e7e6; color: #a46d66; }
.item .tag .coin-ico, .item .tag .star-ico { width: 15px; height: 15px; }
.pv { width: 54px; height: 54px; display: grid; place-items: center; }
.pv.ball { border-radius: 50%; box-shadow: inset -6px -8px 0 rgba(0,0,0,.12), inset 4px 4px 0 rgba(255,255,255,.35), 0 3px 6px rgba(0,0,0,.15); }
.pv.trail { width: 80px; height: 18px; border-radius: 9px; background: linear-gradient(90deg, transparent, #ff6a52); }
.pv.trail.t-none { background: repeating-linear-gradient(90deg, #d5e6e2 0 6px, transparent 6px 12px); }
.pv.trail.t-rainbow { background: linear-gradient(90deg, transparent, #ff5a48, #ffd23f, #5fd3a8, #2e8fe6, #9b7bff); }
.pv.trail.t-fire { background: linear-gradient(90deg, transparent, #ff5214, #ffd23f, #fffbe0); }
.pv.trail.t-bubbles { background: radial-gradient(circle at 20% 50%, #bff6ff 0 4px, transparent 5px), radial-gradient(circle at 50% 40%, #7fe6ff 0 6px, transparent 7px), radial-gradient(circle at 80% 55%, #bff6ff 0 5px, transparent 6px); }
.pv.trail.t-sparkle { background: radial-gradient(circle at 20% 50%, #ffd23f 0 2px, transparent 3px), radial-gradient(circle at 45% 30%, #fff 0 3px, transparent 4px), radial-gradient(circle at 70% 60%, #ffd23f 0 2px, transparent 3px), radial-gradient(circle at 90% 40%, #fff 0 2px, transparent 3px); }
.pv.flag { width: 66px; height: 44px; border-radius: 4px 10px 10px 4px; background-size: cover; box-shadow: 0 2px 5px rgba(0,0,0,.2); }
.pv.cele { font-size: 38px; }

/* ---------- daily */
.daily-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1.5px #d5e6e2; margin-bottom: 16px; }
.dc-mod { display: flex; gap: 12px; align-items: center; }
.dc-ico { font-size: 38px; }
.dc-mod b { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; }
.dc-mod span { color: var(--ink-2); font-size: 14px; }
.dc-hole { font-size: 15px; }
.dc-goal { font-weight: 600; color: var(--coral-deep); }
.dc-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.done-msg { text-align: center; width: 100%; margin: 0 !important; }

/* ---------- HUD extras */
.hud-left { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.player-tag, .mod-tag { display: none; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); font-weight: 600; font-size: 15px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.player-tag.show, .mod-tag.show { display: inline-flex; }
.player-tag .dot, .turn-banner .dot, .mp-row .dot, .mp-table .dot, .podium-row .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.8); }
.mod-tag .wind-arrow { display: none; width: 22px; height: 22px; color: var(--sun); }
.mod-tag.wind .wind-arrow { display: inline-grid; }
.mod-tag .wind-arrow svg { width: 22px; height: 22px; }
.turn-banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); font-size: 40px; display: flex; align-items: center; gap: 14px; opacity: 0; white-space: nowrap; }
.turn-banner .dot { width: 26px; height: 26px; box-shadow: 0 0 0 4px #123c46, inset 0 0 0 3px rgba(255,255,255,.8); }
.turn-banner.show { animation: turnIn 1.6s var(--ease) both; }
@keyframes turnIn { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }
.name-tags { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.name-tag { position: absolute; left: 0; top: 0; font-size: 15px; -webkit-text-stroke-width: 4px; padding-bottom: 4px; border-bottom: 3px solid var(--c, #fff); white-space: nowrap; opacity: .9; }
.name-tag.active { font-size: 18px; opacity: 1; }
.ach-ico { font-size: 22px; }

/* ---------- multiplayer */
.kb-lift { margin-bottom: calc(var(--gutter) + var(--kb, 0px)); transition: margin-bottom .2s; }
.mp-block { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 2px; }
.mp-block .lbl { font-weight: 600; }
.mp-players { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 8px; }
.mp-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px #d5e6e2; min-height: 54px; }
.mp-row .mp-name { flex: 1; font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: #1a7f90; font-weight: 600; padding: 8px 4px; }
.name-input { flex: 1; min-width: 0; font: inherit; font-size: 17px; font-weight: 600; color: var(--ink); background: var(--foam-2); border: 0; border-radius: 10px; padding: 8px 12px; min-height: 40px; outline: 2px solid var(--shallow); user-select: text; -webkit-user-select: text; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.mp-note { margin: 8px 0 16px !important; font-size: 14px !important; }
.mp-table { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 16px; }
.mp-table th { font-size: 13px; color: var(--ink-2); font-weight: 500; text-align: right; padding: 4px 6px; }
.mp-table td { padding: 9px 6px; border-top: 1px solid #e1ece9; }
.mp-table td:first-child { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mp-table td.num { text-align: right; font-family: var(--display); font-weight: 700; font-size: 20px; }
.mp-table td.lead { color: var(--coral-deep); }
.podium { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 18px; }
.podium-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px #d5e6e2; animation: rise .4s var(--ease) both; }
.podium-row.first { background: #fff4cf; box-shadow: inset 0 0 0 2px var(--sun); }
.podium-row .place { font-family: var(--display); font-weight: 700; font-size: 22px; width: 24px; color: var(--ink-2); }
.podium-row .pn { flex: 1; font-weight: 600; font-size: 17px; }
.podium-row .num { font-family: var(--display); font-weight: 700; font-size: 24px; }
.btn.danger-btn { background: #fde4e0; color: var(--coral-deep); box-shadow: 0 4px 0 #f3c3bb; }

/* ---------- records */
.sec { font-family: var(--display); font-weight: 600; font-size: 20px; margin: 14px 0 8px; display: flex; align-items: baseline; gap: 8px; }
.sec .sub { margin: 0; font-size: 14px; }
.stats-wrap { overflow-x: auto; border-radius: 14px; box-shadow: inset 0 0 0 1.5px #d5e6e2; }
.stats { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 440px; }
.stats th { font-size: 12px; color: var(--ink-2); font-weight: 500; padding: 8px 6px; text-align: right; }
.stats td { padding: 8px 6px; border-top: 1px solid #e1ece9; }
.stats td.num { text-align: right; font-family: var(--display); font-weight: 600; font-size: 16px; }
.stats td.nm { font-weight: 600; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 14px; }
.ach { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--foam-2); opacity: .7; }
.ach.got { background: #fff4cf; opacity: 1; }
.ach .ai { font-size: 26px; }
.ach .an { display: flex; flex-direction: column; font-size: 13px; color: var(--ink-2); }
.ach .an b { color: var(--ink); font-size: 15px; }

/* ---------- first-time lesson (only "skip" takes taps) */
#ui .lesson, #ui .lesson * { pointer-events: none; }
#ui .lesson .lesson-skip { pointer-events: auto; }
.lesson { position: fixed; inset: 0; z-index: 2; }
.lesson-text { position: absolute; left: 50%; top: calc(90px + var(--sat)); transform: translateX(-50%); width: min(560px, calc(100% - 2 * var(--gutter))); text-align: center; }
.lt-title { font-size: 30px; line-height: 1.15; }
.lt-sub { margin-top: 8px; font-size: 18px; -webkit-text-stroke-width: 4px; }
.lesson-area { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(18px + var(--sab)); height: 22%; border: 3px dashed rgba(255,255,255,.75); border-radius: 26px; display: grid; place-items: end center; padding-bottom: 14px; }
.lesson-area span { font-size: 18px; -webkit-text-stroke-width: 4px; }
.lesson-finger { position: absolute; left: 50%; bottom: calc(18px + var(--sab) + 11%); width: 54px; height: 54px; margin: 0 0 -27px -20px; }
.lesson-finger svg { width: 54px; height: 54px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); animation: lessonPull 2.8s var(--ease) infinite; }
@keyframes lessonPull {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  10% { opacity: 1; transform: translate(0, 0) scale(.9); }
  55% { transform: translate(var(--dx, 0px), var(--dy, 90px)) scale(.9); opacity: 1; }
  65% { transform: translate(var(--dx, 0px), var(--dy, 90px)) scale(1.05); opacity: 1; }
  85%, 100% { transform: translate(var(--dx, 0px), var(--dy, 90px)) scale(1); opacity: 0; }
}
.lesson-finger { --dx: 0px; --dy: 90px; }
.lesson-finger svg { --dx: inherit; --dy: inherit; }
.lesson-skip { position: absolute; right: calc(var(--gutter) + var(--sar)); bottom: calc(22% + 34px + var(--sab)); min-height: 44px; padding: 0 18px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--ink); font-weight: 600; font-size: 15px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.lesson-done { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: 54px; opacity: 0; }
.lesson.done > :not(.lesson-done) { opacity: 0; transition: opacity .2s; }
.lesson.done .lesson-done { animation: pop .5s var(--ease) both; opacity: 1; }

/* ---------- accessibility */
body.colorblind .coin { position: relative; }
body.colorblind .coin[data-g]:not([data-g=""])::before { content: attr(data-g); position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 60%; color: rgba(40,25,0,.75); }
body.colorblind .coin.flip::before { z-index: 1; }
body.large-text .panel, body.large-text .sheet, body.large-text .hud-top, body.large-text .title-wrap, body.large-text .toast-wrap, body.large-text .title-top { zoom: 1.15; }
body.large-text .hint, body.large-text .lesson-text { font-size: 115%; }

@media (max-width: 480px) {
  .lesson-text { top: calc(128px + var(--sat)); }
}
@media (max-width: 640px) {
  .course-cards { grid-template-columns: 1fr; }
  .course-card .cc-art { height: 132px; }
  .turn-banner { font-size: 32px; }
  .lt-title { font-size: 25px; }
  .lt-sub { font-size: 16px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .lesson-text { top: calc(70px + var(--sat)); }
  .lt-title { font-size: 22px; }
  .lesson-area { height: 26%; }
}

/* title on short landscape screens (phones turned sideways) */
@media (max-height: 520px) and (orientation: landscape) {
  .title-wrap { padding-top: calc(10px + var(--sat)); padding-bottom: calc(10px + var(--sab)); }
  .wordmark { height: 19vh; width: auto; }
  .tagline { display: none; }
  .title-foot { width: min(640px, 100%); gap: 8px; }
  .title-actions { gap: 8px; }
  .btn.big { min-height: 54px; font-size: 22px; }
  .btn.mid { min-height: 48px; font-size: 16px; }
  .tile { min-height: 50px; flex-direction: row; gap: 8px; }
  .tile svg { width: 22px; height: 22px; }
  .title-best { display: none; }
}
@media (max-width: 440px) {
  .btn.mid { font-size: 16px; padding: 0 10px; gap: 7px; min-height: 62px; }
  .btn.mid svg { width: 21px; height: 21px; }
  .btn.mid .lbl { white-space: normal; line-height: 1.1; text-align: left; }
  .tile { font-size: 12px; }
  .tile span { padding: 0 2px; }
}

/* ---------------------------------------------------------------- online */
.choice-list { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.choice { display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1.5px #d5e6e2, 0 3px 0 #d5e6e2; color: var(--ink); min-height: 76px; }
.choice:active { transform: translateY(2px); box-shadow: inset 0 0 0 1.5px #d5e6e2; }
.choice .ci { width: 48px; height: 48px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--foam-2); color: var(--ink); }
.choice .ci svg { width: 28px; height: 28px; }
.choice[data-a=online] .ci { background: var(--coral); color: #fff; }
.choice .ct { display: flex; flex-direction: column; gap: 3px; }
.choice .ct b { font-family: var(--display); font-size: 19px; font-weight: 600; }
.choice .ct span { font-size: 14px; color: var(--ink-2); line-height: 1.3; }
.ol-panel h2 { margin-bottom: 4px; }
.ol-name { margin: 10px 0 4px; font-size: 16px; color: var(--ink-2); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.ol-name b { color: var(--ink); }
.ol-name.editing { gap: 10px; flex-wrap: nowrap; }
.ol-name.editing .name-input { flex: 1; min-width: 0; }
.res-actions.col { flex-direction: column; align-items: stretch; gap: 10px; }
.res-actions.col .btn { width: 100%; }
.btn.big-ish { min-height: 58px; font-size: 20px; }
.ol-code-row { display: flex; gap: 10px; margin: 14px 0 6px; }
.ol-code-row .code-input { flex: 1; min-width: 0; font-family: var(--display); font-size: 26px; letter-spacing: 6px; text-transform: uppercase; text-align: center; }
.ol-err { color: var(--coral-deep); font-weight: 600; margin: 6px 0 0; }
.ol-spin { display: grid; place-items: center; padding: 22px 0 10px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid #d5e6e2; border-top-color: var(--coral); display: inline-block; animation: olspin .8s linear infinite; }
.spinner.small { width: 16px; height: 16px; border-width: 2.5px; vertical-align: -3px; margin-right: 8px; }
@keyframes olspin { to { transform: rotate(360deg); } }
.ol-code { display: flex; justify-content: center; gap: 7px; margin: 12px 0 8px; user-select: text; -webkit-user-select: text; }
.ol-code span { width: 46px; height: 58px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: #fffbe9; font-family: var(--display); font-weight: 700; font-size: 32px; box-shadow: inset 0 -26px 0 rgba(255,255,255,.06), 0 3px 0 #0b2830; animation: rise .35s var(--ease) both; }
.ol-code span:nth-child(2) { animation-delay: .05s; } .ol-code span:nth-child(3) { animation-delay: .1s; } .ol-code span:nth-child(4) { animation-delay: .15s; } .ol-code span:nth-child(5) { animation-delay: .2s; }
.invite-btn { gap: 8px; background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 #d9a21b; }
.ol-players { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 6px; }
.ol-slot.empty { background: transparent; box-shadow: inset 0 0 0 1.5px dashed #c8dcd7; border: 1.5px dashed #c8dcd7; box-shadow: none; color: #8aa8a6; }
.ol-slot.empty .dot { background: #e1ece9; }
.ol-slot.me { box-shadow: inset 0 0 0 2px var(--ink); }
.ol-slot.off { opacity: .55; }
.ol-you { font-weight: 500; color: var(--ink-2); font-size: 14px; }
.ol-left { font-weight: 500; color: #8aa8a6; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.ol-host { font-size: 18px; }
.ol-ball { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.5px rgba(18,60,70,.25), 0 1px 2px rgba(0,0,0,.15); }
.ol-cfg { text-align: center; margin: 10px 0; }
.ol-wait { text-align: center; color: var(--ink-2); font-weight: 500; margin: 8px 0; min-height: 22px; }
.mp-table tr.left td, .podium-row.left { opacity: .5; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.net-banner { position: fixed; top: calc(var(--sat) + 10px); left: 50%; transform: translate(-50%, -140%); z-index: 60; padding: 8px 16px; border-radius: 999px; background: var(--glass); color: #fff; font-weight: 600; font-size: 15px; transition: transform .25s var(--ease); pointer-events: none; }
.net-banner.show { transform: translate(-50%, 0); }
.net-banner .spinner { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
.player-tag .note { font-weight: 500; opacity: .75; font-size: 13px; }
.player-tag .note:empty { display: none; }
.player-tag .clock { display: none; font-family: var(--display); font-weight: 700; padding: 1px 8px; border-radius: 8px; background: rgba(255,255,255,.18); }
.player-tag .clock.show { display: inline-block; }
.player-tag .clock.urgent { background: var(--coral); animation: olpulse .8s ease-in-out infinite; }
@keyframes olpulse { 50% { transform: scale(1.12); } }
@media (max-width: 380px) { .ol-code span { width: 40px; height: 52px; font-size: 28px; } }

/* ---------------------------------------------------------------- locker juice */
.item.pop { animation: itempop .45s var(--ease); }
@keyframes itempop { 0% { transform: scale(1); } 35% { transform: scale(1.08) rotate(-1.5deg); } 70% { transform: scale(.98); } 100% { transform: scale(1); } }
.nope { animation: nope .42s ease; }
@keyframes nope { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px) rotate(-2deg); } 40% { transform: translateX(6px) rotate(2deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.coins-chip.bump { animation: chipbump .5s var(--ease); }
@keyframes chipbump { 30% { transform: scale(1.25); } 100% { transform: scale(1); } }
.short-card { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: var(--gutter); background: rgba(10, 40, 48, .38); animation: shortfade .2s ease both; }
.short-card.out { animation: shortfade .2s ease reverse both; }
@keyframes shortfade { from { opacity: 0; } to { opacity: 1; } }
.short-box { width: min(360px, 100%); background: var(--foam); color: var(--ink); border-radius: 24px; padding: 20px 20px 16px; box-shadow: 0 18px 50px rgba(0,0,0,.3), inset 0 0 0 2px #fff; animation: shortpop .42s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes shortpop { from { transform: scale(.7) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.short-top { display: flex; align-items: center; gap: 14px; }
.short-top h3 { font-family: var(--display); font-size: 22px; margin: 0; }
.short-top .sub { margin: 2px 0 0; }
.short-pv { position: relative; width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1.5px #d5e6e2; }
.short-pv .pv { transform: scale(.9); }
.short-lock { position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.2); animation: lockwiggle 1.2s ease-in-out .3s 2; }
.short-lock svg { width: 16px; height: 16px; }
@keyframes lockwiggle { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg); } 30% { transform: rotate(12deg); } 45% { transform: rotate(-6deg); } 60% { transform: rotate(0); } }
.short-need { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; font-family: var(--display); font-size: 20px; font-weight: 600; }
.short-need b { color: var(--coral-deep); font-size: 26px; }
.short-need .coin-ico, .short-need .star-ico { width: 24px; height: 24px; animation: coinspin 1.1s ease-in-out infinite; }
@keyframes coinspin { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.25); } }
.short-bar { position: relative; height: 22px; border-radius: 11px; background: #e3eeeb; overflow: hidden; box-shadow: inset 0 2px 3px rgba(0,0,0,.08); }
.short-bar span { position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 11px; background: linear-gradient(90deg, #ffd23f, #ffb020); animation: barfill .8s var(--ease) .15s both; }
@keyframes barfill { from { width: 0; } }
.short-bar em { position: relative; display: block; text-align: center; font-style: normal; font-weight: 700; font-size: 13px; line-height: 22px; color: var(--ink); }
.short-tips { margin: 14px 0 6px; padding: 0 0 0 18px; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.short-tips li { margin: 3px 0; }
.lesson .lesson-text, .lesson .lesson-area { transition: opacity .2s ease; }
.lesson.aiming .lesson-text, .lesson.aiming .lesson-area, .lesson.aiming .lesson-finger { opacity: 0; }
.lesson ~ .toast-wrap, body .hud .toast-wrap { transition: top .2s var(--ease); }

/* ---------------------------------------------------------------- global ranking */
.tabs.two { margin-bottom: 14px; }
.view-ranking .seg { display: flex; width: 100%; margin: 0 0 8px; }
.view-ranking .seg button { flex: 1; }
.rk-list { min-height: 140px; margin: 8px 0 4px; }
.rk-rows { display: flex; flex-direction: column; gap: 6px; }
.rk-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px #d5e6e2; animation: rise .35s var(--ease) both; }
.rk-row.me { background: #fff4cf; box-shadow: inset 0 0 0 2px var(--sun); }
.rk-row.out { margin-top: 8px; }
.rk-pos { width: 30px; text-align: center; font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--ink-2); flex: none; }
.rk-pos.top1, .rk-pos.top2, .rk-pos.top3 { font-size: 22px; }
.rk-nm { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-sc { font-family: var(--display); font-weight: 700; font-size: 20px; white-space: nowrap; }
.rk-sc small { font-family: var(--ui); font-weight: 500; font-size: 12px; color: var(--ink-2); }
.rk-next, .rk-closes { text-align: center; margin: 8px 0 0; }
.rk-empty { padding: 24px 0; }
.rk-how { text-align: center; font-size: 13px; }
.rank-line { margin: 12px auto 4px; padding: 10px 16px; border-radius: 14px; background: var(--foam-2); font-weight: 600; text-align: center; width: fit-content; max-width: 100%; }
.rank-line.done { background: #fff4cf; box-shadow: inset 0 0 0 2px var(--sun); animation: itempop .5s var(--ease); }
.rank-line.muted { color: var(--ink-2); font-weight: 500; }
.rank-line .rk-new { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 14px; animation: chipbump .6s var(--ease) .2s both; }
