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

:root {
  --bg: #ffffff;
  --surface: #fafafa;
  --border: #e6e8eb;
  --text: #16181d;
  --text-muted: #6b7280;
  --accent: #f2a900;
  --accent-dark: #d99a00;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 14px;
}

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

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-accent {
  color: var(--accent-dark);
}

.wallet-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  min-width: 0;
}

.wallet-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

#walletEmail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.chip-edit {
  border: none;
  background: none;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 0 4px;
  flex-shrink: 0;
}

.chip-edit:hover {
  text-decoration: underline;
}

/* Balance card */
.balance-card {
  background: linear-gradient(180deg, #ffffff, #fbf9f4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.balance-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.balance-value {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
}

.balance-unit {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: 1px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat + .stat {
  border-left: 1px solid var(--border);
}

.stat-value {
  font-size: 15px;
  font-weight: 700;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-top: 20px;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

/* Panels */
.panel {
  margin-top: 16px;
}

.panel.hidden {
  display: none;
}

.claim-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.claim-btn:hover:not(:disabled) {
  background: var(--accent-dark);
}

.claim-btn:disabled {
  cursor: not-allowed;
}

#claimLabel {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.claim-sub {
  font-size: 13px;
  opacity: 0.9;
}

.hint {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.hint strong {
  color: var(--text);
}

/* Withdraw */
.withdraw-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.withdraw-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  padding: 8px 0;
}

.withdraw-box .withdraw-row:first-of-type {
  margin-top: 16px;
}

.withdraw-row + .withdraw-row {
  border-top: 1px solid var(--border);
}

.withdraw-row strong {
  color: var(--text);
  font-weight: 600;
}

.withdraw-btn {
  width: 100%;
  margin-top: 16px;
  border: none;
  border-radius: 12px;
  background: var(--text);
  color: #fff;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.withdraw-btn:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

/* Ad slot */
.ad-slot {
  margin-top: 20px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot iframe {
  border: 0;
  max-width: 100%;
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.foot-muted {
  margin-top: 4px;
  opacity: 0.8;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
}

.text-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.18);
}

.text-input::placeholder {
  color: #9ca3af;
}

.error {
  color: var(--red);
  font-size: 13px;
  margin-top: 8px;
}

.error.hidden {
  display: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.25);
  z-index: 60;
  text-align: center;
  max-width: 90vw;
  transition: opacity 0.2s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 420px) {
  .balance-value {
    font-size: 36px;
  }
  #walletEmail {
    max-width: 110px;
  }
}