/* ============================================================
   HASH FORGE v4
   ============================================================ */
:root {
  --bg: #07080a;
  --bg-2: #0b0d10;
  --surface: #101317;
  --surface-2: #151a1f;
  --raise: #1b2128;
  --line: #20262d;
  --line-2: #2c343d;
  --fg: #f1ece2;
  --muted: #98a0a8;
  --subtle: #5f6770;
  --btc: #f7931a;
  --btc-hi: #ffb54d;
  --btc-deep: #8a4b06;
  --hash: #c8f24a;
  --cyan: #3ec8e8;
  --gold: #ffd166;
  --red: #ff5d5d;
  --paper: #f3f0e9;
  --r: 14px;
  --r-lg: 20px;
  --sans: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.03) inset, 0 12px 32px rgb(0 0 0 / 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body {
  overflow: hidden;
  background:
    radial-gradient(1000px 600px at 20% -10%, rgb(247 147 26 / 0.10), transparent 60%),
    radial-gradient(800px 500px at 100% 100%, rgb(62 200 232 / 0.05), transparent 60%),
    var(--bg);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--btc); outline-offset: 2px; }
img { display: block; max-width: 100%; }
::selection { background: var(--btc); color: #1a0d00; }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.c-gold { color: var(--gold); }
.c-orange { color: var(--btc); }
.c-cyan { color: var(--cyan); }
kbd { font-family: var(--mono); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

/* ============ APP SHELL ============ */
.app { display: flex; flex-direction: column; height: 100dvh; max-width: 1240px; margin: 0 auto; position: relative; z-index: 1; }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 16px; padding: 4px 20px 20px; }

/* ============ TOP BAR ============ */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; height: 76px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, var(--btc-hi), var(--btc) 55%, #c96a05);
  color: #1f1000; font-weight: 700; font-size: 19px; transform: rotate(-8deg);
  box-shadow: 0 6px 18px rgb(247 147 26 / 0.3), inset 0 1px 0 rgb(255 255 255 / 0.4);
}
.brand-name { font-size: 18px; letter-spacing: -0.02em; font-weight: 500; color: var(--muted); }
.brand-name b { color: var(--fg); font-weight: 700; }
.wallet { text-align: center; line-height: 1; }
.wallet-main { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.wallet-main strong { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.wallet-main .unit { font-family: var(--mono); font-size: 12px; color: var(--btc); letter-spacing: 0.08em; }
.wallet-sub { margin-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wallet-sub #sps { color: var(--hash); }
.wallet-sub .dot { color: var(--subtle); margin: 0 4px; }
.top-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums;
}
.pill .ico { width: 15px; height: 15px; }
.pill-stim { color: var(--cyan); }
.pill-key { color: var(--gold); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: color 0.15s, border-color 0.15s; }
.icon-btn:hover { color: var(--fg); border-color: var(--line-2); }

/* ============ LEFT: CORE ============ */
.core-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.core-col::-webkit-scrollbar { display: none; }

.core-card {
  position: relative; flex: none; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 52%, rgb(247 147 26 / 0.20), transparent 55%),
    linear-gradient(180deg, rgb(7 8 10 / 0.55), rgb(7 8 10 / 0.92)),
    url("../assets/t/hero-farm.webp") center 60% / cover;
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s;
}
.core-card.overclock { box-shadow: var(--shadow), inset 0 0 0 1px rgb(247 147 26 / 0.5), 0 0 40px rgb(247 147 26 / 0.18); }
.core-card.clickfrenzy { box-shadow: var(--shadow), inset 0 0 0 1px rgb(255 209 102 / 0.7), 0 0 50px rgb(255 209 102 / 0.25); }
.core-shake { padding: 16px 18px 16px; will-change: transform; }
.core-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hash-display {
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.28em; color: var(--hash);
  padding: 7px 10px; border-radius: 8px; background: rgb(7 8 10 / 0.6); border: 1px solid rgb(200 242 74 / 0.18);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hash-display .zero { color: var(--btc); text-shadow: 0 0 12px rgb(247 147 26 / 0.8); }
.block-odds { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.block-odds span { color: var(--cyan); font-weight: 600; }

/* the coin */
.coin-stage { position: relative; display: grid; place-items: center; height: 250px; margin: 6px 0 2px; }
.coin-halo {
  position: absolute; width: 236px; height: 236px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 8%, rgb(247 147 26 / 0.5) 12%, transparent 20% 45%, rgb(62 200 232 / 0.35) 52%, transparent 60% 80%, rgb(200 242 74 / 0.35) 86%, transparent 94%);
  -webkit-mask: radial-gradient(circle, transparent 64%, #000 65%, #000 67%, transparent 68%);
  mask: radial-gradient(circle, transparent 64%, #000 65%, #000 67%, transparent 68%);
  animation: halo-spin 14s linear infinite;
  opacity: 0.8;
}
@keyframes halo-spin { to { transform: rotate(360deg); } }
.coin {
  position: relative; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ffe7b8 0%, #ffbd5a 16%, #f7931a 42%, #d67506 70%, #9a5205 100%);
  box-shadow:
    0 0 0 5px rgb(247 147 26 / 0.14),
    0 18px 50px rgb(247 147 26 / 0.28),
    0 10px 24px rgb(0 0 0 / 0.5),
    inset 0 -10px 22px rgb(90 40 0 / 0.45),
    inset 0 8px 18px rgb(255 240 210 / 0.55);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
}
.coin:hover { transform: scale(1.03); }
.coin:focus-visible { outline: 3px solid var(--cyan); outline-offset: 6px; }
.coin.press { animation: coin-press 0.14s ease-out; }
@keyframes coin-press { 0% { transform: scale(1); } 40% { transform: scale(0.92) rotate(-2deg); } 100% { transform: scale(1); } }
.coin-rim {
  position: absolute; inset: 13px; border-radius: 50%;
  border: 2px solid rgb(255 236 200 / 0.4);
  box-shadow: inset 0 2px 10px rgb(90 40 0 / 0.35), 0 1px 0 rgb(255 255 255 / 0.2);
  background: repeating-conic-gradient(from 0deg, rgb(120 60 0 / 0.08) 0 3deg, transparent 3deg 9deg);
}
.coin-glyph {
  position: relative; display: block; font-size: 104px; font-weight: 700; line-height: 1; color: #fff4de;
  transform: rotate(14deg) translateY(-2px);
  text-shadow: 0 3px 0 #b85f00, 0 6px 14px rgb(80 30 0 / 0.45);
}
.coin-hint {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--fg);
  padding: 5px 10px; border-radius: 999px; background: rgb(7 8 10 / 0.75); border: 1px solid rgb(247 147 26 / 0.45);
  animation: hint-bob 1.4s ease-in-out infinite;
}
@keyframes hint-bob { 50% { transform: translateX(-50%) translateY(-4px); } }
@media (hover: none) { .coin-hint { font-size: 0; } .coin-hint::after { content: "Tap the coin to mine"; font-size: 11px; } }
.core-card.hot .coin { box-shadow: 0 0 0 6px rgb(247 147 26 / 0.25), 0 18px 60px rgb(247 147 26 / 0.45), 0 10px 24px rgb(0 0 0 / 0.5), inset 0 -10px 22px rgb(90 40 0 / 0.45), inset 0 8px 18px rgb(255 240 210 / 0.55); }
.core-card.glow .coin { animation: coin-glow 0.6s ease-in-out infinite; }
.core-card.glow .coin.press { animation: coin-press 0.14s ease-out; }
@keyframes coin-glow { 50% { box-shadow: 0 0 0 8px rgb(255 209 102 / 0.3), 0 0 90px rgb(255 190 80 / 0.7), 0 10px 24px rgb(0 0 0 / 0.5), inset 0 -10px 22px rgb(90 40 0 / 0.45), inset 0 8px 18px rgb(255 240 210 / 0.55); } }
.core-card.overclock .coin-halo { animation-duration: 3s; opacity: 1; }

.core-meta { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; margin-top: 4px; }
.per-strike { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.per-strike b { display: block; font-family: var(--sans); font-size: 20px; color: var(--fg); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.combo-line { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.combo-line b { color: var(--hash); font-weight: 600; white-space: pre; }
.combo-bar { height: 6px; border-radius: 6px; background: rgb(255 255 255 / 0.07); overflow: hidden; }
.combo-time { height: 2px; margin-top: 3px; border-radius: 2px; overflow: hidden; }
.combo-time i { display: block; height: 100%; background: rgb(241 236 226 / 0.35); transform-origin: left; transform: scaleX(0); }
.combo-bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), var(--hash) 60%, var(--btc)); transition: width 0.12s; }

.buffs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.buffs:empty { display: none; }
.buff {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; background: rgb(7 8 10 / 0.7); border: 1px solid var(--line-2);
  animation: pop-in 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.buff .ico { width: 14px; height: 14px; }
.buff em { font-style: normal; color: var(--muted); font-size: 11px; }
.buff i { font-style: normal; font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.b-gold { color: var(--gold); border-color: rgb(255 209 102 / 0.45); }
.b-orange { color: var(--btc); border-color: rgb(247 147 26 / 0.45); }
.b-cyan { color: var(--cyan); border-color: rgb(62 200 232 / 0.45); }
.b-green { color: var(--hash); border-color: rgb(200 242 74 / 0.45); }
@keyframes pop-in { from { opacity: 0; transform: scale(0.8); } }

/* block banner (inside the core card) */
.block-flash {
  position: absolute; left: 50%; top: 88px; z-index: 5; pointer-events: none; text-align: center;
  background: var(--hash); color: #10160a; border-radius: 12px; padding: 8px 16px;
  box-shadow: 0 0 40px rgb(200 242 74 / 0.5);
  animation: flash 1.1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.block-flash b { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; }
.block-flash span { display: block; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.block-flash small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; opacity: 0.6; }
@keyframes flash {
  0% { opacity: 0; transform: translateX(-50%) scale(0.7); }
  15% { opacity: 1; transform: translateX(-50%) scale(1.05); }
  25% { transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-24px); }
}

/* abilities */
.abilities { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; flex: none; }
.ability {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  text-align: center; transition: border-color 0.15s, transform 0.08s, background 0.15s;
  --cd: 0;
}
.ability:active { transform: scale(0.96); }
.ab-ring { position: absolute; inset: 0; background: rgb(0 0 0 / 0.55); transform-origin: bottom; transform: scaleY(var(--cd)); transition: transform 0.2s linear; pointer-events: none; }
.ab-ico { position: relative; width: 22px; height: 22px; color: var(--muted); }
.ab-name { position: relative; font-size: 12px; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.ab-state { position: relative; font-family: var(--mono); font-size: 9.5px; color: var(--subtle); line-height: 1.25; min-height: 24px; display: grid; place-items: center; }
.ability kbd { position: absolute; top: 5px; right: 6px; font-size: 9px; color: var(--subtle); }
.ability.ready { border-color: rgb(247 147 26 / 0.45); background: linear-gradient(180deg, rgb(247 147 26 / 0.1), var(--surface)); }
.ability.ready .ab-ico { color: var(--btc); }
.ability.ready:hover { border-color: var(--btc); }
.ability.running { border-color: var(--hash); }
.ability.running .ab-ico { color: var(--hash); }
.ability.locked { opacity: 0.45; cursor: default; }
.ability.locked .ab-ico { color: var(--subtle); }

/* goal */
.goal-card { flex: none; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.goal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.goal-label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.goal-label .ico { width: 13px; height: 13px; }
.goal-reward { font-family: var(--mono); font-size: 10px; color: var(--subtle); }
.goal-name { font-weight: 600; font-size: 15px; }
.goal-name small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.goal-bar { height: 5px; border-radius: 5px; background: rgb(255 255 255 / 0.07); overflow: hidden; margin-top: 10px; }
.goal-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--btc), var(--gold)); border-radius: 5px; transition: width 0.3s; }
.goal-num { margin-top: 6px; font-family: var(--mono); font-size: 10px; color: var(--subtle); font-variant-numeric: tabular-nums; }

/* ticker */
.ticker { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r); border: 1px dashed var(--line-2); font-size: 12px; color: var(--muted); min-height: 42px; }
.ticker-tag { font-family: var(--mono); font-size: 9px; letter-spacing: 0.16em; color: var(--btc); padding: 3px 6px; border: 1px solid rgb(247 147 26 / 0.35); border-radius: 5px; }
#news.in { animation: news-in 0.4s ease; }
@keyframes news-in { from { opacity: 0; transform: translateY(4px); } }

/* ============ RIGHT: SHOP ============ */
.shop-col { display: flex; flex-direction: column; min-height: 0; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-2); box-shadow: var(--shadow); overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; scrollbar-width: none; flex: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  position: relative; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: color 0.15s, background 0.15s;
}
.tabs button .ico { width: 16px; height: 16px; }
.tabs button:hover { color: var(--fg); background: rgb(255 255 255 / 0.03); }
.tabs button.active { color: var(--fg); background: var(--raise); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05); }
.tabs button.active .ico { color: var(--btc); }
.badge { font-style: normal; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--btc); color: #1f1000; font-family: var(--mono); font-size: 10px; font-weight: 600; display: grid; place-items: center; }
.badge:empty { display: none; }

.tab-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; }
.pane { display: none; }
.pane.active { display: block; animation: pane-in 0.2s ease; }
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } }
.pane-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pane-title { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.pane-title.sub { margin: 22px 0 10px; display: flex; gap: 8px; align-items: baseline; }
.pane-note { font-family: var(--mono); font-size: 11px; color: var(--subtle); font-weight: 400; }
.intro p { margin: 0 0 14px; font-size: 13px; line-height: 1.55; color: var(--muted); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 12px; border-radius: 7px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--raise); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13px; font-weight: 600; transition: background 0.15s, border-color 0.15s, transform 0.08s; }
.btn:hover { border-color: var(--subtle); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(180deg, var(--btc-hi), var(--btc)); border-color: transparent; color: #1f1000; box-shadow: 0 6px 20px rgb(247 147 26 / 0.25); }
.btn-primary:hover { border-color: transparent; filter: brightness(1.06); }
.btn-primary:disabled { background: var(--surface-2); color: var(--subtle); box-shadow: none; border-color: var(--line); filter: none; }
.btn-danger { color: var(--red); border-color: rgb(255 93 93 / 0.35); }
.btn-danger.armed { background: var(--red); color: #1a0000; }
.btn-wide { width: 100%; height: 48px; font-size: 14px; }
.btn-ghost { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.btn-ghost:hover { color: var(--fg); border-color: var(--btc); }

/* rigs */
.rig-list { display: flex; flex-direction: column; gap: 8px; }
.rig {
  display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 10px 12px 10px 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  text-align: left; transition: border-color 0.15s, background 0.15s, transform 0.08s, opacity 0.2s;
  opacity: 0.62;
}
.rig.can { opacity: 1; border-color: var(--line-2); }
.rig.can:hover { border-color: rgb(247 147 26 / 0.6); background: var(--surface-2); }
.rig:active { transform: scale(0.99); }
.rig.hidden, .rig-teaser.hidden { display: none; }
.rig.can.fresh { animation: fresh-pulse 1.6s ease-in-out infinite; }
@keyframes fresh-pulse { 50% { border-color: var(--btc); box-shadow: 0 0 0 3px rgb(247 147 26 / 0.12); } }
.rig.bought { animation: bought 0.35s ease; }
@keyframes bought { 30% { background: rgb(247 147 26 / 0.14); border-color: var(--btc); } }
.rig-art { width: 60px; height: 60px; border-radius: 12px; background: var(--paper); overflow: hidden; display: grid; place-items: center; }
.rig-art img { width: 100%; height: 100%; object-fit: contain; padding: 4px; mix-blend-mode: multiply; }
.rig-art.dark { background: #0d0d0e; }
.rig-art.dark img { mix-blend-mode: normal; }
.rig-art.ghost { background: var(--surface-2); }
.rig-art.ghost img { filter: grayscale(1) invert(1) brightness(0.4) blur(1.5px); mix-blend-mode: screen; }
.rig-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rig-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.rig-name b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rig-tag { font-style: normal; font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; color: var(--subtle); white-space: nowrap; }
.rig-rate { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.rig-ms { display: flex; align-items: center; gap: 8px; }
.rig-ms-bar { flex: 1; max-width: 140px; height: 3px; border-radius: 3px; background: rgb(255 255 255 / 0.07); overflow: hidden; }
.rig-ms-bar i { display: block; height: 100%; width: 0; background: var(--cyan); border-radius: 3px; }
.rig-ms small { font-family: var(--mono); font-size: 10px; color: var(--subtle); white-space: nowrap; }
.rig.fresh .rig-ms { display: none; }
.rig-side { display: flex; align-items: center; gap: 14px; }
.rig-count { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; color: rgb(241 236 226 / 0.16); font-variant-numeric: tabular-nums; min-width: 1ch; text-align: right; }
.rig-cost { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; min-width: 92px; height: 44px; padding: 0 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rig-cost b { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.rig-qty { font-style: normal; font-family: var(--mono); font-size: 9px; color: var(--subtle); }
.rig-qty:empty { display: none; }
.rig.can .rig-cost { background: linear-gradient(180deg, rgb(247 147 26 / 0.2), rgb(247 147 26 / 0.08)); border-color: rgb(247 147 26 / 0.45); }
.rig.can .rig-cost b { color: var(--btc-hi); }
.rig.can .rig-qty { color: var(--btc); }
.rig-teaser { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r); border: 1px dashed var(--line-2); color: var(--subtle); }
.rig-teaser b { display: block; font-size: 15px; color: var(--muted); }
.rig-teaser small { font-family: var(--mono); font-size: 11px; }

/* upgrades */
.up-list { display: flex; flex-direction: column; gap: 8px; }
.up {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px 10px 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  text-align: left; opacity: 0.6; transition: border-color 0.15s, opacity 0.15s, background 0.15s;
}
.up.can { opacity: 1; border-color: var(--line-2); }
.up.can:hover { border-color: rgb(247 147 26 / 0.6); background: var(--surface-2); }
.up-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.up-kind { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; color: var(--subtle); }
.up-info b { font-size: 14px; font-weight: 600; }
.up-info small { font-size: 12px; color: var(--muted); }
.up-cost { font-family: var(--mono); font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.up-cost em { display: block; font-style: normal; font-size: 9px; color: var(--subtle); }
.up.can .up-cost { color: var(--btc-hi); }
.up-ico { position: relative; width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--surface-2); }
.up-ico .ico { width: 20px; height: 20px; }
.up-ico.rig { background: var(--paper); border-color: transparent; overflow: hidden; }
.up-ico.rig.dark { background: #0d0d0e; }
.up-ico.rig img { width: 100%; height: 100%; object-fit: contain; padding: 3px; mix-blend-mode: multiply; }
.up-ico.rig.dark img { mix-blend-mode: normal; }
.up-ico.rig em { position: absolute; right: 2px; bottom: 2px; font-style: normal; font-family: var(--mono); font-size: 9px; font-weight: 600; padding: 1px 4px; border-radius: 4px; background: var(--btc); color: #1f1000; }
.k-click, .k-hustle { color: var(--btc); }
.k-block, .k-reward { color: var(--cyan); }
.k-net { color: var(--hash); }
.k-gold { color: var(--gold); }
.k-combo { color: #ff8a5c; }
.k-ability { color: #a5b4fc; }
.owned-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.owned .up-ico { width: 38px; height: 38px; border-radius: 9px; }
.owned .up-ico .ico { width: 16px; height: 16px; }
.muted-note { margin: 0; font-size: 12px; color: var(--subtle); }
.empty { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: var(--r); border: 1px dashed var(--line-2); color: var(--subtle); }
.empty p { margin: 0; font-size: 13px; line-height: 1.5; }

/* mods */
.mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mod { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: auto auto; gap: 10px 12px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); }
.mod-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgb(62 200 232 / 0.08); border: 1px solid rgb(62 200 232 / 0.25); color: var(--cyan); }
.mod-info b { display: block; font-size: 14px; font-weight: 600; }
.mod-info small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.mod-buy, .mod .switch { grid-column: 1 / -1; }
.mod-buy { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 9px; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 12px; color: var(--muted); opacity: 0.7; }
.mod-buy .ico { width: 14px; height: 14px; }
.mod-buy.can { opacity: 1; color: #041418; background: var(--cyan); border-color: transparent; font-weight: 600; }
.mod-buy.can:hover { filter: brightness(1.08); }
.mod.owned { border-color: rgb(62 200 232 / 0.3); background: linear-gradient(180deg, rgb(62 200 232 / 0.06), var(--surface)); }
.switch { display: inline-flex; align-items: center; gap: 10px; height: 34px; font-size: 12px; color: var(--muted); }
.switch i { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); transition: background 0.15s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--fg); transition: transform 0.15s; }
.switch.on i { background: var(--cyan); }
.switch.on i::after { transform: translateX(14px); }

/* fork */
.fork-hero { padding: 18px; border-radius: var(--r); border: 1px solid rgb(247 147 26 / 0.35); background: linear-gradient(160deg, rgb(247 147 26 / 0.12), var(--surface) 60%); }
.fork-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fork-top small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.fork-top b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.fork-top span { font-size: 12px; color: var(--subtle); }
.fork-next { margin: 14px 0 4px; }
.fork-next small { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--subtle); }
.fork-next small b { color: var(--muted); }
.fork-copy { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 12px 0 16px; }
.fork-legacy { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--gold); margin: 12px 0 0; }
.perk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.perk { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-align: left; opacity: 0.6; transition: border-color 0.15s, opacity 0.15s; }
.perk.can { opacity: 1; border-color: rgb(255 209 102 / 0.4); }
.perk.can:hover { border-color: var(--gold); }
.perk.owned { opacity: 1; border-color: rgb(255 209 102 / 0.25); background: linear-gradient(180deg, rgb(255 209 102 / 0.06), var(--surface)); cursor: default; }
.perk-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgb(255 209 102 / 0.08); border: 1px solid rgb(255 209 102 / 0.25); color: var(--gold); }
.perk-info b { display: block; font-size: 14px; }
.perk-info small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.perk-cost { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 13px; color: var(--gold); }
.perk-cost .ico { width: 14px; height: 14px; }

/* trophies */
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.trophy { position: relative; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); opacity: 0.55; }
.trophy.got { opacity: 1; border-color: rgb(255 209 102 / 0.35); background: linear-gradient(180deg, rgb(255 209 102 / 0.07), var(--surface)); }
.trophy-ico { display: block; color: var(--subtle); margin-bottom: 6px; }
.trophy.got .trophy-ico { color: var(--gold); }
.trophy b { display: block; font-size: 13px; }
.trophy small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.trophy-bar { display: block; height: 3px; border-radius: 3px; background: rgb(255 255 255 / 0.07); margin-top: 8px; overflow: hidden; }
.trophy-bar i { display: block; height: 100%; width: 0; background: var(--gold); }

/* stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.stat { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.stat small { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--subtle); }
.stat b { display: block; margin-top: 4px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============ OVERLAYS ============ */
#fx { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
#bgfx { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.drop-layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.gold-drop {
  position: absolute; width: 76px; height: 76px; margin: -38px 0 0 -38px; pointer-events: auto; border-radius: 50%;
  filter: drop-shadow(0 0 18px rgb(255 209 102 / 0.8));
  animation: drop-in 0.45s cubic-bezier(0.2, 1.5, 0.4, 1), drop-bob 1.6s ease-in-out 0.45s infinite, drop-fade var(--stay, 13000ms) linear forwards;
}
.gold-drop img { width: 100%; height: 100%; pointer-events: none; animation: drop-spin 3s ease-in-out infinite; }
.gold-drop:hover { filter: drop-shadow(0 0 26px rgb(255 209 102 1)); }
.gold-drop.gone { animation: drop-out 0.4s ease forwards; pointer-events: none; }
@keyframes drop-in { from { transform: scale(0) rotate(-40deg); } }
@keyframes drop-bob { 50% { translate: 0 -10px; } }
@keyframes drop-spin { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.06); } }
@keyframes drop-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0.35; } }
@keyframes drop-out { to { opacity: 0; transform: scale(0.4); } }

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; pointer-events: none; width: min(460px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.4;
  background: rgb(21 26 31 / 0.96); border: 1px solid var(--line-2); box-shadow: 0 12px 30px rgb(0 0 0 / 0.45); backdrop-filter: blur(8px);
  animation: toast-in 0.3s cubic-bezier(0.2, 1.2, 0.4, 1);
  transition: opacity 0.3s, transform 0.3s;
}
.toast .ico { color: var(--btc); }
.toast b { font-weight: 600; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast.t-gold { border-color: rgb(255 209 102 / 0.4); }
.toast.t-gold .ico, .toast.t-gold b { color: var(--gold); }
.toast.t-cyan { border-color: rgb(62 200 232 / 0.4); }
.toast.t-cyan .ico { color: var(--cyan); }
.toast.t-red { border-color: rgb(255 93 93 / 0.4); }
.toast .t-img { width: 26px; height: 26px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }

.ach-pop {
  position: fixed; right: 20px; top: 84px; z-index: 85; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 12px 12px; border-radius: 14px; background: rgb(21 26 31 / 0.97); border: 1px solid rgb(255 209 102 / 0.45);
  box-shadow: 0 14px 40px rgb(0 0 0 / 0.5), 0 0 30px rgb(255 209 102 / 0.12);
  animation: ach-in 0.4s cubic-bezier(0.2, 1.3, 0.4, 1), ach-out 0.4s ease 3.3s forwards;
}
.ach-medal { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(145deg, var(--gold), var(--btc)); color: #2a1600; }
.ach-pop small { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.ach-pop b { display: block; font-size: 15px; color: var(--gold); }
@keyframes ach-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes ach-out { to { opacity: 0; transform: translateX(20px); } }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgb(3 4 5 / 0.7); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.2s; }
.modal-back.show { opacity: 1; }
.modal-back[hidden] { display: none; }
.modal { width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgb(0 0 0 / 0.6); transform: translateY(10px) scale(0.98); transition: transform 0.25s cubic-bezier(0.2, 1.2, 0.4, 1); text-align: center; }
.modal-back.show .modal { transform: none; }
.modal h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
.modal p { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.modal-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; }
.modal-icon .ico { width: 24px; height: 24px; }
.m-orange { background: rgb(247 147 26 / 0.12); color: var(--btc); border: 1px solid rgb(247 147 26 / 0.35); }
.m-green { background: rgb(200 242 74 / 0.1); color: var(--hash); border: 1px solid rgb(200 242 74 / 0.3); }
.modal-big { font-size: 36px; font-weight: 700; letter-spacing: -0.03em; color: var(--hash); margin: 4px 0 20px; }
.modal-big span { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 400; }
.modal-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.modal-stats div { padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.modal-stats small { display: block; font-family: var(--mono); font-size: 10px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.08em; }
.modal-stats b { display: block; margin-top: 4px; font-size: 17px; }
.modal-actions { display: flex; gap: 8px; justify-content: center; }
.modal-actions .btn { flex: 1; height: 44px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; text-align: left; }
.modal-head h2 { margin: 0; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
.set-row b { display: block; font-size: 14px; }
.set-row small { display: block; font-size: 12px; color: var(--subtle); margin-top: 2px; }
.set-row .seg { flex: none; }
.set-row input[type="range"] { width: 160px; accent-color: var(--btc); }
.set-divider { height: 8px; }
.set-btns { display: flex; gap: 6px; }
.set-btns .btn { height: 34px; }
.set-row.danger { border-bottom: 0; }
.save-box { width: 100%; margin: 8px 0; padding: 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--fg); font-family: var(--mono); font-size: 11px; resize: vertical; }

/* ============ MOD EVENTS ============ */
.ransom {
  position: fixed; z-index: 70; width: 280px; border-radius: 10px; overflow: hidden;
  border: 1px solid #ff3b3b; background: #0f0606; color: #ffc2c2;
  box-shadow: 0 0 34px rgb(255 59 59 / 0.25), 0 20px 50px rgb(0 0 0 / 0.6);
  animation: ransom-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes ransom-in { from { opacity: 0; transform: translateY(-14px) scale(0.94); } }
.ransom-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px 7px 10px; background: #220707; border-bottom: 1px solid #571414; font-family: var(--mono); font-size: 10px; font-weight: 600; color: #ff7070; }
.ransom-bar span { display: inline-flex; align-items: center; gap: 6px; }
.ransom-bar .ico { width: 13px; height: 13px; }
.ransom-bar button { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: #2a0a0a; border: 1px solid #571414; color: #ff8f8f; }
.ransom-body { padding: 12px; font-size: 12.5px; line-height: 1.5; }
.ransom-body pre { margin: 8px 0 0; font-family: var(--mono); font-size: 9px; color: #7a3030; overflow: hidden; text-overflow: ellipsis; }
.ransom-claim { width: calc(100% - 20px); margin: 0 10px 12px; height: 36px; border-radius: 7px; background: var(--gold); color: #1c0f00; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; }
.ransom-claim:hover { filter: brightness(1.08); }

.stamp {
  position: fixed; z-index: 66; pointer-events: none; font-family: var(--mono); font-weight: 600; font-size: 20px; letter-spacing: 0.08em;
  padding: 10px 18px; border: 3px solid; border-radius: 8px; transform: rotate(-4deg);
  animation: stamp-slam 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.stamp small { display: block; font-size: 11px; font-weight: 400; letter-spacing: 0.04em; margin-top: 2px; opacity: 0.85; }
.stamp.up { color: var(--hash); border-color: var(--hash); background: rgb(16 19 8 / 0.9); }
.stamp.down { color: var(--cyan); border-color: var(--cyan); background: rgb(8 15 19 / 0.9); }
@keyframes stamp-slam { 0% { opacity: 0; transform: rotate(-4deg) scale(2.2); } 12% { opacity: 1; transform: rotate(-4deg) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(-4deg) scale(0.96); } }

.whale {
  position: fixed; left: 0; right: 0; top: 80px; z-index: 64; pointer-events: none; text-align: center; white-space: nowrap; overflow: hidden;
  padding: 10px 0; font-size: 13px; color: #dceeff;
  background: linear-gradient(90deg, transparent, rgb(10 24 34 / 0.94) 12% 88%, transparent);
  animation: whale-swim 6.2s linear forwards;
}
.whale span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--cyan); margin-right: 8px; }
.whale b { color: var(--hash); margin-left: 6px; }
@keyframes whale-swim { 0% { transform: translateX(100vw); } 12% { transform: translateX(0); } 82% { transform: translateX(0); opacity: 1; } 100% { transform: translateX(-12vw); opacity: 0; } }

.fx-terminal::after { content: ""; position: fixed; inset: 0; z-index: 42; pointer-events: none; background: repeating-linear-gradient(to bottom, rgb(0 0 0 / 0.12) 0 1px, transparent 1px 3px); opacity: 0.55; }
.fx-worm::before { content: ""; position: fixed; inset: 0; z-index: 42; pointer-events: none; box-shadow: inset 0 0 180px rgb(3 4 5 / 0.85); animation: worm-breathe 4s ease-in-out infinite; }
@keyframes worm-breathe { 50% { box-shadow: inset 0 0 220px rgb(62 200 232 / 0.2); } }

body.forking .app { animation: forking 1.2s ease; }
@keyframes forking { 0% { filter: none; } 20% { filter: brightness(2.2) saturate(0) blur(2px); } 100% { filter: none; } }

/* ============ RESPONSIVE ============ */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 360px minmax(0, 1fr); }
  .mod-grid, .perk-grid { grid-template-columns: 1fr; }
  .tabs button span { display: none; }
  .tabs button { padding: 0 12px; }
  .tabs button.active span { display: inline; }
}

@media (max-width: 820px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100dvh; }
  .topbar { position: sticky; top: 0; z-index: 30; grid-template-columns: auto 1fr auto; height: 64px; padding: 0 16px; background: rgb(7 8 10 / 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .brand-name { display: none; }
  .wallet-main strong { font-size: 24px; }
  .wallet-sub { font-size: 11px; margin-top: 4px; }
  .wallet-sub .dot, .wallet-sub #btc { display: none; }
  .pill { height: 30px; padding: 0 9px; font-size: 12px; }
  .top-actions { gap: 6px; }
  .top-actions .icon-btn { width: 32px; height: 32px; }
  #muteBtn { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 24px; gap: 12px; }
  .core-col { display: contents; }
  .core-card { order: 1; }
  .abilities { order: 2; }
  .shop-col { order: 3; }
  .goal-card { order: 4; }
  .coin-stage { height: 214px; }
  .coin { width: 170px; height: 170px; }
  .coin-glyph { font-size: 88px; }
  .coin-halo { width: 204px; height: 204px; }
  .shop-col { overflow: visible; }
  .tabs { position: sticky; top: 64px; z-index: 20; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .tabs button span { display: none; }
  .tabs button.active span { display: inline; }
  .tab-body { overflow: visible; }
  .ticker { order: 5; }
  .tab-body { padding: 12px; }
  .ach-pop { top: 74px; right: 12px; left: 12px; }
}

@media (max-width: 480px) {
  .pill-key { display: none; }
  .ab-state { display: none; }
  .ability { padding: 10px 4px; }
  .rig { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; }
  .rig-art { width: 52px; height: 52px; }
  .rig-count { font-size: 20px; }
  .rig-side { gap: 8px; }
  .rig-tag { display: none; }
  .rig-cost { min-width: 78px; padding: 0 10px; }
  .fork-top { grid-template-columns: 1fr 1fr; }
  .fork-top > div:last-child { grid-column: 1 / -1; }
  .set-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .set-row input[type="range"] { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
