/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg:      #000000;
  --card:    #0a0a0a;
  --card2:   #141414;
  --border:  #333333;
  --border2: #4d4d4d;

  --purple:  #ffffff;
  --purple-d:rgba(255,255,255,.1);
  --cyan:    #ffffff;
  --cyan-d:  rgba(255,255,255,.1);
  --gold:    #ffffff;
  --gold-d:  rgba(255,255,255,.1);
  --green:   #ffffff;
  --green-d: rgba(255,255,255,.1);
  --red:     #ffffff;
  --red-d:   rgba(255,255,255,.1);

  --text:    #ffffff;
  --muted:   #999999;
  --dim:     #444444;

  --nav-h:   68px;
  --safe-b:  env(safe-area-inset-bottom, 0px);
  --safe-t:  env(safe-area-inset-top, 0px);
}

html {
  height: 100%;
  height: 100dvh;
}
body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  justify-content: center;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 9999;
  background: var(--bg);
}

.loader-row {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.loader-ring {
  flex-shrink: 0;
  width: 40px;
  height: 3px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.loader-ring::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: var(--gold);
  animation: loader-scan 1s ease-in-out infinite;
}
@keyframes loader-scan {
  0%   { left: -40%; }
  100% { left: 100%; }
}
.loader-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.btn-loading {
  position: relative;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.7;
}
.btn-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.25) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 0.9s linear infinite;
}
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

.mono   { font-family: 'Space Mono', monospace; }
.gold   { color: var(--gold); }
.cyan   { color: var(--cyan); }
.purple { color: var(--purple); }
.muted  { color: var(--muted); }

/* ── App Shell ────────────────────────────────────────────── */
#app {
  height: 100vh;
  height: 100dvh;
  height: var(--tg-viewport-height, 100dvh);
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.sidebar { display: none; }

.content-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 14px 0;
  flex-shrink: 0;
  background: transparent;
}

#main-content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#page-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  width: 0%;
  background: #ffffff;
  opacity: 0;
  z-index: 20;
  transition: width .2s ease-out, opacity .3s ease;
  pointer-events: none;
}

#screens-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* ── Screens ──────────────────────────────────────────────── */
.screen {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.screen.active { display: flex; }

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 14px 12px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 18px;
}

/* ── PROFILE ─────────────────────────────────────────────── */
#screen-profile {
  position: relative;
}
.prof-stats {
  padding: 20px 14px 0;
  flex-shrink: 0;
}

.prof-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.prof-mini-stats {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.power-stat {
  height: 51px;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
}
.power-stat-label {
  font-size: 8px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
}
.power-stat-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.wallet-balance-chip {
  height: 46px;
  box-sizing: border-box;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  flex-shrink: 0;
}
.wallet-balance-chip-label {
  font-size: 8px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .6px;
}
.wallet-balance-chip-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.connect-wallet-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 46px;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 0;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Space Mono', monospace;
}
.connect-wallet-btn:active { opacity: .8; }
.connect-wallet-icon-active {
  width: 14px;
  height: 14px;
  border-radius: 0;
  flex-shrink: 0;
  object-fit: contain;
}
.connect-wallet-btn.connected {
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Rig tabs */
.rig-tabs {
  display: flex;
  gap: 8px;
  padding: 0;
  overflow-x: auto;
  flex-shrink: 0;
  margin-right: auto;
}
.rig-tab {
  flex-shrink: 0;
  padding: 5px 16px;
  border-radius: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Space Mono', monospace;
  cursor: pointer;
  transition: all .18s;
}
.rig-tab.active {
  background: var(--purple-d);
  border-color: var(--purple);
  color: var(--purple);
}
.rig-add-btn {
  padding: 5px 13px;
  font-size: 16px;
  color: var(--muted);
  border-style: dashed;
}
.rig-add-btn:hover { color: var(--text); border-color: var(--text); }

/* Rig context menu */
.rig-ctx-menu {
  position: fixed;
  z-index: 999;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 0;
  padding: 4px;
  min-width: 130px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
  animation: ctxIn .12s ease;
}
@keyframes ctxIn {
  from { opacity:0; transform:translateY(-4px); }
  to   { opacity:1; transform:translateY(0); }
}
.ctx-item {
  display: block; width: 100%;
  padding: 10px 14px;
  border: none; background: transparent;
  text-align: left; border-radius: 0;
  font-size: 13px; font-weight: 600;
  font-family: 'Space Mono', monospace;
  cursor: pointer; transition: background .1s;
}
.ctx-item:active { background: rgba(255,255,255,0.06); }
.ctx-delete { color: var(--red); }

/* 3D Canvas */
.rig-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}
.rig-canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.rig-canvas:active { cursor: grabbing; }
.screenshot-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
}

/* Bottom rate bar */
.prof-bottom {
  padding: 8px 14px 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rate-bar {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rig-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 0;
  border: 1px solid var(--border2);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.rig-ctrl-btn:hover  { color: var(--text); border-color: var(--text); }
.rig-ctrl-btn:active { opacity: .65; }

.rate-bar-left    { display: flex; flex-direction: column; gap: 2px; }
.rate-label       { font-size: 13px; color: var(--muted); }
.mining-rate-label{ font-size: 11px; color: var(--muted); opacity: 0.7; }
.rate-val         { font-size: 15px; font-weight: 700; color: var(--gold); }
.rate-right       { display: flex; align-items: center; gap: 10px; }
.claim-btn  { background: var(--gold); color: #000; border: none; border-radius: 0; padding: 5px 12px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .2s, color .2s; }
.claim-btn.claim-btn-empty { background: #2a2a2a; color: #555; cursor: default; }

/* ── EQUIPMENT ────────────────────────────────────────────── */
.equip-group { margin-bottom: 22px; }

/* Rig groups inside connected section */
.inv-rig-group { margin-bottom: 18px; }
.inv-rig-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.inv-rig-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
}
.inv-slot-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 0;
}
.inv-slot-badge.slots-ok   { color: var(--green); background: var(--green-d); }
.inv-slot-badge.slots-full { color: var(--muted);  background: var(--card2);  }

/* Rig label on connected GPU card */
.gpu-rig-label {
  font-size: 11px;
  color: var(--cyan);
  margin-bottom: 5px;
  font-weight: 600;
}

/* Rig picker modal */
.rig-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  width: 100%;
}
.rig-picker-list { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.rig-pick-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
  transition: background .15s;
  font-family: 'Space Mono', monospace;
}
.rig-pick-btn:active:not(.disabled) { background: var(--border2); }
.rig-pick-btn.disabled { opacity: .4; cursor: not-allowed; }
.rig-pick-name { font-size: 15px; font-weight: 700; color: var(--text); }
.rig-pick-slots {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 0;
}
.slots-ok   { color: var(--green); background: var(--green-d); }
.slots-full { color: var(--muted); background: var(--card);    }
.group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
}
.glabel-dot {
  width: 7px; height: 7px;
  border-radius: 0;
  background: var(--dim);
}
.glabel-dot.active-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.glabel-dot.idle-dot   { background: var(--muted); }

.gpu-list { display: flex; flex-direction: column; gap: 10px; }

.gpu-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border-left-width: 3px;
}
.gpu-card.gpu-on  { border-left-color: var(--cyan); }
.gpu-card.gpu-off { border-left-color: var(--dim); opacity: .65; }

.gpu-vis-3d { width: 66px; height: 66px; flex-shrink: 0; background: #0a0a0a; border-radius: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gpu-vis-3d img { height: 58px; width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,.9)); }

/* ── GPU Visual Component ─────────────────────────────────── */
.gpu-vis {
  background: #0a0a0a;
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.gpu-vis-sm { width: 66px; height: 50px; }
.gpu-vis-lg { width: 100%; height: 70px; border-radius: 0; }

.gv-body {
  flex: 1;
  background: #1e1e1e;
  margin: 4px 4px 0;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
}
.gpu-vis-lg .gv-body { margin: 5px 5px 0; }

.gv-fans { display: flex; gap: 5px; }
.gv-fan {
  width: 16px; height: 16px;
  border-radius: 0;
  border: 2px solid #3a3a3a;
  background: #141414;
  display: flex; align-items: center; justify-content: center;
}
.gpu-vis-lg .gv-fan { width: 24px; height: 24px; border-width: 2.5px; }
.gv-hub {
  width: 4px; height: 4px;
  border-radius: 0;
  background: #2e2e2e;
}
.gpu-vis-lg .gv-hub { width: 6px; height: 6px; }

.gv-accent { height: 3px; margin: 3px 4px 0; border-radius: 0; opacity: 0.9; }
.gpu-vis-lg .gv-accent { height: 4px; margin: 3px 5px 0; }

.gv-bracket { height: 6px; background: #4a4a4a; margin: 2px 0 0; }
.gpu-vis-lg .gv-bracket { height: 8px; }

.gpu-card-body { flex: 1; min-width: 0; }
.gpu-card-name { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.gpu-specs { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.spec-item { font-size: 11px; color: var(--muted); }
.spec-item strong { color: var(--cyan); font-weight: 600; }

.wear-bar-bg { height: 3px; background: var(--border); border-radius: 0; overflow: hidden; margin-bottom: 4px; }
.wear-bar-fill { height: 100%; border-radius: 0; transition: width .4s; }
.wear-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }

.card-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.small-btn {
  font-size: 11px; font-weight: 600;
  padding: 5px 12px;
  border-radius: 0;
  border: 1px solid var(--border2);
  background: transparent;
  cursor: pointer;
  transition: all .15s;
  color: var(--muted);
}
.small-btn:active { opacity:.7; }
.small-btn.install-btn   { color: var(--cyan);   border-color: rgba(255,255,255,.3); }
.small-btn.uninstall-btn { color: var(--red);    border-color: rgba(255,255,255,.3); }
.small-btn.repair-btn    { color: var(--gold);   border-color: rgba(255,255,255,.3); }
.small-btn.trash-btn     { color: #ffffff;       border-color: rgba(255,255,255,.3); }
.gpu-broken { opacity: 0.7; }
.broken-badge { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; color: #ffffff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); border-radius: 0; padding: 1px 5px; margin-left: 7px; vertical-align: middle; }

/* ── MARKET ───────────────────────────────────────────────── */
.market-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 14px 0; margin-bottom: 14px; flex-shrink: 0; }
.market-top .page-title { margin-bottom: 0; }
.buy-rood-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--text);
  color: #000;
  border: none;
  border-radius: 0;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity .15s ease;
}
.buy-rood-btn:hover { opacity: .9; }
.buy-rood-btn:active { opacity: .8; }

.market-tabs {
  display: flex;
  gap: 5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 4px;
  margin: 0 14px 16px;
  flex-shrink: 0;
}
.mtab {
  flex: 1;
  padding: 8px 0;
  border: none; background: transparent;
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  font-family: 'Space Mono', monospace;
  cursor: pointer; border-radius: 0;
  transition: all .15s;
}
.mtab.active { color: var(--text); background: var(--card2); }

.market-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* ── ELECTRICITY ──────────────────────────────────────────── */
.elec-balance-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  font-size: 13px;
}
.elec-bal-label { color: var(--muted); }
.elec-bal-val { font-size: 15px; font-weight: 700; }

.elec-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.elec-card:active { border-color: var(--purple); }
.elec-info { flex: 1; min-width: 0; }
.elec-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.elec-sub  { font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.elec-price { font-size: 13px; font-weight: 700; font-family: 'Space Mono', monospace; color: var(--text); }
.elec-buy-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 0;
  border: 1px solid rgba(255,255,255,.3);
  background: var(--purple-d);
  color: var(--purple);
  font-size: 12px; font-weight: 700;
  font-family: 'Space Mono', monospace;
  cursor: pointer; transition: opacity .15s;
  white-space: nowrap;
}
.elec-buy-btn:active  { opacity: .75; }
.elec-buy-btn:disabled { background: var(--border); border-color: transparent; color: var(--muted); cursor: default; }

/* ── GPU Market 3D Visual ─────────────────────────────────── */
.gmv-scene {
  height: 112px;
  background: #111111;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gmv-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.gmv-img {
  height: 86px;
  width: auto;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 20px rgba(0,0,0,0.95));
}

.m-card {
  background: transparent;
  border: 1px solid rgba(128,128,128,.3);
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .18s;
}
.m-card:active { transform: scale(.97); }

.m-card-content {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: rgba(128,128,128,.1);
}

.rarity-badge {
  display: inline-block;
  font-size: 8px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .8px;
  padding: 2px 7px; border-radius: 0; margin-bottom: 4px;
}
.r-common    { background:rgba(128,128,128,.12); color:#999999;       border:1px solid rgba(128,128,128,.25); }
.r-uncommon  { background:var(--green-d);        color:var(--green);  border:1px solid rgba(255,255,255,.25);  }
.r-rare      { background:var(--cyan-d);         color:var(--cyan);   border:1px solid rgba(255,255,255,.25);   }
.r-epic      { background:rgba(204,204,204,.12);  color:#cccccc;       border:1px solid rgba(204,204,204,.25);  }
.r-legendary { background:var(--gold-d);         color:var(--gold);   border:1px solid rgba(255,255,255,.35);  }

.m-card-name  { font-size: 13px; font-weight: 700; }
.m-card-brand { font-size: 10px; color: var(--muted); margin-top: 1px; }

.m-stats { display: flex; flex-direction: column; gap: 4px; }
.m-stat  { display: flex; justify-content: space-between; font-size: 11px; }
.m-stat-key { color: var(--muted); }
.m-stat-val { color: var(--cyan); font-weight: 600; font-family: 'Space Mono', monospace; font-size: 10px; }

.m-price {
  text-align: center; font-size: 13px; font-weight: 800;
  color: var(--gold); font-family: 'Space Mono', monospace;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 0; padding: 5px 0;
}
.m-price-curr { font-size: 10px; font-weight: 600; opacity: .7; }

.buy-btn {
  width: 100%; padding: 10px;
  background: linear-gradient(135deg, #ffffff, #888888);
  border: none; border-radius: 0;
  color: #000; font-size: 13px; font-weight: 800;
  font-family: 'Space Mono', monospace; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.buy-btn:active   { opacity: .85; transform: scale(.98); }
.buy-btn:disabled { background: var(--border); color: var(--muted); cursor: default; transform: none; }

/* ── Rig Preview (Market) ─────────────────────────────────── */
.rig-preview {
  width: 38px;
  height: 54px;
  flex-shrink: 0;
  border: 1px solid var(--border2);
  border-radius: 0;
  background: var(--card2);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px;
}
.rp-shelf {
  flex: 1;
  border-radius: 0;
  background: var(--border2);
  border: 1px solid var(--dim);
}
.rig-preview[data-rows="1"] .rp-shelf { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.35); }
.rig-preview[data-rows="2"] .rp-shelf { background: rgba(255,255,255,.15);  border-color: rgba(255,255,255,.30);  }
.rig-preview[data-rows="3"] .rp-shelf { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.30); }

/* ── POOLS ────────────────────────────────────────────────── */
/* ── Pool list ──────────────────────────────────────────── */
.pool-create-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #ffffff, #888888);
  border: none; border-radius: 0;
  color: #000; font-size: 14px; font-weight: 800;
  font-family: 'Space Mono', monospace; cursor: pointer;
  margin-bottom: 14px; transition: opacity .15s;
}
.pool-create-btn:active { opacity: .8; }

.pool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 16px;
  margin-bottom: 8px;
}
.pool-card-mine {
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.04);
}
.pool-card-badge {
  display: inline-block;
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
  color: #ffffff; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 0; padding: 2px 7px; margin-bottom: 8px;
}
.pool-card-name {
  font-size: 15px; font-weight: 700;
  margin-bottom: 3px;
  display: flex; align-items: center; gap: 7px;
}
.pool-card-desc { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.45; }
.pool-card-stats {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  flex-wrap: wrap; margin-bottom: 12px;
}
.pool-stat-val { color: var(--cyan); font-weight: 700; }
.pool-stat-sep { color: var(--dim); }
.pool-buff-badge {
  font-size: 11px; font-weight: 700;
  color: var(--gold); background: var(--gold-d);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 0; padding: 1px 5px;
  font-family: 'Space Mono', monospace;
}
.pool-card-clickable { cursor: pointer; transition: transform .12s, border-color .12s; }
.pool-card-clickable:active { transform: scale(.985); border-color: var(--border2); }
.pools-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 36px 0; }

.pools-search-input {
  width: 100%; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0; color: var(--text);
  font-size: 14px; font-family: 'Space Mono', monospace;
  outline: none; box-sizing: border-box;
  transition: border-color .15s;
}
.pools-search-input:focus { border-color: var(--border2); }

/* ── Pool action buttons ────────────────────────────────── */
.pool-join-btn {
  width: 100%; padding: 10px;
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: 0; color: var(--text);
  font-size: 13px; font-weight: 700; font-family: 'Space Mono', monospace;
  cursor: pointer; transition: border-color .15s;
}
.pool-join-btn:active { border-color: var(--cyan); }
.pool-leave-btn {
  flex: 1; padding: 10px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.2);
  border-radius: 0; color: #ffffff;
  font-size: 13px; font-weight: 700; font-family: 'Space Mono', monospace;
  cursor: pointer; transition: opacity .15s;
}
.pool-leave-btn:active { opacity: .7; }

/* ── Pool detail ────────────────────────────────────────── */
.pool-detail-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0; padding: 16px; margin-bottom: 10px;
}
.pool-detail-name {
  font-size: 18px; font-weight: 800; letter-spacing: -.2px;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pool-detail-desc { font-size: 13px; color: var(--muted); line-height: 1.45; margin-bottom: 12px; }
.pool-detail-stats {
  display: flex; gap: 0; flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 0; overflow: hidden; margin-bottom: 12px;
}
.pool-detail-stat {
  flex: 1; padding: 9px 12px; text-align: center;
  border-right: 1px solid var(--border); min-width: 70px;
}
.pool-detail-stat:last-child { border-right: none; }
.pool-detail-stat-val { font-size: 13px; font-weight: 700; color: var(--cyan); }
.pool-detail-stat-buff .pool-detail-stat-val { color: var(--gold); }
.pool-detail-stat-key { font-size: 10px; color: var(--muted); margin-top: 2px; }
.pool-detail-divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.pool-detail-actions { display: flex; gap: 8px; }
.pool-disband-warn {
  font-size: 12px; color: #ffffff;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.18); border-radius: 0;
  padding: 9px 12px; margin-bottom: 8px; line-height: 1.45;
}

/* ── Member list ────────────────────────────────────────── */
.pool-members-list {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0; overflow: clip;
}
.pool-members-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px;
  color: var(--muted); padding: 12px 16px 8px;
}
.pool-member {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--border);
  font-size: 13px; position: relative;
}
.pool-member:first-of-type { border-top: none; }
.pool-member-me { background: rgba(255,255,255,.04); }
.pool-member-rank { color: var(--dim); font-size: 11px; width: 20px; flex-shrink: 0; text-align: right; }
.pool-member-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.pool-member-you { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--cyan); background: rgba(255,255,255,.12); border-radius: 0; padding: 1px 5px; margin-left: 5px; vertical-align: middle; }
.pool-member-hr { color: var(--cyan); font-size: 11px; font-weight: 600; flex-shrink: 0; }
.pool-member-pct { font-size: 11px; color: var(--muted); flex-shrink: 0; width: 36px; text-align: right; }

/* ── Member 3-dot menu ──────────────────────────────────── */
.pool-member-menu-wrap { position: relative; flex-shrink: 0; }
.pool-member-dots {
  background: none; border: none;
  color: var(--muted); font-size: 18px; line-height: 1;
  padding: 2px 6px; cursor: pointer; border-radius: 0;
  transition: color .15s, background .15s;
}
.pool-member-dots:active,
.pool-member-dots.open { color: var(--text); background: var(--card2); }
.pool-member-dropdown {
  display: none;
  position: fixed;
  z-index: 1000;
  background: var(--card2); border: 1px solid var(--border2);
  border-radius: 0; overflow: hidden;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.pool-member-dropdown.open { display: block; }
.pool-member-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 14px;
  background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 600; font-family: 'Space Mono', monospace;
  cursor: pointer; text-align: left; white-space: nowrap;
  transition: background .12s;
}
.pool-member-dropdown-item:last-child { border-bottom: none; }
.pool-member-dropdown-item:active { background: var(--card); }
.pool-member-dropdown-item.danger { color: #ffffff; }

/* ── Invite code row ────────────────────────────────────── */
.pool-invite-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 0; padding: 10px 12px; margin-bottom: 12px;
}
.pool-invite-label { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.pool-invite-code { color: var(--cyan); font-size: 15px; letter-spacing: 3px; flex: 1; }
.pool-show-code-btn {
  background: none; border: 1px solid var(--border2); color: var(--muted);
  border-radius: 0; padding: 3px 10px; font-size: 11px; font-weight: 600;
  font-family: 'Space Mono', monospace; cursor: pointer; flex-shrink: 0;
  transition: color .15s, border-color .15s;
}
.pool-show-code-btn:active { color: var(--text); }

/* ── Create Pool Modal ────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.6);
  display: none; align-items: flex-end; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 0;
  width: 100%; max-width: 480px;
  padding: 20px 16px calc(20px + var(--safe-b));
  max-height: 90dvh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close {
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 4px;
}
.modal-field { margin-bottom: 14px; }
.modal-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.modal-input {
  width: 100%; padding: 11px 13px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0; color: var(--text);
  font-size: 14px; font-family: 'Space Mono', monospace;
  outline: none; transition: border-color .15s;
}
.modal-input:focus { border-color: var(--border2); }
.modal-textarea { min-height: 72px; resize: none; line-height: 1.4; }
.cp-fee-note { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: 14px; }
.modal-error { font-size: 12px; color: #ffffff; min-height: 16px; margin-bottom: 8px; text-align: center; }
.modal-submit-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #ffffff, #888888);
  border: none; border-radius: 0;
  color: #000; font-size: 14px; font-weight: 800;
  font-family: 'Space Mono', monospace; cursor: pointer;
  transition: opacity .15s;
}
.modal-submit-btn:active { opacity: .85; }
.screenshot-modal-img {
  width: 100%;
  display: block;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.screenshot-modal-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 14px;
}

/* Number input spinners */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ── Empty State ──────────────────────────────────────────── */
.empty-state { grid-column: 1 / -1; width: 100%; text-align: center; padding: 28px 16px; box-sizing: border-box; }
.empty-icon  { font-size: 36px; margin-bottom: 10px; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.empty-sub   { font-size: 13px; color: var(--muted); }

/* ── Bottom Nav ───────────────────────────────────────────── */
.bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: transparent;
  flex-shrink: 0;
}
.nav-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  background: none; border: none;
  color: #3a3a3a;
  cursor: pointer; padding: 8px 4px;
  transition: color .18s;
}
.nav-btn span { font-size: 10px; font-weight: 600; letter-spacing: .2px; font-family: 'Space Mono', monospace; }
.nav-svg { width: 20px; height: 20px; image-rendering: pixelated; }
.nav-btn[data-screen="profile"].active   { color: var(--gold); }
.nav-btn[data-screen="equipment"].active { color: var(--cyan); }
.nav-btn[data-screen="pools"].active     { color: #ffffff; }
.nav-btn[data-screen="market"].active    { color: var(--green); }
.nav-btn[data-screen="explorer"].active  { color: #ffffff; }
.nav-btn[data-screen="wallet"].active    { color: #ffffff; }

/* ── Pools coming soon ───────────────────────────────────────── */
.pools-coming {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
  padding: 40px 32px;
  text-align: center;
}
.pools-icon-big {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  color: #ffffff;
  opacity: 0.85;
}
.pools-coming-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.3px;
}
.pools-coming-sub {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 0;
  padding: 4px 14px;
}
.pools-coming-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 260px;
}

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: calc(var(--safe-t) + 20px);
  left: 50%; transform: translateX(-50%) translateY(-10px);
  background: rgba(20,20,20,.96);
  border: 1px solid var(--border2);
  color: var(--text); padding: 10px 20px;
  border-radius: 0; font-size: 13px; font-weight: 600;
  font-family: 'Space Mono', monospace; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  backdrop-filter: blur(12px); z-index: 999;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ── Deposit Modal ───────────────────────────────────────── */
.dep-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}
.dep-overlay.open { display: flex; }
.dep-sheet {
  background: #131313;
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 20px calc(44px + var(--safe-b));
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
@keyframes stakingRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.staking-overview { background: var(--card); border: 1px solid var(--border); border-radius: 0; width: 100%; animation: stakingRise .4s ease both; }
.staking-hero  { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 26px 16px 22px; overflow: hidden; }
.staking-hero::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(255,255,255,.12), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.staking-apy-value { position: relative; font-size: 46px; font-weight: 900; color: var(--text); font-family: 'Space Mono', monospace; line-height: 1; }
.staking-apy-label { position: relative; font-size: 11px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.staking-stats-row { display: flex; width: 100%; border-top: 1px solid var(--border); }
.staking-stat { flex: 1; padding: 14px 10px; text-align: center; }
.staking-stat + .staking-stat { border-left: 1px solid var(--border); }
.staking-stat-val { font-size: 15px; font-weight: 700; color: var(--text); font-family: 'Space Mono', monospace; }
.staking-stat-key { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 5px; }
.staking-stat-icon { flex-shrink: 0; opacity: .8; }
.staking-section { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 16px; width: 100%; margin-top: 12px; animation: stakingRise .4s ease both; animation-delay: .06s; }
#staking-form-section { animation-delay: .12s; }
.staking-section-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.staking-pending-callout { display: flex; justify-content: space-between; align-items: center; background: var(--card2); border: 1px solid var(--border2); padding: 12px 14px; margin-bottom: 4px; }
.staking-pending-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.staking-pending-icon { flex-shrink: 0; opacity: .85; }
.staking-pending-val { font-size: 19px; font-weight: 800; color: var(--text); font-family: 'Space Mono', monospace; }
.staking-info-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.staking-info-row:last-of-type { border-bottom: none; }
.staking-info-key { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.staking-info-val { font-size: 13px; color: var(--text); font-weight: 600; }
.staking-lock-row { padding: 9px 0; }
.staking-lock-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.staking-lock-track { height: 4px; background: var(--border); overflow: hidden; }
.staking-lock-fill { height: 100%; width: 0; background: var(--text); transition: width .4s ease; }

/* ── Block Explorer ───────────────────────────────────────── */
.explorer-stats-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.explorer-stat { flex: 1; min-width: 120px; background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 12px; text-align: center; }
.explorer-stat-val { font-size: 16px; font-weight: 700; color: var(--text); }
.explorer-stat-key { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.explorer-section { background: var(--card); border: 1px solid var(--border); border-radius: 0; padding: 14px; }
.explorer-section-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.explorer-block-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.explorer-block-row:last-child { border-bottom: none; }
.explorer-block-height { font-weight: 700; color: var(--text); font-family: 'Space Mono', monospace; }
.explorer-block-meta { color: var(--muted); font-family: 'Space Mono', monospace; }
.explorer-block-winner { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
a.explorer-block-winner:hover { text-decoration: underline; }
.explorer-blocks-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.explorer-nav-btn { flex: 1; padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 0; cursor: pointer; transition: border-color .15s ease; }
.explorer-nav-btn:hover:not(:disabled) { border-color: var(--text); }
.explorer-nav-btn:disabled { color: var(--muted); cursor: default; opacity: .5; }
.staking-btn-row { display: flex; gap: 8px; margin-top: 14px; }
.staking-btn { flex: 1; padding: 12px; border-radius: 0; font-size: 13px; font-weight: 700; border: none; cursor: pointer; transition: opacity .15s ease, border-color .15s ease; }
.staking-btn:active { opacity: .8; }
.staking-btn:disabled { opacity: .35; cursor: default; }
.staking-btn-unstake { background: var(--text); color: #000; }
.staking-btn-unstake:hover:not(:disabled) { opacity: .9; }
.staking-btn-stake  { background: var(--text); color: #000; padding: 12px 18px; border-radius: 0; font-size: 13px; font-weight: 700; border: none; cursor: pointer; white-space: nowrap; transition: opacity .15s ease; }
.staking-btn-stake:hover { opacity: .9; }
.staking-btn-stake:active { opacity: .8; }
.staking-input-wrap {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
}
.staking-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 56px 12px 12px;
  font-size: 15px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  transition: border-color .15s ease;
}
.staking-input:focus { outline: none; border-color: var(--text); }
.staking-max-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: var(--card2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  font-family: 'Space Mono', monospace;
  padding: 5px 10px;
  cursor: pointer;
  transition: border-color .15s ease;
}
.staking-max-btn:hover { border-color: var(--text); }
.staking-hint { font-size: 11px; color: var(--muted); margin-top: 8px; text-align: center; }
.dep-drag-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 0;
  align-self: center;
  margin-bottom: 4px;
}
.dep-title { font-size: 18px; font-weight: 800; }
.dep-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dep-close {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px;
  cursor: pointer; flex-shrink: 0;
}

/* ── Pool private badge ─────────────────────────────────── */
.pool-private-badge {
  font-size: 10px; font-weight: 700;
  color: var(--gold); background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 0; padding: 1px 6px;
}

/* ── Pools page header ──────────────────────────────────── */
.pools-header { margin-bottom: 10px; }
.pools-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.pools-title-actions { display: flex; gap: 6px; }
.pools-icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0; border: 1px solid var(--border);
  background: var(--card); cursor: pointer;
  font-size: 17px; line-height: 1;
  transition: border-color .15s, background .15s;
}
.pools-icon-btn:active { background: var(--card2); border-color: var(--border2); }
.pools-icon-create {
  border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.06);
  color: #ffffff; font-weight: 800;
}
.pools-icon-create:active { background: rgba(255,255,255,.12); }
.pools-search-wrap {
  position: relative; display: flex; align-items: center;
}
.pools-search-icon {
  position: absolute; left: 12px; width: 16px; height: 16px;
  color: var(--muted); pointer-events: none; flex-shrink: 0;
}
.pools-search-input {
  width: 100%; padding: 11px 14px 11px 36px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0; color: var(--text);
  font-size: 14px; font-family: 'Space Mono', monospace;
  outline: none; box-sizing: border-box; transition: border-color .15s;
}
.pools-search-input:focus { border-color: var(--border2); }

/* ── Your pool compact row ──────────────────────────────── */
.pool-mine-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 0; padding: 12px 14px;
  margin-bottom: 10px;
}
.pool-mine-dot {
  width: 8px; height: 8px; border-radius: 0;
  background: #ffffff; flex-shrink: 0;
  box-shadow: 0 0 6px rgba(255,255,255,.6);
}
.pool-mine-info { flex: 1; min-width: 0; }
.pool-mine-name {
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pool-mine-stats { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pool-mine-chevron { width: 8px; height: 14px; color: var(--muted); flex-shrink: 0; }

/* ── Create pool form ───────────────────────────────────── */
.cp-toggle-label {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.cp-toggle-label input[type=checkbox] {
  width: 16px; height: 16px; accent-color: var(--cyan); cursor: pointer;
}

/* ── Pool filters ───────────────────────────────────────── */
.pool-filters {
  display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 6px; align-items: center;
}
.pools-total-count {
  margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.pool-filter-chip {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); border-radius: 0;
  padding: 5px 13px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
  font-family: 'Space Mono', monospace;
}
.pool-filter-chip.active {
  border-color: var(--cyan); color: var(--cyan); background: rgba(255,255,255,.08);
}

/* ── Skeleton loaders ─────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--card) 0%, var(--border) 50%, var(--card) 100%);
  background-size: 300% 100%;
  animation: skel-shimmer 1.5s ease-in-out infinite;
  border-radius: 0;
}
@keyframes skel-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
/* utility widths / heights */
.skel-line { height: 13px; }
.h11 { height: 11px !important; } .h14 { height: 14px !important; }
.w50 { width: 50%; } .w55 { width: 55%; } .w60 { width: 60%; }
.w65 { width: 65%; } .w70 { width: 70%; } .w75 { width: 75%; }
.w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; }
.mt5  { margin-top:  5px; } .mt6  { margin-top:  6px; }
.mt8  { margin-top:  8px; } .mt10 { margin-top: 10px; }
.mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; }

/* Quest skeleton */
.skel-quest-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 0;
  padding: 14px;
  margin-bottom: 10px;
}
.skel-quest-top-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.skel-tag { flex-shrink: 0; width: 44px; height: 16px; border-radius: 0; }

/* Pool skeleton */
.skel-pool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 16px;
  margin-bottom: 8px;
}
.skel-badge { width: 56px; height: 16px; border-radius: 0; }
.skel-stats-row { display: flex; gap: 8px; }
.skel-stat { flex: 1; height: 11px; border-radius: 0; }
.skel-btn { height: 36px; border-radius: 0; width: 100%; }

/* ── Wallet login ────────────────────────────────────────── */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  text-align: center;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 0;
  padding: 34px 22px 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,.55);
}
.login-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}
.login-logo {
  width: 52px;
  height: 52px;
  display: block;
  margin: 0 auto 14px;
}
.login-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 26px;
}
#docs-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  overflow-y: auto;
}
.docs-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 20px calc(60px + var(--safe-b));
}
.docs-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.docs-page-title {
  font-size: 24px;
  font-weight: 800;
}
.docs-close-btn {
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  font-family: 'Space Mono', monospace;
  padding: 9px 14px;
  cursor: pointer;
}
.docs-close-btn:hover { border-color: var(--text); }
.docs-quicknav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.docs-quicknav-btn {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 7px 12px;
  text-decoration: none;
  white-space: nowrap;
}
.docs-quicknav-btn:hover { color: var(--text); border-color: var(--text); }
.docs-page-body { display: flex; flex-direction: column; gap: 28px; }
.docs-section { scroll-margin-top: 20px; }
.docs-h {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.docs-section p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 10px;
}
.docs-section p:last-child { margin-bottom: 0; }
.docs-section code {
  font-family: 'Space Mono', monospace;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1px 5px;
  color: var(--text);
}
.docs-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.docs-link:hover { color: var(--muted); }
.docs-formula {
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px 14px;
  margin-bottom: 10px;
  overflow-x: auto;
  white-space: nowrap;
}
.docs-loop {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.docs-loop-step {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border2);
  padding: 10px 14px;
}
.docs-loop-step b { color: var(--text); }
.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 0;
  padding: 13px 14px 13px 16px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.wallet-option:active { transform: scale(.98); }
.wallet-option:hover { border-color: var(--text); background: var(--card2); }
.wallet-icon { width: 28px; height: 28px; border-radius: 0; flex-shrink: 0; }
.wallet-option span { flex: 1; }
.wallet-option-arrow { color: var(--muted); flex-shrink: 0; transition: color .15s ease; }
.wallet-option:hover .wallet-option-arrow { color: var(--text); }

/* ── Sub-screen back buttons ────────────────────────────────── */
.screen-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.screen-header-row .page-title { margin-bottom: 0; }
.screen-back-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  border-radius: 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); font-size: 20px; line-height: 1;
  cursor: pointer; flex-shrink: 0;
}
#pools-content > .screen-back-btn { margin-bottom: 12px; }

/* ── Widescreen desktop layout ──────────────────────────────
   Real widescreen layout — persistent sidebar and wider content —
   rather than a mobile column stretched or shrunk to fit the window. */
@media (min-width: 900px) {
  body {
    background: var(--bg);
  }
  #app {
    max-width: none;
    flex-direction: row;
  }
  :root { --sidebar-w: 240px; }
  body.sidebar-collapsed { --sidebar-w: 64px; }

  .sidebar {
    position: relative;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    transition: width .18s ease;
  }
  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 24px;
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    overflow: hidden;
    transition: gap .18s ease, padding .18s ease, justify-content .18s ease;
  }
  .sidebar-logo img { width: 28px; height: 28px; border-radius: 0; flex-shrink: 0; }
  .sidebar-logo span {
    opacity: 1;
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity .15s ease, max-width .18s ease;
  }
  body.sidebar-collapsed .sidebar-logo {
    justify-content: center;
    gap: 0;
    padding: 4px 0 24px;
  }
  body.sidebar-collapsed .sidebar-logo span {
    opacity: 0;
    max-width: 0;
  }
  .sidebar-collapse-btn {
    position: absolute;
    top: 24px;
    right: -9px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--card2);
    border: 1px solid var(--border2);
    border-radius: 0;
    color: var(--muted);
    cursor: pointer;
    z-index: 10;
  }
  .sidebar-collapse-btn:hover { color: var(--text); border-color: var(--text); }
  .sidebar-collapse-icon { transition: transform .18s ease; }
  body.sidebar-collapsed .sidebar-collapse-icon { transform: rotate(180deg); }
  .sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow: hidden; }
  .sidebar .nav-btn {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 0;
    width: 100%;
    overflow: hidden;
    transition: gap .18s ease, padding .18s ease, justify-content .18s ease;
  }
  .sidebar .nav-btn span {
    font-size: 13px;
    white-space: nowrap;
    opacity: 1;
    max-width: 160px;
    overflow: hidden;
    transition: opacity .15s ease, max-width .18s ease;
  }
  .sidebar .nav-btn.active { background: rgba(255,255,255,.05); }
  body.sidebar-collapsed .sidebar .nav-btn { justify-content: center; gap: 0; padding: 11px 0; }
  body.sidebar-collapsed .sidebar .nav-btn span { opacity: 0; max-width: 0; }
  .sidebar-divider {
    height: 1px;
    background: var(--card2);
    margin: 6px 10px;
    flex-shrink: 0;
  }
  .sidebar-social {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid var(--border);
  }
  .social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 0;
    border: none;
    color: var(--muted);
    background: rgba(255,255,255,.04);
    font-family: inherit;
    cursor: pointer;
    transition: color .15s, background .15s;
  }
  .social-icon:hover { color: var(--text); background: rgba(255,255,255,.08); }
  .social-icon.disabled { opacity: .4; cursor: default; }
  .content-topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 24px 0;
    flex-shrink: 0;
  }

  .bottom-nav { display: none; }

  #screens-wrap {
    padding: 0 max(24px, calc((100% - 920px) / 2));
  }

  .rig-canvas-wrap {
    width: auto;
    margin: 0 calc(-1 * max(24px, (100% - 920px) / 2));
  }

  .market-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .gpu-list {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 10px;
  }
  .gpu-list .gpu-card {
    flex: 0 0 420px;
  }
  .prof-bottom {
    align-self: center;
    width: 100%;
    max-width: 560px;
  }
  .modal-overlay {
    align-items: center;
    padding-left: var(--sidebar-w);
  }
  .dep-overlay {
    align-items: center;
    padding-left: var(--sidebar-w);
  }
  .dep-sheet {
    width: 100%;
    max-width: 420px;
  }
  .toast {
    left: calc(var(--sidebar-w) + (100% - var(--sidebar-w)) / 2);
    transition: left .18s ease;
  }
}
