:root {
  --bg: #09070b;
  --panel: rgba(12, 10, 15, 0.92);
  --panel-strong: rgba(13, 11, 18, 0.98);
  --border: rgba(255, 175, 60, 0.32);
  --border-soft: rgba(255, 175, 60, 0.18);
  --gold-1: #ffd66b;
  --gold-2: #ffb23f;
  --gold-3: #d67a1f;
  --text: #fff8eb;
  --text-soft: rgba(255, 243, 220, 0.72);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 0 1px rgba(255, 170, 60, 0.18), 0 0 35px rgba(255, 136, 0, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(7, 7, 10, 0.78) 0%, rgba(12, 10, 8, 0.82) 45%, rgba(10, 8, 6, 0.9) 100%),
    radial-gradient(circle at top center, rgba(255, 160, 64, 0.18) 0%, rgba(255, 160, 64, 0.06) 24%, rgba(0,0,0,0) 52%),
    url("/mining/static/img/backmine.png") center center / cover no-repeat fixed;
  background-color: #08090c;
}

body {
  min-height: 100vh;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 16px 16px 104px;
}

.page-glow {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.5;
}

.page-glow-1 {
  width: 220px;
  height: 220px;
  top: 110px;
  left: -60px;
  background: rgba(255, 122, 28, 0.16);
}

.page-glow-2 {
  width: 240px;
  height: 240px;
  right: -80px;
  bottom: 160px;
  background: rgba(255, 185, 72, 0.14);
}

.app-wrap {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.brand-wrap {
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0 10px;
}

.brand-logo-img {
  display: block;
  width: auto;
  max-width: 90px;
  max-height: 80px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(255, 140, 40, 0.28));
}
.brand-fallback {
  display: none;
  justify-content: center;
  align-items: center;
  min-width: 64px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 170, 70, 0.35);
  background: rgba(255, 170, 70, 0.08);
  color: #ffb45c;
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.mini-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.top-mini-stats {
  margin-bottom: 14px;
}

.bottom-mini-stats {
  margin-top: 14px;
}

.mini-stat-card,
.miner-stage-card,
.wallet-card,
.upgrade-card,
.bottom-tabs {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(135deg, rgba(255, 137, 29, 0.08), rgba(255, 206, 114, 0.04) 24%, rgba(8, 7, 11, 0.88) 55%, rgba(10, 8, 13, 0.98) 100%);
  box-shadow: var(--shadow), var(--glow);
}

.mini-stat-card::before,
.miner-stage-card::before,
.wallet-card::before,
.upgrade-card::before,
.bottom-tabs::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 215, 110, 0.32), rgba(255, 145, 30, 0.12), rgba(255, 222, 163, 0.06));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.highlight-card,
.compact-card {
  padding: 12px 14px;
}

.mini-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.mini-stat-card strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

#mining-rate {
  font-size: 15px;
}

.miner-stage-card {
  padding: 14px 14px 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.status-pill-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.status-pill {
  padding: 9px 12px;
  border-radius: 18px;
  background: rgba(8, 8, 12, 0.64);
  border: 1px solid rgba(255, 178, 58, 0.18);
}

.status-pill span {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.status-pill strong {
  font-size: 14px;
}

.miner-stage {
  position: relative;
  min-height: 315px;
  margin: 12px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.halo-ring {
  position: absolute;
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 176, 60, 0.3) 0%, rgba(255, 138, 20, 0.16) 28%, rgba(255, 115, 0, 0.06) 46%, transparent 72%);
  filter: blur(6px);
  animation: pulseGlow 4.8s ease-in-out infinite;
}

.miner-image {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  max-height: 290px;
  object-fit: contain;
  filter: drop-shadow(0 24px 38px rgba(0, 0, 0, 0.48)) drop-shadow(0 0 26px rgba(255, 138, 20, 0.12));
  transform-origin: center center;
  animation: minerFloat 5.5s ease-in-out infinite;
}

.compact-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.action-btn {
  border: none;
  border-radius: 18px;
  min-height: 46px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.action-btn:active {
  transform: scale(0.985);
}

.primary-btn {
  color: #241100;
  background: linear-gradient(135deg, #ffe07c 0%, #ffbf49 40%, #d77721 100%);
  box-shadow: 0 12px 28px rgba(215, 119, 33, 0.28);
}

.secondary-btn {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border: 1px solid rgba(255, 185, 69, 0.2);
}

.action-btn:disabled {
  opacity: 0.62;
  cursor: default;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 18px;
}

.section-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 174, 57, 0.1);
  border: 1px solid rgba(255, 174, 57, 0.2);
  color: var(--gold-1);
  font-size: 12px;
  font-weight: 700;
}

.tab-panel {
  display: none;
  margin-bottom: 12px;
}

.tab-panel.active {
  display: block;
}

.wallet-card {
  padding: 16px;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

input[type="text"] {
  width: 100%;
  border: 1px solid rgba(255, 187, 76, 0.18);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 16px;
  min-height: 48px;
  padding: 13px 14px;
  outline: none;
  margin-bottom: 12px;
}

input[type="text"]::placeholder {
  color: rgba(255,255,255,0.36);
}

.full-btn {
  width: 100%;
}

.note {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.upgrade-list {
  display: grid;
  gap: 10px;
}

.upgrade-card {
  padding: 14px;
}

.upgrade-card.current {
  border-color: rgba(255, 207, 102, 0.34);
}

.upgrade-card.next {
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 207, 102, 0.12) inset, var(--glow);
}

.upgrade-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.upgrade-top span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: var(--gold-1);
  font-size: 12px;
  font-weight: 700;
}

.upgrade-top strong {
  display: block;
  text-align: right;
  font-size: 15px;
  max-width: 54%;
}

.upgrade-meta {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 12px;
}

.upgrade-card button {
  width: 100%;
  border: none;
  border-radius: 16px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255, 185, 69, 0.16);
}

.upgrade-card button.active-upgrade {
  color: #241100;
  background: linear-gradient(135deg, #ffe07c 0%, #ffbf49 40%, #d77721 100%);
}

.section-header-card,
.bottom-tabs {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(135deg, rgba(255, 137, 29, 0.08), rgba(255, 206, 114, 0.04) 24%, rgba(8, 7, 11, 0.88) 55%, rgba(10, 8, 13, 0.98) 100%);
  box-shadow: var(--shadow), var(--glow);
}

.section-header-card::before,
.bottom-tabs::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(255, 215, 110, 0.32), rgba(255, 145, 30, 0.12), rgba(255, 222, 163, 0.06));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.section-header-card {
  padding: 14px 16px;
  margin-bottom: 14px;
}

.compact-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-title {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.05;
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
  width: min(calc(100vw - 28px), 520px);
  display: grid;
  gap: 10px;
  padding: 10px;
  background: rgba(8, 7, 11, 0.92);
  backdrop-filter: blur(12px);
}

.nav-tabs-3 {
  grid-template-columns: repeat(3, 1fr);
}

.tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 48px;
  border-radius: 18px;
  background: transparent;
  color: rgba(255, 243, 220, 0.58);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.tab-link.active {
  color: #241100;
  background: linear-gradient(135deg, #ffe07c 0%, #ffbf49 40%, #d77721 100%);
  box-shadow: 0 10px 24px rgba(215, 119, 33, 0.22);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(20px);
  z-index: 40;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(14, 12, 18, 0.95);
  color: var(--text);
  text-align: center;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.24s ease;
}

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

@keyframes minerFloat {
  0%, 100% {
    transform: translateY(0) rotate(-2.2deg);
  }
  50% {
    transform: translateY(-10px) rotate(1.5deg);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(0.94);
    opacity: 0.82;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@media (max-width: 420px) {
  .page-shell {
    padding: 14px 12px 100px;
  }

  .mini-stat-card strong {
    font-size: 16px;
  }

  #mining-rate {
    font-size: 13px;
  }

  .miner-stage {
    min-height: 270px;
  }

  .miner-image {
    max-height: 245px;
  }

  .action-btn,
  .tab-btn {
    font-size: 13px;
  }
}


@media (max-width: 420px) {
  .page-title {
    font-size: 24px;
  }
}

.mini-stats-grid.with-center-logo {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.top-center-logo-wrap {
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 78px;
  height: 78px;
  margin: 0 -2px;
  background: transparent;
}

.top-center-logo {
  display: block;
  width: auto;
  max-width: 64px;
  max-height: 64px;
  object-fit: contain;
}

.mini-stats-grid.with-center-logo .mini-stat-card {
  min-width: 0;
}

.wallet-connect-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 16px;
}
/* ===== Reown wallet connect ===== */
.wallet-connect-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.wallet-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.wallet-network-pill {
  flex: 0 0 auto;
  padding: 8px 11px;
  border-radius: 999px;
  color: #241405;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--gold-1), var(--gold-2));
  box-shadow: 0 8px 22px rgba(255, 178, 63, 0.18);
}

.wallet-address-preview {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 178, 58, 0.22);
  background: rgba(8, 8, 12, 0.64);
  color: var(--text-soft);
  font-weight: 800;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-address-preview.connected {
  color: var(--gold-1);
  border-color: rgba(255, 214, 107, 0.44);
  box-shadow: inset 0 0 22px rgba(255, 178, 63, 0.08);
}

.wallet-actions-row {
  display: grid;
  grid-template-columns: 1fr 0.72fr;
  gap: 10px;
}

.ghost-btn {
  color: var(--gold-1);
  background: rgba(255, 178, 63, 0.08);
  border: 1px solid rgba(255, 178, 63, 0.24);
}

.manual-wallet-fallback {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 178, 63, 0.16);
  background: rgba(0, 0, 0, 0.18);
  padding: 10px 12px;
}

.manual-wallet-fallback summary {
  cursor: pointer;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.manual-wallet-fallback[open] summary {
  margin-bottom: 10px;
}

@media (max-width: 420px) {
  .wallet-actions-row {
    grid-template-columns: 1fr;
  }
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: inherit;
}

.brand-logo-link .brand-logo-img {
  display: block;
}
