:root {
  color-scheme: dark;
  --bg: #0c0e12;
  --bg-2: #14171d;
  --card: #1a1e25;
  --card-2: #222731;
  --line: #262c36;
  --text: #e6e8eb;
  --muted: #8b929c;
  --accent: #ea5455;          /* AlphaChart-style coral */
  --accent-2: #ff7a6b;
  --green: #19c463;
  --green-d: #16a34a;
  --red: #ef4444;
  --red-d: #7f1d1d;
  --blue: #3b82f6;
  --gold: #f2c94c;
  --orange: #ff9f43;
  --r: 12px;
  --tab-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; touch-action: manipulation; user-select: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.pad { padding: 16px; }
.pad-x { padding-left: 16px; padding-right: 16px; }
.grow { flex: 1; min-width: 0; }
.pos, .up { color: var(--green); }
.neg, .down { color: var(--red); }
.gold { color: var(--gold); }
h4 { margin: 20px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
svg { flex: none; }

#app { position: relative; height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
  padding-top: env(safe-area-inset-top); }
#screens { position: relative; flex: 1; min-height: 0; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--bg); }
.screen.active { display: flex; }
.screen.tab > *, .screen#scr-accounts > *, .screen#scr-achievements > *, .screen#scr-room > *, .screen#scr-results > * { width: 100%; max-width: 620px; margin-left: auto; margin-right: auto; }
.scroll { flex: 1; overflow-y: auto; min-height: 0; }

/* ---------- headers ---------- */
.bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 54px; }
.bar h1 { margin: 0; font-size: 26px; font-weight: 700; }
.bar h2 { margin: 0; font-size: 17px; font-weight: 600; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar.big { padding: 14px 16px 6px; }
.bar.big h1 { flex: 1; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: var(--text); }
.icon-btn:hover { background: var(--card); }
.pill-tag { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff;
  background: linear-gradient(90deg, #a855f7, var(--accent)); white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--card-2); color: var(--muted); font-weight: 600; vertical-align: 2px; }
.tag.on { background: #10351f; color: var(--green); }

/* ---------- buttons ---------- */
.btn { border-radius: 10px; padding: 12px 16px; font-weight: 700; background: var(--card-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--card-2); }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.danger { background: #3a1616; color: #ff8a8a; }
.btn.start { width: 100%; max-width: 380px; display: flex; margin: 18px auto 0; padding: 16px; font-size: 20px; border-radius: 999px;
  background: var(--accent); color: #fff; box-shadow: 0 6px 24px rgba(234, 84, 85, .3); }
.btn.cancel { background: #5a1414; color: #7ee2a0; }
.blitz-cta { color: var(--gold); max-width: 380px; display: flex; margin: 12px auto 0; }

/* ---------- avatars / logos / gems ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #e8b4a0, #b07a8f); color: #fff; font-weight: 700; font-size: 14px; flex: none; text-transform: uppercase; }
.avatar.xl { width: 84px; height: 84px; font-size: 34px; }
.gold-logo { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; font-weight: 800; color: #5b3d00;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #f2c94c 45%, #b8860b); box-shadow: inset 0 -2px 4px rgba(0,0,0,.25); }
.tier-gem { vertical-align: -4px; }
.medal { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 800; font-size: 13px; color: #3b2a00; flex: none; }
.medal.m1 { background: radial-gradient(circle, #ffe27a, #e0a800); }
.medal.m2 { background: radial-gradient(circle, #f2f4f7, #9aa3ad); }
.medal.m3 { background: radial-gradient(circle, #f0b98d, #b56b34); }
.rank-n { width: 30px; text-align: center; color: var(--accent); font-weight: 700; flex: none; }

/* ---------- home ---------- */
.profile { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0 18px; }
.profile.small { justify-content: flex-start; gap: 8px; margin: 0 0 12px; }
.pname { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.tier-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card); padding: 5px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.tier-chip .muted { font-weight: 400; font-size: 12px; }
.acct-select { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); font-weight: 600; text-align: left; }
.balance-block { margin: 18px 2px; }
.big-bal { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.big-bal span { font-size: 17px; font-weight: 600; }
.tier-progress { height: 12px; background: var(--card-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.tp-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ff9a7a, #ff0f5b); }
.tp-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.card { background: var(--card); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.card .kv, .res-body .kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; }
.card .kv > span, .res-body .kv > span { color: var(--muted); }
.card .kv b, .res-body .kv b { font-size: 17px; font-variant-numeric: tabular-nums; }
.wl-bar { display: flex; width: 150px; white-space: nowrap; height: 26px; border-radius: 4px; overflow: hidden; font-weight: 700; font-size: 13px; }
.wl-w { background: #5a0f0f; color: var(--green); display: flex; align-items: center; padding-left: 8px; min-width: 44px; }
.wl-l { background: #0e2a66; color: #ff6b6b; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; min-width: 44px; }
.start-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.opt { display: flex; flex-direction: column; align-items: center; padding: 8px 6px; border: 1px solid var(--line); border-radius: 999px; }
.opt small { color: var(--muted); font-size: 11px; }
.opt b { font-size: 16px; }
.opt svg { width: 14px; height: 14px; color: var(--muted); }

/* ---------- lists ---------- */
.filters { display: flex; gap: 8px; margin: 4px 0 12px; }
.filters button { padding: 6px 16px; border-radius: 999px; background: var(--card); font-weight: 600; }
.filters button.on { background: var(--text); color: var(--bg); }
.room-card, .rank-row, .hist-row, .acc-row, .set-row { display: flex; align-items: center; gap: 12px; }
.room-card { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; background: var(--bg-2); cursor: pointer; }
.room-ic { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--card); border-radius: 10px; padding: 8px 10px; }
.room-ic small { color: var(--muted); }
.rank-row { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.rank-row small { display: block; }
.rank-row.me { border-color: var(--gold); }
.rank-card { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; cursor: pointer; }
.rc-left { display: flex; align-items: center; }
.rc-top { display: flex; align-items: center; gap: 8px; }
.rc-bot { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.tier-select { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; text-align: left; }
.ladder .tier-progress { height: 8px; }
.hist-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.hist-row { padding: 12px 16px; border-bottom: 1px solid var(--bg-2); cursor: pointer; }
.hist-row:hover { background: var(--bg-2); }
.hist-row svg { width: 16px; color: var(--muted); }
.wl { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 13px; flex: none; }
.wl.W { background: #5a0f0f; color: var(--green); }
.wl.L { background: #0e2a66; color: #ff6b6b; }
.wl.D { background: var(--card-2); color: var(--muted); }
.acc-row { padding: 12px; border-radius: var(--r); margin-bottom: 8px; background: var(--bg-2); border-left: 3px solid transparent; }
.acc-row.active { border-left-color: var(--accent); }
.set-row { justify-content: space-between; padding: 12px; border-radius: var(--r); background: var(--bg-2); margin-bottom: 8px; cursor: pointer; }
.switch { display: inline-block; width: 44px; height: 26px; border-radius: 999px; background: var(--card-2); position: relative; transition: background .15s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on, input:checked + .switch { background: var(--accent); }
.switch.on::after, input:checked + .switch::after { left: 21px; }
.switch-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch-label input { display: none; }
.tab-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.tab-foot.col { display: flex; flex-direction: column; gap: 8px; }
.tab-foot .btn.wide { margin-top: 0; }

/* blitz presets */
.preset { border: 1px solid transparent; cursor: pointer; }
.preset.sel { border-color: var(--accent); }
.pr-head { display: flex; justify-content: space-between; align-items: baseline; }
.pr-head h3 { margin: 0; font-size: 18px; }
.pr-rules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.pr-rules div { background: var(--bg-2); border-radius: 8px; padding: 6px; text-align: center; }
.pr-rules small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.pr-foot { display: flex; justify-content: space-between; align-items: center; }
.pr-foot .btn { padding: 8px 22px; }

/* ---------- tab bar ---------- */
#tabbar { display: flex; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line); background: var(--bg); flex: none; }
#tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; }
#tabbar button.on { color: var(--accent); }

/* ---------- results ---------- */
.res-head { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 10px 0 16px; text-align: center; }
.res-head h1 { margin: 6px 0 0; font-size: 26px; }
.chip-tag { margin-top: 4px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--card); }
.verdict { margin-top: 8px; font-size: 30px; font-weight: 900; letter-spacing: .08em; }
.verdict.pass { color: var(--green); text-shadow: 0 0 24px rgba(25, 196, 99, .5); }
.verdict.fail { color: var(--red); }
.seg-tabs { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: 10px; margin: 0 16px 12px; }
.seg-tabs button { flex: 1; padding: 8px 4px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.seg-tabs button.on { background: #4a4f58; color: var(--text); }
.res-body { padding: 0 16px 16px; }
.bal-flow { display: flex; align-items: center; justify-content: space-around; text-align: center; margin: 8px 0 14px; }
.bal-flow span { display: block; color: var(--muted); font-size: 14px; }
.bal-flow b { font-size: 22px; font-variant-numeric: tabular-nums; }
.bal-flow .arrow { font-size: 26px; color: var(--text); }
.note span { display: block; color: var(--muted); margin: 10px 0 6px; }
.note textarea { width: 100%; min-height: 110px; background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 10px; resize: vertical; }
.th-head { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; color: var(--muted); font-size: 13px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.th-head span:last-child { text-align: right; }
.th-trade { padding: 10px 0; border-bottom: 1px solid var(--bg-2); }
.step-chip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 12px; color: var(--muted); margin: 6px 0 4px; }
.th-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; font-variant-numeric: tabular-nums; }
.th-row small { color: var(--muted); }
.th-row .r { text-align: right; }
.th-memo { width: 100%; margin-top: 8px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: inherit; font: inherit; font-size: 13px; }
.th-memo:focus { outline: none; border-color: var(--muted); }
.eq-chart { height: 260px; margin: 6px 0; }
.res-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.res-foot .btn { padding: 14px; font-size: 17px; }

/* ---------- game ---------- */
.game { background: #111418; }
.g-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px 6px; }
.g-bal { display: flex; gap: 24px; flex: 1; }
.g-bal span { display: block; font-size: 12px; color: var(--muted); }
.g-bal b { font-size: 19px; font-variant-numeric: tabular-nums; }
.g-actions { display: flex; gap: 2px; }
.g-timer { font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.g-timer.low { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.g-meter { padding: 0 12px 6px; }
.meter-track { position: relative; height: 10px; border-radius: 5px; overflow: hidden; display: flex; background: var(--card-2); }
.meter-loss { background: linear-gradient(90deg, #6b1d1d, #2a1a1f); }
.meter-gain { flex: 1; background: linear-gradient(90deg, #172b20, #1f6a3a); }
.meter-start { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--muted); }
.meter-marker { position: absolute; top: -2px; width: 4px; height: 14px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 6px #fff; transition: left .12s linear; }
.meter-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.g-tools { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.g-tools button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 4px; color: var(--muted); font-weight: 600; font-size: 14px; }
.g-tools button svg { width: 20px; height: 20px; }
.g-tools button.on { color: var(--text); background: var(--card); }
.g-body { flex: 1; display: flex; min-height: 0; }
.chart-wrap { position: relative; flex: 1; min-width: 0; }
.chart-host { position: absolute; inset: 0; }
.to-latest { position: absolute; z-index: 7; left: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid #f85149; background: rgba(17,20,24,.85); color: #f85149; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.to-latest svg { width: 20px; height: 20px; }
.to-latest.hidden { display: none; }
.legend { position: absolute; z-index: 6; top: 6px; left: 8px; right: 70px; font-size: 12px; color: var(--muted); pointer-events: none; font-variant-numeric: tabular-nums; }
.lg-ohlc b { font-weight: 600; margin-right: 6px; }
.lg-px { color: var(--text); margin-left: 4px; }
.lg-inds { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; }
.lg-ind { pointer-events: auto; font-size: 12px; color: var(--muted); padding: 0; }
.lg-ind span { margin-left: 3px; }
.draw-bar { display: flex; flex-direction: column; gap: 2px; padding: 4px; border-right: 1px solid var(--line); overflow-y: auto; background: var(--bg); flex: none; }
.db { width: 38px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.db svg { width: 20px; height: 20px; }
.db.on { background: var(--card-2); color: var(--text); }
.db-glyph { font-size: 17px; font-weight: 700; line-height: 1; }
.db-sep { height: 1px; background: var(--line); margin: 3px 4px; }
.pill.change { position: absolute; z-index: 7; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; background: rgba(20, 23, 29, .92); border: 1px solid var(--line); font-weight: 700; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.pill.change svg { width: 18px; height: 18px; }
.pill .free { font-size: 10px; background: var(--green-d); color: #fff; padding: 2px 6px; border-radius: 6px; }
.countdown { position: absolute; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; font-size: 120px; font-weight: 900;
  color: #fff; text-shadow: 0 0 40px rgba(234, 84, 85, .9); background: rgba(0, 0, 0, .3); pointer-events: none; }
.g-pos { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 12px; font-size: 13px; background: var(--bg-2); border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.g-pos .side { font-weight: 800; }
.g-pos.long .side { color: var(--green); } .g-pos.short .side { color: var(--red); }
.g-pos .mini { margin-left: auto; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: var(--card-2); }
.g-foot { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #111418; }
.g-step { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 8px; font-size: 15px; }
.g-step .num { color: var(--accent); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.g-step .tot { font-size: 17px; }
.g-prog { flex: 1; height: 4px; background: var(--card-2); border-radius: 2px; margin-left: 10px; overflow: hidden; }
.g-prog div { height: 100%; width: 0; background: var(--accent); border-radius: 2px; }
.g-btns { display: flex; gap: 10px; align-items: center; }
.g-btns .btn { flex: 1; padding: 14px 8px; font-size: 19px; border-radius: 8px; flex-direction: column; gap: 0; }
.g-btns .btn small { font-size: 12px; font-weight: 600; opacity: .9; }
.g-btns .buy { background: var(--green); color: #fff; }
.g-btns .sell { background: var(--red); color: #fff; }
.g-btns .close { background: var(--card-2); }
.g-btns .close.up small { color: var(--green); } .g-btns .close.down small { color: var(--red); }
.g-btns .flip { background: var(--card-2); flex: .55; }
.g-btns .ext { background: var(--card-2); color: var(--accent); }
.g-btns .res { background: var(--accent); color: #fff; }
.pass { width: 76px; height: 76px; margin-top: -26px; border-radius: 50%; background: #f4f5f7; color: #111; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.pass svg { width: 26px; height: 26px; }
.pass:disabled { opacity: .45; }
.v-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 14px; }

/* ---------- sheets ---------- */
.sheet-wrap { position: absolute; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .18s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; display: flex; flex-direction: column; background: #1c2027;
  border-radius: 18px 18px 0 0; transform: translateY(100%); transition: transform .18s ease-out; max-width: 620px; margin: 0 auto; }
.sheet.full { top: 0; max-height: none; border-radius: 0; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: #3a414d; margin: 8px auto 4px; }
.sheet-head { display: flex; align-items: center; padding: 8px 10px; }
.sheet-head h3 { flex: 1; text-align: center; margin: 0; font-size: 18px; }
.sheet-head span { width: 38px; }
.sheet-body { overflow-y: auto; padding: 6px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet-body h3 { margin: 10px 0; }
.search { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border-radius: 10px; padding: 0 10px; margin: 0 0 8px; }
.search svg { width: 18px; color: var(--muted); }
.search input { flex: 1; background: none; border: none; outline: none; padding: 10px 0; }
.sheet-body .seg-tabs { margin: 0 0 10px; }
.pick-list { display: flex; flex-direction: column; }
.pick-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; cursor: pointer; border-bottom: 1px solid #242932; }
.pick-row.sel { background: var(--card); border-radius: 8px; }
.pick-row.danger { color: #ff8a8a; }
.pick-name { flex: 1; font-size: 16px; }
.pick-row .gear { color: var(--muted); }
.check { width: 24px; height: 24px; border-radius: 6px; border: 2px solid #4b5360; flex: none; position: relative; }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on::after { content: ''; position: absolute; left: 7px; top: 2px; width: 6px; height: 12px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #4b5360; flex: none; position: relative; }
.radio.on { border-color: var(--accent); }
.radio.on::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.prm { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #242932; }
.prm span { color: var(--muted); }
.prm input, .prm select { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 55%; text-align: right; }
.o-btns { display: flex; gap: 10px; margin-top: 16px; }
.o-btns .btn { flex: 1; padding: 14px; font-size: 17px; }
.o-btns .btn.buy { background: var(--green-d); color: #fff; }
.o-btns .btn.sell { background: #b91c1c; color: #fff; }
.order-title { text-align: center; font-size: 22px; font-weight: 600; }
.o-row { display: flex; justify-content: space-between; margin: 12px 0 8px; }
.chips4, .chips6 { display: grid; gap: 8px; }
.chips4 { grid-template-columns: repeat(4, 1fr); }
.chips6 { grid-template-columns: repeat(6, 1fr); }
.chips4 button, .chips6 button { padding: 10px 0; border-radius: 8px; background: #3a3f48; font-weight: 600; }
.chips4 button.on, .chips6 button.on { background: var(--text); color: var(--bg); }
.o-brackets { display: grid; gap: 8px; margin: 14px 0 6px; }
.o-br { display: flex; align-items: center; gap: 8px; background: var(--bg-2); border-radius: 10px; padding: 8px 10px; font-weight: 600; }
.o-br .stepper { margin-left: auto; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.o-br .stepper b { font-size: 13px; min-width: 110px; text-align: center; font-weight: 600; }
.o-br .stepper button { width: 30px; height: 30px; border-radius: 8px; background: #3a3f48; }
.o-kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 16px; }
.o-kv span { color: var(--muted); }
.o-kv b { font-variant-numeric: tabular-nums; }
.o-quick { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 8px; }
.info-list { padding-left: 18px; line-height: 1.6; }
.keys { line-height: 2.2; }
kbd { display: inline-block; min-width: 24px; padding: 1px 6px; border-radius: 5px; background: var(--card-2); border: 1px solid var(--line); text-align: center; font-size: 12px; margin-right: 2px; }

/* ---------- toast ---------- */
.toast { position: absolute; left: 50%; top: 70px; transform: translate(-50%, -10px); z-index: 80; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
  background: #2a303a; border: 1px solid var(--line); padding: 9px 16px; border-radius: 10px; font-weight: 600; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error, .toast.bad { border-color: var(--red); color: #ff9d97; }
.toast.good { border-color: var(--green); color: #7ee2a0; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  .game .g-foot { display: flex; align-items: center; gap: 24px; }
  .game .g-step { margin: 0; width: 280px; }
  .game .g-btns { flex: 1; max-width: 640px; margin-left: auto; }
  .pass { margin-top: 0; width: 64px; height: 64px; }
}
@media (max-width: 380px) {
  .g-bal { gap: 14px; } .g-bal b { font-size: 16px; }
  .g-btns .btn { font-size: 17px; }
}

/* ---------- rivals scoreboard / feed ---------- */
.g-rivals { display: flex; gap: 6px; overflow-x: auto; padding: 2px 12px 8px; scrollbar-width: none; }
.g-rivals::-webkit-scrollbar { display: none; }
.rv { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 5px; border-radius: 999px; background: var(--card); border: 1px solid transparent;
  white-space: nowrap; font-size: 13px; flex: none; font-variant-numeric: tabular-nums; }
.rv.me { background: #2a2130; border-color: var(--accent); }
.rv.on { border-color: #8b949e; }
.rv.dead { opacity: .45; }
.rv-rank { color: var(--muted); font-size: 11px; width: 10px; text-align: center; }
.rv-av { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #111; font-weight: 800; font-size: 11px; }
.rv-name { font-weight: 600; }
.rv-pos { font-size: 10px; }
.rv-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.feed { position: absolute; z-index: 8; left: 50%; top: 42px; transform: translate(-50%, -6px); max-width: 92%; padding: 6px 12px; border-radius: 10px;
  background: rgba(22, 26, 33, .94); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.feed.show { opacity: 1; transform: translate(-50%, 0); }
.feed i { color: var(--muted); }
.v-rivals { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; border-top: 1px solid var(--line); }
.rank-line { margin-top: 8px; font-weight: 700; color: var(--gold); }

/* ---------- career ---------- */
.start-opts.four { grid-template-columns: repeat(4, 1fr); }
.career { margin-top: 18px; }
.car-head { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.link-btn { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 13px; }
.link-btn svg { width: 16px; height: 16px; }
.car-dots { display: flex; gap: 6px; margin: 10px 0; }
.car-dots span { flex: 1; height: 6px; border-radius: 3px; background: var(--card-2); }
.car-dots span.done { background: var(--green); }
.car-dots span.cur { background: var(--accent); }
.car-stage { margin-bottom: 8px; }
.car-bots { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.car-bots .muted { margin-left: 4px; }
.career .btn.wide { margin-top: 12px; }
.stage-n { width: 30px; height: 30px; border-radius: 50%; background: var(--card-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.stage-n.done { background: var(--green-d); color: #fff; }
.pick-row.locked { opacity: .45; cursor: default; }

/* ---------- markets ---------- */
.mkt-logo { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; flex: none; font-weight: 800; color: #fff;
  letter-spacing: -.02em; box-shadow: inset 0 -2px 4px rgba(0,0,0,.25); }
.mkt-logo.coin { background: radial-gradient(circle at 35% 30%, #4b5563, #1f2937); color: #d1d5db; }
.mkt-line { display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 10px; font-size: 12px; color: var(--muted); min-height: 16px; }
.mkt-line span:last-child { margin-left: 6px; }

/* ---------- achievements ---------- */
.chip-row { display: flex; gap: 6px; margin-top: 6px; }
.medal-box { background: linear-gradient(135deg, #2a2412, #1a1e25); border: 1px solid #5a4a1a; border-radius: var(--r); padding: 10px 12px; margin-bottom: 12px; }
.mb-title { font-weight: 800; color: var(--gold); margin-bottom: 6px; }
.medal-new { display: flex; align-items: center; gap: 10px; padding: 4px 0; animation: pop .4s ease-out both; }
.medal-new small { display: block; font-weight: 700; }
.mi, .ach-ic { font-size: 26px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: var(--card-2); border-radius: 50%; flex: none; }
.mdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0,0,0,.35); }
.mdot.off { opacity: .15; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.goals { background: var(--card); border-radius: var(--r); padding: 10px 12px; margin-bottom: 12px; }
.goal { font-size: 13px; margin-top: 6px; }
.gbar { height: 6px; background: var(--card-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.gbar div { height: 100%; background: linear-gradient(90deg, #ff9a7a, var(--accent)); border-radius: 3px; }
.ach-head { margin-bottom: 14px; }
.ach-head .big { font-size: 30px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--bg-2); margin-bottom: 8px; }
.ach.locked .ach-ic { filter: grayscale(1); opacity: .5; }
.ach-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dots { display: inline-flex; gap: 3px; }
.g-timer small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }

/* ---------- collection (TCG binder, dark) ---------- */
.avatar-img { display: inline-flex; border-radius: 50%; overflow: hidden; flex: none; padding: 0; box-shadow: 0 0 0 3px #2a303a, 0 0 18px rgba(234,84,85,.25); }
.avatar-img.xl { width: 84px; height: 84px; }
.avatar-img img, .rv-av img, .mi img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.rv-av { overflow: hidden; }
.mi { overflow: hidden; }
.mi.round { border-radius: 50%; }
.coll-sub { margin-bottom: 10px; }
.tcg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tcg { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border-radius: 12px; text-align: center;
  background: linear-gradient(160deg, #1d222b, #13161c); border: 1.5px solid var(--c); box-shadow: 0 0 14px -6px var(--c); overflow: hidden; }
.tcg-art { width: 78px; height: 78px; display: flex; align-items: center; justify-content: center; position: relative; }
.tcg-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.6)); }
.tcg-art.round { border-radius: 50%; overflow: hidden; border: 2px solid var(--c); }
.tcg-art.round img { object-fit: cover; }
.tcg-name { font-size: 12px; font-weight: 700; line-height: 1.2; min-height: 29px; display: flex; align-items: center; }
.tcg-dots { display: flex; gap: 3px; }
.tcg-dots .mdot { width: 9px; height: 9px; }
.tcg .gbar { width: 100%; }
.tcg-max { font-size: 10px; font-weight: 800; color: var(--c); letter-spacing: .08em; }
.tcg-rar { font-size: 10px; font-weight: 700; }
.tiny { font-size: 10px; line-height: 1.2; }
.tcg.locked .tcg-art img { filter: grayscale(1) brightness(.28); }
.tcg.locked { box-shadow: none; }
.tcg .lock { position: absolute; font-size: 20px; }
.tcg.equipped { outline: 2px solid var(--accent); outline-offset: 2px; }
.tcg.holo::after { content: ''; position: absolute; inset: -40%; pointer-events: none; mix-blend-mode: color-dodge; opacity: .35;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 45%, rgba(120,200,255,.4) 50%, rgba(255,120,220,.35) 55%, transparent 65%);
  animation: holo 3.2s ease-in-out infinite; }
@keyframes holo { 0% { transform: translateX(-35%); } 50% { transform: translateX(35%); } 100% { transform: translateX(-35%); } }
.md-big { display: flex; justify-content: center; margin: 6px 0; }
.md-big img { width: 180px; height: 180px; object-fit: contain; filter: drop-shadow(0 6px 16px rgba(0,0,0,.7)); }
.md-big img.locked { filter: grayscale(1) brightness(.3); }
.md-tiers > div { display: grid; grid-template-columns: 14px 70px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid #242932; font-size: 14px; }
.md-tiers > div:not(.got) { opacity: .55; }
.quest { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #242932; font-size: 14px; }
.quest.claimed { opacity: .5; }
.quest .gbar { margin-top: 5px; }
.q-claim { padding: 6px 14px; animation: pulse 1.2s infinite; }
.q-done { color: var(--green); font-weight: 800; }
.quests-card { margin-top: 18px; }
.reveal-list { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.reveal-card { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--c);
  background: linear-gradient(135deg, #22262f, #15181e); box-shadow: 0 0 22px -6px var(--c); animation: flipin .5s ease-out both; }
.reveal-card small { display: block; font-weight: 700; }
.rc-art { width: 72px; height: 72px; flex: none; }
.rc-art img { width: 100%; height: 100%; object-fit: contain; }
.rc-art.round { border-radius: 50%; overflow: hidden; border: 2px solid var(--c); }
.rc-art.round img { object-fit: cover; }
@keyframes flipin { from { transform: perspective(600px) rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- themed dialogs ---------- */
.modal-wrap { position: absolute; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .15s; }
.modal { position: relative; width: 100%; max-width: 340px; background: #1c2027; border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.6); transform: scale(.94); opacity: 0; transition: transform .15s, opacity .15s; }
.modal-wrap.open .modal-backdrop { opacity: 1; }
.modal-wrap.open .modal { transform: none; opacity: 1; }
.modal h3 { margin: 4px 0 6px; font-size: 18px; }
.modal p { margin: 0 0 4px; font-size: 14px; }
.modal-ic { font-size: 30px; }
.modal-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.modal-input { width: 100%; margin-top: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
.modal-input:focus { border-color: var(--accent); }
.btn.danger-solid { background: #c62828; color: #fff; }

/* ---------- battle card (result share card) ---------- */
.bc-wrap { padding: 4px 16px 12px; }
.bcard { position: relative; overflow: hidden; border-radius: 14px; min-height: 330px; background: #07080b;
  border: 3px solid transparent; background-clip: padding-box; box-shadow: 0 0 0 1px #2a2f38, 0 10px 30px rgba(0,0,0,.6); }
.bcard::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: 16px; }
.bcard.win, .bcard.epic { border-color: #c9a33a; box-shadow: 0 0 0 1px #6b5418, 0 0 28px -6px rgba(242,201,76,.55); }
.bcard.loss, .bcard.fallen { border-color: #6b2323; box-shadow: 0 0 0 1px #3a1414, 0 0 26px -8px rgba(239,68,68,.5); }
.bcard.even { border-color: #4a515c; }
.bc-hero { position: absolute; right: -6%; top: 0; bottom: 0; width: 62%; }
.bc-hero img { height: 100%; width: 100%; object-fit: cover; object-position: center top; }
.bcard.win .bc-hero img, .bcard.epic .bc-hero img { filter: saturate(1.15) brightness(1.05); animation: heroGlow 3s ease-in-out infinite; }
.bcard.loss .bc-hero img { filter: grayscale(.7) brightness(.62) contrast(1.1); }
.bcard.fallen .bc-hero img { filter: grayscale(.9) brightness(.45) sepia(.4) hue-rotate(-20deg); }
@keyframes heroGlow { 50% { filter: saturate(1.25) brightness(1.15) drop-shadow(0 0 12px rgba(242,201,76,.5)); } }
.bc-shade { position: absolute; inset: 0; background: linear-gradient(90deg, #07080b 0%, rgba(7,8,11,.94) 42%, rgba(7,8,11,.25) 72%, rgba(7,8,11,0) 100%); }
.bcard.loss .bc-shade, .bcard.fallen .bc-shade { background: linear-gradient(90deg, #07080b 0%, rgba(7,8,11,.94) 42%, rgba(40,6,6,.35) 72%, rgba(60,0,0,.2) 100%); }
.bcard.epic::after { content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .22;
  background: linear-gradient(115deg, transparent 35%, rgba(255,230,150,.7) 48%, transparent 60%); animation: holo 4s ease-in-out infinite; }
.bc-body { position: relative; padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 2px; max-width: 66%; }
.bc-brand { display: flex; gap: 8px; align-items: center; font-size: 11px; font-weight: 800; letter-spacing: .12em; color: #9aa3ad; }
.bc-kind { padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.08); letter-spacing: .02em; font-weight: 700; }
.bc-title { margin-top: 6px; font-size: 30px; line-height: 1; font-weight: 900; letter-spacing: .02em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff4c2, #f2c94c 55%, #a37a1c); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 18px rgba(242,201,76,.25); }
.bcard.loss .bc-title, .bcard.fallen .bc-title { background: linear-gradient(180deg, #ffd0d0, #ef4444 60%, #7a1010); -webkit-background-clip: text; background-clip: text; }
.bcard.even .bc-title { background: linear-gradient(180deg, #fff, #9aa3ad); -webkit-background-clip: text; background-clip: text; }
.bc-line { font-size: 13px; color: #cfd4da; margin-bottom: 8px; }
.bc-pair { font-size: 17px; font-weight: 800; }
.bc-pair span { color: #cfd4da; font-weight: 700; margin-left: 4px; }
.bc-pair small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.bc-roi { font-size: 44px; font-weight: 900; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; animation: roiIn .6s ease-out both; }
.bc-pnl { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
@keyframes roiIn { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.bc-story { list-style: none; padding: 0; margin: 10px 0 0; font-size: 12px; color: #cfd4da; display: flex; flex-direction: column; gap: 3px; }
.bc-story li::before { content: '⚔ '; color: var(--muted); }
.bcard.win .bc-story li::before, .bcard.epic .bc-story li::before { color: var(--gold); }
.bc-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: #6b727d; }
.bc-share { width: 100%; margin-top: 8px; padding: 10px; }
@media (min-width: 560px) { .bc-title { font-size: 38px; } .bc-roi { font-size: 56px; } }

.credit { color: var(--muted); text-decoration: underline; }

/* =================== v1.10 buttons: 3D, glow, ripple =================== */
.btn, .pass, .rv, .tcg, .opt { position: relative; overflow: hidden; -webkit-user-select: none; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.35); transform: scale(0); pointer-events: none;
  animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* every button: soft gradient face + 3D base that sinks when pressed */
.btn { background: linear-gradient(180deg, #2b313c, #20252e); box-shadow: 0 3px 0 #12151a, inset 0 1px 0 rgba(255,255,255,.07);
  transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 #12151a, inset 0 1px 0 rgba(255,255,255,.05); }
.btn.primary { background: linear-gradient(180deg, #ff7066, #e2474b 55%, #c23540); color: #fff; box-shadow: 0 3px 0 #7c1d25, 0 6px 18px -6px rgba(234,84,85,.6), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.primary:active:not(:disabled) { box-shadow: 0 0 0 #7c1d25, inset 0 1px 0 rgba(255,255,255,.2); }
.btn.ghost { background: linear-gradient(180deg, #262b35, #1c2029); border: 1px solid #323946; }
.btn.danger-solid { background: linear-gradient(180deg, #e53935, #b71c1c); box-shadow: 0 3px 0 #6d1010, inset 0 1px 0 rgba(255,255,255,.2); }

/* ---- START: forge button ---- */
.btn.start { position: relative; isolation: isolate; flex-direction: column; gap: 2px; padding: 0; height: 74px; font-size: 21px; border-radius: 18px;
  background: #1a0e10; color: #fff; box-shadow: 0 6px 0 #5e141c, 0 14px 34px -8px rgba(234,84,85,.7); animation: breathe 2.8s ease-in-out infinite; }
.btn.start::before { content: ''; position: absolute; inset: -60%; z-index: -2;
  background: conic-gradient(from 0deg, #ff9a5a, #ea5455, #a855f7, #f2c94c, #ff9a5a); animation: spin 4s linear infinite; }
.btn.start .st-glow { position: absolute; inset: 2px; z-index: -1; border-radius: 16px;
  background: radial-gradient(120% 140% at 50% 0%, #ff7a66 0%, #e2474b 45%, #9e2432 100%); }
.btn.start::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; z-index: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); animation: sweep 3.2s ease-in-out infinite; }
.st-face { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.st-title { font-weight: 900; letter-spacing: .08em; text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 18px rgba(255,210,160,.45); }
.btn.start small { font-size: 12px; font-weight: 600; opacity: .85; letter-spacing: .02em; }
.btn.start:hover { filter: brightness(1.08); }
.btn.start:active { transform: translateY(5px) scale(.99); box-shadow: 0 1px 0 #5e141c, 0 6px 18px -8px rgba(234,84,85,.7); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sweep { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes breathe { 50% { box-shadow: 0 6px 0 #5e141c, 0 16px 44px -6px rgba(234,84,85,.95); } }

/* ---- game: BUY / SELL / CLOSE / PASS ---- */
.g-btns .btn { border-radius: 12px; }
.g-btns .buy { background: linear-gradient(180deg, #34e07f, #16b85a 55%, #0f9448); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25);
  box-shadow: 0 4px 0 #0b5e2e, 0 8px 20px -8px rgba(25,196,99,.7), inset 0 1px 0 rgba(255,255,255,.35); }
.g-btns .sell { background: linear-gradient(180deg, #ff6b6b, #e53935 55%, #c62828); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25);
  box-shadow: 0 4px 0 #6d1010, 0 8px 20px -8px rgba(239,68,68,.7), inset 0 1px 0 rgba(255,255,255,.3); }
.g-btns .buy:active:not(:disabled), .g-btns .sell:active:not(:disabled) { transform: translateY(4px); }
.g-btns .buy:active:not(:disabled) { box-shadow: 0 0 0 #0b5e2e, inset 0 1px 0 rgba(255,255,255,.3); }
.g-btns .sell:active:not(:disabled) { box-shadow: 0 0 0 #6d1010, inset 0 1px 0 rgba(255,255,255,.3); }
.g-btns .close { background: linear-gradient(180deg, #333a46, #252a33); }
.g-btns .res { background: linear-gradient(180deg, #ff7066, #c23540); box-shadow: 0 4px 0 #7c1d25, inset 0 1px 0 rgba(255,255,255,.25); }
.pass { background: radial-gradient(circle at 50% 35%, #ffffff, #dfe3ea 70%, #b9c0cc); box-shadow: 0 5px 0 #7d8594, 0 10px 24px rgba(0,0,0,.55), 0 0 0 4px rgba(255,255,255,.06);
  transition: transform .08s, box-shadow .08s; }
.pass:not(:disabled)::before { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); animation: passRing 1.8s ease-out infinite; }
.pass:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 #7d8594, 0 4px 10px rgba(0,0,0,.5); }
@keyframes passRing { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .btn.start, .btn.start::before, .btn.start::after, .pass::before, .q-claim { animation: none !important; }
}

/* ranking: you vs bots */
.rank-card.me { border-color: var(--gold); box-shadow: 0 0 18px -8px rgba(242,201,76,.6); }
.rank-card.bot { background: linear-gradient(90deg, #14171d, #111418); }

/* ---------- glowing page titles + tab bar ---------- */
.ptitle { display: flex; align-items: center; gap: 12px; }
.hdr-ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
  color: var(--g); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--g) 28%, transparent), rgba(255,255,255,.03) 70%);
  border: 1px solid color-mix(in srgb, var(--g) 45%, transparent);
  box-shadow: 0 0 16px -2px color-mix(in srgb, var(--g) 65%, transparent), inset 0 0 12px color-mix(in srgb, var(--g) 25%, transparent);
  animation: hdrGlow 2.6s ease-in-out infinite; }
.hdr-ic svg { width: 24px; height: 24px; filter: drop-shadow(0 0 6px var(--g)); }
@keyframes hdrGlow { 50% { box-shadow: 0 0 26px 0 color-mix(in srgb, var(--g) 80%, transparent), inset 0 0 16px color-mix(in srgb, var(--g) 35%, transparent); } }
#tabbar button svg { transition: filter .2s, transform .2s; }
#tabbar button.on svg { filter: drop-shadow(0 0 6px var(--accent)) drop-shadow(0 0 12px rgba(234,84,85,.55)); transform: translateY(-1px) scale(1.08); }
#tabbar button.on { text-shadow: 0 0 10px rgba(234,84,85,.6); }
@media (prefers-reduced-motion: reduce) { .hdr-ic { animation: none; } }

/* ---------- pair logos ---------- */
.pair-logo { position: relative; display: inline-block; flex: none; }
.pair-logo .pc { position: absolute; width: 68%; height: 68%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; line-height: 1; box-shadow: inset 0 -2px 3px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.4); }
.pair-logo .base { left: 0; top: 0; z-index: 2; border: 2px solid #0c0e12; }
.pair-logo .quote { right: 0; bottom: 0; z-index: 1; opacity: .95; }
/* ---------- about ---------- */
.about { text-align: center; }
.about-logo img { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 0 24px -6px rgba(234,84,85,.6); }
.about h2 { margin: 8px 0 2px; }
.about-ver { display: inline-block; padding: 2px 12px; border-radius: 999px; background: #10351f; color: var(--green); font-weight: 800; font-size: 13px; }
.about-new { text-align: left; background: var(--bg-2); border-radius: 12px; padding: 10px 14px; margin: 14px 0 8px; }
.about-new ul { margin: 6px 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.about .kv { display: flex; justify-content: space-between; gap: 10px; text-align: left; padding: 9px 0; border-bottom: 1px solid #242932; font-size: 14px; }
.about .kv span { color: var(--muted); }

.about-notice { margin: 14px 0 0; font-size: 11px; color: #6b727d; line-height: 1.5; }
.about-notice a { color: #6b727d; }

/* ---------------- coins & shop (v1.14) ---------------- */
.coin-chip { font-weight: 800; font-size: 14px; padding: 5px 12px; border-radius: 999px; color: #2a1d00; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffe08a, #f2b632); box-shadow: 0 0 0 1px #8a6510 inset, 0 2px 10px rgba(242,182,50,.25); cursor: pointer; }
.btn.price-btn { padding: 5px 10px; font-size: 13px; border-radius: 8px; flex: none; white-space: nowrap; }
.btn.price-btn svg { width: 13px; height: 13px; }
.btn.price-btn:disabled { opacity: .45; }
.pick-row.locked-soft .pick-name { opacity: .6; }
.coin-hero { text-align: center; padding: 10px 0 14px; }
.coin-big { font-size: 34px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(242,201,76,.35); }
.owner-note { border: 1px dashed #6b5a2a; font-size: 13px; }
.card.earn summary { cursor: pointer; list-style: none; }
.card.earn summary::after { content: ' ▾'; color: var(--muted); }
.card.earn[open] summary { margin-bottom: 6px; }
.ladder-stage { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 12px 0 4px; }
.shop-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border-radius: 10px; margin-bottom: 6px; }
.shop-row.locked { background: var(--bg-2); }
.shop-row .gbar { margin-top: 4px; }
.tf-badge { display: inline-grid; place-items: center; min-width: 46px; height: 32px; padding: 0 8px; border-radius: 8px; font-weight: 800; background: var(--card-2); }
.shop-row.locked .tf-badge { color: var(--muted); }
.temper { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; flex-wrap: wrap; }
.temper-tag { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 999px;
  color: var(--t); background: color-mix(in srgb, var(--t) 14%, transparent); border: 1px solid color-mix(in srgb, var(--t) 40%, transparent); }
.temper-tag.sm { font-size: 11px; padding: 1px 7px; vertical-align: 1px; }
.mkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.mkt-card { border-radius: var(--r); overflow: hidden; background: var(--card); border: 1px solid color-mix(in srgb, var(--t) 35%, var(--line)); }
.mkt-card.locked .mkt-art { filter: grayscale(.6) brightness(.7); }
.mkt-art { position: relative; aspect-ratio: 16 / 9; background: #111; }
.mkt-art svg, .mkt-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mkt-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.mkt-title { width: 100%; }
.mkt-meter { width: 100%; height: 5px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.mkt-meter div { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #3fb950, #f2a93b, #f85149); }
.ind-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ind-chip { font-size: 12px; padding: 5px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.coin-log .kv span { font-size: 13px; }
.tcg .av-buy { margin-top: 4px; }
.coin-box { background: linear-gradient(135deg, #2b2410, #1a1e25); border: 1px solid #6b5a1e; border-radius: var(--r); padding: 10px 12px; margin-bottom: 12px; }
.cb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cb-head b { color: var(--gold); font-size: 17px; }
.cb-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; }
.cb-row b { color: var(--gold); }
.btn.price-btn.short { background: var(--card-2); color: var(--muted); box-shadow: none; }

/* ---------- energy (v1.17) ---------- */
.energy-chip { font-weight: 800; font-size: 14px; padding: 5px 11px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; cursor: pointer;
  color: #06222b; background: linear-gradient(180deg, #8ff0ff, #2bb8d9); box-shadow: 0 0 0 1px #12708a inset, 0 2px 10px rgba(43,184,217,.25); margin-right: 6px; }
.en-hero { text-align: center; padding: 6px 0 12px; }
.en-big { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.en-need { text-align: center; color: #ff9d97; }
.en-costs { margin: 6px 0 14px; }
.en-costs .kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }

/* ---------- prop challenge (v1.17) ---------- */
.g-play { display: flex; gap: 6px; align-items: center; padding: 6px 12px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); background: #0e1115; }
.g-play::-webkit-scrollbar { display: none; }
.g-play button { flex: none; padding: 7px 10px; border-radius: 8px; background: var(--card-2); color: var(--text); font-weight: 700; font-size: 13px; white-space: nowrap; }
.g-play button:disabled { opacity: .4; }
.g-play .pl-auto { background: var(--accent); color: #fff; min-width: 78px; }
.g-play .pl-auto.on { background: #e3b341; color: #1a1300; }
.g-play .pl-speed { font-variant-numeric: tabular-nums; color: var(--muted); }
.g-play .pl-sep { width: 1px; height: 22px; background: var(--line); flex: none; }
.game.prop .g-timer { font-size: 24px; }
.o-btns.col { flex-direction: column; gap: 8px; }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(248,81,73,.4); }
.prop-card .seg { display: flex; gap: 6px; margin: 6px 0 10px; flex-wrap: wrap; }
.prop-card .seg button { flex: 1; min-width: 60px; padding: 8px 6px; border-radius: 8px; background: var(--card-2); color: var(--text); font-weight: 700; font-size: 13px; }
.prop-card .seg button.on { background: var(--accent); color: #fff; }
.prop-card .seg button:disabled { opacity: .35; }
.prop-card .seg-label { font-size: 12px; color: var(--muted); }
.prop-resume { border: 1px solid #e3b341; }
.prop-resume .pr-prog { height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; margin: 8px 0; }
.prop-resume .pr-prog div { height: 100%; background: #e3b341; }
.o-btns.col .btn.wide { margin-top: 0; }

/* ---------- online ranking (v1.19) ---------- */
.join-card h3 { margin: 0 0 6px; }
.join-card .modal-input { width: 100%; box-sizing: border-box; margin-top: 8px; }
.on-me { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#scr-ranking .seg-tabs.pad-x { margin: 0 16px 4px; }
