/* ---------- animated how-it-works ---------- */
.hw { border: 1px solid var(--line); border-radius: 20px; background: var(--card); overflow: hidden; }
.hw-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.hw-tab { position: relative; display: flex; gap: 12px; align-items: flex-start; text-align: left; background: none; border: 0; padding: 18px 20px 20px; cursor: pointer; color: var(--muted); transition: background .2s; }
.hw-tab + .hw-tab { border-left: 1px solid var(--line); }
.hw-tab:hover { background: var(--bg-soft); }
.hw-n { width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); transition: background .25s, color .25s, border-color .25s; }
.hw-tab.on .hw-n, .hw-tab.past .hw-n { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.hw-tt b { display: block; font-size: 15px; font-weight: 600; color: var(--muted); transition: color .25s; }
.hw-tab.on .hw-tt b { color: var(--ink); }
.hw-tt span { display: block; font-size: 13px; line-height: 1.45; margin-top: 2px; }
.hw-prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.hw-prog i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .12s linear; }

.hw-stage {
  position: relative; display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 18px; padding: 28px; min-height: 380px; align-items: start;
  background-color: var(--bg-soft);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
}
.hw-col { min-width: 0; }
.hw-mid { display: flex; flex-direction: column; gap: 12px; }
.hw-panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: opacity .45s, filter .45s; }
.hw-panel.dim { opacity: .45; filter: saturate(.3); }
.hw-ph { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.hw-who { white-space: nowrap; margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--bg-soft); padding: 2px 7px; border-radius: 6px; }
.hw-av { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.hw-av.a, .hw-art.a { background: linear-gradient(135deg, #10a37f, #0b6b54); }
.hw-av.b, .hw-art.b { background: linear-gradient(135deg, #5b8cff, #3346c9); }
.hw-av.c, .hw-art.c { background: linear-gradient(135deg, #ff9a4a, #e0451f); }
.hw-fl { font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.hw-input { height: 44px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; padding: 0 12px; font-family: var(--mono); font-weight: 600; font-size: 17px; }
.hw-dollar { color: var(--faint); margin-right: 3px; }
.hw-caret { width: 2px; height: 20px; background: var(--ink); margin-left: 2px; animation: hwblink 1s steps(1) infinite; }
@keyframes hwblink { 50% { opacity: 0; } }
.hw-hint { min-height: 20px; margin-top: 8px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.hw-hint.green { color: var(--green); }
.hw-hint.amber { color: var(--amber); }
.hw-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hw-note { margin-top: 6px; font-size: 12.5px; line-height: 1.45; background: var(--amber-bg); color: var(--amber); border-radius: 10px; padding: 8px 10px; }
.hw-btn { margin-top: 14px; height: 42px; border-radius: 999px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: 13.5px; font-weight: 500; opacity: .3; transition: opacity .25s, transform .15s, background .3s; white-space: nowrap; overflow: hidden; padding: 0 12px; }
.hw-btn.ready, .hw-btn.busy, .hw-btn.done { opacity: 1; }
.hw-btn.ready { animation: hwpulse 1.4s ease-in-out infinite; }
@keyframes hwpulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ink) 10%, transparent); } }
.hw-btn.press { transform: scale(.95); }
.hw-btn.done { background: var(--green); color: #fff; }

.hw-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--bg-soft); font-size: 14px; }
.hw-tk { font-family: var(--mono); font-weight: 600; font-size: 16px; }
.hw-d, .hw-arrow { color: var(--faint); }
.hw-owner { font-family: var(--mono); font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.hw-owner.set { color: var(--ink); font-weight: 600; }
.hw-status { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.hw-status.free { background: var(--line-2); color: var(--muted); }
.hw-status.owned { background: var(--green-bg); color: var(--green); }
.hw-coins { display: flex; flex-direction: column; gap: 10px; }
.hw-coin { position: relative; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.hw-coin.ghost { opacity: 0; }
.hw-art { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.hw-cm { min-width: 0; flex: 1; }
.hw-nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-sb { font-size: 12px; color: var(--muted); white-space: nowrap; font-family: var(--mono); }
.hw-lock { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font: 600 11.5px var(--mono); padding: 4px 9px; border-radius: 999px; background: var(--green-bg); color: var(--green); white-space: nowrap; }
.hw-trades { position: absolute; right: 12px; top: -12px; pointer-events: none; }
.hw-tick { display: block; white-space: nowrap; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--primary); color: var(--on-primary); animation: hwtick 1.4s ease-out forwards; }
@keyframes hwtick { 0% { opacity: 0; transform: translateY(8px); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }

.hw-bal { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.hw-bal small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.hw-bal.bump { animation: hwbump .6s ease-out; }
@keyframes hwbump { 0% { color: var(--green); transform: scale(1.04); } 100% { color: var(--ink); transform: none; } }
.hw-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.hw-log { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 100px; }
.hw-log li { white-space: nowrap; display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 7px 10px; border-radius: 10px; background: var(--bg-soft); animation: rise .3s ease-out; }
.hw-log li b { color: var(--green); font: 600 12.5px var(--mono); }
.hw-auto { margin-top: 10px; font-size: 12.5px; font-weight: 500; color: var(--green); opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.hw-auto.on { opacity: 1; transform: none; }

.hw-fly { position: absolute; left: 0; top: 0; z-index: 5; pointer-events: none; will-change: transform; }
.hw-fly.chip, .hw-fly.coin { white-space: nowrap; font: 700 14px var(--mono); padding: 7px 13px; border-radius: 999px; background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-lg); }
.hw-fly.coin { font-family: Inter, sans-serif; font-weight: 600; background: linear-gradient(135deg, #5b8cff, #3346c9); color: #fff; }
.hw-fly.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-bg), 0 0 18px var(--green); }
.pop { animation: hwpop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hwpop { 0% { transform: scale(.94); } 100% { transform: none; } }

@media (max-width: 960px) {
  .hw-stage { grid-template-columns: 1fr 1fr; }
  .hw-stage .hw-col:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .hw-tab { flex-direction: column; gap: 8px; padding: 14px 12px 16px; }
  .hw-tt span { display: none; }
  .hw-tt b { font-size: 13px; }
  .hw-stage { grid-template-columns: 1fr; padding: 16px; gap: 12px; min-height: 0; }
  .hw-stage .hw-col:last-child { grid-column: auto; }
  .hw-log { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hw *, .hw *::before { animation: none !important; transition: none !important; }
}

/* ---------- profile ---------- */
.avatar { display: inline-block; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.btn.with-av { padding-left: 8px; gap: 8px; }
.prof { display: flex; align-items: center; gap: 18px; min-width: 0; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tcard { display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); transition: border-color .15s, box-shadow .15s, transform .15s; }
.tcard:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }
.tc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tc-tk { font: 600 26px var(--mono); letter-spacing: -0.02em; }
.tc-earn b { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tc-earn span { color: var(--muted); font-size: 13.5px; }
.tc-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.tc-meta b { color: var(--ink); font-weight: 600; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-2); padding-top: 10px; font-size: 12.5px; color: var(--faint); }
.tc-go { display: inline-flex; color: var(--muted); transition: transform .15s; }
.tcard:hover .tc-go { transform: translateX(3px); color: var(--ink); }
.me-empty { width: 64px; height: 64px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); }
@media (max-width: 720px) {
  .prof { gap: 12px; }
  .prof .avatar { width: 52px !important; height: 52px !important; }
}

/* ---------- fee split bar ---------- */
.bar.split { display: flex; gap: 3px; background: transparent; }
.bar.split i { border-radius: 99px; }
.bar-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.bar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bar-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
