:root {
  --bg: #0a0a0a;
  --card: #111118;
  --card2: #16161f;
  --border: #1e1e2e;
  --border-light: #2a2a3e;
  --text: #f0f0f5;
  --text2: #a0a0b8;
  --text3: #6a6a80;
  --orange: #f7931a;
  --orange-dim: #f7931a22;
  --green: #4ade80;
  --green-dim: #4ade8022;
  --red: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--orange);
  color: #1a1000;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 0 20px var(--orange-dim);
}

.logo-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.logo-sub {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.3px;
}

.btc-price-badge {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* ===== SECTIONS ===== */
.balance-section,
.pay-section,
.pool-section,
.info-section {
  margin-bottom: 28px;
}

.section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--orange);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.section-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ===== BALANCE CARD ===== */
.balance-card {
  background: linear-gradient(145deg, #1a1200 0%, #111118 60%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--orange-dim), transparent 70%);
  pointer-events: none;
}

.balance-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
  margin-bottom: 8px;
}

.balance-amount {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text);
  margin-bottom: 4px;
}

.balance-sub {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 4px;
}

.balance-usd {
  font-size: 14px;
  color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 20px;
}

.balance-visual {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}

.mining-ring {
  position: relative;
  flex-shrink: 0;
}

.mining-ring-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 800;
  color: var(--orange);
  font-family: 'JetBrains Mono', monospace;
}

.mining-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.mstat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.mstat-label {
  color: var(--text3);
}

.mstat-val {
  color: var(--text);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

/* ===== PAY SECTION ===== */
.pay-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.qr-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
  background: #fff;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  padding: 12px;
}

.qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.qr-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--orange);
  color: #1a1000;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(247, 147, 26, 0.4);
}

.pay-addr-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.pay-addr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 20px;
}

.pay-addr {
  flex: 1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text);
  word-break: break-all;
  background: transparent;
  border: none;
  outline: none;
  min-width: 0;
}

.btn-copy {
  background: var(--orange);
  color: #1a1000;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.btn-copy:hover { opacity: 0.9; }
.btn-copy.copied {
  background: var(--green);
  color: #001a00;
}

.pay-amt-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 10px;
}

.pay-amt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.amt-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.amt-btn:hover {
  border-color: var(--orange);
  background: var(--orange-dim);
}

.pay-actions {
  display: flex;
  gap: 10px;
}

.btn-wallet {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-wallet:hover { background: var(--border); }

.btn-paid {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--orange);
  border: none;
  border-radius: 10px;
  padding: 14px;
  color: #1a1000;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-paid:hover { opacity: 0.9; }

.pay-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f7931a0d;
  border: 1px solid #f7931a22;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 12px;
  color: #d4a05a;
}

.pay-warning span:first-child {
  font-size: 14px;
}

/* ===== POOL SECTION ===== */
.pool-header-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.pool-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
}

.pool-stat-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.pool-stat-label {
  font-size: 10px;
  color: var(--text3);
  font-weight: 500;
}

.miner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.miner-empty {
  background: var(--card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
}

.miner-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0.6;
}

.miner-empty-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 4px;
}

.miner-empty-sub {
  font-size: 12px;
  color: var(--text3);
}

.miner-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.miner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--orange-dim);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

.miner-info {
  flex: 1;
  min-width: 0;
}

.miner-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.miner-time {
  font-size: 11px;
  color: var(--text3);
}

.miner-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--orange);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.miner-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green-dim);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== STEPS ===== */
.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--orange);
  color: #1a1000;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  flex-shrink: 0;
}

.step-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.step-desc {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 24px 0 8px;
  border-top: 1px solid var(--border);
}

.footer-brand {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 4px;
}

.footer-note {
  font-size: 11px;
  color: var(--text3);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--green);
  color: #001a00;
  font-size: 13px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 99px;
  box-shadow: 0 8px 24px rgba(74, 222, 128, 0.3);
  z-index: 100;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
  .app {
    padding: 0 24px 60px;
  }
}

@media (max-width: 380px) {
  .balance-amount {
    font-size: 28px;
  }
  .pay-actions {
    flex-direction: column;
  }
  .pay-amt-grid {
    grid-template-columns: 1fr 1fr;
  }
}
