/* /play (Game chat): the game screen + the level select. Dark world, one accent per world, green / red only for profit / loss.
   Opaque panels over the live canvas (no backdrop-filter, no blend modes: memory webgl-page-no-blur-overlays). */
@font-face { font-family: "Urbanist"; src: url("/fonts/urbanist/urbanist-100_900.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Zalando Sans Expanded"; src: url("/fonts/zalando-expanded/zalando-expanded-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hibur Mono"; src: url("/fonts/hibur-mono/hibur-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root { color-scheme: dark; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--sb-thumb, rgba(140, 140, 150, .35)); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover, rgba(160, 160, 170, .6)); }
*::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
*::-webkit-scrollbar-corner { background: transparent; }
@supports (-moz-appearance: none) {
  * { scrollbar-width: thin; scrollbar-color: var(--sb-thumb, rgba(140, 140, 150, .35)) transparent; }
}
.no-sb { scrollbar-width: none; }
.no-sb::-webkit-scrollbar { display: none; }

:root {
  --bg: #05060b; --bg2: #090b14; --panel: #0b0d18; --panel2: #10132080; --line: rgba(150, 165, 255, .12); --line2: rgba(150, 165, 255, .22);
  --ink: #eef0ff; --ink2: #a9afd2; --ink3: #6b7196; --up: #40ff8c; --down: #ff3d4d; --warn: #ffb547; --real: #ff3d4d;
  --acc: #ff3878; --acc2: #9d3bff; --acc-ink: #19020a;
  --f: "Urbanist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --fd: "Zalando Sans Expanded", var(--f); --fm: "Hibur Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px; --sb-thumb: rgba(255, 255, 255, .18);
}
[data-world="stretch"] { --acc: #ffad29; --acc2: #ff5233; --acc-ink: #1c1000; }
[data-world="migrated"] { --acc: #2edbff; --acc2: #4d73ff; --acc-ink: #001820; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--f); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
input { font: inherit; color: var(--ink); }
.muted { color: var(--ink2); }
#app { position: fixed; inset: 0; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
#stage { position: absolute; inset: 0; display: block; }
#touch { position: absolute; inset: 52px 0 0 0; }
#app[data-screen="scope"] #stage, #app[data-screen="scope"] #touch { visibility: hidden; }
#app[data-screen="scope"] { background: radial-gradient(1200px 600px at 20% -10%, rgba(255, 56, 120, .10), transparent 60%), radial-gradient(900px 500px at 90% 0%, rgba(46, 219, 255, .08), transparent 60%), var(--bg); }

/* boot */
#boot { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 50; transition: opacity .35s; }
#app.booted #boot { opacity: 0; pointer-events: none; }
.bootcard { display: grid; gap: 10px; justify-items: center; }
.bootcard b { font-family: var(--fd); font-size: 22px; letter-spacing: -.01em; }
.bootcard span { color: var(--ink2); font-size: 14px; }
.bootcard .bar { width: 180px; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.bootcard .bar i { display: block; height: 100%; width: 40%; background: var(--acc); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.nojs { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--ink2); }

/* REAL edge */
#edge { position: absolute; inset: 0; pointer-events: none; z-index: 40; box-shadow: inset 0 0 0 0 transparent; transition: box-shadow .3s; }
#app.real #edge { box-shadow: inset 0 0 0 3px var(--real), inset 0 0 60px rgba(255, 61, 77, .28); }

/* top bar */
#topbar { position: absolute; left: 0; right: 0; top: 0; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; z-index: 30;
  background: linear-gradient(180deg, rgba(5, 6, 11, .96), rgba(5, 6, 11, .78)); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand .logo { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(from 200deg, var(--acc), var(--acc2), var(--acc)); flex: none; overflow: hidden; display: grid; place-items: center; }
.brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.brand .bname { font-family: var(--fd); font-weight: 400; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.tright { display: flex; align-items: center; gap: 8px; min-width: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--acc); color: var(--acc-ink); font-weight: 700; font-size: 13px; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink2); border: 1px solid var(--line); font-weight: 600; }
.btn.ghost:hover { color: var(--ink); border-color: var(--line2); }
.btn.tiny { height: 24px; padding: 0 10px; font-size: 11px; background: transparent; border: 1px solid var(--line2); color: var(--ink2); }
.btn.real { background: var(--real); color: #fff; }
.seg { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--line); }
.seg button { height: 26px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--ink3); letter-spacing: .02em; }
.seg button.on { background: var(--ink); color: #05060b; }
.seg.mode button:last-child.on { background: var(--real); color: #fff; }
.bal { font-family: var(--fm); font-size: 13px; color: var(--ink); white-space: nowrap; min-width: 80px; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.tright > * { flex: none; }
.tright .badge { white-space: nowrap; }
.bal.warn { color: var(--warn); font-family: var(--f); font-size: 12px; }
#app.real .bal { color: #fff; }

/* level select */
#scope { position: absolute; inset: 52px 0 0 0; overflow-y: auto; padding: 18px 16px 28px; z-index: 5; }
.scopetop { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .9fr); gap: 14px; align-items: stretch; margin-bottom: 14px; }
.intro h1 { font-family: var(--fd); font-weight: 400; font-size: clamp(26px, 3vw, 40px); letter-spacing: -.02em; margin: 4px 0 8px; }
.intro p { margin: 0; max-width: 560px; line-height: 1.45; font-size: 15px; }
.mecard, .daily { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; align-content: start; text-align: left; }
.mehead { display: flex; align-items: center; gap: 8px; }
.mehead .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.mehead .lv { margin-left: auto; color: var(--ink2); font-size: 13px; }
.mecard .xp { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.mecard .xp i { display: block; height: 100%; background: var(--acc); transform-origin: left; }
.qs { display: grid; gap: 4px; font-size: 12px; color: var(--ink2); }
.qs .q.done { color: var(--up); }
.mebtns { display: flex; flex-wrap: wrap; gap: 6px; }
.daily { cursor: pointer; border-color: rgba(255, 173, 41, .35); }
.daily .k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--warn); }
.daily b { font-size: 18px; }
.daily .muted { font-size: 12px; line-height: 1.4; }
.daily .go { justify-self: start; padding: 6px 14px; border-radius: 999px; background: var(--warn); color: #1c1000; font-weight: 800; font-size: 12px; }
.tabs { display: none; gap: 6px; margin-bottom: 10px; }
.tabs button { flex: 1; height: 36px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink2); font-weight: 700; font-size: 13px; }
.tabs button.on { color: var(--ink); border-color: var(--acc); background: var(--panel); }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; min-height: 420px; }
.colhead { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); position: relative; }
.colhead::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, var(--acc), transparent); }
.ct { display: flex; align-items: center; gap: 8px; }
.ct b { font-size: 15px; }
.count { font-family: var(--fm); font-size: 11px; color: var(--acc); border: 1px solid var(--line2); border-radius: 999px; padding: 2px 8px; }
.filt { font-size: 12px; color: var(--ink3); }
.list { display: flex; flex-direction: column; }
.card { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 112px; padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; transition: background .15s; }
.card:hover { background: rgba(150, 165, 255, .05); }
.card .left { display: grid; justify-items: center; gap: 6px; }
.pic { position: relative; width: 74px; height: 74px; }
.pic .ring { position: absolute; inset: 0; border-radius: 16px; background: conic-gradient(var(--acc) calc(var(--p, 0) * 1%), rgba(150, 165, 255, .12) 0); }
.pic .img { position: absolute; inset: 3px; border-radius: 13px; background: #121526; overflow: hidden; display: grid; place-items: center; font-weight: 800; color: var(--ink3); font-size: 18px; }
.pic .img img { width: 100%; height: 100%; object-fit: cover; }
.ca { font-family: var(--fm); font-size: 10px; color: var(--ink3); }
.mid { display: grid; gap: 6px; min-width: 0; }
.l1 { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.l1 .sym { font-size: 16px; font-weight: 800; white-space: nowrap; }
.l1 .nm { color: var(--ink2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.l2 { display: flex; gap: 10px; font-size: 12px; color: var(--ink2); flex-wrap: wrap; }
.age.fresh { color: var(--up); } .age.warm { color: var(--warn); } .age.old { color: var(--ink3); }
.rd.hot { color: var(--acc); font-weight: 700; }
.tx { color: var(--ink3); }
.l3 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 11px; }
.badge { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line2); color: var(--ink2); font-size: 11px; white-space: nowrap; }
.badge:empty { display: none; }
.badge.low { color: var(--up); border-color: rgba(64, 255, 140, .3); }
.badge.mid { color: var(--warn); border-color: rgba(255, 181, 71, .35); }
.badge.high { color: var(--down); border-color: rgba(255, 61, 77, .4); }
.dlab { color: var(--ink3); }
.diff { display: inline-flex; gap: 2px; }
.diff i { width: 4px; height: 10px; border-radius: 1px; background: var(--line2); }
.diff i.on { background: var(--acc); }
.right { display: grid; justify-items: end; gap: 6px; }
.kv { font-family: var(--fm); font-size: 12px; color: var(--ink2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.kv.mc.t1 { color: var(--ink); } .kv.mc.t2 { color: var(--warn); } .kv.mc.t3 { color: var(--up); }
.bsr { width: 64px; height: 3px; border-radius: 3px; background: rgba(255, 61, 77, .5); overflow: hidden; }
.bsr i { display: block; height: 100%; background: var(--up); transform-origin: left; }
.play { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--acc); color: var(--acc); font-weight: 800; font-size: 12px; letter-spacing: .04em; }
.card:hover .play { background: var(--acc); color: var(--acc-ink); }
.card.skel .left, .card.skel .mid, .card.skel .right { height: 70px; border-radius: 10px; background: linear-gradient(90deg, rgba(150,165,255,.04), rgba(150,165,255,.09), rgba(150,165,255,.04)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.emptycol { padding: 28px 16px; color: var(--ink3); font-size: 13px; text-align: center; }

/* room HUD */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
.coinbar { position: absolute; left: 14px; top: 62px; display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; max-width: calc(100% - 28px); }
.coinimg { width: 32px; height: 32px; border-radius: 9px; background: #121526; overflow: hidden; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--ink3); flex: none; box-shadow: 0 0 0 1px var(--acc); }
.coinimg img { width: 100%; height: 100%; object-fit: cover; }
.cident { display: grid; line-height: 1.15; min-width: 0; }
.cident .sym { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.cident .cname { font-size: 12px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.stat { font-family: var(--fm); font-size: 12px; color: var(--ink2); white-space: nowrap; }
.stat:empty { display: none; }
.stat.riders { color: var(--acc); }
.zoom { margin-left: 4px; }
.back { height: 28px; padding: 0 10px; font-size: 12px; }
.pnl { position: absolute; left: 50%; top: 62px; transform: translateX(-50%); text-align: center; pointer-events: none; }
.pnl .big { font-family: var(--fd); font-size: clamp(30px, 4.4vw, 56px); letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.pnl .big.up { color: var(--up); } .pnl .big.down { color: var(--down); } .pnl .big.cash { color: var(--ink); opacity: .85; font-size: clamp(18px, 2.2vw, 26px); letter-spacing: .14em; }
.pnl .big.wait { color: var(--acc); font-size: clamp(18px, 2.2vw, 26px); letter-spacing: .12em; }
.pnl .big.locked { font-size: clamp(24px, 3.2vw, 40px); }
.pnl .sub { margin-top: 6px; font-family: var(--fm); font-size: 12px; color: var(--ink2); min-height: 16px; white-space: nowrap; }
.banner { position: absolute; left: 50%; top: 150px; transform: translate(-50%, -8px); padding: 8px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line2); font-weight: 700; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.banner.on { opacity: 1; transform: translate(-50%, 0); }
.banner.bad { border-color: var(--down); color: var(--down); } .banner.warn { border-color: var(--warn); color: var(--warn); } .banner.good { border-color: var(--up); color: var(--up); }
.side { position: absolute; right: 14px; top: 120px; width: 250px; display: grid; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; max-height: calc(100% - 250px); overflow: hidden; }
.sidehead { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.riderlist { display: grid; gap: 2px; }
.rrow { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 8px; font-size: 12px; text-align: left; }
.rrow:hover, .rrow.spot { background: rgba(150, 165, 255, .07); }
.rrow .dot { width: 8px; height: 8px; border-radius: 50%; }
.rrow .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .s { color: var(--ink3); font-size: 11px; }
.rrow .p { font-family: var(--fm); font-size: 12px; }
.rrow .real { grid-column: 2 / -1; font-size: 10px; color: var(--real); letter-spacing: .1em; }
.up { color: var(--up); } .down { color: var(--down); }
.empty { color: var(--ink3); font-size: 12px; padding: 4px 6px; }
.feed { display: grid; gap: 4px; font-size: 12px; color: var(--ink2); overflow: hidden; }
.fline { line-height: 1.35; }
.fline.me { color: var(--ink); } .fline.good { color: var(--up); } .fline.bad { color: var(--down); } .fline.warn { color: var(--warn); }
.moves { position: absolute; left: 14px; bottom: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; max-width: calc(100% - 330px); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; }
.chip .k { color: var(--ink3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.chip.lab .seg { border: 0; background: transparent; padding: 0; }
.chip.lab .seg button { height: 24px; padding: 0 9px; font-family: var(--fm); font-weight: 400; }
.chip.stepper .toggle { font-weight: 700; color: var(--ink3); padding: 0 4px; }
.chip.stepper .toggle.on { color: var(--ink); }
.chip.stepper .pm { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink2); }
.chip.stepper .val { font-family: var(--fm); min-width: 54px; text-align: center; }
.chip.stepper.off .val, .chip.stepper.off .pm { opacity: .35; }
.chip.toggle { font-weight: 700; color: var(--ink3); padding: 0 12px; }
.chip.toggle.on { color: var(--ink); border-color: var(--line2); }
.hint { font-size: 12px; color: var(--ink3); padding: 0 4px; }
.movesbtn, .sheetdone { display: none; }
.actions { position: absolute; right: 14px; bottom: 18px; display: flex; align-items: flex-end; gap: 8px; }
.btn.act { height: 64px; min-width: 190px; padding: 0 22px; border-radius: 16px; font-size: 16px; letter-spacing: .06em; font-weight: 800; background: var(--acc); color: var(--acc-ink); box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 10px 40px -10px var(--acc); touch-action: none; }
.btn.act.sell { background: var(--ink); color: #05060b; box-shadow: 0 10px 40px -12px rgba(255,255,255,.5); }
.btn.act.busy { opacity: .75; }
#app.real .btn.act { background: var(--real); color: #fff; }
#app.real .btn.act.sell { background: #fff; color: #2a0006; }
.btn.hop { height: 46px; padding: 0 16px; border-radius: 14px; background: var(--panel); color: var(--ink); border: 1px solid var(--line2); display: none; touch-action: none; }
.btn.hop.show { display: inline-flex; }
.btn.emo { width: 46px; height: 46px; border-radius: 14px; background: var(--panel); color: var(--ink2); border: 1px solid var(--line); font-size: 18px; }
.emotes { position: absolute; right: 0; bottom: 74px; display: none; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.emotes.open { display: flex; }
.emotes button { min-width: 40px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; }
.xpbar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(150, 165, 255, .08); pointer-events: none; }
.xpbar .fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--acc2), var(--acc)); transform-origin: left; transform: scaleX(0); transition: transform .4s; }
.xpbar .lvl { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-family: var(--fm); font-size: 10px; color: var(--ink3); white-space: nowrap; }
.net { position: absolute; left: 50%; top: 190px; transform: translateX(-50%); padding: 8px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--warn); color: var(--warn); font-size: 13px; display: none; pointer-events: none; }
.net.on { display: block; }
.axis { position: absolute; left: 0; top: 0; pointer-events: none !important; }
.axis .tick { position: absolute; left: 10px; top: 0; font-family: var(--fm); font-size: 10px; color: rgba(169, 175, 210, .55); white-space: nowrap; }

/* labels + popups */
#labels { position: absolute; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; }
.rlabel { position: absolute; left: 0; top: 0; font-size: 11px; font-weight: 600; color: var(--ink2); white-space: nowrap; padding: 2px 7px; border-radius: 999px; background: rgba(9, 11, 20, .82); border: 1px solid var(--line); will-change: transform; }
.rlabel.me { color: var(--ink); border-color: var(--line2); }
.rlabel.up { color: var(--up); } .rlabel.down { color: var(--down); }
.rlabel.emote { background: var(--ink); color: #05060b; font-weight: 800; font-size: 13px; }
.popup { position: absolute; transform: translate(-50%, 0); font-weight: 800; font-size: 14px; letter-spacing: .04em; white-space: nowrap; animation: pop 1.4s ease-out forwards; color: var(--ink); }
.popup.trick { color: #fff; } .popup.combo { color: var(--acc); font-size: 16px; } .popup.good { color: var(--up); } .popup.bad { color: var(--down); } .popup.xp { color: var(--warn); }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.9); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -34px) scale(1); } }

/* toasts + clip */
#toasts { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; z-index: 35; pointer-events: none; }
.toast { padding: 9px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); font-size: 13px; font-weight: 600; transition: opacity .4s, transform .4s; max-width: min(560px, 92vw); text-align: center; }
.toast.good { border-color: rgba(64, 255, 140, .5); color: var(--up); } .toast.bad { border-color: rgba(255, 61, 77, .5); color: #ff8a93; } .toast.warn { border-color: rgba(255, 181, 71, .5); color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); }
.clip { pointer-events: auto; display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line2); }
.clip img { width: 200px; border-radius: 8px; grid-column: 1 / -1; }

/* drawers */
#drawer { position: absolute; inset: 0; z-index: 45; background: rgba(3, 4, 8, .72); display: grid; place-items: center; padding: 20px; }
#drawer[hidden] { display: none; }
.panel { width: min(760px, 100%); max-height: calc(100% - 20px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 18px 20px 22px; }
.phead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.phead h2 { font-family: var(--fd); font-weight: 400; font-size: 22px; margin: 0; }
.panel h3 { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin: 18px 0 8px; }
.panel p { line-height: 1.5; color: var(--ink2); margin: 6px 0; }
.qrow { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qrow .qt { font-weight: 600; } .qrow .qx { color: var(--warn); font-family: var(--fm); font-size: 12px; }
.qrow .qbar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.qrow .qbar i { display: block; height: 100%; background: var(--acc); transform-origin: left; }
.qrow .qn { font-family: var(--fm); font-size: 12px; color: var(--ink2); }
.qrow.done .qt { color: var(--up); }
.achgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.ach { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink3); font-size: 12px; }
.ach.got { color: var(--ink); border-color: rgba(64, 255, 140, .4); }
.stats { display: grid; grid-template-columns: repeat(3, auto 1fr); gap: 6px 10px; font-size: 13px; }
.stats .k { color: var(--ink3); } .stats b { font-family: var(--fm); font-weight: 400; }
.namerow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.namerow .k { color: var(--ink3); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.namerow input { height: 34px; padding: 0 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line2); width: 200px; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.item { display: grid; gap: 2px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); text-align: left; }
.item b { font-size: 14px; } .item .req { font-size: 11px; color: var(--ink3); }
.item.on { border-color: var(--acc); } .item.on .req { color: var(--acc); }
.item.locked { opacity: .45; cursor: default; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; }
.sw.on { border-color: #fff; }
.helpgrid { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; align-items: baseline; }
.helpgrid b { font-size: 14px; } .helpgrid p { margin: 0; }
.btnrow { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
#wallet-root { position: absolute; z-index: 46; }

/* phone + narrow */
@media (max-width: 1100px) {
  .scopetop { grid-template-columns: 1fr 1fr; } .intro { grid-column: 1 / -1; }
  .side { width: 210px; }
  .moves { max-width: calc(100% - 290px); }
  .hint { display: none; }
}
@media (max-width: 760px) {
  #topbar { padding: 0 10px; gap: 6px; }
  .brand .bname { display: none; }
  .tright .btn.ghost:not(.wallet) { display: none; }
  .tright .badge { display: none !important; }
  .bal { min-width: 0; font-size: 12px; }
  .scopetop { grid-template-columns: 1fr; }
  .tabs { display: flex; }
  .cols { grid-template-columns: 1fr; }
  .col { display: none; } .col.on { display: flex; }
  .card { grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; min-height: 100px; padding: 10px; }
  .pic { width: 62px; height: 62px; }
  .coinbar { top: 58px; left: 8px; gap: 6px; padding: 4px 8px 4px 4px; }
  .coinbar .stat:not(.riders), .coinbar .badge { display: none; }
  .cident .cname { max-width: 90px; }
  .zoom button { padding: 0 8px; }
  .pnl { top: 128px; }
  .banner { top: 250px; font-size: 13px; }
  .cident .sym { max-width: 96px; font-size: 14px; }
  .net { top: 230px; }
  .side { display: none; }
  .moves { display: none; }
  .moves.open { display: flex; flex-direction: column; align-items: stretch; gap: 8px; left: 8px; right: 8px; bottom: 92px; max-width: none; padding: 12px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; z-index: 20; }
  .moves.open .chip { justify-content: space-between; height: 40px; }
  .moves.open .sheetdone { display: inline-flex; height: 40px; }
  #app.sheet #touch { pointer-events: none; }
  .movesbtn { display: inline-flex; position: absolute; left: 8px; right: 8px; bottom: 92px; height: 38px; justify-content: flex-start; background: var(--panel); color: var(--ink); border: 1px solid var(--line2); font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .actions { left: 8px; right: 8px; bottom: 14px; }
  .btn.act { flex: 1; min-width: 0; height: 62px; }
  #toasts { bottom: 140px; }
  .helpgrid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: auto 1fr; }
  .axis .tick { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { .popup { animation-duration: .01s; } }
.board { display: grid; gap: 2px; }
.brow { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 3px 6px; font-size: 12px; }
.brow .rk { font-family: var(--fm); color: var(--ink3); font-size: 11px; }
.brow .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow b { font-family: var(--fm); font-weight: 400; } .brow .s { color: var(--ink3); font-size: 11px; }
.brow.me { border-top: 1px solid var(--line); }
.openrides { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.openrides .k { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--warn); }
.deskmsg { position: absolute; left: 14px; bottom: 62px; max-width: min(620px, calc(100% - 340px)); padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line2); color: var(--ink2); font-size: 13px; }
@media (max-width: 760px) { .deskmsg { left: 8px; right: 8px; bottom: 136px; max-width: none; z-index: 2; } }
@media (max-width: 760px) { #app.deskdown #toasts { bottom: 196px; } }
/* v2: the chase chip + far state of the action button */
.chase { position: absolute; left: 50%; top: 146px; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line2); font-family: var(--fm); font-size: 12px; color: var(--ink2); white-space: nowrap; pointer-events: none !important; }
.chase.near { color: var(--warn); border-color: rgba(255, 181, 71, .45); }
.chase.now { color: #05060b; background: #fff; border-color: #fff; font-weight: 700; letter-spacing: .08em; }
.banner { top: 186px; }
.net { top: 226px; }
.btn.act.far { background: var(--panel); color: var(--ink2); border: 1px solid var(--line2); box-shadow: none; font-size: 14px; letter-spacing: .02em; }
#app.real .btn.act.far { background: var(--panel); color: var(--ink2); }
.rlabel.me.up { color: var(--up); } .rlabel.me.down { color: var(--down); }
@media (max-width: 760px) { .chase { top: 206px; } }
