/* The Process Mini App: a dark, game-like character sheet. */

:root {
  --bg: #0a0c11;
  --surface: #141821;
  --surface-2: #1c212d;
  --surface-3: #252b39;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .12);
  --text: #f3f5fa;
  --muted: #8b94a8;
  --faint: #5d6578;
  --accent: #6f7cff;
  --accent-2: #38bdf8;
  --accent-grad: linear-gradient(135deg, #7c6cff 0%, #4f8dff 55%, #38bdf8 100%);
  --xp-grad: linear-gradient(90deg, #38bdf8, #7c6cff);
  --gold: #fbbf24;
  --gold-grad: linear-gradient(135deg, #fde68a, #f59e0b);
  --ok: #34d399;
  --danger: #f87171;
  --radius: 18px;
  --radius-sm: 12px;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(111, 124, 255, .16), transparent 60%),
    var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 16px);
}
main { max-width: 520px; margin: 0 auto; padding: 14px 16px 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

/* ---------- type ---------- */
h2 {
  margin: 26px 2px 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.title { font-weight: 650; word-break: break-word; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.card + .card, .stack > * + * { margin-top: 10px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 14px;
}
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .sub { font-size: 13px; color: var(--muted); }
.empty {
  text-align: center; color: var(--muted); padding: 26px 18px;
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.empty .ico-big { width: 44px; height: 44px; margin: 0 auto 10px; color: var(--faint); }

/* emoji in a rounded tile */
.tile {
  flex: none; width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; font-size: 21px;
  background: var(--surface-2); border: 1px solid var(--line);
}

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border-radius: 15px;
  font-size: 16px; font-weight: 650; letter-spacing: .01em;
  transition: transform .12s ease, opacity .15s ease, background .15s ease;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }
.btn.full { width: 100%; }
.btn.primary { background: var(--accent-grad); color: #fff; box-shadow: 0 8px 24px -10px rgba(111, 124, 255, .8); }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); }
.btn.ghost { background: transparent; color: var(--muted); height: 40px; padding: 0 10px; font-size: 14px; font-weight: 550; }
.btn.danger { background: rgba(248, 113, 113, .12); color: var(--danger); border: 1px solid rgba(248, 113, 113, .25); }
.btn.small { height: 36px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn.small svg { width: 16px; height: 16px; }
.btn.icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.btn.icon svg { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.added { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-size: 13px; font-weight: 600; }
.added svg { width: 16px; height: 16px; }

svg.i { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- progress ---------- */
.bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--xp-grad); transition: width .5s ease; }
.bar.done > i { background: var(--gold-grad); }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.gold { color: #1a1300; background: var(--gold-grad); border: 0; }
.pill.accent { color: #fff; background: rgba(111, 124, 255, .22); border-color: rgba(111, 124, 255, .35); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  padding: 18px; border-radius: 22px;
  background: linear-gradient(160deg, #1d2233 0%, #141822 70%);
  border: 1px solid var(--line-strong);
}
.hero::after {
  content: ""; position: absolute; inset: -40% -30% auto auto; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(124, 108, 255, .35), transparent 70%); pointer-events: none;
}
.ring { position: relative; flex: none; width: 92px; height: 92px; }
.ring svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, .08); }
.ring .value { stroke: url(#xp); transition: stroke-dashoffset .6s ease; }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .num b { display: block; font-size: 30px; line-height: 1; font-weight: 800; }
.ring .num small { display: block; font-size: 10px; letter-spacing: .1em; color: var(--muted); margin-top: 3px; }
.hero .who { min-width: 0; flex: 1; position: relative; z-index: 1; }
.hero .name { font-size: 20px; font-weight: 750; word-break: break-word; }
.hero .rank { margin: 6px 0 10px; }
.hero .to-next { font-size: 13px; color: var(--muted); margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.stat svg { width: 20px; height: 20px; }
.stat.fire svg { color: #fb923c; }
.stat.film svg { color: var(--accent-2); }
.stat.eye svg { color: #c084fc; }
.stat b { font-size: 22px; line-height: 1; font-weight: 800; }
.stat span { font-size: 12px; color: var(--muted); }

.actions { display: grid; gap: 10px; margin-top: 14px; }

/* ---------- skills ---------- */
.skill { display: flex; gap: 12px; align-items: center; }
.skill .grow { flex: 1; min-width: 0; }
.skill .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.skill .meta { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* ---------- days ---------- */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day {
  aspect-ratio: 1; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--faint);
}
.day small { display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.day.on { background: var(--accent-grad); border-color: transparent; color: #fff; font-weight: 700; }
.day.on small { color: rgba(255, 255, 255, .75); }

/* ---------- inputs ---------- */
.input, select.input, textarea.input {
  width: 100%; height: 48px; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px;
  outline: none; transition: border-color .15s ease;
}
textarea.input { height: auto; padding: 12px 14px; resize: none; line-height: 1.4; }
.input:focus { border-color: var(--accent); }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: var(--muted); }
.search .input { padding-left: 44px; }
.label { font-size: 13px; color: var(--muted); margin: 14px 2px 8px; }
.label:first-child { margin-top: 0; }

/* horizontal chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 99px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); font-size: 14px; font-weight: 550;
  transition: background .15s ease, border-color .15s ease;
}
.chip.on { background: rgba(111, 124, 255, .2); border-color: var(--accent); color: #fff; }

/* segmented control */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; }
.segmented button { height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.segmented button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .value { flex: 1; text-align: center; font-size: 26px; font-weight: 800; }
.stepper .value small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.stepper .btn.icon { width: 50px; height: 50px; border-radius: 14px; color: var(--text); }

/* settings rows with a native select */
.select-wrap { position: relative; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.select-wrap select {
  appearance: none; -webkit-appearance: none; background: transparent; border: 0; outline: none;
  color: var(--accent-2); font-weight: 600; text-align: right; text-align-last: right; padding-right: 2px; max-width: 170px; cursor: pointer;
}
.select-wrap svg { width: 16px; height: 16px; }
.row-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.row-ico svg { width: 18px; height: 18px; }
.row-ico.blue { background: linear-gradient(135deg, #4f8dff, #6f7cff); }
.row-ico.orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.row-ico.teal { background: linear-gradient(135deg, #2dd4bf, #0ea5e9); }

/* ---------- challenges and badges ---------- */
.dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.dots i { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.dots i.on { background: var(--xp-grad); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge {
  position: relative; text-align: center; padding: 14px 6px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
}
.badge .emoji { width: 50px; height: 50px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 25px;
  background: var(--surface-2); filter: grayscale(1); opacity: .45; }
.badge.on .emoji { filter: none; opacity: 1; background: radial-gradient(circle at 30% 30%, rgba(253, 230, 138, .35), rgba(245, 158, 11, .12)); box-shadow: 0 0 0 2px rgba(251, 191, 36, .55); }
.badge b { display: block; font-size: 12px; line-height: 1.25; }
.badge span { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.25; }
.badge .lock { position: absolute; top: 8px; right: 8px; width: 14px; height: 14px; color: var(--faint); }

.path { display: flex; gap: 12px; align-items: flex-start; }
.path .grow { flex: 1; min-width: 0; }
.path .blurb { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- camera ---------- */
.cam { margin: -14px -16px 0; padding: 14px 16px 0; }
.viewfinder {
  position: relative; overflow: hidden; border-radius: 26px;
  aspect-ratio: 3 / 4; max-height: calc(100vh - 290px); width: 100%;
  background: radial-gradient(100% 80% at 50% 30%, #1b2030, #07080b);
  border: 1px solid var(--line-strong);
}
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.viewfinder video.mirror { transform: scaleX(-1); }
.vf-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; color: var(--muted); }
.vf-empty svg { width: 56px; height: 56px; color: var(--faint); }
.vf-top { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.vf-top > * { pointer-events: auto; }
.glass {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px;
  background: rgba(10, 12, 17, .55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .12); color: #fff; font-size: 13px; font-weight: 650;
}
button.glass { cursor: pointer; width: 40px; height: 40px; padding: 0; justify-content: center; }
.glass svg { width: 20px; height: 20px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.vf-busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(7, 8, 11, .6); backdrop-filter: blur(4px); }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: #fff; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

.shutter-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 18px 0 4px; }
.shutter-row .side { display: flex; justify-content: center; }
.round {
  width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line-strong); cursor: pointer;
  background: var(--surface-2); color: var(--text); display: grid; place-items: center;
}
.round svg { width: 22px; height: 22px; }
.round:active { transform: scale(.94); }
.shutter { position: relative; width: 82px; height: 82px; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.shutter svg { position: absolute; inset: 0; width: 82px; height: 82px; transform: rotate(-90deg); }
.shutter .ring-bg { stroke: rgba(255, 255, 255, .9); }
.shutter .ring-fg { stroke: #ef4444; stroke-dasharray: 232.5; stroke-dashoffset: 232.5; }
.shutter.rec .ring-fg { animation: ring 5s linear forwards; }
@keyframes ring { to { stroke-dashoffset: 0; } }
.shutter .core { position: absolute; inset: 9px; border-radius: 50%; background: #ef4444; transition: all .2s ease; }
.shutter.rec .core { inset: 25px; border-radius: 9px; }
.shutter:disabled { opacity: .4; }
.cam-hint { text-align: center; font-size: 13px; color: var(--muted); min-height: 20px; }

.result { text-align: center; padding: 26px 18px 18px; }
.result .check { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, rgba(52, 211, 153, .3), rgba(52, 211, 153, .08)); color: var(--ok); }
.result .check svg { width: 36px; height: 36px; stroke-width: 2.4; }
.result .xp { font-size: 34px; font-weight: 800; background: var(--xp-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result .levelup { margin: 10px auto 0; }
.result .lines { margin: 14px 0 4px; display: grid; gap: 6px; font-size: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 50;
  transform: translate(-50%, -140%); transition: transform .3s cubic-bezier(.2, .9, .3, 1.2);
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 14px;
  display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
  background: rgba(28, 33, 45, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6);
}
.toast.show { transform: translate(-50%, 0); }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--danger); }

/* ---------- tab bar ---------- */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b)); padding: 0 6px var(--safe-b);
  background: rgba(12, 14, 20, .86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  min-width: 0; border: 0; background: none; cursor: pointer; color: var(--faint);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
}
.tab .ico { display: grid; place-items: center; width: 46px; height: 28px; border-radius: 99px; transition: background .2s ease, color .2s ease; }
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--text); }
.tab.on .ico { background: rgba(111, 124, 255, .2); color: #a5b4ff; }
.tab.cam .ico { background: var(--accent-grad); color: #fff; width: 48px; height: 32px; box-shadow: 0 6px 18px -6px rgba(111, 124, 255, .9); }
.tab.cam.on .ico { box-shadow: 0 0 0 2px rgba(255, 255, 255, .25), 0 6px 18px -6px rgba(111, 124, 255, .9); }

/* ---------- misc ---------- */
.splash { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: var(--muted); }
a.btn { text-decoration: none; }
.note { font-size: 13px; color: var(--muted); }
.mt { margin-top: 12px; }
h2.first { margin-top: 4px; }
.list-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.hero .bar { position: relative; z-index: 1; }
.cam-btns, .viewfinder + .btn-row { margin: 18px 0 4px; }

/* ================= navigation pages ================= */
.page-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.back { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.back svg { width: 22px; height: 22px; }
.page-title { font-size: 22px; font-weight: 800; }
.tap { cursor: pointer; transition: transform .12s ease; }
.tap:active { transform: scale(.985); }
.chev { width: 18px; height: 18px; color: var(--faint); flex: none; }
.mt-s { margin-top: 6px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; }
.loading { display: grid; place-items: center; padding: 34px 0; }

/* ================= avatar with a level frame ================= */
.avatar { --frame: linear-gradient(135deg, #d6a77a, #8a5a35); position: relative; flex: none; width: 52px; height: 52px; border-radius: 50%; padding: 3px; background: var(--frame); }
.avatar .face { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text); font-weight: 800; font-size: 20px; border: 2px solid var(--bg); }
.avatar .face img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 46px; height: 46px; }
.avatar.md { width: 64px; height: 64px; }
.avatar.md .face { font-size: 26px; }
.avatar.t2 { --frame: linear-gradient(135deg, #f1f5f9, #94a3b8); }
.avatar.t3 { --frame: linear-gradient(135deg, #fde68a, #f59e0b); }
.avatar.t4 { --frame: linear-gradient(135deg, #6ee7b7, #059669); }
.avatar.t5 { --frame: conic-gradient(from 0deg, #f472b6, #a78bfa, #38bdf8, #34d399, #fbbf24, #f472b6); animation: spin-slow 6s linear infinite; }
.avatar.t5 .face { animation: spin-slow 6s linear infinite reverse; }
@keyframes spin-slow { to { transform: rotate(360deg); } }

.ring { position: relative; flex: none; width: 104px; height: 104px; }
.ring svg { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring .avatar.ring-face { position: absolute; inset: 12px; width: 80px; height: 80px; }
.ring .avatar.ring-face .face { font-size: 30px; }
.lvl-badge { position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%); min-width: 30px; height: 24px; padding: 0 8px;
  border-radius: 99px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #1a1300; background: var(--gold-grad);
  border: 2px solid var(--bg); }
.hero .rank { display: flex; gap: 6px; flex-wrap: wrap; }

/* ================= home ================= */
.streak-note, .freeze { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 14px;
  font-size: 13px; background: rgba(251, 146, 60, .1); border: 1px solid rgba(251, 146, 60, .22); color: #fdba74; }
.streak-note svg, .freeze svg { width: 18px; height: 18px; flex: none; }
.freeze { background: rgba(56, 189, 248, .1); border-color: rgba(56, 189, 248, .25); color: #7dd3fc; margin-top: 0; }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.shortcut { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); min-width: 0; }
.shortcut .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shortcut .grow { min-width: 0; flex: 1; }
.sc-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(111, 124, 255, .18); color: #a5b4ff; flex: none; }
.sc-ico svg { width: 20px; height: 20px; }
.quest .q-mark { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.quest.done .q-mark { background: rgba(52, 211, 153, .16); border-color: rgba(52, 211, 153, .4); color: var(--ok); }
.quest.done .q-mark svg { width: 20px; height: 20px; stroke-width: 2.6; }
.quest.done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(139, 148, 168, .5); }
.day.frozen { background: rgba(56, 189, 248, .14); border-color: rgba(56, 189, 248, .35); color: #7dd3fc; }
.queue-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; border-radius: 14px; font-size: 13px;
  background: rgba(111, 124, 255, .12); border: 1px solid rgba(111, 124, 255, .3); }
.queue-banner > svg { width: 22px; height: 22px; color: #a5b4ff; flex: none; }

/* ================= path ================= */
.h-scroll { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }
.video-card { position: relative; flex: none; width: 168px; height: 210px; border-radius: 20px; border: 1px solid var(--line-strong); cursor: pointer;
  padding: 14px; text-align: left; color: #fff; display: flex; flex-direction: column; justify-content: flex-end;
  background: radial-gradient(120% 90% at 20% 0%, rgba(124, 108, 255, .55), transparent 60%), linear-gradient(160deg, #1f2540, #0f121b); }
.vc-play { position: absolute; top: 14px; left: 14px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vc-play svg { width: 18px; height: 18px; margin-left: 2px; }
.vc-kicker { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.vc-title { font-size: 17px; font-weight: 800; margin-top: 2px; }
.vc-sub { font-size: 12px; opacity: .7; margin-top: 2px; }
.day-card { padding: 14px 14px 6px; }
.day-head { display: flex; justify-content: space-between; align-items: center; }
.clip-list { margin-top: 6px; }
.clip-list .list-row { padding: 8px 0; min-height: 48px; }
.clip-list .list-row + .list-row { border-top: 1px solid var(--line); }
.play { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--accent-grad); color: #fff; box-shadow: 0 6px 14px -8px rgba(111, 124, 255, .9); }
.play svg { width: 16px; height: 16px; margin-left: 2px; }
.play:disabled { background: var(--surface-3); box-shadow: none; color: var(--faint); }
.xp-chip { flex: none; font-size: 13px; font-weight: 800; color: var(--accent-2); }
.friend-head { display: flex; align-items: center; gap: 12px; }
.friend .sub, .list-row .sub { font-size: 13px; color: var(--muted); }
.friend-video { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.friend-video .list-row { padding: 6px 0; min-height: 0; }
.reactions { display: flex; gap: 8px; margin: 4px 0 4px 50px; }
.react { height: 34px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; font-size: 16px; color: var(--text); transition: transform .12s ease; }
.react b { font-size: 12px; }
.react.on { background: rgba(111, 124, 255, .22); border-color: var(--accent); }
.react:active { transform: scale(.92); }

/* ================= skill page ================= */
.skill-hero { padding: 16px; }
.skill-hero .skill { margin-bottom: 12px; }
.tile.big { width: 60px; height: 60px; border-radius: 18px; font-size: 30px; }
.big-title { font-size: 21px; font-weight: 800; }
.skill-hero .rank { display: flex; gap: 6px; margin-top: 6px; }
.stats.four { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats.four .stat { padding: 10px 8px; }
.stats.four .stat b { font-size: 19px; }
.stats.four .stat span { font-size: 11px; line-height: 1.2; }
svg.chart { width: 100%; height: 90px; margin-top: 10px; }
svg.chart rect.on { fill: url(#xp); fill: #6f7cff; }
svg.chart rect.off { fill: rgba(255, 255, 255, .07); }

/* ================= play: month ================= */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-title { font-size: 18px; font-weight: 800; }
.month .stats.four { margin-top: 0; }
.top-skills { margin-top: 12px; font-weight: 600; }

/* ================= profile ================= */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 4px 2px 0; }
.profile-head .name { font-size: 20px; font-weight: 800; }
.profile-head .sub { color: var(--muted); font-size: 14px; }
.tap-row { width: 100%; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }

/* ================= overlays ================= */
.player { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; animation: fade .2s ease; }
.player-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 10px; color: #fff; }
.player-title { font-weight: 700; font-size: 15px; }
.player video { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #000; }
@keyframes fade { from { opacity: 0; } }
.intro { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(16px + var(--safe-b));
  background: radial-gradient(90% 60% at 50% 20%, rgba(124, 108, 255, .35), transparent 70%), rgba(7, 8, 11, .96); animation: fade .25s ease; }
.intro-card { width: 100%; max-width: 480px; text-align: center; }
.intro-art { width: 132px; height: 132px; margin: 0 auto 26px; border-radius: 40px; display: grid; place-items: center; color: #fff;
  background: var(--accent-grad); box-shadow: 0 24px 60px -20px rgba(111, 124, 255, .9); }
.intro-art svg { width: 64px; height: 64px; stroke-width: 1.6; }
.intro-title { font-size: 26px; font-weight: 800; line-height: 1.2; color: #fff; }
.intro-text { color: var(--muted); font-size: 16px; margin: 10px 8px 22px; }
.intro-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 22px; }
.intro-dots i { width: 7px; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .2); transition: width .2s ease; }
.intro-dots i.on { width: 22px; background: #fff; }
.glass.wide { width: auto; padding: 0 12px; gap: 6px; }
.count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; font-weight: 900; color: #fff;
  text-shadow: 0 10px 40px rgba(0, 0, 0, .6); pointer-events: none; }
.count.pop { animation: pop .9s ease; }
@keyframes pop { 0% { transform: scale(1.6); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.9); opacity: .2; } }
#tabs { grid-template-columns: repeat(5, 1fr); }

/* ================= light theme (follows Telegram) ================= */
[data-theme="light"] {
  --bg: #f4f5f9; --surface: #ffffff; --surface-2: #f0f2f7; --surface-3: #e4e8f0;
  --line: rgba(15, 23, 42, .07); --line-strong: rgba(15, 23, 42, .12);
  --text: #0f172a; --muted: #64748b; --faint: #94a3b8;
}
[data-theme="light"] body { background: radial-gradient(120% 60% at 50% -10%, rgba(111, 124, 255, .14), transparent 60%), var(--bg); }
[data-theme="light"] .hero { background: linear-gradient(160deg, #ffffff 0%, #eef0ff 100%); }
[data-theme="light"] #tabs { background: rgba(255, 255, 255, .9); }
[data-theme="light"] .tab.on .ico { color: var(--accent); }
[data-theme="light"] .bar, [data-theme="light"] .dots i:not(.on) { background: rgba(15, 23, 42, .08); }
[data-theme="light"] .ring .track { stroke: rgba(15, 23, 42, .08); }
[data-theme="light"] .toast { background: rgba(255, 255, 255, .95); }
[data-theme="light"] svg.chart rect.off { fill: rgba(15, 23, 42, .07); }
[data-theme="light"] .streak-note { color: #c2410c; }
[data-theme="light"] .freeze, [data-theme="light"] .day.frozen { color: #0369a1; }
[data-theme="light"] .sc-ico, [data-theme="light"] .tab.on .ico { color: var(--accent); }
[data-theme="light"] .viewfinder { background: radial-gradient(100% 80% at 50% 30%, #e7eaf3, #cfd5e3); }
[data-theme="light"] .chip.on { color: var(--text); }
[data-theme="light"] .intro-text { color: #a6aec0; }
[data-theme="light"] .pill.accent { color: #4338ca; background: rgba(111, 124, 255, .14); border-color: rgba(111, 124, 255, .3); }
[data-theme="light"] .xp-chip { color: #4f5bd5; }

/* ================= rating ================= */
.board-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 14px; font-weight: 600; }
.board-head svg { width: 18px; height: 18px; color: var(--accent-2); }
.board-row { gap: 12px; }
.board-row .place { width: 28px; flex: none; text-align: center; font-size: 22px; font-weight: 800; color: var(--muted); }
.board-row.me .title { color: var(--accent-2); }
.board-row.me .place { color: var(--accent-2); }
.segmented button { min-width: 0; }

/* ================= notes ================= */
.clip-item + .clip-item { border-top: 1px solid var(--line); }
.clip-list .clip-item .list-row + .list-row { border-top: 0; }
.note-wrap { padding: 0 0 10px 50px; display: grid; gap: 4px; justify-items: start; }
.clip-note { font-size: 14px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 6px 10px; }
.link-btn { border: 0; background: none; padding: 2px 0; color: var(--accent-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.note-editor { display: flex; gap: 8px; align-items: center; width: 100%; }
.note-editor .input { flex: 1; margin: 0; height: 42px; }
.note-editor .btn.icon { flex: none; width: 42px; height: 42px; }
.result .note-editor { margin-top: 14px; }

/* ================= together ================= */
.invite-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.invite-actions .btn.icon { width: 36px; height: 36px; }
.list-row.invite { align-items: center; }
.partner { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 12px; border-radius: 12px; font-size: 14px;
  background: rgba(111, 124, 255, .1); border: 1px solid rgba(111, 124, 255, .25); }
.partner svg { width: 16px; height: 16px; color: var(--accent-2); }
.sheet-shade { position: fixed; inset: 0; z-index: 65; display: flex; align-items: flex-end; background: rgba(0, 0, 0, .55); animation: fade .2s ease; }
.sheet { width: 100%; max-height: 80vh; overflow: auto; padding: 10px 16px calc(16px + var(--safe-b)); border-radius: 24px 24px 0 0;
  background: var(--surface); border-top: 1px solid var(--line-strong); animation: rise .25s ease; }
.sheet-grip { width: 40px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet-title { font-size: 19px; font-weight: 800; margin-bottom: 4px; }
.sheet .btn.ghost { margin-top: 8px; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }

/* ================= skill extras ================= */
.forecast { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--accent-2); font-weight: 600; }
.forecast svg { width: 18px; height: 18px; flex: none; }
.reel-art { width: 48px; height: 48px; flex: none; border-radius: 15px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #f472b6, #7c6cff); box-shadow: 0 10px 22px -12px rgba(244, 114, 182, .9); }
.reel-art svg { width: 24px; height: 24px; }

/* ================= streak alarm, gift ================= */
.streak-alarm { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 14px; font-size: 13px; font-weight: 600;
  background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .35); color: #fca5a5; animation: pulse 2.4s ease-in-out infinite; }
.streak-alarm svg { width: 18px; height: 18px; flex: none; }
@keyframes pulse { 50% { border-color: rgba(248, 113, 113, .7); } }
.gift { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 14px; font-size: 13px;
  background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .28); color: #fcd34d; }
.gift svg { width: 18px; height: 18px; flex: none; }

/* ================= styles and toggles ================= */
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.style { position: relative; display: grid; gap: 8px; justify-items: center; padding: 12px 8px; border-radius: 16px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; }
.style.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.swatch { width: 100%; height: 26px; border-radius: 99px; }
.sw-violet { background: linear-gradient(90deg, #8f7bff, #c8f53c); }
.sw-sunset { background: linear-gradient(90deg, #ff5e62, #ffc354); }
.sw-ocean { background: linear-gradient(90deg, #388cf8, #34e1be); }
.sw-rose { background: linear-gradient(90deg, #ec4899, #c497ff); }
.sw-mono { background: linear-gradient(90deg, #a0a5b4, #ffffff); }
.style-check { position: absolute; top: 6px; right: 6px; width: 16px; height: 16px; padding: 2px; border-radius: 50%; color: #fff; background: var(--accent); stroke-width: 3; }
.toggle-row { cursor: pointer; }
.list-row input.switch { appearance: none; min-width: 50px; padding: 0; border: 0; box-sizing: border-box; display: block; -webkit-appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; border-radius: 99px; cursor: pointer;
  background: var(--surface-3); transition: background .2s ease; }
.list-row input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .2s ease; }
.list-row input.switch:checked { background: var(--ok); }
.list-row input.switch:checked::after { transform: translateX(20px); }
.link-line { font-size: 14px; font-weight: 600; color: var(--accent-2); word-break: break-all; }

[data-theme="light"] .streak-alarm { color: #b91c1c; }
[data-theme="light"] .gift { color: #92400e; }
[data-theme="light"] .forecast, [data-theme="light"] .link-btn, [data-theme="light"] .link-line { color: #4f5bd5; }
[data-theme="light"] .board-row.me .title { color: #4f5bd5; }

.btn-row > .btn { min-width: 0; }
