:root {
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --bg: #f3efe9;
  --card: #ffffff;
  --ink: #232634;
  --ink2: #6b6f7d;
  --ink3: #a3a7b3;
  --line: #e6e1d9;
  --accent: #ff6f61;
  --accent2: #7c5cff;
  --gold: #ffb627;
  --ok: #3bb273;
  --shadow: 0 6px 22px rgba(60, 40, 20, 0.10), 0 1px 3px rgba(60, 40, 20, 0.08);
  --shadow-s: 0 2px 8px rgba(60, 40, 20, 0.12);
  --r: 20px;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
:root[data-theme="night"] {
  --bg: #1c1f2b; --card: #2a2e3d; --ink: #f1f3fa; --ink2: #aab2c8; --ink3: #6f7891; --line: #3a3f52;
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.35); --shadow-s: 0 2px 8px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}
:root[data-theme="dawn"] { --bg: #f7e9ea; --card: #fffafa; --line: #efd9dc; }
:root[data-theme="water"] { --bg: #e6eff1; --card: #fbfefe; --line: #d3e2e6; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
.ic { display: inline-flex; width: 24px; height: 24px; }
.ic svg { width: 100%; height: 100%; }

/* ---------- colouring screen ---------- */
.cs { position: fixed; inset: 0; background: var(--bg); overflow: hidden; }
.cs-canvas { position: absolute; inset: 0; touch-action: none; display: block; }
.cs-top {
  position: absolute; left: calc(10px + var(--sl)); right: calc(10px + var(--sr)); top: calc(8px + var(--st));
  display: flex; align-items: center; gap: 10px; pointer-events: none;
}
.cs-top > * { pointer-events: auto; }
.icbtn, .hint {
  width: 46px; height: 46px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-s);
  display: grid; place-items: center; position: relative; transition: transform .15s ease;
}
.icbtn:active, .hint:active { transform: scale(0.92); }
.cs-prog { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--card); box-shadow: var(--shadow-s); border-radius: 23px; height: 46px; padding: 0 14px; min-width: 0; }
.cs-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.cs-bar-fill { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .35s ease; }
.cs-pct { font-weight: 700; font-size: 15px; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.cs-hints { display: flex; gap: 8px; }
.hint .badge {
  position: absolute; right: -3px; top: -3px; min-width: 20px; height: 20px; border-radius: 10px; padding: 0 5px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--card);
}
.hint[aria-label] .badge:empty { display: none; }
.hint.empty .badge { background: var(--ok); }
.hint.armed { background: var(--accent); color: #fff; animation: armed 0.9s ease-in-out infinite; }
@keyframes armed { 50% { transform: scale(1.08); } }
.cs.finished .cs-top .cs-hints, .cs.finished .cs-palwrap { opacity: 0; pointer-events: none; transition: opacity .5s; }

.cs-palwrap {
  position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: var(--sb);
  background: color-mix(in srgb, var(--card) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 24px 24px 0 0; box-shadow: 0 -4px 20px rgba(60, 40, 20, 0.08);
}
.cs-pal {
  display: flex; gap: 10px; overflow-x: auto; padding: 14px calc(16px + var(--sr)) 14px calc(16px + var(--sl));
  scrollbar-width: none; scroll-snap-type: x proximity;
}
.cs-pal::-webkit-scrollbar { display: none; }
.sw {
  flex: 0 0 auto; width: 54px; height: 54px; border-radius: 50%; background: var(--c); color: var(--ink);
  position: relative; display: grid; place-items: center; scroll-snap-align: center;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), opacity .3s;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.sw .n { font-weight: 800; font-size: 18px; color: var(--sw-ink); position: relative; z-index: 1; }
.sw .ring {
  position: absolute; inset: -6px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), color-mix(in srgb, var(--line) 70%, transparent) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3.5px));
  opacity: 0; transition: opacity .2s;
}
.sw .ok { position: absolute; width: 26px; height: 26px; color: var(--sw-ink); opacity: 0; transform: scale(0.4); transition: all .25s; }
.sw.sel { transform: scale(1.14); }
.sw.sel .ring, .sw:hover .ring { opacity: 1; }
.sw.done { opacity: 0.45; order: 1; }   /* finished colours move to the end of the palette */
html[data-hidedone] .sw.done { display: none; }
html[data-big] .sw { width: 64px; height: 64px; }
html[data-big] .sw .n { font-size: 22px; }
html[data-big] .icbtn { width: 52px; height: 52px; }
.sw.done .n { opacity: 0; }
.sw.done .ok { opacity: 1; transform: none; }
.sw.nudge { animation: nudge .45s ease; }
@keyframes nudge { 20%, 60% { transform: translateX(-4px) scale(1.1); } 40%, 80% { transform: translateX(4px) scale(1.1); } }

.cs.land .cs-palwrap { left: auto; top: 0; width: calc(100px + var(--sr)); border-radius: 24px 0 0 24px; padding-bottom: 0; padding-top: var(--st); }
.cs.land .cs-pal { flex-direction: column; overflow-x: hidden; overflow-y: auto; height: 100%; padding: 18px 22px calc(18px + var(--sb)); scroll-snap-type: y proximity; }
html[data-lefty] .cs.land .cs-palwrap { right: auto; left: 0; width: calc(100px + var(--sl)); border-radius: 0 24px 24px 0; }
html[data-big] .cs.land .cs-palwrap { width: calc(116px + var(--sr)); }
html[data-big][data-lefty] .cs.land .cs-palwrap { width: calc(116px + var(--sl)); }
.cs.land .cs-top { right: calc(112px + var(--sr)); }
html[data-big] .cs.land .cs-top { right: calc(128px + var(--sr)); }
html[data-lefty] .cs.land .cs-top { right: calc(12px + var(--sr)); left: calc(112px + var(--sl)); }
html[data-lefty][data-big] .cs.land .cs-top { left: calc(128px + var(--sl)); }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 0; right: 0; top: calc(66px + var(--st)); display: grid; justify-items: center; gap: 8px; pointer-events: none; z-index: 50; }
.toast {
  background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 14px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(-8px); transition: all .3s ease; max-width: 88vw; text-align: center;
}
.toast.in { opacity: 1; transform: none; }

/* ---------- shell ---------- */
.shell { position: fixed; inset: 0; display: flex; flex-direction: column; }
.shell.behind { visibility: hidden; }
.app-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--st)) calc(16px + var(--sr)) 8px calc(16px + var(--sl)); }
.logo { font-weight: 900; font-size: 25px; letter-spacing: -0.6px; }
.logo .l0 { color: #ff6f61; } .logo .l1 { color: #ffb627; } .logo .l2 { color: #3bb273; } .logo .lt { color: var(--ink); }
.top-r { display: flex; gap: 8px; }
.pill-btn { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px; border-radius: 19px; background: var(--card); box-shadow: var(--shadow-s); font-weight: 800; font-variant-numeric: tabular-nums; }
.pill-btn .ic { width: 20px; height: 20px; color: #3fb5cf; }
.pill-btn.lv .ic { color: var(--gold); }
.view { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 0 calc(16px + var(--sr)) 28px calc(16px + var(--sl)); }
.tabbar {
  display: flex; justify-content: space-around; border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 92%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  padding: 4px calc(6px + var(--sr)) calc(4px + var(--sb)) calc(6px + var(--sl));
}
.tab { flex: 1; max-width: 110px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; color: var(--ink3); font-size: 11px; font-weight: 700; position: relative; }
.tab.on { color: var(--accent); }
.tab .dot { position: absolute; top: 4px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--card); display: none; }
.tab .dot.on { display: block; }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 96px 1fr; grid-template-rows: auto 1fr; }
  .tabbar { grid-row: 1 / 3; grid-column: 1; flex-direction: column; justify-content: flex-start; gap: 6px; border-top: 0; border-right: 1px solid var(--line); padding: calc(20px + var(--st)) 6px 20px calc(6px + var(--sl)); }
  .tab { flex: 0 0 auto; max-width: none; padding: 12px 0; font-size: 12px; }
  .app-top, .view { grid-column: 2; }
}

/* ---------- common ---------- */
.screen { max-width: 1100px; margin: 0 auto; padding-top: 2px; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.scr-title { font-size: 30px; font-weight: 900; margin: 4px 0 14px; letter-spacing: -0.5px; }
.sub { font-size: 19px; font-weight: 800; margin: 24px 0 10px; display: flex; align-items: center; gap: 8px; }
.sub .count { margin-left: auto; font-size: 14px; color: var(--ink2); font-weight: 700; }
.sub .ic { color: var(--accent); }
.muted { color: var(--ink2); }
.tile { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.tile .sub { margin-top: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; position: sticky; top: 0; z-index: 2; background: var(--bg); }
.chips::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: none; }
.chip { padding: 9px 16px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-s); font-weight: 700; font-size: 15px; white-space: nowrap; color: var(--ink2); }
.chip.on { background: var(--ink); color: var(--card); }
.chip { display: inline-flex; align-items: center; gap: 5px; flex: none; }
.chip .n { font-size: 12.5px; font-weight: 800; opacity: .55; }
.chip .ic { width: 15px; height: 15px; }
.chip.complete .ic { color: var(--ok); }
.chip.on.complete .ic { color: inherit; }
.chip-hide { margin-left: auto; }
.empty-note { grid-column: 1 / -1; text-align: center; padding: 30px 10px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 400px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.card { position: relative; display: block; width: 100%; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s; text-align: left; }
.card:active { transform: scale(.97); }
.card-art { position: relative; aspect-ratio: 1; }
.card .thumb { width: 100%; height: 100%; display: block; }
.card-bar { position: absolute; left: 10px; right: 10px; bottom: 9px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .12); overflow: hidden; }
.card-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 3px; }
.card-ok { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-s); }
.card-ok .ic { width: 18px; height: 18px; }
.card-lock { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 55%, transparent); color: var(--ink2); }
.card-badge { position: absolute; left: 7px; top: 7px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--card); font-weight: 800; font-size: 13px; display: grid; place-items: center; padding: 0 6px; box-shadow: var(--shadow-s); }
.card-time { position: absolute; left: 7px; bottom: 7px; height: 22px; padding: 0 7px 0 5px; border-radius: 11px; background: color-mix(in srgb, var(--card) 90%, transparent); color: var(--ink2); font-weight: 800; font-size: 11.5px; display: flex; align-items: center; gap: 3px; box-shadow: var(--shadow-s); }
.card-time[hidden] { display: none; }
.card-fav { position: absolute; left: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--ink3); box-shadow: var(--shadow-s); cursor: pointer; }
.card-fav .ic { width: 17px; height: 17px; }
.card-fav.on { color: #ff5a7a; }
.card-fav.on .ic svg, .fav-btn.on .ic svg { fill: currentColor; }
.fav-btn { flex: none; padding-left: 14px; padding-right: 14px; }
.fav-btn.on { color: #ff5a7a; }
.card-time .ic { width: 13px; height: 13px; }
.card.small .card-time { left: 5px; bottom: 5px; height: 19px; font-size: 10.5px; padding: 0 6px 0 4px; }
.transfer-tile .set-row b { font-weight: 800; }
.transfer-tile p { margin: 4px 0 12px; font-size: 14px; }
.transfer-tile .row .btn { padding: 0 10px; font-size: 15px; white-space: nowrap; }
.transfer h2 { margin: 0 0 12px; font-size: 19px; }
.transfer textarea { width: 100%; box-sizing: border-box; border-radius: 16px; padding: 12px; font: 12px/1.35 ui-monospace, Menlo, monospace; background: var(--bg); color: var(--ink); border: 1px solid var(--line); resize: none; word-break: break-all; margin-bottom: 12px; }
.tr-err { color: #e5484d; font-weight: 700; font-size: 14px; margin: -4px 0 12px; }
.tr-err[hidden] { display: none; }
.card-myst { position: absolute; inset: 0; display: grid; place-items: center; font: 900 64px/1 var(--font); color: color-mix(in srgb, var(--accent2) 55%, transparent); pointer-events: none; }
.card.small .card-myst { font-size: 44px; }
.myst-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mystery p { margin: 2px 0 12px; font-size: 14px; }
.mystery .sub .count .reward { font-size: 13px; }
.card-cap { display: block; text-align: center; font-weight: 700; font-size: 12px; color: var(--ink2); padding: 6px 0 8px; }
.card.small { border-radius: 16px; box-shadow: var(--shadow-s); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 24px; border-radius: 25px; font-weight: 800; font-size: 16px; transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #ff8e53); color: #fff; box-shadow: 0 6px 16px rgba(255, 111, 97, .32); }
.btn.ghost { background: var(--card); box-shadow: var(--shadow-s); }
.btn.danger { background: #e5484d; color: #fff; }
.btn.small { height: 38px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn .ic { width: 20px; height: 20px; }
.danger-t { color: #e5484d; margin-top: 18px; width: 100%; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 16px; font-weight: 800; font-size: 14px; background: var(--line); }
.pill .ic { width: 18px; height: 18px; }
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, var(--card)); color: var(--ok); }
.pill.gold { background: color-mix(in srgb, var(--gold) 22%, var(--card)); color: #b7791f; }
.pill.fire { background: color-mix(in srgb, #ff7a45 18%, var(--card)); color: #e8590c; }
.pill.ice { background: color-mix(in srgb, #4aa3df 16%, var(--card)); color: #1f78b4; }
.pill.lvup { background: color-mix(in srgb, var(--accent2) 16%, var(--card)); color: var(--accent2); }
.reward { display: inline-flex; gap: 8px; }
.rw { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; }
.rw .ic { width: 18px; height: 18px; }
.rw-drops .ic { color: #3fb5cf; } .rw-bomb .ic { color: #ff7a45; } .rw-fill .ic { color: var(--accent2); } .rw-xp .ic { color: var(--gold); }
.btn.primary .rw .ic { color: #fff; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink2); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty > .ic { width: 56px; height: 56px; color: var(--accent); }
.q-bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.q-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 4px; transition: width .4s; }
.pip svg { display: block; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-2deg); } }

/* ---------- story ---------- */
.hero { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #fff4e3, #ffe6ee); border-radius: 26px; padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 18px; }
:root[data-theme="night"] .hero { background: linear-gradient(135deg, #2d3247, #3b2f46); }
.hero-pip { flex: 0 0 auto; animation: bob 3s ease-in-out infinite; }
.hero-talk { flex: 1; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-width: 0; }
.bubble { background: var(--card); border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-weight: 600; font-size: 15px; line-height: 1.35; box-shadow: var(--shadow-s); }
.chapters { display: flex; flex-direction: column; gap: 14px; }
.chapter { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 14px; border-top: 5px solid var(--tint, var(--line)); }
.chapter.locked .ch-pics { opacity: .6; }
.chapter.soon { opacity: .6; border-top-color: var(--line); }
.ch-head { display: flex; align-items: center; gap: 12px; }
.ch-ic { width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--tint, var(--ink3)) 18%, var(--card)); color: var(--tint, var(--ink3)); display: grid; place-items: center; flex: 0 0 auto; }
.ch-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ch-t small { color: var(--ink2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.ch-t b { font-size: 18px; font-weight: 800; }
.ch-n { font-weight: 800; color: var(--ink2); font-size: 14px; white-space: nowrap; }
.ch-bar { height: 6px; border-radius: 3px; background: var(--line); margin: 12px 0; overflow: hidden; }
.ch-bar i { display: block; height: 100%; background: var(--tint); border-radius: 3px; }
.ch-lock { color: var(--ink2); font-size: 14px; margin: 0 0 10px; }
.ch-pics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 760px) { .ch-pics { grid-template-columns: repeat(8, 1fr); } }

/* ---------- daily ---------- */
.today { display: flex; gap: 16px; align-items: center; background: var(--card); border-radius: 26px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 14px; }
.today .card.big { flex: 0 0 min(46%, 260px); box-shadow: var(--shadow-s); }
.today-t { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.today-t small { color: var(--accent); font-weight: 800; text-transform: capitalize; }
.today-t b { font-size: 22px; font-weight: 900; }
.today-t p { margin: 0 0 6px; color: var(--ink2); }
@media (max-width: 480px) {
  .today { flex-direction: column; align-items: stretch; }
  .today .card.big { flex: none; width: 100%; }
  .today-t { align-items: center; text-align: center; }
  .today-t .btn { align-self: stretch; }
}
.streak { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.flame { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--line); color: var(--ink3); }
.streak.lit .flame { background: linear-gradient(160deg, #ffb347, #ff6a3d); color: #fff; }
.flame .ic { width: 30px; height: 30px; }
.streak b { font-size: 26px; font-weight: 900; display: block; line-height: 1; }
.streak small { color: var(--ink2); font-weight: 700; }
.week { display: flex; gap: 6px; margin-left: auto; }
.wd { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--line); color: var(--ink2); text-transform: uppercase; }
.wd.on { background: #ff8a3d; color: #fff; }
.wd.now { box-shadow: 0 0 0 2px var(--accent); }
.streak .best { width: 100%; text-align: right; }
.streak .freeze { width: 100%; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); color: #1f78b4; font-weight: 800; }
.streak .freeze .ic { width: 20px; height: 20px; }
.streak .freeze small { grid-column: 2; font-weight: 600; }
.ladder { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 12px; }
.rung { border-radius: 12px; background: var(--bg); padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.rung small { color: var(--ink2); font-weight: 700; font-size: 10px; white-space: nowrap; }
.rung .reward { flex-direction: column; gap: 2px; }
.rung .rw { font-size: 12px; } .rung .rw .ic { width: 15px; height: 15px; }
.rung.got { opacity: .4; }
.rung.cur { background: color-mix(in srgb, var(--accent) 14%, var(--card)); box-shadow: 0 0 0 2px var(--accent); }
.rung.gold { background: color-mix(in srgb, var(--gold) 20%, var(--card)); }
.gift .btn { width: 100%; }
.gift > small { display: block; text-align: center; }
.quest { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.quests .sub + .quest { border-top: 0; }
.q-t { flex: 1; display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 15px; min-width: 0; }
.q-t small { color: var(--ink2); font-size: 12px; }
.quest.claimed { opacity: .55; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.hscroll .card { flex: 0 0 120px; width: 120px; }

/* ---------- profile ---------- */
.level { display: flex; align-items: center; gap: 16px; }
.lv-ring { width: 76px; height: 76px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; flex: 0 0 auto; }
.lv-ring b { width: 62px; height: 62px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 26px; font-weight: 900; }
.lv-t { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.lv-t b { font-size: 20px; font-weight: 900; } .lv-t small { color: var(--ink2); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.stat { background: var(--card); border-radius: 18px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow-s); }
.stat b { display: block; font-size: 20px; font-weight: 900; } .stat small { color: var(--ink2); font-size: 12px; font-weight: 700; }
@media (max-width: 420px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.ach { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 18px; padding: 12px; box-shadow: var(--shadow-s); }
.ach-ic { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; background: var(--line); color: var(--ink3); font-weight: 900; font-size: 20px; flex: 0 0 auto; }
.ach.t-bronze .ach-ic { background: linear-gradient(150deg, #f0b27a, #c97d3e); color: #fff; }
.ach.t-silver .ach-ic { background: linear-gradient(150deg, #e3e7ee, #a2acbc); color: #fff; }
.ach.t-gold .ach-ic { background: linear-gradient(150deg, #ffe08a, #f5b400); color: #fff; }
.ach.t-diamond .ach-ic { background: linear-gradient(150deg, #a5f3fc, #7c5cff); color: #fff; }
.ach-t { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ach-t b { font-size: 15px; } .ach-t small { color: var(--ink2); font-size: 13px; }
.ach.hidden { opacity: .7; }
.medals { display: flex; flex-direction: column; gap: 3px; }
.medals i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.medals .m-bronze { background: #d08a4b; } .medals .m-silver { background: #a2acbc; } .medals .m-gold { background: #f5b400; } .medals .m-diamond { background: #7c5cff; }
.settings { display: flex; flex-direction: column; padding: 4px 16px; }
.set-row { display: flex; align-items: center; gap: 12px; min-height: 54px; font-weight: 700; }
.set-row > span:not(.ic) { flex: 1; }
.set-row > .ic { color: var(--ink2); }
.set-col { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.set-col + .set-col { border-top: 0; }
.seg { display: flex; background: var(--bg); border-radius: 14px; padding: 3px; }
.seg button { padding: 8px 12px; border-radius: 11px; font-weight: 700; font-size: 14px; color: var(--ink2); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow-s); }
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 440px; }
.theme { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); font-weight: 700; }
.theme i { width: 100%; aspect-ratio: 1.4; border-radius: 14px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.theme.on i { box-shadow: 0 0 0 3px var(--accent); }
.tog { width: 52px; height: 32px; border-radius: 16px; background: var(--line); position: relative; transition: background .2s; flex: 0 0 auto; }
.tog i { position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-s); transition: transform .2s; }
.tog.on { background: var(--ok); } .tog.on i { transform: translateX(20px); }
.ver { text-align: center; font-size: 12px; margin: 14px 0; }

/* ---------- avatar, profile card, account ---------- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; background: var(--av, #dff3e4); overflow: hidden; flex: 0 0 auto; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .05); }
.avatar svg { width: 100%; height: 100%; display: block; }
.av-rainbow { background: conic-gradient(from 200deg, #ffe0dc, #fff2c7, #dcf5d9, #d7f1f8, #e6defc, #ffe0ec, #ffe0dc); }
.tab .tab-av { width: 26px; height: 26px; display: grid; place-items: center; }
.tab .tab-av .avatar { box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--line); transition: transform .2s; }
.tab.on .tab-av .avatar { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent); transform: scale(1.06); }
.me { display: flex; align-items: center; gap: 16px; padding: 18px 16px; background: linear-gradient(140deg, color-mix(in srgb, var(--av-tint, #ffd6cf) 50%, var(--card)), var(--card) 70%); }
.me-av { position: relative; flex: 0 0 auto; border-radius: 50%; transition: transform .15s; }
.me-av:active { transform: scale(.95); }
.me-av .lv-ring { width: 100px; height: 100px; }
.me-av .avatar { animation: bob 3.2s ease-in-out infinite; }
.me-lv { position: absolute; left: -2px; bottom: 0; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px; background: linear-gradient(135deg, #ffd166, var(--gold)); color: #6b4300; display: grid; place-items: center; font-weight: 900; font-size: 16px; box-shadow: 0 0 0 3px var(--card); }
.me-pen { position: absolute; right: -2px; bottom: 2px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent2); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--card); }
.me-pen .ic { width: 17px; height: 17px; }
.me-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.me-t > small { color: var(--ink2); font-weight: 600; }
.me-name { display: flex; align-items: center; gap: 6px; text-align: left; font-size: 21px; font-weight: 900; line-height: 1.2; }
.me-name b { overflow-wrap: anywhere; }
.me-name .ic { width: 17px; height: 17px; color: var(--ink3); flex: 0 0 auto; }
.cloud-in { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; background: linear-gradient(150deg, color-mix(in srgb, #a3ccff 30%, var(--card)), var(--card) 75%); }
.ci-art { position: relative; width: 56px; height: 56px; border-radius: 18px; background: #fff; display: grid; place-items: center; color: #5aa9e6; box-shadow: var(--shadow-s); }
.ci-art > .ic { width: 34px; height: 34px; }
.ci-art .ci-heart { position: absolute; width: 16px; height: 16px; left: 20px; top: 23px; color: var(--accent); }
.ci-heart svg { fill: currentColor; }
.ci-t b { font-size: 17px; font-weight: 900; }
.ci-t p { margin: 4px 0 0; font-size: 14px; line-height: 1.4; }
.cloud-in .g-btn { grid-column: 1 / -1; margin-top: 8px; }
.ci-note { grid-column: 1 / -1; text-align: center; font-size: 12px; }
.g-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 50px; border-radius: 25px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font: 600 16px/1 Roboto, var(--font); box-shadow: var(--shadow-s); transition: transform .12s; }
.g-btn:active { transform: scale(.97); }
.g-btn:disabled { opacity: .6; }
.cloud-me { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 16px; }
.cm-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, #5aa9e6 16%, var(--card)); color: #3f86c4; flex: 0 0 auto; }
.cm-ic.busy .ic { animation: bob 1.2s ease-in-out infinite; }
.cm-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cm-t small { color: var(--ink2); font-size: 13px; }
.cm-go { color: var(--ink3); }
.days-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.days-h b { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.days-h b .ic { color: var(--accent); width: 20px; height: 20px; }
.days-g { display: flex; gap: 8px; }
.days-l { display: grid; grid-template-rows: repeat(7, 1fr); gap: 4px; flex: 0 0 auto; font-size: 10px; font-weight: 700; color: var(--ink3); width: 16px; }
.days-l small { line-height: 1; align-self: center; }
.days-c { flex: 1; display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 24px); gap: 4px; }
.days-c i { aspect-ratio: 1; border-radius: 35%; background: var(--line); opacity: .7; }
.days-c i.on { opacity: 1; transform: rotate(-8deg); border-radius: 45% 55% 50% 40%; }
.days-c .c0 { background: #ff8a7a; } .days-c .c1 { background: #ffc94d; } .days-c .c2 { background: #7bc96f; } .days-c .c3 { background: #5aa9e6; } .days-c .c4 { background: #a08ae6; }
.days-c i.now { box-shadow: 0 0 0 2px var(--accent); }
.days > small { display: block; margin-top: 10px; }
.sheet.look-sheet { max-width: 560px; }
.look h2 { margin: 0 0 10px; text-align: center; font-size: 22px; font-weight: 900; }
.look-prev { display: grid; place-items: center; margin-bottom: 14px; }
.look-prev .avatar { animation: bob 3s ease-in-out infinite; box-shadow: var(--shadow); }
.look-tabs { width: max-content; margin: 0 auto 14px; }
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.look-it { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 18px; background: var(--bg); transition: transform .12s; }
.look-it:active { transform: scale(.95); }
.look-it small { font-size: 12px; font-weight: 700; color: var(--ink2); text-align: center; line-height: 1.2; }
.look-it.on { background: color-mix(in srgb, var(--accent) 14%, var(--card)); box-shadow: inset 0 0 0 2px var(--accent); }
.look-it.on small { color: var(--ink); }
.look-it.locked .avatar { filter: grayscale(1) opacity(.45); }
.look-lock { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--card); display: grid; place-items: center; color: var(--ink3); box-shadow: var(--shadow-s); }
.look-lock .ic { width: 14px; height: 14px; }
.look-it.nope { animation: nope .35s; }
@keyframes nope { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.look-hint { min-height: 22px; margin: 12px 0 0; text-align: center; font-weight: 700; color: var(--accent2); }
.nick { display: flex; flex-direction: column; align-items: center; text-align: center; }
.nick h2 { margin: 12px 0 4px; font-size: 20px; }
.nick p { margin: 0 0 14px; font-size: 14px; }
.nick-in { width: 100%; height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); padding: 0 16px; font: 700 18px var(--font); text-align: center; }
.nick-in:focus { outline: none; border-color: var(--accent); }
.t-look { display: inline-flex; align-items: center; gap: 10px; text-align: left; }
.sheet.acct-sheet { max-width: 480px; }
.acct-top { display: flex; align-items: center; gap: 14px; margin: 0 40px 16px 0; }
.acct-top b { display: block; font-size: 19px; font-weight: 900; }
.acct-top small { overflow-wrap: anywhere; }
.acct-box { background: var(--bg); border-radius: 18px; padding: 12px 14px; }
.acct-row { display: flex; align-items: center; gap: 12px; }
.acct-d { font-size: 13px; margin: 10px 0 0; line-height: 1.4; }
.acct h3 { font-size: 15px; margin: 18px 0 6px; color: var(--ink2); }
.devs > .btn.link { margin-top: 4px; }
.dev { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dev-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; color: var(--ink2); flex: 0 0 auto; }
.dev-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dev-t small { font-size: 12.5px; }
.dev .btn.link { margin: 0; padding: 0 4px; height: 36px; }
.acct-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.acct-btns .btn { padding: 0 12px; font-size: 15px; color: var(--ink); text-decoration: none; }
.acct-del { width: 100%; justify-content: center; }
@media (max-width: 380px) { .acct-btns { grid-template-columns: 1fr; } .me { gap: 12px; } .me-av .lv-ring { width: 88px; height: 88px; } }

/* profile: header gear, showcase, freezes, passport, medals first, settings sheet */
.scr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gear-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-s); display: grid; place-items: center; color: var(--ink2); margin-bottom: 10px; transition: transform .15s; }
.gear-btn:active { transform: rotate(40deg) scale(.95); }
.gear-btn .ic { width: 22px; height: 22px; }
.me { flex-wrap: wrap; }
.me-show { flex: 1 0 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 18px; background: color-mix(in srgb, var(--card) 70%, transparent); text-align: left; }
.me-show > small { margin-left: auto; font-weight: 700; }
.me-show.empty > small { margin-left: 4px; }
.stk { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: 0 0 auto; background: var(--line); box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(40, 30, 60, .18); transform: rotate(-6deg); }
.stk:nth-child(2) { transform: rotate(5deg); } .stk:nth-child(3) { transform: rotate(-2deg); }
.stk .ic { width: 22px; height: 22px; }
.stk.none { background: transparent; box-shadow: inset 0 0 0 2px var(--line); transform: none; }
.stk.t-bronze { background: linear-gradient(150deg, #f0b27a, #c97d3e); } .stk.t-silver { background: linear-gradient(150deg, #e3e7ee, #a2acbc); }
.stk.t-gold { background: linear-gradient(150deg, #ffe08a, #f5b400); } .stk.t-diamond { background: linear-gradient(150deg, #a5f3fc, #7c5cff); }
.stk.big { width: 56px; height: 56px; } .stk.big .ic { width: 28px; height: 28px; }
.show h2 { margin: 0 40px 4px 0; font-size: 22px; font-weight: 900; }
.show p { margin: 0 0 14px; font-size: 14px; }
.show-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.show-it { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px 10px; border-radius: 18px; background: var(--bg); }
.show-it small { font-size: 12px; font-weight: 700; color: var(--ink2); text-align: center; line-height: 1.2; }
.show-it.on { background: color-mix(in srgb, var(--accent) 14%, var(--card)); box-shadow: inset 0 0 0 2px var(--accent); }
.show-n { position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; display: grid; place-items: center; }
.ci-btns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.ci-btns .g-btn { margin: 0; flex: 1 1 220px; width: auto; }
.ci-btns .btn { flex: 1 0 auto; width: auto; height: 50px; padding: 0 22px; }
.talk .ci-btns { margin: 0; }
.cloud-thin { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; text-align: left; }
.cloud-thin .cm-ic { width: 34px; height: 34px; border-radius: 12px; }
.cloud-thin b { flex: 1; font-size: 15px; }
.days-st { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.days .days-h { flex-wrap: wrap; row-gap: 8px; }
.days-fire, .days-ice { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 14px; }
.days-fire { background: color-mix(in srgb, #ff9f43 18%, var(--card)); color: #d9661f; }
.days-ice { background: color-mix(in srgb, #5aa9e6 16%, var(--card)); color: #3f86c4; }
.days-st .ic { width: 15px; height: 15px; }
.days-c i.ice { opacity: 1; background: #d6ebfb; position: relative; }
.days-c i.ice::after { content: ''; position: absolute; inset: 28%; border-radius: 50%; background: radial-gradient(circle, #fff 35%, #8cc4ee 36% 60%, transparent 61%); }
.stats .stat b { font-variant-numeric: tabular-nums; }
.passport { padding-bottom: 12px; }
.pp-g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stamp { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 44px; padding: 10px 2px 8px; border-radius: 18px; background: var(--bg); text-align: center; transition: transform .12s; }
.stamp:active { transform: scale(.95); }
.st-ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px color-mix(in srgb, var(--c) 45%, transparent); transform: rotate(-8deg); }
.st-ic .ic { width: 24px; height: 24px; }
.stamp small { font-size: 11px; font-weight: 800; line-height: 1.15; color: var(--ink2); overflow-wrap: anywhere; }
.stamp em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ink3); }
.stamp.on em { color: var(--c); }
.stamp.part .st-ic { background: color-mix(in srgb, var(--c) 35%, var(--card)); color: var(--c); box-shadow: 0 0 0 2px var(--c) inset; transform: none; }
.stamp.fog .st-ic { background: transparent; color: var(--ink3); box-shadow: inset 0 0 0 2px var(--line); transform: none; opacity: .7; }
.stamp.fog small { color: var(--ink3); }
.stamp.big { background: none; padding: 0; margin: 0 auto 8px; }
.stamp.big .st-ic { width: 84px; height: 84px; } .stamp.big .st-ic .ic { width: 42px; height: 42px; }
.pp-sheet-in { display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.pp-sheet-in h2 { margin: 4px 0; font-size: 22px; font-weight: 900; }
.pp-sheet-in > p { margin: 0 0 10px; }
.pp-sheet-in h3 { font-size: 15px; margin: 18px 0 8px; color: var(--ink2); }
.pp-gifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.sub2 { font-size: 14px; font-weight: 800; color: var(--ink2); margin: 4px 0 8px; text-transform: none; }
.achs.near { margin-bottom: 16px; }
.achs.near .ach { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--gold) 45%, transparent), var(--shadow-s); }
.btn.wide { width: 100%; }
.tr-easy { background: color-mix(in srgb, #5aa9e6 12%, var(--card)); border-radius: 16px; padding: 10px 12px 12px; margin: 8px 0 4px; }
.tr-easy p { margin: 0 0 8px; font-weight: 700; font-size: 14px; }
.danger-box { margin-top: 22px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.danger-box > small { color: var(--ink3); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.sheet.set-sheet { max-width: 560px; }
.set-sheet-in h2 { display: flex; align-items: center; gap: 8px; margin: 0 40px 12px 0; font-size: 22px; font-weight: 900; }
.set-sheet-in h2 .ic { color: var(--accent); }
.set-sheet-in .tile { box-shadow: none; background: var(--bg); }
.so .col { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.so .muted { font-size: 14px; font-weight: 500; margin-top: 0; }
@media (max-width: 380px) { .pp-g { gap: 6px; } .st-ic { width: 40px; height: 40px; } }
@media (prefers-reduced-motion: reduce) {
  .profile *, .look-sheet *, .show-sheet *, .pp-sheet *, .acct-sheet *, .talk-sheet * { animation: none !important; transition: none !important; }
}

.ia-link { width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); margin: 4px 0 12px; }
.confirm.ia .btn { width: 100%; justify-content: center; }
/* ---------- sheets ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 18, 30, .45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .25s; }
.backdrop.in { opacity: 1; }
.sheet { position: relative; background: var(--card); width: 100%; max-width: 520px; border-radius: 28px 28px 0 0; padding: 24px 20px calc(20px + var(--sb)); max-height: 92vh; overflow-y: auto; transform: translateY(40px); transition: transform .3s cubic-bezier(.2, .9, .3, 1.1); }
.backdrop.in .sheet { transform: none; }
@media (min-width: 600px) { .backdrop { align-items: center; } .sheet { border-radius: 28px; padding-bottom: 22px; } }
.sheet-x { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; z-index: 2; }
.sheet-x .ic { width: 18px; height: 18px; }
.row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; width: 100%; }
.row .btn { flex: 1; }
.confirm p { font-size: 17px; font-weight: 600; margin: 8px 34px 4px 0; line-height: 1.4; }
.done-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.done-card h2 { margin: 8px 0 0; font-size: 28px; font-weight: 900; }
.done-card > p { margin: 0; }
.tl-wrap { position: relative; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.tl-wrap canvas { width: 100%; height: 100%; display: block; }
.tl-re { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; }
.tl-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tl-ctl { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.tl-seg button { padding: 7px 10px; font-size: 13px; }
.tl-vid { padding: 8px 12px; font-size: 14px; }
.tl-vid.busy { opacity: .7; pointer-events: none; animation: armed 1.2s ease-in-out infinite; }
.tl-spd { min-width: 52px; padding: 8px 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hls .theme i { aspect-ratio: 2.2; }
.done-stats { display: flex; gap: 16px; color: var(--ink2); font-weight: 700; }
.done-stats span { display: inline-flex; align-items: center; gap: 5px; } .done-stats .ic { width: 18px; height: 18px; }
.done-rw { display: flex; gap: 14px; font-size: 18px; padding: 6px 14px; border-radius: 16px; background: var(--bg); }
.done-ach { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.ach-new { display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--gold) 16%, var(--card)); border-radius: 14px; padding: 8px 12px; text-align: left; }
.ach-new .ic { color: #d99a00; } .ach-new small { display: block; color: var(--ink2); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.pip-say { display: flex; align-items: flex-end; gap: 6px; text-align: left; width: 100%; margin-top: 6px; }
.pip-say .bubble { flex: 1; background: var(--bg); box-shadow: none; }
.talk { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.talk h2 { margin: 0; text-align: center; font-size: 24px; font-weight: 900; }
.talk-row { display: flex; align-items: flex-end; gap: 8px; }
.talk-row .pip { animation: bob 3s ease-in-out infinite; flex: 0 0 auto; }
.bubble.big { flex: 1; font-size: 17px; background: var(--bg); min-height: 84px; box-shadow: none; }
.bubble.big p { margin: 4px 0 0; }
.bubble small { color: var(--accent); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.talk .reward { justify-content: center; font-size: 18px; }
.shop h2 { display: flex; align-items: center; gap: 8px; margin: 0 44px 4px 0; }
.shop h2 b { margin-left: auto; }
.shop h2 .ic { color: #3fb5cf; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.shop-ic { width: 50px; height: 50px; border-radius: 16px; background: var(--bg); display: grid; place-items: center; color: var(--accent); flex: 0 0 auto; }
.shop-t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.shop-t small { color: var(--ink2); font-size: 13px; }

/* postcards */
.btn.link { background: none; box-shadow: none; color: var(--ink2); font-weight: 700; margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; }
.btn.link .ic { width: 18px; height: 18px; }
.sheet.pc { max-width: 460px; }
.postcard { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.postcard h2 { margin: 0; }
.pc-prev { width: min(100%, 300px); height: auto; aspect-ratio: 4 / 5; border-radius: 14px; box-shadow: var(--shadow-s); }
.pc-frames { display: flex; gap: 10px; }
.pc-fr { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--d) 0 22%, var(--c) 23%); box-shadow: var(--shadow-s); border: 3px solid transparent; }
.pc-fr.on { border-color: var(--ink); }
.pc-msgs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pc-msgs .chip { padding: 7px 12px; font-size: 14px; }
.pc-own { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 15px; }

/* Pip wiggles when tapped */
.hero-pip { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hero-pip.wiggle { animation: wiggle .45s ease; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg) scale(1.04); } 60% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .hero-pip.wiggle { animation: none; } }

/* island map (story screen) */
.isle { position: relative; max-width: 560px; margin: 0 auto 18px; }
.isle-map { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 26px; box-shadow: var(--shadow); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.isle-pip { position: absolute; width: 14%; pointer-events: none; animation: bob 3s ease-in-out infinite; filter: drop-shadow(0 3px 3px rgba(0,0,0,.18)); }
.isle-pip .pip, .isle-pip svg { display: block; width: 100%; height: auto; }
.isle-cap { text-align: center; color: var(--ink2); font-weight: 700; font-size: 14px; margin: 10px 0 0; }
.chapter.flash { animation: chflash 1.3s ease; }
@keyframes chflash { 25%, 60% { box-shadow: 0 0 0 4px var(--tint), var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .isle-pip, .chapter.flash { animation: none; } }
.chapter { scroll-margin-top: 72px; }
.ver a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
