/* Huff n Puff — claymorphism design system */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(../fonts/fredoka.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/nunito.woff2) format('woff2'); }

:root {
  --bg: #fff5ea; --bg2: #ffe9d6; --card: #ffffff; --card2: #fff8f1; --ink: #2b2340; --muted: #807593; --line: #f1e2d4;
  --primary: #ff4f9a; --primary-2: #ff7fb6; --primary-ink: #fff; --accent: #ffb21f; --teal: #22c7b4; --purple: #7b3fe4; --blue: #4f9dff; --pink: #ff7eb6; --green: #4cbf62; --danger: #e5484d;
  --track: #f4e5d8; --body: #ecdccf; --muscle0: #e2d1c3; --muscle1: #ffc0dc; --muscle2: #ff8cc0; --muscle3: #ff4f9a;
  --hm0: #f1e3d6; --hm1: #ffd0e4; --hm2: #ffa0cb; --hm3: #ff6fae; --hm4: #e23c86;
  --sh-clay: 0 14px 28px -14px rgba(140, 70, 30, .35), 0 3px 8px -3px rgba(140, 70, 30, .12), inset 0 -5px 0 rgba(120, 60, 20, .06), inset 0 3px 0 rgba(255, 255, 255, .9);
  --sh-btn: 0 10px 18px -10px rgba(255, 60, 140, .7), inset 0 -4px 0 rgba(0, 0, 0, .12), inset 0 3px 0 rgba(255, 255, 255, .35);
  --sh-soft: inset 0 -3px 0 rgba(120, 60, 20, .06), inset 0 2px 0 rgba(255, 255, 255, .8);
  --r: 26px; --r-sm: 16px;
  --font-d: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --font: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --nav-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #1a1524; --bg2: #221b2f; --card: #2a2238; --card2: #241d31; --ink: #f7f0fb; --muted: #a99dbb; --line: #3a3049;
  --track: #3b3149; --body: #3e3451; --muscle0: #4a3f5f; --muscle1: #7a3f62; --muscle2: #c94f8a; --muscle3: #ff4f9a;
  --hm0: #2f2740; --hm1: #5a2f4a; --hm2: #8f3a67; --hm3: #cf4a8a; --hm4: #ff4f9a;
  --sh-clay: 0 16px 30px -14px rgba(0, 0, 0, .65), inset 0 -5px 0 rgba(0, 0, 0, .18), inset 0 2px 0 rgba(255, 255, 255, .06);
  --sh-soft: inset 0 -3px 0 rgba(0, 0, 0, .18), inset 0 2px 0 rgba(255, 255, 255, .05);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
h1, h2, h3, h4, .display { font-family: var(--font-d); font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.15; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; } h4 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 800; }
.center { text-align: center; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap { gap: 10px; } .gap-s { gap: 6px; } .gap-l { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 14px; } .mt-l { margin-top: 24px; } .mb { margin-bottom: 14px; }
.hidden { display: none !important; }
.ic { width: 22px; height: 22px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- app shell ---------- */
#app { max-width: 560px; margin: 0 auto; min-height: 100%; position: relative; }
.view { padding: calc(14px + var(--safe-t)) 16px calc(var(--nav-h) + 28px + var(--safe-b)); animation: viewIn .32s cubic-bezier(.2, .9, .3, 1.2); }
.view.no-nav { padding-bottom: calc(24px + var(--safe-b)); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; gap: 10px; min-height: 48px; margin-bottom: 10px; }
.topbar h1, .topbar h2 { flex: 1; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 16px; display: grid; place-items: center; background: var(--card);
  box-shadow: var(--sh-clay); flex: none; transition: transform .15s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.flat { background: transparent; box-shadow: none; }

nav.tabs {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); width: min(528px, calc(100% - 20px));
  height: var(--nav-h); background: var(--card); border-radius: 28px; box-shadow: var(--sh-clay), 0 20px 40px -20px rgba(80, 40, 20, .35);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px; z-index: 30;
}
nav.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 20px; color: var(--muted); font-size: 11.5px; font-weight: 800; transition: background .2s, color .2s, transform .15s; }
nav.tabs a .ic { width: 24px; height: 24px; }
nav.tabs a.on { color: var(--primary); background: color-mix(in srgb, var(--primary) 13%, transparent); }
nav.tabs a:active { transform: scale(.92); }
body.immersive nav.tabs { display: none; }

/* ---------- cards & surfaces ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--sh-clay); padding: 18px; position: relative; }
.card.tight { padding: 14px; }
.card + .card, .section + .section { margin-top: 14px; }
.section { margin-top: 22px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.section-h a, .link { color: var(--primary); font-weight: 800; font-size: 14px; }
.soft { background: var(--card2); border-radius: var(--r-sm); box-shadow: var(--sh-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 20px;
  font-family: var(--font-d); font-weight: 600; font-size: 17px; background: var(--card); box-shadow: var(--sh-clay); transition: transform .12s, filter .2s; white-space: nowrap;
}
.btn:active { transform: scale(.96) translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: var(--primary-ink); box-shadow: var(--sh-btn); }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn.danger { background: var(--danger); color: #fff; box-shadow: 0 10px 18px -10px rgba(229, 72, 77, .7), inset 0 -4px 0 rgba(0, 0, 0, .12); }
.btn.small { height: 40px; padding: 0 16px; border-radius: 15px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.big { height: 62px; font-size: 20px; border-radius: 24px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 14px; background: var(--card); box-shadow: var(--sh-soft), 0 4px 10px -6px rgba(120, 60, 20, .25);
  font-weight: 800; font-size: 14px; white-space: nowrap; transition: background .15s, color .15s;
}
.chip.on { background: var(--ink); color: var(--bg); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 800; background: var(--track); color: var(--ink); }
.pill .ic { width: 14px; height: 14px; }
.pill.p { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.pill.t { background: color-mix(in srgb, var(--teal) 18%, transparent); color: #0f8f84; }
.pill.y { background: color-mix(in srgb, var(--accent) 28%, transparent); color: #a2750a; }
.pill.v { background: color-mix(in srgb, var(--purple) 18%, transparent); color: #6a55e0; }
:root[data-theme='dark'] .pill.t { color: var(--teal); } :root[data-theme='dark'] .pill.y { color: var(--accent); } :root[data-theme='dark'] .pill.v { color: #b3a6ff; }

.seg { display: flex; background: var(--track); padding: 5px; border-radius: 18px; gap: 4px; }
.seg button { flex: 1; height: 40px; border-radius: 14px; font-weight: 800; color: var(--muted); font-size: 14.5px; transition: all .2s; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 4px 10px -5px rgba(0, 0, 0, .25); }

.input { width: 100%; height: 52px; border-radius: 16px; border: 0; background: var(--card2); box-shadow: inset 0 3px 6px rgba(120, 60, 20, .08), inset 0 0 0 2px var(--line); padding: 0 16px; font-size: 16px; outline: none; }
.input:focus { box-shadow: inset 0 3px 6px rgba(120, 60, 20, .08), inset 0 0 0 2px var(--primary); }
textarea.input { height: auto; min-height: 90px; padding: 14px 16px; resize: vertical; }
.search { position: relative; }
.search .ic { position: absolute; left: 15px; top: 15px; color: var(--muted); }
.search .input { padding-left: 46px; }

.switch { position: relative; width: 54px; height: 32px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--track); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .12); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 3px 6px rgba(0, 0, 0, .2), inset 0 -2px 0 rgba(0, 0, 0, .08); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(22px); }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.li { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--card); border-radius: 22px; box-shadow: var(--sh-clay); transition: transform .12s; width: 100%; text-align: left; }
.li:active { transform: scale(.985); }
.li .li-main { flex: 1; min-width: 0; }
.li .li-title { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .li-sub { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .chev { color: var(--muted); }
.li-thumb { width: 74px; height: 58px; border-radius: 16px; overflow: hidden; flex: none; box-shadow: var(--sh-soft); background: var(--track); }
.emoji-badge { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; flex: none; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12), inset 0 3px 0 rgba(255, 255, 255, .35); }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.set-row:last-child { border-bottom: 0; }

/* ---------- clay svg ---------- */
.clay-svg { display: block; width: 100%; height: 100%; }
.clay-thumb { width: 100%; aspect-ratio: 320 / 250; background: var(--track); overflow: hidden; }
.clay-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.clay-thumb[data-bare] { background: none; }
.clay-thumb.tall { aspect-ratio: 390 / 640; }
.clay-thumb img { animation: thumbIn .35s ease; }
@keyframes thumbIn { from { opacity: .4; } to { opacity: 1; } }
.hello .avatar .clay-thumb { aspect-ratio: 1; height: 100%; }
.clay-canvas { display: block; width: 100%; height: 100%; }
.clay-stage.is-3d::after, .is-3d.clay-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(120% 95% at 50% 45%, transparent 60%, rgba(60, 25, 10, .22)); }
.li-thumb .clay-thumb { height: 100%; aspect-ratio: auto; }
.li-thumb .clay-svg { object-fit: cover; }
.clay-stage { border-radius: 28px; overflow: hidden; aspect-ratio: 320 / 250; box-shadow: var(--sh-clay); background: var(--track); position: relative; }

/* ---------- home ---------- */
.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.hello .avatar { width: 52px; height: 52px; border-radius: 18px; overflow: hidden; box-shadow: var(--sh-clay); flex: none; background: var(--card); }
.hero {
  border-radius: 30px; padding: 20px; color: #fff; position: relative; overflow: hidden; box-shadow: 0 20px 34px -18px rgba(255, 80, 50, .75), inset 0 -6px 0 rgba(0, 0, 0, .12), inset 0 3px 0 rgba(255, 255, 255, .3);
  background: radial-gradient(120% 120% at 100% 0%, #ffb36b 0%, var(--primary) 55%, #f04a5c 100%);
}
.hero .clay-thumb { position: absolute; right: -18px; bottom: -6px; width: 58%; background: none; mask-image: radial-gradient(closest-side, #000 75%, transparent); }
.hero-content { position: relative; z-index: 1; max-width: 60%; }
.hero .kicker { font-weight: 800; font-size: 13px; opacity: .9; text-transform: uppercase; letter-spacing: .06em; }
.hero h2 { font-size: 26px; margin: 6px 0 4px; }
.hero .meta { font-size: 14px; opacity: .95; font-weight: 700; }
.hero .btn { margin-top: 16px; background: #fff; color: var(--primary); box-shadow: 0 10px 16px -10px rgba(0, 0, 0, .4), inset 0 -4px 0 rgba(0, 0, 0, .08); height: 48px; }
.hero.rest { background: radial-gradient(120% 120% at 100% 0%, #7ee8d9 0%, var(--teal) 55%, #1d9a8f 100%); box-shadow: 0 20px 34px -18px rgba(30, 160, 150, .75), inset 0 -6px 0 rgba(0, 0, 0, .12), inset 0 3px 0 rgba(255, 255, 255, .3); }
.hero.rest .btn { color: #128a7f; }

.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: 22px; box-shadow: var(--sh-clay); padding: 14px 12px; text-align: center; }
.stat .v { font-family: var(--font-d); font-weight: 600; font-size: 24px; line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.stat .e { font-size: 20px; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); }
.week .dot { width: 36px; height: 36px; border-radius: 13px; display: grid; place-items: center; background: var(--track); color: var(--muted); font-size: 13px; transition: transform .2s; }
.week .dot.done { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: var(--sh-btn); }
.week .dot.plan { box-shadow: inset 0 0 0 2.5px var(--primary); color: var(--primary); background: transparent; }
.week .dot.today { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.week .d.is-today { color: var(--ink); }

.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { display: block; }
.ring-inner { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-arc { transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .3, 1); }

/* horizontal carousels */
.hscroll { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 4px 16px 18px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }

/* workout cards */
.wk-card { width: 236px; border-radius: 26px; background: var(--card); box-shadow: var(--sh-clay); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s; text-align: left; }
.wk-card:active { transform: scale(.97); }
.wk-card .wk-art { position: relative; aspect-ratio: 320/220; overflow: hidden; }
.wk-card .wk-art .clay-thumb { height: 100%; aspect-ratio: auto; }
.wk-card .wk-art .clay-svg { height: 100%; object-fit: cover; }
.wk-card .wk-emoji { position: absolute; left: 10px; top: 10px; width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: var(--card); box-shadow: var(--sh-clay); }
.wk-card .wk-tag { position: absolute; right: 10px; top: 12px; }
.wk-card .wk-body { padding: 12px 14px 14px; }
.wk-card .wk-title { font-family: var(--font-d); font-weight: 600; font-size: 18px; }
.wk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wk-grid .wk-card { width: auto; }
.wk-grid .wk-card .wk-title { font-size: 16px; }

.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ex-card { background: var(--card); border-radius: 22px; overflow: hidden; box-shadow: var(--sh-clay); text-align: left; transition: transform .15s; }
.ex-card:active { transform: scale(.97); }
.ex-card .ex-name { padding: 10px 12px 2px; font-weight: 800; font-size: 14.5px; line-height: 1.25; }
.ex-card .ex-meta { padding: 0 12px 12px; color: var(--muted); font-size: 12.5px; }
@media (min-width: 520px) { .ex-grid { grid-template-columns: 1fr 1fr 1fr; } }

/* detail */
.detail-stage { margin: 0 -4px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.bullets { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bullets li { display: flex; gap: 10px; }
.bullets li::before { content: '✓'; color: var(--green); font-weight: 900; }
.bullets.bad li::before { content: '✕'; color: var(--danger); }
.bodymap-wrap { position: relative; }
.bodymap { display: flex; justify-content: center; gap: 4px; position: relative; padding: 6px 0 2px; }
.bodymap::before { content: ''; position: absolute; inset: 4% 8%; z-index: 0; border-radius: 50%; filter: blur(14px); opacity: .55;
  background: radial-gradient(40% 45% at 30% 45%, color-mix(in srgb, var(--primary) 45%, transparent), transparent 70%), radial-gradient(40% 45% at 72% 55%, color-mix(in srgb, var(--teal) 45%, transparent), transparent 70%), radial-gradient(30% 30% at 50% 15%, color-mix(in srgb, var(--accent) 50%, transparent), transparent 70%); }
.bodymap figure { margin: 0; text-align: center; flex: 1; max-width: 150px; position: relative; z-index: 1; }
.bodymap figure:first-child { transform: rotate(-4deg); } .bodymap figure:last-child { transform: rotate(4deg); }
.bodymap svg { width: 100%; height: auto; overflow: visible; }
.bodymap figcaption { font-family: 'Spray', var(--font-d); font-size: 16px; color: var(--ink); margin-top: -4px; }
.mz3 { animation: mzPulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes mzPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.mz-stickers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 6px; margin-top: 10px; }
.mz-sticker { font-family: var(--font-d); font-weight: 700; font-size: 13px; padding: 4px 11px; border-radius: 999px; border: 2.5px solid #2a1636; box-shadow: 2px 3px 0 #2a1636; color: #2a1636; }
.mz-sticker.p { background: var(--muscle3); color: #fff; }
.mz-sticker.s { background: var(--muscle1); }
.mz-sticker:nth-child(odd) { transform: rotate(-3deg); } .mz-sticker:nth-child(even) { transform: rotate(2.5deg); }
.mz { transition: fill .4s; }
.legend { display: flex; gap: 12px; justify-content: center; font-size: 12px; color: var(--muted); font-weight: 700; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-lbl { font-size: 11px; fill: var(--muted); text-anchor: middle; font-weight: 700; font-family: var(--font); }
.chart-val { font-size: 11.5px; fill: var(--ink); text-anchor: middle; font-weight: 800; font-family: var(--font); }
.chart-val.dim { fill: var(--muted); }
.heatmap { width: 100%; height: auto; display: block; }
.hm0 { fill: var(--hm0); } .hm1 { fill: var(--hm1); } .hm2 { fill: var(--hm2); } .hm3 { fill: var(--hm3); } .hm4 { fill: var(--hm4); }
.hm-today { stroke: var(--ink); stroke-width: 1.5; }
.empty-chart { padding: 30px 0; text-align: center; }

.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 11.5px; font-weight: 800; line-height: 1.2; }
.badge .medal { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--accent) 55%, #e0a312); box-shadow: 0 8px 14px -8px rgba(200, 140, 0, .8), inset 0 -5px 0 rgba(0, 0, 0, .12), inset 0 3px 0 rgba(255, 255, 255, .6); }
.badge.locked .medal { background: var(--track); filter: grayscale(1); opacity: .45; box-shadow: var(--sh-soft); }
.badge.locked { color: var(--muted); }

/* ---------- player (full-screen scene, floating HUD) ---------- */
.player { position: fixed; inset: 0; z-index: 40; background: #111; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.player .p-canvas { position: absolute; inset: 0; border-radius: 0; box-shadow: none; aspect-ratio: auto; background: #1a1524; touch-action: none; }
.player .p-canvas.is-3d::after { border-radius: 0; }
.glass { background: color-mix(in srgb, var(--card) 70%, transparent) !important; backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .35) !important; }
.player .p-hud-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(8px + var(--safe-t)) 12px 0; max-width: 560px; margin: 0 auto; pointer-events: none; }
.player .p-hud-top > * { pointer-events: auto; }
.player .p-top { display: flex; align-items: center; gap: 8px; }
.player .p-top .icon-btn { width: 40px; height: 40px; border-radius: 14px; }
.player .p-progress { flex: 1; display: flex; gap: 3px; padding: 7px 8px; border-radius: 12px; background: color-mix(in srgb, var(--card) 55%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.player .p-progress i { flex: 1; height: 6px; border-radius: 4px; background: rgba(127, 127, 127, .3); overflow: hidden; position: relative; }
.player .p-progress i.done { background: var(--primary); }
.player .p-progress i.cur::after { content: ''; position: absolute; inset: 0; background: var(--primary); transform-origin: left; transform: scaleX(var(--p, 0)); }
.player .p-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; pointer-events: none; }
.player .p-chips .pill { box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .4); }
.player .p-hud-bottom {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(8px + var(--safe-b)); width: min(544px, calc(100% - 16px));
  border-radius: 26px; padding: 12px 14px 10px; background: color-mix(in srgb, var(--card) 76%, transparent);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.player .p-row1 { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.player .p-name { font-family: var(--font-d); font-weight: 600; font-size: 22px; line-height: 1.1; }
.player .p-sub { color: var(--muted); font-weight: 700; font-size: 13px; margin-top: 2px; }
.player #pRing { flex: none; }
.player .p-timer { font-family: var(--font-d); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.player .p-reps { text-align: center; min-width: 64px; }
.player .p-reps b { display: block; font-family: var(--font-d); font-size: 34px; line-height: 1; }
.player .p-reps span { font-size: 12px; color: var(--muted); font-weight: 800; }
.player .p-center { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.player .p-center:empty { display: none; }
.player .p-center > .chip { align-self: flex-start; }
.player[data-kind='timed'] .p-center { flex-direction: row; }
.player .p-logrow { display: flex; gap: 8px; }
.player .p-logrow .p-step { flex: 1; min-width: 0; }
.player .p-logrow .lbl { display: none; }
.player .p-logrow .stepper { padding: 4px; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--line); background: var(--card2); }
.player .p-logrow .stepper .step-btn { width: 38px; height: 38px; border-radius: 12px; }
.player .p-logrow .stepper input { font-size: 22px; }
.player .p-logrow .p-step:nth-child(2) .stepper input { font-size: 20px; }
.player .p-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.player .p-meta .set-dots { margin: 0; }
.player .p-meta .hint { margin: 0; font-size: 12px; text-align: left; }
.player .p-meta .link { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.player .p-meta .link .ic { width: 16px; height: 16px; }
.player .p-row3 { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.player .p-controls { display: flex; align-items: center; gap: 10px; flex: none; }
.player .p-controls .icon-btn { width: 46px; height: 46px; border-radius: 16px; }
.player .p-main { width: 62px; height: 62px; border-radius: 22px; background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: var(--sh-btn); display: grid; place-items: center; transition: transform .12s; }
.player .p-main .ic { width: 28px; height: 28px; }
.player .p-main:active { transform: scale(.93); }
.player .p-next { flex: 1; min-width: 0; font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.player .p-setmeta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.player .p-setmeta .set-dots { margin: 0; }
.player .p-setmeta .link { display: inline-flex; align-items: center; gap: 2px; }
.player .p-setmeta .link .ic { width: 15px; height: 15px; }
.player .p-next .hint { margin: 2px 0 0; font-size: 12px; text-align: right; white-space: normal; }
.player.resting .p-timer { color: #0f8f84; }
:root[data-theme='dark'] .player.resting .p-timer { color: var(--teal); }
.p-quip { position: absolute; left: 16px; top: calc(96px + var(--safe-t)); max-width: min(72%, 360px); padding: 10px 14px; border-radius: 22px; background: #fff; color: #2a1636; font-family: var(--font-d); font-weight: 600; font-size: 16px; border: 3px solid #2a1636; box-shadow: 4px 5px 0 #2a1636; opacity: 0; transform: translateY(8px) scale(.9); transform-origin: bottom left; transition: opacity .25s, transform .35s cubic-bezier(.2, 1.5, .4, 1); pointer-events: none; }
.p-quip .who { display: block; font-family: 'Spray', var(--font-d); font-size: 13px; color: var(--primary); letter-spacing: .03em; }
.p-quip::after { content: ''; position: absolute; left: 26px; bottom: -17px; width: 22px; height: 18px; background: #fff; border: 3px solid #2a1636; border-top: 0; border-left: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); transform: skewX(-24deg); }
.p-quip.in { opacity: 1; transform: none; }
.p-swipe-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 99px; background: rgba(20, 15, 30, .65); color: #fff; font-weight: 800; font-size: 14px; display: flex; gap: 8px; align-items: center; opacity: 0; pointer-events: none; transition: opacity .4s; }
.p-swipe-hint.in { opacity: 1; animation: nudge 1.4s ease-in-out 3; }
@keyframes nudge { 0%, 100% { transform: translate(-50%, -50%); } 30% { transform: translate(calc(-50% - 14px), -50%); } 60% { transform: translate(calc(-50% + 14px), -50%); } }
.squish { animation: squish .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes squish { 0% { transform: scale(1.04, .94); } 40% { transform: scale(.98, 1.03); } 100% { transform: none; } }
.slide-l { animation: slideL .45s cubic-bezier(.2, .9, .3, 1); }
.slide-r { animation: slideR .45s cubic-bezier(.2, .9, .3, 1); }
@keyframes slideL { from { transform: translateX(28%); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes slideR { from { transform: translateX(-28%); opacity: .3; } to { transform: none; opacity: 1; } }
.set-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.set-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(127, 127, 127, .3); }
.set-dots i.done { background: var(--green); }
.set-dots i.cur { background: var(--primary); transform: scale(1.3); }
.hint { text-align: center; font-size: 13.5px; font-weight: 700; color: var(--primary); margin-top: 6px; }
.p-next .li-thumb { display: none; }
.rep-target { font-family: var(--font-d); font-weight: 600; font-size: 46px; text-align: center; line-height: 1; margin-top: 8px; }
.rep-target small { font-size: 18px; color: var(--muted); font-weight: 600; }
.set-logger { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.set-logger .lbl { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; text-align: center; margin-bottom: 4px; }

.stepper { display: flex; align-items: center; gap: 4px; background: var(--card); border-radius: 20px; box-shadow: var(--sh-clay); padding: 6px; }
.stepper .step-btn { width: 42px; height: 42px; border-radius: 15px; background: var(--track); display: grid; place-items: center; flex: none; }
.stepper .step-btn:active { transform: scale(.9); }
.stepper .step-val { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 3px; min-width: 0; }
.stepper input { width: 100%; min-width: 0; text-align: center; border: 0; background: transparent; font-family: var(--font-d); font-weight: 600; font-size: 24px; outline: none; -moz-appearance: textfield; padding: 0; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper .step-unit { font-size: 12px; color: var(--muted); font-weight: 800; }

/* ---------- summary ---------- */
.summary-hero { text-align: center; padding: 10px 0 0; }
.summary-hero .trophy { width: 120px; height: 120px; margin: 0 auto; border-radius: 40px; display: grid; place-items: center; font-size: 62px; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--accent) 55%, #e0a312); box-shadow: 0 18px 30px -14px rgba(200, 140, 0, .8), inset 0 -8px 0 rgba(0, 0, 0, .12), inset 0 4px 0 rgba(255, 255, 255, .6); animation: pop .7s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.rating { display: flex; justify-content: center; gap: 8px; }
.rating button { width: 52px; height: 52px; border-radius: 18px; font-size: 26px; background: var(--card); box-shadow: var(--sh-clay); transition: transform .15s; filter: grayscale(.6); opacity: .7; }
.rating button.on { transform: scale(1.12); filter: none; opacity: 1; box-shadow: var(--sh-clay), 0 0 0 3px var(--primary); }

/* ---------- onboarding ---------- */
.onb { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(20px + var(--safe-t)) 20px calc(20px + var(--safe-b)); }
.onb .onb-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.onb .dots { display: flex; gap: 6px; justify-content: center; }
.onb .dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--track); transition: width .3s, background .3s; }
.onb .dots i.on { width: 26px; background: var(--primary); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { padding: 16px 14px; border-radius: 22px; background: var(--card); box-shadow: var(--sh-clay); text-align: left; display: flex; flex-direction: column; gap: 4px; transition: transform .12s, box-shadow .2s; }
.choice .e { font-size: 28px; }
.choice b { font-family: var(--font-d); font-weight: 600; font-size: 17px; }
.choice span { color: var(--muted); font-size: 13px; line-height: 1.3; }
.choice.on { box-shadow: var(--sh-clay), 0 0 0 3px var(--primary); }
.choice:active { transform: scale(.97); }
.daypick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daypick button { height: 52px; border-radius: 16px; background: var(--card); box-shadow: var(--sh-clay); font-weight: 800; }
.daypick button.on { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: var(--sh-btn); }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-d); font-weight: 700; font-size: 28px; }
.logo svg { width: 44px; height: 44px; }
.splash-clay { max-width: 360px; width: 100%; margin: 0 auto; border-radius: 32px; overflow: hidden; box-shadow: var(--sh-clay); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 14px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .15), inset 0 3px 0 rgba(255, 255, 255, .35); transition: transform .15s; }
.swatch.on { outline: 3px solid var(--ink); outline-offset: 3px; transform: scale(1.05); }

.settings .li { box-shadow: none; border-radius: 0; background: transparent; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.settings .li:last-child { border-bottom: 0; }
.settings .card { padding: 4px 16px; }
.set-ic { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }

/* builder */
.b-item { display: flex; gap: 10px; align-items: center; padding: 10px; background: var(--card); border-radius: 20px; box-shadow: var(--sh-clay); }
.b-item .li-thumb { width: 64px; height: 50px; }
.b-item .b-ctrl { display: flex; flex-direction: column; gap: 4px; }
.b-item .b-ctrl button { width: 32px; height: 28px; border-radius: 10px; background: var(--track); display: grid; place-items: center; }
.b-item .b-ctrl .ic { width: 16px; height: 16px; }
.mini-steps { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.mini { display: flex; align-items: center; gap: 2px; background: var(--card2); border-radius: 12px; padding: 2px; box-shadow: var(--sh-soft); }
.mini button { width: 26px; height: 26px; border-radius: 9px; background: var(--track); font-weight: 900; display: grid; place-items: center; }
.mini span { min-width: 44px; text-align: center; font-weight: 800; font-size: 13px; }

/* ---------- sheets / toasts ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(30, 20, 40, .45); opacity: 0; transition: opacity .25s; }
.sheet { position: absolute; left: 50%; bottom: 0; width: min(560px, 100%); transform: translate(-50%, 100%); background: var(--bg); border-radius: 30px 30px 0 0; padding: 0 18px calc(22px + var(--safe-b)); max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; transition: transform .34s cubic-bezier(.22, 1, .36, 1); box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); will-change: transform; }
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-wrap.in .sheet-backdrop { opacity: 1; }
.sheet-wrap.in .sheet { transform: translate(-50%, 0); }
/* a big, sticky drag area around the little handle */
.sheet-grab { position: sticky; top: 0; z-index: 2; display: grid; place-items: center; height: 26px; margin: 0 -18px 6px; background: var(--bg); cursor: grab; touch-action: none; }
.sheet-grab i { width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.dialog { display: flex; flex-direction: column; gap: 14px; padding: 6px 0; }

#toasts { position: fixed; left: 50%; top: calc(12px + var(--safe-t)); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px; background: var(--card); color: var(--ink); border: 1.5px solid var(--line); font-weight: 700; box-shadow: var(--sh-clay), 0 14px 30px -12px rgba(0, 0, 0, .35); transform: translateY(-20px) scale(.95); opacity: 0; transition: all .3s cubic-bezier(.2, 1.3, .4, 1); }
.toast.in { transform: none; opacity: 1; }
.toast-ic { font-size: 20px; }
.toast-btn { margin-left: auto; flex: none; padding: 7px 14px; border-radius: 12px; background: var(--primary); color: var(--primary-ink); font-weight: 900; box-shadow: var(--sh-btn); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i { position: absolute; top: -20px; border-radius: 40%; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15), inset 0 2px 0 rgba(255, 255, 255, .4); animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); } }

.empty { text-align: center; padding: 30px 16px; }
.empty .clay-thumb, .empty .clay-stage { max-width: 260px; margin: 0 auto 14px; border-radius: 26px; overflow: hidden; }

.install-card { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--purple) 22%, var(--card)), var(--card)); }

.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.kv .v { font-family: var(--font-d); font-weight: 600; font-size: 20px; }
.kv .l { font-size: 11.5px; color: var(--muted); font-weight: 800; text-transform: uppercase; }

.fab { position: fixed; right: max(16px, calc(50% - 264px)); bottom: calc(var(--nav-h) + 24px + var(--safe-b)); z-index: 25; width: 60px; height: 60px; border-radius: 22px; background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #fff; display: grid; place-items: center; box-shadow: var(--sh-btn); }
.fab .ic { width: 28px; height: 28px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (min-width: 700px) { body { background: radial-gradient(circle at 20% 0%, var(--bg2), var(--bg) 60%); } }

/* ---------- full-screen summary ---------- */
.summary.fs { position: fixed; inset: 0; z-index: 40; background: #111; overflow: hidden; }
.summary .p-canvas { position: absolute; inset: 0; border-radius: 0; box-shadow: none; aspect-ratio: auto; }
.summary .sum-top { position: absolute; top: calc(10px + var(--safe-t)); left: 0; right: 0; display: flex; justify-content: center; z-index: 2; pointer-events: none; }
.summary .sum-title { padding: 10px 18px; border-radius: 22px; text-align: center; animation: pop .7s cubic-bezier(.2, 1.6, .4, 1); }
.summary .sum-title h1 { font-size: 24px; }
.summary .sum-scroll { position: absolute; inset: 0; overflow-y: auto; z-index: 1; -webkit-overflow-scrolling: touch; }
.summary .sum-spacer { height: 52vh; height: 52dvh; }
.summary .sum-sheet { position: relative; max-width: 560px; margin: 0 auto; padding: 16px 16px calc(24px + var(--safe-b)); border-radius: 30px 30px 0 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); min-height: 48vh; box-shadow: 0 -16px 40px -20px rgba(0, 0, 0, .5); }
.summary .sum-quip { display: flex; gap: 10px; align-items: center; margin: 0 4px 12px; }
.summary .sum-quip > span { font-size: 30px; }

/* ---------- cast ---------- */
.cast-list { display: flex; flex-direction: column; gap: 14px; }
.cast-card { display: grid; grid-template-columns: 38% 1fr; gap: 14px; padding: 12px; transition: opacity .3s, filter .3s; }
.cast-card.off .cast-art { filter: grayscale(1) brightness(.85); opacity: .6; }
.cast-card h2 { font-size: 20px; }
.cast-art { border-radius: 20px; overflow: hidden; display: block; box-shadow: var(--sh-soft); align-self: start; }
.cast-art .clay-thumb { border-radius: 20px; }
.cast-info { min-width: 0; }
@media (max-width: 380px) { .cast-card { grid-template-columns: 1fr; } }

/* ---------- Huff n Puff vibes: spray-paint headings, speckled walls, stickers ---------- */
body { background-image: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--primary) 9%, transparent) 0 1.5px, transparent 2.5px), radial-gradient(circle at 70% 60%, color-mix(in srgb, var(--teal) 9%, transparent) 0 1.2px, transparent 2.2px); background-size: 34px 34px, 46px 46px; background-attachment: fixed; }
.topbar h1, .graffiti { font-family: 'Spray', var(--font-d); font-weight: 400; letter-spacing: .01em; line-height: 1.05; text-shadow: .045em .06em 0 color-mix(in srgb, var(--primary) 55%, transparent); }
.topbar h1 { font-size: 34px; transform: rotate(-1.5deg); transform-origin: left center; }
.section-h h2 { font-family: var(--font-d); font-weight: 700; }
.sticker { display: inline-block; font-family: 'Spray', var(--font-d); padding: 4px 10px; border-radius: 12px; background: var(--accent); color: #2a1636; transform: rotate(-3deg); box-shadow: 0 0 0 3px #fff, 0 6px 14px -6px rgba(0, 0, 0, .4); }
:root[data-theme='dark'] .sticker { box-shadow: 0 0 0 3px #2a1636, 0 6px 14px -6px rgba(0, 0, 0, .6); }

/* comic speech bubbles the characters talk in */
.speech { position: absolute; z-index: 4; max-width: min(74%, 340px); padding: 12px 16px 13px; border-radius: 24px; background: #fff; color: #2a1636; font-family: var(--font-d); font-weight: 600; font-size: 17px; line-height: 1.2;
  border: 3px solid #2a1636; box-shadow: 4px 5px 0 #2a1636; pointer-events: none; transform-origin: var(--tail-x, 22px) 110%; }
.speech::after { content: ''; position: absolute; left: var(--tail-x, 22px); bottom: -17px; width: 22px; height: 18px; background: #fff; border: 3px solid #2a1636; border-top: 0; border-left: 0; clip-path: polygon(0 0, 100% 0, 100% 100%); transform: skewX(-24deg); }
.speech.tail-r::after { left: auto; right: var(--tail-x, 22px); transform: scaleX(-1) skewX(-24deg); }
.speech .who { display: block; font-family: 'Spray', var(--font-d); font-weight: 400; font-size: 13px; color: var(--primary); letter-spacing: .03em; margin-bottom: 2px; }
.speech.pop { animation: speechPop .55s cubic-bezier(.2, 1.7, .4, 1) both; }
@keyframes speechPop { from { opacity: 0; transform: scale(.4) rotate(-6deg); } to { opacity: 1; transform: none; } }
.summary .sum-cheer { z-index: 1; top: calc(84px + var(--safe-t)); right: 16px; max-width: 58%; animation-delay: .9s; }

/* giant get-ready countdown */
.p-count { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 3; }
.p-count b { font-family: 'Spray', var(--font-d); font-weight: 400; font-size: min(46vw, 260px); line-height: 1; color: var(--accent); -webkit-text-stroke: .02em #2a1636; paint-order: stroke fill;
  text-shadow: .03em .045em 0 #2a1636, .06em .09em 0 #2a1636, 0 0 .3em rgba(0, 0, 0, .35); filter: drop-shadow(0 0 .02em #2a1636); animation: countPop .95s cubic-bezier(.2, 1.6, .35, 1) both; }
.p-count b.n3 { color: #ff5fa8; } .p-count b.n2 { color: #ffb21f; } .p-count b.n1 { color: #22c7b4; }
.p-count b.go { color: #fff; font-size: min(34vw, 190px); animation: goPop .9s cubic-bezier(.2, 1.6, .35, 1) both; }
@keyframes countPop { 0% { opacity: 0; transform: scale(2.2) rotate(-12deg); } 30% { opacity: 1; transform: scale(.92) rotate(3deg); } 45% { transform: scale(1.04) rotate(-2deg); } 80% { opacity: 1; transform: scale(1) rotate(-3deg); } 100% { opacity: 0; transform: scale(.7) rotate(-6deg); } }
@keyframes goPop { 0% { opacity: 0; transform: scale(.3) rotate(8deg); } 35% { opacity: 1; transform: scale(1.15) rotate(-4deg); } 75% { opacity: 1; transform: scale(1) rotate(-4deg); } 100% { opacity: 0; transform: scale(1.5) rotate(-4deg); } }
.player.ready #pRing { visibility: hidden; }

/* move thumbs up / down */
.ex-wrap { position: relative; transition: transform .35s, opacity .35s; }
.ex-wrap.bye { transform: scale(.6) rotate(-6deg); opacity: 0; }
.ex-wrap.voted-down .ex-card { opacity: .55; filter: grayscale(.7); }
.votes { display: flex; gap: 4px; }
.ex-wrap .votes { position: absolute; top: 8px; right: 8px; }
.vote { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; font-size: 16px; background: rgba(255, 255, 255, .78); backdrop-filter: blur(6px); box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .3); filter: grayscale(1); opacity: .75; transition: transform .2s cubic-bezier(.2, 1.7, .4, 1), filter .2s, opacity .2s; }
:root[data-theme='dark'] .vote { background: rgba(42, 34, 56, .8); }
.vote:active { transform: scale(.85); }
.vote.on { filter: none; opacity: 1; transform: scale(1.12) rotate(-6deg); }
.vote.up.on { background: #d9fbf4; box-shadow: 0 0 0 2px var(--teal); }
.vote.down.on { background: #ffe0ee; box-shadow: 0 0 0 2px var(--primary); }
.votes.inline .vote { width: 40px; height: 40px; font-size: 19px; }

/* ---------- welcome: the whole cast floating about ---------- */
.onb.is-welcome { padding: 0; }
.welcome { position: fixed; inset: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff;
  background: radial-gradient(70% 55% at 25% 18%, #ffc24a 0, transparent 65%), radial-gradient(70% 55% at 80% 88%, #ffa915 0, transparent 65%), #ffb21f; }
.welcome::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, .3) 0 1.5px, transparent 2.5px) 0 0 / 24px 24px; opacity: .5; }
.wl-float { position: absolute; inset: 0; }
.wl-sprite { position: absolute; width: 44vw; max-width: 260px; aspect-ratio: 300 / 330; opacity: 0; transition: opacity .8s;
  animation: wlDrift var(--dur) ease-in-out var(--del) infinite alternate; }
.wl-sprite.in { opacity: 1; }
.wl-sprite img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(110, 50, 0, .35)); transform: scaleX(var(--flip, 1)); }
.wl-sprite img:not([src]) { visibility: hidden; }
@keyframes wlDrift { from { transform: translate(0, 0) rotate(var(--r0)) scale(var(--s)); } to { transform: translate(var(--dx), var(--dy)) rotate(var(--r1)) scale(var(--s)); } }
.wl-center { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 26px; margin-top: -8vh; }
.wl-center .hnp-logo { width: min(78vw, 420px); }
.wl-tag { text-align: center; font-family: var(--font-d); font-weight: 600; font-size: 16px; line-height: 1.35; padding: 8px 16px; border-radius: 18px; background: rgba(42, 22, 54, .45); backdrop-filter: blur(8px); }
.wl-join { position: absolute; z-index: 3; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%) rotate(-2deg); width: min(420px, calc(100% - 40px));
  font-family: 'Spray', var(--font-d); font-weight: 400; font-size: 30px; letter-spacing: .02em; padding: 16px 20px; border-radius: 26px; color: #fff; background: #7b3fe4;
  border: 3.5px solid #2a1636; box-shadow: 5px 6px 0 #2a1636; animation: joinBob 2.6s ease-in-out infinite; }
.wl-join:active { transform: translateX(-50%) rotate(-2deg) translate(3px, 4px); box-shadow: 2px 2px 0 #2a1636; }
@keyframes joinBob { 0%, 100% { margin-bottom: 0; } 50% { margin-bottom: 6px; } }
@media (prefers-reduced-motion: reduce) { .wl-sprite, .wl-join { animation: none; } }

/* cast picker (onboarding + You) */
.cast-pick { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cast-pick::-webkit-scrollbar { display: none; }
.cast-pick-b { flex: none; width: 84px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 5px; font-weight: 800; font-size: 12.5px; color: var(--muted); }
.cast-pick-b .clay-thumb { width: 78px; height: 78px; border-radius: 26px; overflow: hidden; box-shadow: var(--sh-clay); background: var(--card2); transition: transform .25s cubic-bezier(.2, 1.7, .4, 1), box-shadow .2s; }
.cast-pick-b .clay-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cast-pick-b.on { color: var(--ink); }
.cast-pick-b.on .clay-thumb { transform: rotate(-4deg) scale(1.06); box-shadow: 0 0 0 3px #2a1636, 4px 5px 0 3px var(--primary); }
.cast-pick.big { display: grid; grid-template-columns: repeat(4, 1fr); overflow: visible; }
.cast-pick.big .cast-pick-b { width: auto; }
.cast-pick.big .cast-pick-b .clay-thumb { width: 100%; height: auto; aspect-ratio: 1; }

/* ---------- rest-period films: bubbles, comic sound effects, wipes ---------- */
.il-ov { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.il-say { position: absolute; font-size: 15px; width: max-content; max-width: min(58vw, 250px); translate: -26px calc(-100% - 22px); }
.il-say.tail-r { translate: calc(-100% + 26px) calc(-100% - 22px); }
.il-sfx { position: absolute; translate: -50% -50%; font-family: 'Spray', var(--font-d); font-size: 40px; white-space: nowrap; color: #ffb21f; -webkit-text-stroke: 2px #2a1636; paint-order: stroke fill;
  text-shadow: 3px 4px 0 #2a1636; animation: sfxPop .9s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes sfxPop { 0% { opacity: 0; transform: scale(.2) rotate(-20deg); } 30% { opacity: 1; transform: scale(1.25) rotate(-6deg); } 80% { opacity: 1; transform: scale(1) rotate(-8deg); } 100% { opacity: 0; transform: scale(1.3) rotate(-8deg); } }
.il-wipe { position: absolute; inset: 0; --w: 0; }
.il-wipe > i { position: absolute; display: block; }
.il-wipe[data-kind='flash'] { background: #fff; opacity: var(--w); }
.il-wipe[data-kind='iris'] { background: radial-gradient(circle at 50% 46%, transparent calc((1 - var(--w)) * 80vmax), #1a0f24 calc((1 - var(--w)) * 80vmax + 1px)); }
.il-wipe[data-kind='splat'] > i { left: 50%; top: 46%; width: 70vmin; height: 64vmin; background: #ff5fa8; border: 6px solid #2a1636; border-radius: 58% 42% 63% 37% / 45% 58% 42% 55%;
  transform: translate(-50%, -50%) scale(calc(var(--w) * 3.4)) rotate(calc(var(--w) * 50deg)); }
.il-wipe[data-kind='splat'] > i + i { background: #22c7b4; border-radius: 40% 60% 45% 55% / 60% 40% 60% 40%; transform: translate(-40%, -60%) scale(max(0, calc(var(--w) * 3.6 - 1.2))) rotate(calc(var(--w) * -70deg)); }
.il-wipe[data-kind='curtain'] > i { top: 0; bottom: 0; width: 51%; background: repeating-linear-gradient(90deg, #b3202f 0 18px, #d8303f 18px 30px, #a01a28 30px 44px); box-shadow: inset 0 -30px 40px rgba(0, 0, 0, .35); }
.il-wipe[data-kind='curtain'] > i:first-child { left: 0; transform: translateX(calc((var(--w) - 1) * 100%)); border-radius: 0 0 40% 0; }
.il-wipe[data-kind='curtain'] > i + i { right: 0; transform: translateX(calc((1 - var(--w)) * 100%)); border-radius: 0 0 0 40%; }
.il-wipe[data-kind='blinds'] { background: repeating-linear-gradient(90deg, #22c7b4 0 calc(var(--w) * 46px), transparent 0 46px), repeating-linear-gradient(90deg, transparent 0 calc(var(--w) * 46px - 6px), rgba(42, 22, 54, .35) 0 calc(var(--w) * 46px)); }
.il-wipe[data-kind='paint'] { background: linear-gradient(115deg, #ff5fa8 calc(var(--w) * 140% - 40%), #ffb21f calc(var(--w) * 140% - 25%), transparent calc(var(--w) * 140% - 8%)); }
.il-wipe[data-kind='stars'] { opacity: var(--w); background: radial-gradient(circle, #ffe066 0 2px, transparent 3px) 0 0 / 31px 31px, radial-gradient(circle, #fff 0 1.2px, transparent 2px) 12px 16px / 23px 23px, radial-gradient(circle at 50% 50%, #4a2a8e, #120a24 70%); }
.il-wipe[data-kind='tiles'] { clip-path: inset(calc((1 - var(--w)) * 100%) 0 0 0); background: repeating-conic-gradient(#f4f4f0 0 25%, #bfe9e0 0 50%) 0 0 / 64px 64px; box-shadow: inset 0 6px 0 #2a1636; }
.il-wipe[data-kind='vinyl'] > i { left: 50%; top: 46%; width: 150vmax; height: 150vmax; border-radius: 50%;
  background: radial-gradient(circle, #ff5fa8 0 7%, #111 7.3% 8%, transparent 8.2%), repeating-radial-gradient(circle, #151517 0 3px, #26262b 3px 5px);
  transform: translate(-50%, -50%) scale(var(--w)) rotate(calc(var(--w) * 720deg)); }
.il-wipe[data-kind='leaves'] { clip-path: circle(calc(var(--w) * 150%) at 100% 0); background: radial-gradient(ellipse 40px 18px at 20% 30%, #7fb069 60%, transparent 62%) 0 0 / 90px 70px, radial-gradient(ellipse 34px 15px at 70% 70%, #4a6b52 60%, transparent 62%) 0 0 / 110px 80px, #5f8f4e; }
.il-wipe[data-kind='vhs'] { opacity: var(--w); background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .16) 0 2px, transparent 2px 5px), linear-gradient(#2a2a3e, #3d3550); }
.il-wipe[data-kind='vhs']::after { content: '▶ PLAY'; position: absolute; left: 22px; top: 40%; font: 700 28px/1 ui-monospace, monospace; color: #fff; text-shadow: 2px 0 #f0f, -2px 0 #0ff; }

/* the drawer background is an SVG: base colour + a fill that grows with the timer, with REST
   cut clean out of both during rests so the scene shows through the letters */
.player .p-hud-bottom { background: transparent; overflow: hidden; }
.player .p-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.player .p-bg text { font-family: var(--font-d); font-weight: 700; letter-spacing: .02em; }
.player .p-bg-base { fill: var(--card); fill-opacity: .78; transition: fill .3s; }
.player .p-bg-fill { fill: color-mix(in srgb, var(--primary) 26%, var(--card)); fill-opacity: .9; }
.player.worded .p-hud-bottom { --rw: min(30vw, 132px); padding-top: calc(var(--rw) * .9 + 10px); padding-bottom: 16px; backdrop-filter: none; -webkit-backdrop-filter: none; }
.player.resting .p-bg-base { fill: color-mix(in srgb, var(--teal) 26%, var(--card)); fill-opacity: .96; }
.player.resting .p-bg-fill { fill: #19d3bd; fill-opacity: .96; }
.player.paused .p-bg-base { fill: color-mix(in srgb, var(--accent) 26%, var(--card)); fill-opacity: .96; }
.player.paused .p-bg-fill { fill: #ffab0f; fill-opacity: .96; }
/* the time, big and translucent just under the top HUD */
.player .p-clock { position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + 104px); text-align: center; z-index: 3; pointer-events: none;
  font-family: var(--font-d); font-weight: 700; font-size: clamp(54px, 17vw, 84px); line-height: 1; font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .72); text-shadow: 0 2px 18px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .25); }
.player .p-clock:empty { display: none; }
.player.resting .p-row3 { justify-content: flex-start; }
.player .p-upnext { font-weight: 700; font-size: 14px; color: var(--muted); margin-top: 3px; }
.player .p-upnext b { font-weight: 900; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.player .p-eyebrow { font-weight: 900; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #0f8f84; margin-bottom: 2px; }
:root[data-theme='dark'] .player .p-eyebrow { color: var(--teal); }
.player.resting .p-name { font-size: 26px; }

/* tap-to-spotlight muscle groups */
.bodymap .mz { cursor: pointer; transition: opacity .25s; }
.bodymap-wrap.focusing .mz:not(.on) { opacity: .28; }
.bodymap .mz.on { fill: #ffb21f; stroke: #2a1636; stroke-width: 2.2; animation: mzPulse 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mz-sticker { cursor: pointer; transition: transform .2s cubic-bezier(.2, 1.7, .4, 1), background .2s; }
.mz-sticker.on { background: #ffb21f !important; color: #2a1636 !important; transform: scale(1.12) rotate(-4deg) !important; }
.mz-caption { position: absolute; left: 50%; top: 4px; translate: -50% 0; z-index: 2; font-family: var(--font-d); font-weight: 700; font-size: 15px; color: #2a1636; background: #ffb21f;
  padding: 3px 12px; border-radius: 999px; border: 2.5px solid #2a1636; box-shadow: 2px 3px 0 #2a1636; pointer-events: none; }
.mz-caption:empty { display: none; }

/* bottom-right of the drawer always holds the secondary bits: up-next text, or +15s / Skip while resting */
.player .p-row3 { justify-content: space-between; }
.player.resting .p-next { display: flex; gap: 8px; justify-content: flex-end; overflow: visible; }
.player.resting .p-next .chip { flex: none; }
/* on the vivid rest / paused fill the up-next line uses the ink colour so it stays legible */
.player.worded .p-upnext { color: var(--ink); opacity: .82; }
#fav.on { color: var(--primary); }
.li-sub .unfin { color: var(--primary); font-weight: 800; }

/* speech beside the speaker: wraps to fit, tail pointing sideways at them */
.speech.side, .p-quip.side { translate: none; width: max-content; }
.speech.side::after, .p-quip.side::after { bottom: auto; top: calc(var(--tail-y, 50%) - 9px); width: 16px; height: 16px; transform: rotate(45deg); clip-path: none; }
.speech.side-r::after, .p-quip.side-r::after { left: -11px; right: auto; border: 3px solid #2a1636; border-top: 0; border-right: 0; }
.speech.side-l::after, .p-quip.side-l::after { right: -11px; left: auto; border: 3px solid #2a1636; border-bottom: 0; border-left: 0; }
.p-quip.side { transform-origin: center left; }
.speech.above, .p-quip.above { translate: none; width: max-content; }
.speech.above::after, .p-quip.above::after { left: var(--tail-x, 22px); right: auto; }
