:root {
  --bg: #f4f3ee; --bg2: #e9e7df; --panel: rgba(255,255,255,.8); --panel-solid: #ffffff;
  --line: rgba(20,20,15,.09); --line2: rgba(20,20,15,.16);
  --text: #17171a; --muted: #6d6c68; --faint: #a3a19b;
  --accent: #0f8a6b; --accent2: #12b88e; --accent-soft: rgba(15,138,107,.12); --on-accent: #ffffff;
  --rec: #e5382f; --rec-soft: rgba(229,56,47,.14);
  --warn: #b7791f; --warn-soft: rgba(183,121,31,.13);
  --ok: #138a52; --ok-soft: rgba(19,138,82,.12);
  --gold: #c98a06; --gold-soft: rgba(201,138,6,.14);
  --wave: #1b1b1f; --wave-dim: rgba(20,20,15,.18);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px -12px rgba(0,0,0,.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0b0d; --bg2: #101216; --panel: rgba(22,24,29,.74); --panel-solid: #16181d;
    --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.13);
    --text: #f2f1ec; --muted: #9a9993; --faint: #5f5e5a;
    --accent: #2fd6a5; --accent2: #7af0c9; --accent-soft: rgba(47,214,165,.13); --on-accent: #04140f;
    --rec: #ff5148; --rec-soft: rgba(255,81,72,.16);
    --warn: #f2b84b; --warn-soft: rgba(242,184,75,.13);
    --ok: #47d68c; --ok-soft: rgba(71,214,140,.13);
    --gold: #f5c542; --gold-soft: rgba(245,197,66,.14);
    --wave: #f2f1ec; --wave-dim: rgba(255,255,255,.16);
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 60px -20px rgba(0,0,0,.7);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  background-image: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%),
                    radial-gradient(800px 400px at 100% 100%, var(--bg2), transparent 70%);
  background-attachment: fixed;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 20px 16px 32px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0; font-weight: 650; }
h3 { margin: 0 0 6px; font-size: 16px; }
button { font: inherit; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent2)); color: var(--on-accent); box-shadow: 0 6px 20px -6px var(--accent); }
.brand b { font-size: 18px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 12px; color: var(--muted); margin-top: -2px; }
.hud { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hudbox { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 14px; height: 56px; }
.level { min-width: 230px; }
.lvbadge { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 750;
  background: linear-gradient(140deg, var(--gold), #f59e0b); color: #2a1a00; box-shadow: 0 6px 16px -8px var(--gold); }
.lvinfo { flex: 1; min-width: 0; }
.lvname { font-weight: 650; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.lvname span { color: var(--muted); font-weight: 500; font-size: 12px; }
.lvnext { font-size: 11px; color: var(--muted); margin-top: 3px; }
.xpbar { height: 6px; border-radius: 3px; background: var(--line2); overflow: hidden; margin-top: 5px; }
.xpbar > div { height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--gold), #f59e0b); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.streak .flame { font-size: 22px; filter: grayscale(1); opacity: .45; transition: all .3s; }
.streak.lit .flame { filter: none; opacity: 1; }
.big { font-size: 18px; font-weight: 700; line-height: 1.1; }
.lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.goal { cursor: pointer; color: inherit; }
.goal:hover { border-color: var(--accent); }
.goal .tl { text-align: left; }
.ring { position: relative; width: 40px; height: 40px; flex: none; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .arc { transition: stroke-dashoffset .6s cubic-bezier(.2,.7,.2,1); }
.ring .in { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.usermenu { position: relative; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line2); background: var(--accent-soft); color: var(--accent);
  font-weight: 700; cursor: pointer; padding: 0; overflow: hidden; display: grid; place-items: center; }
.avatar:hover { border-color: var(--accent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu { position: absolute; right: 0; top: 52px; z-index: 30; min-width: 250px; padding: 6px; background: var(--panel-solid); }
.menuhead { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menuhead b { display: block; }
.menuhead span { font-size: 12px; color: var(--muted); }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; border: 0; background: none; color: var(--text); cursor: pointer; font-size: 14px; }
.menu a:hover, .menu button:hover { background: var(--line); }

/* ---------- buttons ---------- */
.pill { height: 46px; padding: 0 20px; border-radius: 99px; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-weight: 650; border: 1px solid var(--line2); background: var(--panel-solid); color: var(--text); transition: transform .15s, box-shadow .2s, border-color .15s; }
.pill:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--accent); }
.pill:disabled { opacity: .4; cursor: default; }
.pill.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 8px 24px -10px var(--accent); }
.pill kbd { font: 11px ui-monospace, monospace; padding: 1px 6px; border-radius: 5px; background: rgba(0,0,0,.14); }
.dangerbtn { color: var(--rec); border-color: var(--rec); }
.dangerbtn:not(:disabled):hover { background: var(--rec); color: #fff; border-color: var(--rec); }

/* ---------- landing ---------- */
.hero { text-align: center; padding: 64px 0 32px; }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: 5px 12px; border-radius: 99px; }
.hero h1 { font-size: clamp(34px, 6vw, 62px); line-height: 1.05; letter-spacing: -.035em; margin: 18px 0 16px; font-weight: 750; }
.grad { background: linear-gradient(120deg, var(--accent), var(--accent2) 60%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 640px; margin: 0 auto; font-size: 17px; color: var(--muted); }
.cta-row { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 28px; min-height: 46px; }
.note { margin-top: 10px; font-size: 13px; color: var(--warn); min-height: 20px; }
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.st { padding: 22px; text-align: center; }
.sn { font-size: 34px; font-weight: 750; letter-spacing: -.02em; }
.sl { color: var(--muted); font-size: 13px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.hw { padding: 22px; }
.hw p { margin: 0; color: var(--muted); font-size: 14px; }
.hn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.privacy, .board { padding: 22px 26px; margin-top: 12px; }
.privacy ul { margin: 0; padding-left: 18px; color: var(--muted); }
.privacy li { margin: 4px 0; }
.board ol { margin: 0; padding-left: 22px; columns: 2; }
.board li { margin: 3px 0; }

/* ---------- consent ---------- */
.consent { max-width: 720px; margin: 28px auto 0; padding: 30px 34px; }
.consent h2 { font-size: 24px; text-transform: none; letter-spacing: -.01em; color: var(--text); margin: 14px 0 4px; }
.draft { font-size: 12.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 8px 12px; border-radius: 10px; }
.ctext { margin: 16px 0; padding: 4px 18px 10px; border: 1px solid var(--line); border-radius: 14px; max-height: 340px; overflow: auto; }
.ctext h4 { margin: 14px 0 2px; font-size: 14px; }
.ctext p { margin: 0; color: var(--muted); font-size: 14px; }
.chk { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14.5px; cursor: pointer; }
.chk input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.opt { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--line); }
.optt { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.sel3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sel3 label, .field { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
select, .field input { font: inherit; font-size: 14px; color: var(--text); background: var(--panel-solid); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; }
.row { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }

/* ---------- studio ---------- */
.micbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px 14px 22px; margin-top: 20px; flex-wrap: wrap; }
.devline { margin-top: 10px; font-size: 12px; color: var(--faint); text-align: right; min-height: 18px; }
.stage { position: relative; margin-top: 4px; padding: 28px 32px 26px; border-radius: 24px; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line); color: var(--muted); background: transparent; white-space: nowrap; }
.chip.rec { color: var(--rec); background: var(--rec-soft); border-color: transparent; }
.chip.rec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rec); animation: blink 1s infinite; }
.chip.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.chip.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.chip.gold { color: var(--gold); background: var(--gold-soft); border-color: transparent; }
.chip.hunt { color: var(--accent); background: var(--accent-soft); border-color: transparent; cursor: pointer; }
.meta .sp { flex: 1; }
.linkbtn { font-size: 12px; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 5px 8px; border-radius: 8px; }
.linkbtn:hover:not(:disabled) { color: var(--text); background: var(--line); }
.linkbtn:disabled { opacity: .4; cursor: default; }
.linkbtn.on { color: var(--accent); }
@keyframes blink { 50% { opacity: .25; } }
.sentence { margin: 22px 0 8px; font-size: clamp(26px, 4.2vw, 42px); line-height: 1.28; font-weight: 650; letter-spacing: -.022em; text-wrap: balance; min-height: 2.6em; }
.sentence.fade { animation: rise .4s cubic-bezier(.2,.7,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
.ipa { font-size: 13.5px; color: var(--muted); min-height: 1.5em; word-break: break-word; }
.ipa.off { visibility: hidden; }
.viz { position: relative; margin-top: 20px; height: 120px; border-radius: 14px; overflow: hidden; background: linear-gradient(180deg, transparent, var(--line)); border: 1px solid var(--line); }
.viz canvas { width: 100%; height: 100%; display: block; }
.viz .hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 13px; pointer-events: none; }
.viz .db { position: absolute; right: 10px; top: 8px; font-size: 11px; color: var(--muted); }
.quality { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; min-height: 26px; }
.warns { margin-top: 8px; display: grid; gap: 4px; font-size: 13.5px; color: var(--warn); }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 20px; }
.side { display: flex; gap: 10px; align-items: center; }
.side.r { justify-content: flex-end; }
.ibtn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; background: var(--panel-solid); border: 1px solid var(--line2); color: var(--text); transition: transform .15s, border-color .15s; }
.ibtn:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.ibtn:disabled { opacity: .35; cursor: default; }
.recwrap { position: relative; display: grid; justify-items: center; }
.recbtn { position: relative; width: 84px; height: 84px; border-radius: 50%; cursor: pointer; border: 0; background: var(--rec);
  box-shadow: 0 0 0 6px var(--rec-soft), 0 14px 36px -10px var(--rec); display: grid; place-items: center; transition: transform .15s, box-shadow .2s; }
.recbtn:hover:not(:disabled) { transform: scale(1.05); }
.recbtn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.recbtn .ico { width: 30px; height: 30px; border-radius: 50%; background: #fff; transition: all .2s cubic-bezier(.2,.7,.2,1); }
.recbtn.on .ico { width: 26px; height: 26px; border-radius: 6px; }
.recbtn.on::before, .recbtn.on::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--rec); animation: pulse 1.6s cubic-bezier(.2,.7,.2,1) infinite; }
.recbtn.on::after { animation-delay: .8s; }
@keyframes pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(1.45); opacity: 0; } }
.reclabel { font-size: 12px; color: var(--muted); margin-top: 10px; min-height: 18px; }
.combo { position: absolute; top: -16px; right: -64px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; color: #2a1a00;
  background: linear-gradient(140deg, var(--gold), #f59e0b); transform: rotate(8deg) scale(0); transition: transform .3s cubic-bezier(.3,1.6,.5,1); white-space: nowrap; box-shadow: 0 6px 16px -6px var(--gold); }
.combo.show { transform: rotate(8deg) scale(1); }
.combo.bump { animation: bump .4s; }
@keyframes bump { 40% { transform: rotate(8deg) scale(1.3); } }
.floatxp { position: absolute; left: 50%; top: 40%; transform: translate(-50%, 0); font-weight: 800; font-size: 22px; color: var(--gold); pointer-events: none;
  animation: floatup 1.3s cubic-bezier(.2,.7,.2,1) forwards; text-shadow: 0 2px 12px var(--gold-soft); white-space: nowrap; }
.floatxp small { display: block; text-align: center; font-size: 12px; font-weight: 650; color: var(--accent); }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
.next { margin-top: 14px; padding: 14px 18px; border-radius: 14px; border: 1px dashed var(--line2); color: var(--muted); font-size: 14px; display: flex; gap: 12px; align-items: baseline; }
.next b { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 650; flex: none; }

.grid2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-top: 14px; }
.panel { padding: 20px 22px; }
.phead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.phead .sub { font-size: 12px; color: var(--muted); }
.cov { display: grid; gap: 8px; margin-bottom: 16px; }
.covrow { display: grid; grid-template-columns: 70px 1fr 64px; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.covrow .bar { height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.covrow .bar > div { height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.covrow .v { text-align: right; color: var(--text); font-weight: 650; }
.phon { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: transparent; cursor: pointer;
  display: grid; place-items: center; align-content: center; color: var(--faint); transition: all .25s; }
.ph .i { font-size: 18px; font-weight: 650; font-family: ui-monospace, "SF Mono", Menlo, monospace; line-height: 1.1; }
.ph .l { font-size: 10.5px; }
.ph .c { position: absolute; right: 4px; top: 2px; font-size: 9px; font-weight: 700; }
.ph:hover { border-color: var(--accent); transform: translateY(-2px); }
.ph.t1 { color: var(--text); background: var(--accent-soft); border-color: transparent; }
.ph.t2 { color: var(--text); background: color-mix(in srgb, var(--accent) 28%, transparent); border-color: transparent; }
.ph.t3 { color: var(--on-accent); background: linear-gradient(140deg, var(--accent), var(--accent2)); border-color: transparent; box-shadow: 0 6px 16px -8px var(--accent); }
.ph.cur { outline: 2px solid var(--gold); outline-offset: 1px; }
.ph.pop { animation: pop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 30% { transform: scale(1.25); } }
.legend { display: flex; gap: 12px; margin-top: 12px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg0 { background: var(--line2); } .lg1 { background: var(--accent-soft); } .lg2 { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.lg3 { background: var(--accent); } .lgc { outline: 2px solid var(--gold); }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); min-width: 0; transition: all .3s; }
.badge .e { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--line); filter: grayscale(1); opacity: .5; }
.badge .bt { font-size: 12.5px; font-weight: 650; line-height: 1.2; color: var(--faint); }
.badge .bd { font-size: 11px; color: var(--faint); line-height: 1.25; }
.badge.got { border-color: transparent; background: var(--gold-soft); }
.badge.got .e { filter: none; opacity: 1; background: linear-gradient(140deg, var(--gold), #f59e0b); }
.badge.got .bt { color: var(--text); } .badge.got .bd { color: var(--muted); }
.keys { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 22px; color: var(--muted); font-size: 12.5px; }
.keys kbd { font: 11.5px ui-monospace, "SF Mono", monospace; min-width: 22px; display: inline-block; text-align: center; padding: 2px 6px; margin-right: 6px;
  border-radius: 6px; border: 1px solid var(--line2); border-bottom-width: 2px; background: var(--panel-solid); color: var(--text); }
details.tips { margin-top: 16px; color: var(--muted); font-size: 13.5px; }
details.tips summary { cursor: pointer; text-align: center; list-style: none; color: var(--faint); }
details.tips summary::-webkit-details-marker { display: none; }
details.tips ul { max-width: 680px; margin: 12px auto 0; padding-left: 18px; }
details.tips li { margin: 4px 0; }

/* ---------- profile ---------- */
.profgrid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; margin-top: 20px; align-items: start; }
.side-col { display: grid; gap: 14px; }
.side-col .panel h2 { margin-bottom: 14px; }
.reclist { display: grid; gap: 6px; max-height: 640px; overflow: auto; }
.recitem { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.recitem .t { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recitem .m { font-size: 11.5px; color: var(--muted); }
.recitem .ibtn { width: 34px; height: 34px; }
.recitem .x { color: var(--muted); }
.recitem .x:hover { color: var(--rec); border-color: var(--rec); }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.danger { border-color: var(--rec-soft); }
.danger p { font-size: 14px; }
.danger .field { margin-bottom: 12px; }
.foot { text-align: center; font-size: 12px; margin-top: 36px; }

/* ---------- toast / overlay / confetti ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 40; padding: 10px 16px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 13.5px; display: flex; gap: 8px; align-items: center;
  transition: all .25s cubic-bezier(.2,.7,.2,1); max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.toast.err .dot { background: var(--rec); }
.toast.gold .dot { background: var(--gold); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 45; background: rgba(0,0,0,.35); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .3s; padding: 16px; }
.overlay.show { opacity: 1; pointer-events: auto; }
.ocard { text-align: center; padding: 34px 40px; border-radius: 24px; background: var(--panel-solid); border: 1px solid var(--line2); box-shadow: var(--shadow);
  transform: scale(.85); transition: transform .45s cubic-bezier(.3,1.5,.5,1); max-width: 420px; }
.overlay.show .ocard { transform: scale(1); }
.ocard .oe { font-size: 52px; line-height: 1; }
.ocard .ok { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 750; margin-top: 14px; }
.ocard .ot { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; }
.ocard .od { color: var(--muted); margin-top: 6px; }
.ocard .oh { color: var(--faint); font-size: 12px; margin-top: 18px; }

@media (max-width: 860px) {
  .grid2, .profgrid { grid-template-columns: 1fr; }
  .stats3, .how { grid-template-columns: 1fr; }
  .board ol { columns: 1; }
}
@media (max-width: 720px) {
  .keys { display: none; }
  .sel3 { grid-template-columns: 1fr; }
}
/* ---------- telefon (ko'pchilik shu orqali kiradi) ---------- */
button, a, .chk, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (hover: none) {
  .pill:hover:not(:disabled), .ibtn:hover:not(:disabled), .recbtn:hover:not(:disabled), .ph:hover { transform: none; }
  .pill:active:not(:disabled), .ibtn:active:not(:disabled), .ph:active { transform: scale(.95); }
  .recbtn:active:not(:disabled) { transform: scale(.93); }
  .pill kbd, .keys { display: none; }
}
@media (max-width: 720px) {
  body { background-attachment: scroll; font-size: 15px; }
  .wrap { padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
  select, .field input { font-size: 16px; padding: 10px 12px; }  /* iOS fokusda zoom qilmasin */

  /* header: 1-qator brend + avatar, 2-qator daraja · kun · maqsad */
  .top { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "brand brand menu" "level streak goal"; gap: 8px; min-height: 0; }
  .hud { display: contents; }
  .brand { grid-area: brand; gap: 10px; }
  .logo { width: 34px; height: 34px; border-radius: 10px; }
  .brand small { display: none; }
  .usermenu { grid-area: menu; justify-self: end; }
  .avatar { width: 38px; height: 38px; }
  .menu { top: 46px; min-width: min(280px, calc(100vw - 32px)); }
  .menu a, .menu button { padding: 12px; font-size: 15px; }
  .hudbox { height: 50px; padding: 6px 10px; gap: 8px; border-radius: 12px; }
  .level { grid-area: level; min-width: 0; }
  .streak { grid-area: streak; }
  .goal { grid-area: goal; }
  .lvbadge { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
  .lvname { font-size: 13px; } .lvname span { font-size: 11px; }
  .lvname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lvnext { display: none; }
  .lvname span { white-space: nowrap; }
  .streak .flame { font-size: 18px; }
  .big { font-size: 16px; } .lbl { font-size: 10px; }
  .ring, .ring svg { width: 34px; height: 34px; }

  /* landing */
  .hero { padding: 32px 0 20px; }
  .hero h1 { font-size: clamp(30px, 9vw, 40px); }
  .lead { font-size: 15.5px; }
  .stats3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .st { padding: 14px 6px; border-radius: 14px; }
  .sn { font-size: 24px; } .sl { font-size: 11.5px; line-height: 1.25; }
  .hw { padding: 16px 18px; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; }
  .hw .hn { grid-row: span 2; margin: 0; }
  .privacy, .board { padding: 18px; }

  /* rozilik */
  .consent { margin-top: 16px; padding: 20px 16px; border-radius: 16px; }
  .consent h2 { font-size: 21px; }
  .ctext { max-height: 42vh; padding: 2px 14px 10px; }
  .chk { font-size: 15px; gap: 12px; margin: 14px 0; }
  .chk input { width: 22px; height: 22px; margin-top: 1px; }
  .row { flex-direction: column-reverse; }
  .row .pill { width: 100%; justify-content: center; height: 52px; }

  /* studio: boshqaruv pastki panelda, bosh barmoq yetadigan joyda */
  .micbar { margin-top: 12px; padding: 14px; gap: 10px; }
  .micbar .muted, .pill kbd { display: none; }
  .micbar .pill { width: 100%; justify-content: center; }
  .devline { display: none; }
  .stage { margin-top: 12px; padding: 16px 16px 18px; border-radius: 18px; backdrop-filter: none; background: var(--panel-solid); }  /* backdrop-filter fixed panelni kartaga qamaydi */
  .meta { flex-wrap: nowrap; gap: 4px; }
  #sid { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; }
  .chip { height: 28px; }
  .linkbtn { padding: 7px 8px; font-size: 13px; flex: none; }
  .sentence { margin: 14px 0 6px; font-size: clamp(23px, 6.6vw, 30px); line-height: 1.32; min-height: 2.7em; }
  .viz { height: 72px; margin-top: 14px; }
  .quality { margin-top: 10px; }
  .controls { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; margin: 0;
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: var(--panel-solid); border-top: 1px solid var(--line2); box-shadow: 0 -10px 30px -12px rgba(0,0,0,.18); }
  .side, .side.r { gap: 6px; flex: 1; justify-content: flex-start; }
  .side.r { justify-content: flex-end; }
  .ibtn { width: 44px; height: 44px; }
  .recbtn { width: 66px; height: 66px; box-shadow: 0 0 0 5px var(--rec-soft), 0 10px 26px -10px var(--rec); }
  .recbtn .ico { width: 24px; height: 24px; } .recbtn.on .ico { width: 22px; height: 22px; }
  .reclabel { margin-top: 3px; font-size: 11px; min-height: 15px; }
  .combo { top: -14px; right: -40px; }
  #btnSave { height: 44px; padding: 0 16px; }
  .next { margin-top: 12px; padding: 12px 14px; font-size: 13.5px; }
  body:has(#v-studio:not([hidden])) .wrap { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  body:has(#v-studio:not([hidden])) .toast { bottom: calc(118px + env(safe-area-inset-bottom)); }
  .panel { padding: 16px; }
  .phead { flex-wrap: wrap; }
  .phon { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); }
  .ach { grid-template-columns: 1fr 1fr; }

  /* profil */
  .profgrid { margin-top: 12px; }
  .reclist { max-height: none; overflow: visible; }
  .recitem { grid-template-columns: auto 1fr auto; gap: 10px; padding: 10px; }
  .recitem .chip { display: none; }
  .recitem .t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14.5px; }
  .recitem .ibtn { width: 40px; height: 40px; }
  .danger .pill { width: 100%; justify-content: center; }

  .ocard { padding: 28px 22px; }
  .ocard .ot { font-size: 26px; }
  .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (max-width: 340px) {
  #btnPrev { display: none; }
  .top { grid-template-areas: "brand brand menu" "level level level" "streak goal goal"; grid-template-columns: auto 1fr auto; }
  .goal { justify-self: start; }
}
@media (max-width: 380px) { .lvname span { display: none; } }
@media (max-width: 330px) { .stats3 { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- mavzular (Studio) ---------- */
.topicbar { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; margin: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.topicbar::-webkit-scrollbar { display: none; }
.tbtn { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line2); background: var(--panel); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap; }
.tbtn .tc { font-size: 11px; color: var(--muted); font-weight: 600; }
.tbtn:hover { border-color: var(--accent); }
.tbtn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tbtn.on .tc { color: inherit; opacity: .75; }
.tchip { color: var(--muted); }

/* ---------- musobaqa ---------- */
.invite { padding: 12px 18px; margin-top: 16px; font-size: 14px; text-align: center; border-color: var(--gold); background: var(--gold-soft); }
.chall { margin-top: 20px; padding: 26px 28px; position: relative; overflow: hidden; }
.chall::after { content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent); pointer-events: none; }
.chtop { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.chtitle { font-size: clamp(22px, 3.4vw, 30px); text-transform: none; letter-spacing: -.02em; color: var(--text); margin: 12px 0 6px; font-weight: 750; }
.chtop p { margin: 0; max-width: 560px; font-size: 14px; }
.chtimer { flex: none; text-align: right; padding: 10px 16px; border-radius: 14px; background: var(--gold-soft); color: var(--gold); }
.chtimer .lbl { color: inherit; opacity: .8; }
.mystats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.ms { padding: 16px 18px; box-shadow: none; }
.ms .sn { font-size: 28px; }
.chact { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; position: relative; z-index: 1; }
#pubNote { color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font-weight: 650; padding: 0; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--line); margin-bottom: 14px; }
.tabs button, .seg button { border: 0; background: none; color: var(--muted); font-weight: 650; font-size: 13.5px; height: 34px; padding: 0 16px; border-radius: 99px; cursor: pointer; }
.tabs button.on, .seg button.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chall + .panel { margin-top: 14px; }
.lboard { list-style: none; margin: 0; padding: 0; }
.lrow { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 12px; }
.lrow + .lrow { border-top: 1px solid var(--line); }
.lrow.me { background: var(--accent-soft); border-color: transparent; }
.lr { text-align: center; font-weight: 700; color: var(--muted); font-size: 15px; }
.lm { min-width: 0; }
.ln { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 14.5px; }
.ln span { font-size: 12.5px; }
.lbar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 6px; overflow: hidden; }
.lbar > div { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.lv { font-weight: 700; font-size: 14px; }

/* ---------- ulashish oynasi ---------- */
.oshare { margin-top: 18px; }
body.noscroll { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); }
.mcard { width: min(880px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px 22px 22px; border-radius: 22px;
  background: var(--panel-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.mhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--line); flex-wrap: wrap; }
.mbody { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 22px; margin-top: 14px; align-items: start; }
.prev { display: grid; place-items: center; background: var(--line); border-radius: 16px; padding: 12px; }
.prev img { display: block; max-width: 100%; max-height: 56dvh; border-radius: 10px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5); }
.mside { display: grid; gap: 12px; align-content: start; }
.mside .chk { margin: 0; }
.row2 { display: flex; gap: 10px; flex-wrap: wrap; }
.social { display: flex; gap: 6px; flex-wrap: wrap; }
.social button { height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line2); background: var(--panel-solid); color: var(--text);
  font-weight: 650; font-size: 13px; cursor: pointer; }
.social button:hover { border-color: var(--accent); color: var(--accent); }
.mside textarea { width: 100%; font: 13px/1.45 inherit; font-family: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line2);
  border-radius: 12px; padding: 10px 12px; resize: vertical; }
.mside .linkbtn { justify-self: start; font-size: 13px; }
.small { font-size: 12.5px; margin: 0; }

/* ulashish sahifasi /s/<kod> */
.share-land { max-width: 680px; padding-top: 48px; text-align: center; }
.share-land h1 { font-size: clamp(26px, 5vw, 38px); letter-spacing: -.02em; line-height: 1.15; margin: 16px 0 18px; }
.share-land .stats3 { margin: 0 0 18px; }
.share-land .lead { margin-bottom: 22px; font-size: 15px; }
.share-land .panel { padding: 32px 28px; }

@media (max-width: 720px) {
  .chall { padding: 20px 18px; }
  .chtop { flex-direction: column; gap: 12px; }
  .chtimer { text-align: left; }
  .mystats { grid-template-columns: 1fr 1fr; }
  .chact .pill { flex: 1 1 100%; justify-content: center; }
  .mbody { grid-template-columns: 1fr; }
  .prev img { max-height: 44dvh; }
  .modal { padding: 0; place-items: end stretch; }
  .mcard { border-radius: 22px 22px 0 0; max-height: 94dvh; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .row2 .pill { flex: 1; justify-content: center; }
  .share-land .stats3 { grid-template-columns: repeat(3, 1fr); }
  .share-land .sn { font-size: 26px; }
}
html { background: var(--bg); }
body { min-height: 100dvh; }
.sn.sm { font-size: 22px; line-height: 1.55; }
@media (max-width: 480px) { .tchip { display: none; } }
