/* Puttopia: bright, chunky, rounded. */

:root {
  --ink: #2b2350;
  --ink-soft: #5d5486;
  --paper: #ffffff;
  --sun: #ffd23f;
  --sun-lip: #eaa800;
  --coral: #ff5d73;
  --coral-lip: #d63a52;
  --mint: #3ddc97;
  --mint-lip: #1fae6f;
  --sky: #3fa9ff;
  --sky-lip: #1d7fd6;
  --grape: #7b6bff;
  --grape-lip: #5546d6;
  --lilac: #ece8ff;
  --shadow: 0 12px 30px rgba(43, 35, 80, 0.22);
  --shadow-sm: 0 5px 14px rgba(43, 35, 80, 0.18);
  --font: 'Fredoka', 'Baloo 2', ui-rounded, 'Arial Rounded MT Bold', system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: linear-gradient(#3aa6ff, #bfe9ff);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:focus-visible, a:focus-visible { outline: 4px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 7px var(--grape); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- loading -------------------------------------------------------- */
.loading {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-content: center; justify-items: center; gap: 14px;
  background: radial-gradient(circle at 50% 35%, #8fd3ff, #3aa6ff 70%);
  color: #fff; font-weight: 600; font-size: 18px;
  transition: opacity .5s ease, visibility .5s;
}
.loading.gone { opacity: 0; visibility: hidden; }
.loading p { margin: 0; text-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.loading-ball {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 30%, #e9ecf5 70%, #c9cee0);
  box-shadow: 0 16px 0 -6px rgba(0, 0, 0, .12);
  animation: bounce .7s cubic-bezier(.3, 0, .7, 1) infinite alternate;
}
@keyframes bounce { from { transform: translateY(-26px) scale(.96, 1.04); } to { transform: translateY(0) scale(1.08, .92); } }

/* ---------- buttons -------------------------------------------------------- */
.btn {
  --c: var(--sun); --lip: var(--sun-lip); --t: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 26px;
  border-radius: 999px;
  background: var(--c);
  color: var(--t);
  font-size: 20px; font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 6px 0 var(--lip), 0 12px 22px rgba(43, 35, 80, .22);
  transform: translateY(0);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.btn::after {
  content: ""; position: absolute; left: 14%; right: 14%; top: 6px; height: 34%;
  border-radius: 999px; background: rgba(255, 255, 255, .35); pointer-events: none;
}
.btn:active, .btn.pressed { transform: translateY(5px); box-shadow: 0 1px 0 var(--lip), 0 4px 10px rgba(43, 35, 80, .2); }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.big { min-height: 66px; font-size: 26px; padding: 0 40px; }
.btn.mint { --c: var(--mint); --lip: var(--mint-lip); --t: #fff; }
.btn.coral { --c: var(--coral); --lip: var(--coral-lip); --t: #fff; }
.btn.sky { --c: var(--sky); --lip: var(--sky-lip); --t: #fff; }
.btn.grape { --c: var(--grape); --lip: var(--grape-lip); --t: #fff; }
.btn.white { --c: #fff; --lip: #d9d4f2; --t: var(--ink); }
.btn.round { width: 56px; padding: 0; }
.btn:disabled { filter: grayscale(.8) brightness(1.05); opacity: .6; }

.icon-btn {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(43, 35, 80, .16), 0 8px 18px rgba(43, 35, 80, .14);
  transition: transform .08s ease;
}
.icon-btn:active { transform: translateY(3px) scale(.96); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.on { background: var(--sun); }

/* ---------- screens --------------------------------------------------------- */
.ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: calc(14px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));
  pointer-events: none;
  animation: screen-in .35s cubic-bezier(.2, .9, .3, 1.2) both;
}
.screen > * { pointer-events: auto; }
.screen.out { animation: screen-out .25s ease both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes screen-out { to { opacity: 0; transform: translateY(-10px) scale(.98); } }

/* Title */
.title-screen { align-items: center; text-align: center; }
.title-screen .logo-wrap { flex: 1; }
.title-top { display: flex; width: 100%; justify-content: space-between; align-items: center; }
.hub-link {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 10px;
  border-radius: 999px; background: rgba(255, 255, 255, .85); color: var(--ink);
  font-weight: 600; font-size: 14px; text-decoration: none; box-shadow: var(--shadow-sm);
}
.hub-link svg { width: 16px; height: 16px; }
.logo-wrap { margin-top: 2.5vh; pointer-events: none; }
.logo {
  margin: 0; font-size: clamp(52px, 17vw, 112px); line-height: .95; font-weight: 700; letter-spacing: -.01em;
  display: flex; justify-content: center; flex-wrap: nowrap;
}
.logo span {
  display: inline-block;
  color: var(--c);
  -webkit-text-stroke: .11em #fff;
  paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--lip), 0 .13em .12em rgba(43, 35, 80, .3);
  animation: letter 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * .12s);
}
@keyframes letter { 0%, 100% { transform: translateY(0) rotate(var(--r)); } 50% { transform: translateY(-.08em) rotate(calc(var(--r) * -1)); } }
.tagline {
  display: inline-block; margin: 14px 0 0; padding: 7px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .88); color: var(--ink); font-weight: 500; font-size: clamp(15px, 4.2vw, 19px);
  box-shadow: var(--shadow-sm);
}
.title-actions { display: grid; gap: 18px; justify-items: center; margin-bottom: 2vh; }
.title-row { display: flex; gap: 14px; }
.chip-btn {
  display: grid; justify-items: center; gap: 5px; min-width: 76px;
  font-size: 14px; font-weight: 600; color: var(--ink);
  text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 0 10px rgba(255, 255, 255, .9);
}
.chip-btn .icon-btn { width: 58px; height: 58px; }
.chip-btn .icon-btn svg { width: 28px; height: 28px; }
.title-progress {
  display: inline-flex; gap: 14px; justify-content: center; padding: 6px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .85); font-weight: 600; font-size: 15px; color: var(--ink); box-shadow: var(--shadow-sm);
}
.title-progress b { font-weight: 700; }

/* Worlds */
.worlds-screen { padding-left: 0; padding-right: 0; }
.bar {
  display: flex; align-items: center; gap: 12px; padding: 0 calc(16px + var(--safe-r)) 0 calc(16px + var(--safe-l));
  min-height: 52px;
}
.bar h2 {
  margin: 0; flex: 1; font-size: 28px; font-weight: 700; color: var(--ink);
  -webkit-text-stroke: 6px #fff; paint-order: stroke fill; text-shadow: 0 3px 6px rgba(43, 35, 80, .18);
}
.tally {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); font-weight: 600; font-size: 15px; box-shadow: var(--shadow-sm);
}
.tally svg { width: 18px; height: 18px; }
.carousel {
  flex: 1; display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; padding: 14px calc(9vw + var(--safe-l)) 10px;
  scrollbar-width: none; touch-action: pan-x;
  align-items: center;
}
.carousel::-webkit-scrollbar { display: none; }
.world-card {
  flex: none; width: min(82vw, 380px); max-height: 100%;
  scroll-snap-align: center;
  display: flex; flex-direction: column;
  border-radius: 30px; background: #fff; overflow: hidden;
  box-shadow: 0 8px 0 rgba(43, 35, 80, .12), var(--shadow);
  transition: transform .25s ease;
}
.world-thumb {
  position: relative; aspect-ratio: 4 / 3; max-height: 28vh; width: 100%;
  background: linear-gradient(var(--top), var(--horizon));
  overflow: hidden;
}
.world-thumb canvas, .world-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fade-in .5s ease both; }
@keyframes fade-in { from { opacity: 0; } }
.world-thumb .num {
  position: absolute; left: 14px; top: 14px; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.world-body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.world-body h3 { margin: 0; font-size: 26px; line-height: 1.05; font-weight: 700; color: var(--accent); }
.world-body p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.3; }
.holes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 2px; }
.hole-btn {
  position: relative; aspect-ratio: 1 / .86; border-radius: 14px;
  display: grid; place-items: center; align-content: center; gap: 1px;
  background: var(--soft); color: var(--accent);
  font-weight: 700; font-size: 17px;
  box-shadow: 0 4px 0 var(--soft-lip);
  transition: transform .08s;
}
.hole-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--soft-lip); }
.hole-btn.done { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-lip); }
.hole-btn .stars { display: flex; gap: 0; height: 10px; }
.hole-btn .stars svg { width: 10px; height: 10px; }
.hole-btn.next { animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.world-foot { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.world-foot span { display: inline-flex; align-items: center; gap: 4px; }
.world-foot svg { width: 16px; height: 16px; }
.locked .world-thumb { filter: saturate(.25) brightness(1.05); }
.lock-note {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px;
  background: var(--lilac); color: var(--ink-soft); font-weight: 600; font-size: 15px;
}
.lock-note svg { width: 22px; height: 22px; flex: none; }
.dots { display: flex; justify-content: center; gap: 8px; padding-bottom: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: transform .2s, background .2s; }
.dots i.on { background: #fff; transform: scale(1.35); }

/* Balls */
.balls-screen .grid {
  flex: 1; overflow-y: auto; margin-top: 10px; padding: 6px 2px 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; align-content: start;
  touch-action: pan-y;
}
.ball-card {
  display: grid; justify-items: center; gap: 6px; padding: 14px 6px 12px;
  border-radius: 22px; background: rgba(255, 255, 255, .94); box-shadow: 0 5px 0 rgba(43, 35, 80, .1), var(--shadow-sm);
  font-weight: 600; font-size: 14px; position: relative;
}
.ball-card canvas { width: 64px; height: 64px; filter: drop-shadow(0 6px 4px rgba(43, 35, 80, .25)); }
.ball-card.sel { outline: 4px solid var(--sun); background: #fffbe6; }
.ball-card.locked { background: rgba(255, 255, 255, .8); }
.ball-card.locked canvas { filter: saturate(.55) brightness(1.05) opacity(.6) drop-shadow(0 6px 4px rgba(43, 35, 80, .15)); }
.ball-card small { color: var(--ink-soft); font-weight: 500; display: inline-flex; align-items: center; gap: 3px; }
.ball-card small svg { width: 14px; height: 14px; }

/* ---------- HUD ------------------------------------------------------------- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
.hud > * { pointer-events: auto; }
.hud-top {
  position: absolute; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); top: calc(10px + var(--safe-t));
  display: flex; align-items: flex-start; gap: 10px; pointer-events: none;
}
.hud-top > * { pointer-events: auto; }
.hole-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); box-shadow: var(--shadow-sm); min-width: 0;
}
.hole-chip .n {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 21px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.hole-chip .t { min-width: 0; display: grid; }
.hole-chip b { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hole-chip small { font-size: 13px; color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
.hole-chip small em { font-style: normal; font-weight: 700; color: var(--ink); }
.hud-spacer { flex: 1; }
.gem-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; margin-top: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); font-weight: 600; font-size: 15px; box-shadow: var(--shadow-sm);
}
.gem-chip svg { width: 18px; height: 18px; }
.gem-chip.pop { animation: pop .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { 40% { transform: scale(1.35); } }
.stroke-pop { animation: pop .35s cubic-bezier(.3, 1.8, .5, 1); display: inline-block; }
.hud-bottom {
  position: absolute; right: calc(14px + var(--safe-r)); bottom: calc(16px + var(--safe-b));
  display: grid; gap: 12px;
}
.hud-bottom-left {
  position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(16px + var(--safe-b));
  display: grid; gap: 12px;
}
.hud .icon-btn.gone { opacity: 0; transform: scale(.6); pointer-events: none; }
.hud .icon-btn.recenter { transition: opacity .2s, transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.hint {
  position: absolute; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translateX(-50%);
  padding: 10px 18px; border-radius: 22px; background: rgba(43, 35, 80, .72); color: #fff;
  font-weight: 500; font-size: 16px; line-height: 1.3; text-align: center; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
  transition: opacity .3s;
}
.hint.gone { opacity: 0; }
.tutorial-hand {
  position: absolute; width: 64px; height: 64px; pointer-events: none; z-index: 9;
  animation: drag-demo 2.2s ease-in-out infinite;
}
@keyframes drag-demo {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  12% { opacity: 1; transform: translate(0, 0) scale(.9); }
  55% { transform: translate(0, 90px) scale(.9); opacity: 1; }
  70% { transform: translate(0, 90px) scale(1); opacity: 1; }
  100% { transform: translate(0, 90px) scale(1); opacity: 0; }
}

/* Drag guide */
.drag { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 7; opacity: 0; transition: opacity .15s; }
.drag.on { opacity: 1; }
.drag line { stroke: rgba(255, 255, 255, .85); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 12; }
.drag #drag-start { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 3; }
.drag #drag-end { fill: #fff; stroke: rgba(43, 35, 80, .25); stroke-width: 2; }

/* ---------- banner ------------------------------------------------------------ */
.banner {
  position: fixed; left: 0; right: 0; top: 30%; z-index: 12; pointer-events: none;
  display: grid; place-items: center; text-align: center;
}
.banner .word {
  display: inline-block; padding: 0 20px;
  font-size: clamp(44px, 14vw, 92px); font-weight: 700; line-height: 1;
  color: var(--c, #fff);
  -webkit-text-stroke: .12em #fff; paint-order: stroke fill;
  text-shadow: 0 .08em 0 var(--lip, rgba(0, 0, 0, .15)), 0 .14em .2em rgba(43, 35, 80, .35);
  animation: banner-in .55s cubic-bezier(.2, 1.6, .4, 1) both, banner-out .4s ease 1.5s forwards;
}
.banner .word.small { font-size: clamp(30px, 9vw, 54px); animation: banner-in .45s cubic-bezier(.2, 1.6, .4, 1) both, banner-out .35s ease 1.1s forwards; }
.banner .word.ace {
  background: linear-gradient(90deg, #ff5d73, #ff9f43, #ffd23f, #5fd36b, #3fa9ff, #a77bff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 0; filter: drop-shadow(0 4px 0 #fff) drop-shadow(0 -4px 0 #fff) drop-shadow(4px 0 0 #fff) drop-shadow(-4px 0 0 #fff) drop-shadow(0 10px 10px rgba(43, 35, 80, .35));
  text-shadow: none;
}
.banner .sub { margin-top: 10px; font-size: 20px; font-weight: 600; color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .3); animation: banner-in .5s .1s both, banner-out .4s ease 1.5s forwards; }
@keyframes banner-in { from { transform: scale(.3) rotate(-8deg); opacity: 0; } }
@keyframes banner-out { to { transform: translateY(-30px) scale(.9); opacity: 0; } }

/* ---------- modals ------------------------------------------------------------ */
.modal-root { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.scrim {
  position: absolute; inset: 0; pointer-events: auto;
  background: radial-gradient(circle at 50% 40%, rgba(43, 35, 80, .2), rgba(43, 35, 80, .5));
  display: grid; place-items: center; padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  animation: fade-in .25s ease both;
  touch-action: pan-y;
}
.card {
  position: relative; width: min(92vw, 400px); max-height: 100%; overflow-y: auto;
  border-radius: 32px; background: #fff; padding: 26px 22px 22px;
  box-shadow: 0 10px 0 rgba(43, 35, 80, .14), 0 26px 50px rgba(43, 35, 80, .35);
  text-align: center;
  animation: card-in .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes card-in { from { transform: translateY(60px) scale(.9); opacity: 0; } }
.card h2 { margin: 0; font-size: 34px; line-height: 1.05; font-weight: 700; color: var(--accent, var(--ink)); }
.card .sub { margin: 6px 0 0; font-size: 17px; color: var(--ink-soft); font-weight: 500; }
.card .actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.card .actions .btn { flex: 1 1 auto; }
.card .stack { display: grid; gap: 14px; margin-top: 20px; }
.ribbon {
  margin: -26px -22px 16px; padding: 22px 16px 18px; border-radius: 32px 32px 0 0;
  background: linear-gradient(var(--top, #3aa6ff), var(--horizon, #bfe9ff)); color: #fff;
}
.ribbon .rating {
  display: block; font-size: clamp(38px, 11vw, 52px); font-weight: 700; line-height: 1;
  color: var(--c, #fff); -webkit-text-stroke: .1em #fff; paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--lip, rgba(0, 0, 0, .15));
}
.ribbon .hole-name { display: block; margin-top: 8px; font-weight: 600; font-size: 16px; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.big-stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 8px; }
.big-stars svg { width: 58px; height: 58px; filter: drop-shadow(0 4px 0 rgba(43, 35, 80, .12)); }
.big-stars svg:nth-child(2) { transform: translateY(-10px); width: 66px; height: 66px; }
.big-stars .pop-in { animation: star-in .5s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes star-in { from { transform: scale(0) rotate(-90deg); } }
.result-stats { display: flex; justify-content: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.stat { min-width: 84px; padding: 10px 12px; border-radius: 18px; background: var(--lilac); }
.stat b { display: block; font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.stat.best { background: #fff4c4; }
.gems-row { display: inline-flex; gap: 4px; align-items: center; justify-content: center; margin-top: 12px; font-weight: 600; color: var(--ink-soft); }
.gems-row svg { width: 24px; height: 24px; }
.new-best { display: inline-block; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: var(--sun); font-weight: 700; font-size: 14px; animation: pop .6s .6s both; }

.scorecard { width: 100%; border-collapse: separate; border-spacing: 2px; margin-top: 10px; font-size: 14px; table-layout: fixed; }
.scorecard th { font-size: 11px; color: var(--ink-soft); font-weight: 600; padding: 2px 0; }
.scorecard tr > th:first-child { width: 34px; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
.scorecard tr > :last-child { width: 30px; }
.scorecard td { padding: 5px 0; background: var(--lilac); font-weight: 600; border-radius: 8px; }
.scorecard tr.par td { background: #f4f1ff; color: var(--ink-soft); font-weight: 500; }
.scorecard tr > td:last-child { background: var(--sun); }
.scorecard .under { color: #16a36a; background: #dcf8e9; }
.scorecard .over { color: #e2445c; }
.score-total {
  display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-top: 12px;
  font-weight: 600; color: var(--ink-soft);
}
.score-total b { font-size: 30px; color: var(--ink); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 16px; border-radius: 18px; background: var(--lilac); font-weight: 600; font-size: 17px; text-align: left;
}
.toggle-row .label { display: inline-flex; align-items: center; gap: 10px; }
.toggle-row .label svg { width: 22px; height: 22px; }
.switch { position: relative; width: 58px; height: 34px; border-radius: 999px; background: #cfc8ef; transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.switch[aria-checked="true"] { background: var(--mint); }
.switch[aria-checked="true"]::after { transform: translateX(24px); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #ddd7f6; }
.seg button { padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 4px rgba(43, 35, 80, .15); }
.link-btn { font-size: 14px; font-weight: 500; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; margin-top: 4px; }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; color: #fff; font-size: 20px; }

@media (orientation: landscape) and (max-height: 520px) {
  .logo { font-size: clamp(44px, 11vh, 80px); }
  .logo-wrap { margin-top: 0; }
  .title-actions { gap: 10px; margin-bottom: 0; }
  .btn.big { min-height: 56px; }
  .world-thumb { max-height: 28vh; }
  .world-card { width: min(60vw, 520px); flex-direction: row; }
  .world-card .world-thumb { width: 42%; max-height: none; aspect-ratio: auto; }
  .world-body { flex: 1; padding: 12px 14px; gap: 6px; }
  .banner { top: 18%; }
  .card { padding-top: 18px; }
  .ribbon { margin-top: -18px; padding: 14px 16px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .logo span, .hole-btn.next, .loading-ball, .tutorial-hand { animation: none !important; }
  .screen, .card { animation-duration: .01s !important; }
}

/* ---------- cloud wipe between holes --------------------------------------- */
.wipe { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.wipe i {
  position: absolute; border-radius: 50%; background: #fff;
  box-shadow: inset -14px -18px 0 rgba(160, 175, 230, .25);
  transform: scale(0); transition: transform .42s cubic-bezier(.5, 0, .3, 1);
}
.wipe.on i { transform: scale(1); }
.wipe.off i { transform: scale(0); transition-timing-function: cubic-bezier(.6, 0, .4, 1); }
