:root {
  color-scheme: dark;
  --bg: #09111f;
  --bg-glow: #0f2a25;
  --surface: #111c2e;
  --surface-raised: #17243a;
  --border: #243650;
  --border-soft: #1b2a41;
  --text: #eef4fb;
  --muted: #8da0ba;
  --green: #26a17b;
  --green-bright: #35d6a4;
  --green-soft: rgba(38, 161, 123, 0.14);
  --danger: #ff7a7a;
  --warning: #f2bf62;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% -10%, rgba(38, 161, 123, 0.16), transparent 30rem),
    radial-gradient(circle at 92% 5%, rgba(38, 120, 161, 0.11), transparent 26rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: min(1060px, calc(100% - 40px));
  margin-inline: auto;
}

/* Page shell — ad rails */

.page {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  align-items: start;
  gap: 18px;
  width: min(1740px, 100%);
  margin-inline: auto;
  padding-inline: 18px;
}

.page > .wrap {
  width: 100%;
}

.ad-rail {
  position: sticky;
  top: 18px;
  width: 300px;
}

.ad-slot {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(9, 17, 31, 0.5);
}

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

.ad-slot-top {
  width: 300px;
  height: 250px;
  margin: 28px auto 0;
}

.ad-slot-tall {
  width: 300px;
  height: 600px;
}

/* Header */

.topbar {
  border-bottom: 1px solid var(--border-soft);
  background: rgba(9, 17, 31, 0.72);
  backdrop-filter: blur(16px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.brand-coin {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--green-bright), var(--green));
  color: #051710;
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(53, 214, 164, 0.2);
}

/* Hero */

.hero {
  padding: 64px 0 34px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green-bright);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.45rem, 6vw, 4.15rem);
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

h1 span {
  color: var(--green-bright);
}

.hero-copy {
  max-width: 630px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

/* Layout and cards */

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(19, 32, 51, 0.96), rgba(15, 26, 43, 0.96));
  box-shadow: var(--shadow);
}

.balance-card,
.withdraw-card {
  padding: 28px;
}

.card-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.balance {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 24px;
}

#balance {
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.balance-unit {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 650;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: 12px;
  font-weight: 750;
  letter-spacing: -0.01em;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn:not(:disabled):active {
  transform: translateY(0);
}

.btn:focus-visible,
.max-btn:focus-visible,
.text-btn:focus-visible,
input:focus-visible {
  outline: 2px solid var(--green-bright);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-bright), var(--green));
  color: #041711;
  box-shadow: 0 10px 30px rgba(38, 161, 123, 0.18);
}

.btn-primary:disabled {
  background: var(--surface-raised);
  color: #7386a0;
  box-shadow: none;
}

.btn-withdraw {
  margin-top: 2px;
  border: 1px solid rgba(53, 214, 164, 0.24);
  background: var(--green-soft);
  color: var(--green-bright);
}

.claim-hint {
  min-height: 22px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.claim-hint.ready {
  color: var(--green-bright);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--border-soft);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  background: rgba(9, 17, 31, 0.46);
}

.stat-value {
  font-size: 1rem;
  font-weight: 730;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Withdraw card */

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.tag {
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

form {
  margin-top: 21px;
}

.field + .field {
  margin-top: 15px;
}

label {
  display: block;
  margin-bottom: 7px;
  color: #cbd7e7;
  font-size: 0.78rem;
  font-weight: 650;
}

input {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(7, 13, 24, 0.64);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #60738e;
}

input:hover {
  border-color: #314967;
}

input:focus {
  border-color: var(--green);
  background: rgba(7, 13, 24, 0.88);
}

input.invalid {
  border-color: var(--danger);
}

.field-error {
  min-height: 0;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 0.75rem;
}

.field-error:empty {
  display: none;
}

.amount-input {
  position: relative;
}

.amount-input input {
  padding-right: 66px;
  font-variant-numeric: tabular-nums;
}

.max-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-raised);
  color: var(--green-bright);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.max-btn:hover {
  border-color: var(--green);
}

.form-note {
  margin: 9px 0 0;
  color: #657994;
  font-size: 0.7rem;
  text-align: center;
}

/* Activity */

.activity-card {
  margin-top: 20px;
  padding: 26px 28px 16px;
}

.activity-heading {
  align-items: flex-start;
  margin-bottom: 16px;
}

.activity-heading .muted {
  margin-top: 4px;
}

.text-btn {
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.text-btn:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.activity-list {
  border-top: 1px solid var(--border-soft);
}

.activity-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(9, 17, 31, 0.55);
  font-size: 1rem;
  font-weight: 750;
}

.activity-icon.claim {
  border-color: rgba(53, 214, 164, 0.22);
  background: rgba(53, 214, 164, 0.075);
  color: var(--green-bright);
}

.activity-icon.withdrawal {
  border-color: rgba(242, 191, 98, 0.22);
  background: rgba(242, 191, 98, 0.07);
  color: var(--warning);
}

.activity-main {
  min-width: 0;
}

.activity-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 680;
}

.activity-detail {
  max-width: 100%;
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-amount {
  font-size: 0.84rem;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.activity-amount.positive {
  color: var(--green-bright);
}

.activity-amount.negative {
  color: #ffb4b4;
}

.status {
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.63rem;
  font-weight: 750;
  letter-spacing: 0.035em;
  text-align: center;
  text-transform: uppercase;
}

.status.credited,
.status.paid {
  background: rgba(53, 214, 164, 0.09);
  color: var(--green-bright);
}

.status.processing {
  background: rgba(242, 191, 98, 0.09);
  color: var(--warning);
}

.empty-state {
  padding: 38px 16px 34px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 3px;
  color: #cbd7e7;
  font-size: 0.9rem;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 30px;
  padding-bottom: 34px;
  color: #62748c;
  font-size: 0.7rem;
}

.footer p {
  margin: 0;
}

/* Toasts */

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, calc(100% - 40px));
  pointer-events: none;
}

.toast {
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #17243a;
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
  font-size: 0.8rem;
  animation: toast-in 180ms ease-out;
}

.toast.success {
  border-color: rgba(53, 214, 164, 0.34);
}

.toast.error {
  border-color: rgba(255, 122, 122, 0.34);
}

.toast.leaving {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */

@media (max-width: 1400px) {
  .main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1180px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
  }

  .page > main {
    order: 1;
  }

  .ad-rail {
    position: static;
    width: 100%;
    display: grid;
    place-items: center;
  }

  .ad-rail-left {
    order: 2;
    margin-top: 20px;
  }

  .ad-rail-right {
    order: 3;
  }
}

@media (max-width: 820px) {
  .hero {
    padding-top: 46px;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: min(100% - 28px, 1060px);
  }

  .topbar-inner {
    min-height: 62px;
  }

  .hero {
    padding: 38px 0 26px;
  }

  h1 {
    font-size: clamp(2.25rem, 12vw, 3.2rem);
  }

  .hero-copy {
    font-size: 0.92rem;
  }

  .balance-card,
  .withdraw-card {
    padding: 22px 19px;
  }

  .activity-card {
    padding: 22px 18px 10px;
  }

  .stats {
    margin-top: 23px;
  }

  .stat {
    padding: 12px 8px;
  }

  .stat-label {
    font-size: 0.58rem;
  }

  .activity-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .activity-icon {
    width: 33px;
    height: 33px;
  }

  .status {
    display: none;
  }

  .activity-amount {
    font-size: 0.78rem;
  }

  .toast-stack {
    right: 14px;
    bottom: 14px;
    width: calc(100% - 28px);
  }
}

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