/* EchoChain: dark, phone-first. On a computer it shows as a phone-sized column. */
:root {
  --bg: #070a14; --bg2: #0d1124; --panel: rgba(255,255,255,.06); --line: rgba(255,255,255,.12);
  --text: #f4f6ff; --muted: #9aa4c7; --dim: #5f6889;
  --blue: #2f8bff; --purple: #9b5cff; --pink: #ff3f72; --good: #34d399; --bad: #ff5c7a;
  --grad: linear-gradient(90deg, #2f8bff, #9b5cff 50%, #ff3f72);
  --nav: 64px; --r: 16px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #03050b; color: var(--text); }
body { overscroll-behavior: none; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
input, textarea { font: inherit; }

#app { position: relative; max-width: 480px; height: 100dvh; margin: 0 auto; background: var(--bg); overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,.05), 0 20px 80px rgba(0,0,0,.6); }
#view { position: absolute; inset: 0 0 calc(var(--nav) + env(safe-area-inset-bottom)) 0; overflow-y: auto; overflow-x: hidden; }
#app.nonav #view { bottom: 0; }
#app.nonav #nav { display: none; }
.screen { min-height: 100%; position: relative; padding-bottom: 24px; }
.screen.feed-screen { height: 100%; padding: 0; }

/* ---------- icons */
.ic { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ic svg { width: 100%; height: 100%; }
.ic.big { width: 44px; height: 44px; }
.ic.flip-x { transform: rotate(180deg); width: 18px; height: 18px; opacity: .5; }
.plus-badge { width: 15px; height: 15px; color: #ffd43b; margin-left: 4px; vertical-align: -2px; }

/* ---------- nav */
#nav { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: rgba(7,10,20,.96); border-top: 1px solid var(--line); z-index: 20; }
.nav-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--dim); text-decoration: none; }
.nav-item small { font-size: 11px; }
.nav-item.on { color: var(--text); }
.nav-create { justify-self: center; width: 52px; height: 38px; border-radius: 12px; background: var(--grad); display: grid; place-items: center;
  color: #fff; box-shadow: 0 6px 22px rgba(155,92,255,.4); }
.nav-create .ic { width: 26px; height: 26px; }
.badge { position: absolute; top: -4px; left: 52%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--pink);
  color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* ---------- common bits */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; padding: 10px 10px;
  background: rgba(7,10,20,.92); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,255,255,.05); }
.topbar h2 { font-size: 18px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--text); text-decoration: none; }
.icon-btn:active { background: var(--panel); }
.icon-btn.glass { background: rgba(0,0,0,.35); backdrop-filter: blur(8px); }
.pad { padding: 16px; }
.pad-x { padding: 0 16px; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lead { color: var(--muted); line-height: 1.45; margin: 4px 0 14px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.4; }
.sec { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 22px 0 10px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loading { display: grid; place-items: center; padding: 60px 0; }
.spin { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--purple); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h3 { color: var(--text); margin: 6px 0 0; }
.empty p { margin: 0 0 6px; line-height: 1.45; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: rgba(155,92,255,.22);
  color: #e3d6ff; font-size: 12px; font-weight: 600; }
.chip .ic { width: 13px; height: 13px; }
.success { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; background: rgba(52,211,153,.14);
  color: #b9f5dc; font-weight: 600; }
.note-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--panel); color: var(--muted); margin: 12px 0; }
.note-box p { margin: 0; line-height: 1.4; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; margin: 6px 0 4px;
  background: linear-gradient(135deg, rgba(47,139,255,.22), rgba(255,63,114,.2)); border: 1px solid rgba(155,92,255,.35); }
.banner > div { flex: 1; display: flex; flex-direction: column; }
.banner small { color: var(--muted); }
.card-box { padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.card-box h3 { margin: 0; display: flex; align-items: center; gap: 6px; }
.card-box p { margin: 0; color: var(--muted); line-height: 1.4; }

/* ---------- buttons & form */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 12px; border: 0;
  background: var(--grad); color: #fff; font-weight: 700; text-decoration: none; }
.btn.ghost { background: var(--panel); border: 1px solid var(--line); }
.btn.big { width: 100%; padding: 14px; margin-top: 10px; font-size: 16px; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: #e0314f; }
.btn.danger-ghost { background: transparent; border: 1px solid rgba(255,92,122,.5); color: #ff8aa0; }
.btn .ic { width: 18px; height: 18px; }
.text-link { color: var(--muted); text-align: center; display: block; margin-top: 14px; }
.row-btns { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); margin: 4px 0 8px; outline: none; }
.input:focus { border-color: var(--purple); }
textarea.input { resize: none; }
.lbl { display: block; font-size: 13px; color: var(--muted); margin-top: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; line-height: 1.4; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--purple); flex: none; }
.check a { color: #c9b2ff; }
.seg { display: flex; gap: 6px; background: var(--bg2); padding: 4px; border-radius: 12px; margin: 4px 0 8px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.seg button.on { background: rgba(255,255,255,.12); color: var(--text); }
.seg.small { flex: none; }
.seg.small button { padding: 6px 10px; display: grid; place-items: center; }
.dot { display: inline-block; border-radius: 50%; background: currentColor; }
.two { display: flex; gap: 8px; }
.form-err { color: #ff8aa0; min-height: 1em; margin: 6px 0 0; }
details.more { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--panel); }
details.more summary { cursor: pointer; font-weight: 600; }
details.more[open] summary { margin-bottom: 8px; }

/* ---------- feed */
.feed { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.card { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; background: #000; }
.card.intro { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px; text-align: center;
  background: radial-gradient(circle at 50% 35%, #1a2150, var(--bg) 70%); }
.card.intro h2 { margin: 0; font-size: 28px; }
.card.intro p { color: var(--muted); }
.feed-head { position: absolute; top: 0; left: 0; right: 0; z-index: 6; display: flex; align-items: center; gap: 8px; padding: 12px 10px;
  background: linear-gradient(rgba(0,0,0,.45), transparent); pointer-events: none; }
.feed-head > * { pointer-events: auto; }
.tabs { flex: 1; display: flex; justify-content: center; gap: 16px; }
.tabs a { text-decoration: none; color: rgba(255,255,255,.65); font-weight: 700; padding: 6px 0; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.tabs a.on { color: #fff; border-bottom: 2px solid #fff; }
.guest-pill { position: absolute; top: 108px; right: 10px; z-index: 6; padding: 7px 14px; border-radius: 99px;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; text-decoration: none; }
.card-top { position: absolute; top: 60px; left: 12px; right: 70px; z-index: 3; pointer-events: none; }
.who { display: flex; align-items: center; gap: 8px; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.who > div { display: flex; flex-direction: column; }
.who small { color: rgba(255,255,255,.75); font-size: 12px; }
.actions { position: absolute; right: 8px; bottom: 96px; z-index: 3; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.act { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff;
  filter: drop-shadow(0 1px 6px rgba(0,0,0,.6)); }
.act .ic { width: 32px; height: 32px; }
.act small { font-size: 12px; font-weight: 700; }
.act.on { color: var(--pink); }
.act.on svg { fill: currentColor; }
.card-info { position: absolute; left: 0; right: 64px; bottom: 0; z-index: 3; padding: 60px 14px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.card-info h3 { margin: 0; font-size: 18px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.credits { font-size: 14px; font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px; }
.credits a { text-decoration: none; }
.credits .arr { color: #c9b2ff; }
.shared { margin: 0; font-size: 12px; color: rgba(255,255,255,.7); }
.burst { position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%); z-index: 4; color: var(--pink); pointer-events: none; animation: burst .9s ease-out forwards; }
.burst .ic { width: 110px; height: 110px; }
.burst svg { fill: currentColor; }
@keyframes burst { 0% { opacity: 0; transform: translate(-50%,-50%) scale(.4); } 25% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%,-60%) scale(1.3); } }
.card.spot .fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sponsored { display: inline-block; padding: 3px 9px; border-radius: 6px; background: rgba(0,0,0,.55); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.sponsor { font-size: 13px; color: rgba(255,255,255,.8); }
.celebrate { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; text-align: center; pointer-events: none;
  background: radial-gradient(circle, rgba(155,92,255,.45), rgba(7,10,20,.85) 70%); animation: fadein .4s; transition: opacity .6s; }
.celebrate.out { opacity: 0; }
.celebrate .ic { color: #ffd43b; width: 70px; height: 70px; animation: pop .7s; }
@keyframes fadein { from { opacity: 0; } }

/* ---------- player */
.player { position: absolute; inset: 0; background: #000; overflow: hidden; }
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; }
.layer.on { opacity: 1; }
.fill { width: 100%; height: 100%; object-fit: cover; display: block; }
.kb { animation: kb 5.2s ease-out both; }
@keyframes kb { from { transform: scale(1.12) translate(2%, 1%); } to { transform: scale(1) translate(0, 0); } }
.caption { position: absolute; left: 14px; right: 14px; bottom: 30%; text-align: center; font-weight: 700; font-size: 20px;
  text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.textl { display: grid; place-items: center; padding: 30px; }
.text-spark { font-size: 30px; line-height: 1.25; text-align: center; font-weight: 800; text-shadow: 0 2px 16px rgba(0,0,0,.25); overflow-wrap: anywhere; }
.t-serif { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; }
.t-mono { font-family: Consolas, "Courier New", monospace; font-weight: 700; font-size: 26px; }
.pop { animation: pop .6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.7); } }
.voice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; }
.voice-who { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 18px; }
.wave { height: 90px; width: 78%; display: flex; align-items: center; justify-content: center; gap: 4px; }
.wave i { flex: 1; max-width: 8px; min-height: 6px; border-radius: 4px; background: rgba(255,255,255,.35); transition: background .15s; }
.wave i.on, .wave.live i { background: #fff; }
.voice-tag { display: flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; background: rgba(0,0,0,.25); font-size: 13px; font-weight: 600; }
.removed { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: var(--dim); background: #0b0e1c; }
.muted-hint { display: none; position: absolute; top: 152px; left: 50%; transform: translateX(-50%); padding: 6px 12px; border-radius: 99px;
  background: rgba(0,0,0,.5); font-size: 12px; align-items: center; gap: 6px; white-space: nowrap; pointer-events: none; }
.muted-hint .ic { width: 16px; height: 16px; }
.layer.muted .muted-hint { display: flex; }
.pbars { position: absolute; top: 52px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.pbars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.pbars b { display: block; height: 100%; width: 0; background: #fff; }
.play-badge { position: absolute; inset: 0; display: none; place-items: center; z-index: 2; pointer-events: none; }
.play-badge .ic { width: 64px; height: 64px; color: rgba(255,255,255,.8); filter: drop-shadow(0 2px 10px rgba(0,0,0,.5)); }
.player.paused .play-badge { display: grid; }
.feed .player .pbars { top: 52px; }

/* ---------- create */
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kind { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line); }
.kind:last-child { grid-column: span 2; }
.kind small { color: var(--muted); line-height: 1.3; }
.kind-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); }
.tool { padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.tool-stage { position: relative; height: 58vh; max-height: calc((min(100vw, 480px) - 32px) * 16 / 9); width: auto; max-width: 100%;
  aspect-ratio: 9 / 16; margin: 0 auto; border-radius: var(--r); overflow: hidden;
  background: #000; display: grid; place-items: center; }
.tool-stage.voice { gap: 20px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.cam { width: 100%; height: 100%; object-fit: cover; }
.cam.mirror { transform: scaleX(-1); }
.tool-msg { text-align: center; color: var(--muted); margin: 4px 0; min-height: 1.2em; }
.tool-msg audio { width: 100%; }
.tool-row { display: flex; align-items: center; gap: 10px; justify-content: center; }
.tool-row .spacer { flex: 1; }
.tool-error, .tool-empty { padding: 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; line-height: 1.4; }
.rec-btn { --p: 0; width: 76px; height: 76px; border-radius: 50%; border: 0; padding: 0; position: relative;
  background: conic-gradient(#fff calc(var(--p) * 360deg), rgba(255,255,255,.3) 0); }
.rec-btn::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #ff3f72; transition: inset .2s, border-radius .2s; }
.rec-btn.recording::after { inset: 22px; border-radius: 8px; }
.sketch-pad { width: 100%; height: 100%; touch-action: none; display: block; }
.inks { display: flex; gap: 8px; justify-content: center; }
.ink { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); }
.ink.on { border-color: #fff; transform: scale(1.15); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 4px 0 8px; }
.sw { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent; display: grid; place-items: center; color: #fff; }
.sw.round { border-radius: 50%; }
.sw.on { border-color: #fff; }
.sw.locked { opacity: .55; }
.sw .ic { width: 16px; height: 16px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.preview-box { position: relative; width: 62%; aspect-ratio: 9 / 16; margin: 6px auto 12px; border-radius: var(--r); overflow: hidden; }
.preview-box .pbars { top: 10px; }
.preview-box .muted-hint { top: 24px; }

/* ---------- lists, tiles, grids */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 5px; text-decoration: none; padding-bottom: 6px; }
.tile b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { color: var(--muted); font-size: 12px; }
.tile .btn { margin-top: 2px; }
.tile-cover { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; }
.lock { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; align-items: center; padding: 3px 8px; border-radius: 99px;
  background: rgba(0,0,0,.55); font-size: 11px; font-weight: 700; }
.lock .ic { width: 13px; height: 13px; }
.tile-cover .cover { filter: blur(0); }
.cover { width: 100%; height: 100%; background: #111; display: grid; place-items: center; overflow: hidden; }
.cover img, .cover video { width: 100%; height: 100%; object-fit: cover; }
.cover.textc { padding: 10px; text-align: center; font-weight: 800; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.cover.voicec .ic { width: 34px; height: 34px; }
.cover.blank { color: var(--dim); }
.cover.mini { width: 54px; height: 72px; border-radius: 8px; flex: none; }
.mini-covers { display: flex; gap: 6px; margin: 6px 0; }
.dots { display: flex; gap: 4px; }
.dots i { width: 18px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.18); }
.dots i.on { background: var(--grad); }
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.05); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-decoration: none; }
.row-main p { margin: 0; line-height: 1.35; }
.row-main small { color: var(--muted); }
.row-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-cover { width: 54px; height: 72px; border-radius: 10px; overflow: hidden; flex: none; }
.row-img { width: 54px; height: 72px; border-radius: 10px; object-fit: cover; flex: none; }
.pad .row { padding-left: 0; padding-right: 0; }
.link-row { padding: 14px 0 !important; }
.note.unread { background: rgba(155,92,255,.1); }
.note-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); flex: none; color: #c9b2ff; }
.note-ic .ic { width: 20px; height: 20px; }
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; flex: none; }

/* ---------- chain page & tree */
.title { margin: 0 0 6px; }
.chain-progress { display: flex; gap: 8px; margin: 18px 0 4px; }
.chain-progress > span { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; border: 2px dashed rgba(255,255,255,.25); color: var(--dim); }
.chain-progress > span.on { border: 0; background: var(--grad); color: #fff; }
.tree-wrap { overflow: auto; padding: 8px 0 30px; }
.tree { position: relative; margin: 0 auto; }
.tree-svg { position: absolute; inset: 0; }
.tree-node { position: absolute; display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.tree-node .cover { height: 132px; border-radius: 12px; border: 2px solid transparent; }
.tree-node.focus .cover { border-color: #fff; box-shadow: 0 0 0 3px rgba(155,92,255,.6); }
.tree-node.open .cover { border: 2px dashed rgba(255,255,255,.4); }
.tree-node b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-node small { font-size: 11px; color: var(--muted); }
.tree-node .from { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); padding: 1px 7px; border-radius: 99px;
  background: var(--bg); border: 1px solid rgba(155,92,255,.5); font-size: 10px; color: #c9b2ff; white-space: nowrap; }

/* ---------- profile */
.profile-head { display: flex; flex-direction: column; align-items: center; padding: 20px 16px 10px; gap: 6px; text-align: center; }
.profile-head h2 { margin: 6px 0 0; }
.profile-head p { margin: 0; }
.bio { max-width: 320px; line-height: 1.4; }
.stats { display: flex; gap: 6px; margin-top: 10px; width: 100%; }
.stat-box { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 4px; border-radius: 12px; background: var(--panel); }
.stat-box b { font-size: 18px; }
.stat-box small { color: var(--muted); font-size: 11px; text-align: center; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 10px 3px; }
.gtile { position: relative; aspect-ratio: 3 / 4; overflow: hidden; text-decoration: none; border-radius: 6px; }
.gtitle { position: absolute; left: 6px; right: 6px; bottom: 20px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 4px #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmeta { position: absolute; left: 6px; bottom: 5px; font-size: 11px; text-shadow: 0 1px 4px #000; }

/* ---------- Plus */
.plus-hero { text-align: center; padding: 10px 0; }
.plus-hero .ic { color: #ffd43b; }
.plus-hero h2 { font-size: 28px; margin: 8px 0; }
.plus-hero p { color: var(--muted); line-height: 1.45; }
.perks { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.perks li { display: flex; gap: 12px; align-items: center; }
.perks li > div { display: flex; flex-direction: column; }
.perks small { color: var(--muted); }

/* ---------- welcome & auth */
.welcome { min-height: calc(100dvh - 24px); padding: 40px 24px 30px; display: flex; flex-direction: column; align-items: center; text-align: center;
  background: radial-gradient(circle at 50% 20%, rgba(155,92,255,.3), transparent 60%); }
.welcome .logo { width: 140px; height: 140px; }
.welcome h1 { font-size: 44px; margin: 4px 0 0; font-weight: 900; }
.welcome .tag { color: var(--muted); font-size: 18px; margin: 6px 0 20px; }
.how { list-style: none; padding: 0; margin: 0 0 18px; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.how li { display: flex; gap: 12px; align-items: center; line-height: 1.35; }
.how .ic { color: #c9b2ff; }
.auth { display: flex; flex-direction: column; }

/* ---------- sheet & toast */
.sheet-bg { position: absolute; inset: 0; z-index: 50; background: rgba(0,0,0,0); transition: background .2s; display: flex; align-items: flex-end; }
.sheet-bg.open { background: rgba(0,0,0,.55); }
.sheet { width: 100%; max-height: 85%; overflow-y: auto; background: #121731; border-radius: 20px 20px 0 0; padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .22s ease-out; }
.sheet-bg.open .sheet { transform: none; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); margin: 4px auto 8px; }
.sheet h3 { margin: 4px 6px 10px; font-size: 16px; }
.sheet-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 10px; border: 0; background: transparent; text-align: left; border-radius: 10px; }
.sheet-item:active { background: var(--panel); }
.sheet-item.danger { color: #ff8aa0; }
.sheet-item.cancel { justify-content: center; color: var(--muted); margin-top: 4px; }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); max-width: min(420px, 90vw); padding: 11px 16px; border-radius: 12px;
  background: #1f2647; color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #5a1d2c; }

@media (min-width: 520px) {
  body { display: flex; align-items: center; }
  #app { height: min(100dvh, 900px); border-radius: 24px; }
}
