:root {
  --void: #020407;
  --night: #07111c;
  --surface: rgba(9, 19, 31, 0.88);
  --surface-raised: #0c1825;
  --gold: #e8bd65;
  --gold-pale: #ffe8ae;
  --gold-deep: #9d6518;
  --text: #fbf6e9;
  --muted: #bdb4a5;
  --quiet: #8f887d;
  --line: rgba(232, 189, 101, 0.22);
  --line-soft: rgba(255, 255, 255, 0.09);
  --success: #7dd7a5;
  --danger: #ff9c8f;
  --focus: #ffe19a;
  --radius: 18px;
}

* { box-sizing: border-box; }

html {
  background: var(--void);
  color: var(--text);
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background:
    radial-gradient(circle at 75% 8%, rgba(37, 79, 121, 0.2), transparent 30rem),
    radial-gradient(circle at 10% 70%, rgba(151, 91, 22, 0.1), transparent 32rem),
    var(--void);
  margin: 0;
  min-height: 100dvh;
  min-width: 320px;
}

button,
a,
summary { -webkit-tap-highlight-color: rgba(232, 189, 101, 0.2); }

button:not(:disabled),
a[href],
summary { cursor: pointer; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  background: var(--gold-pale);
  color: var(--void);
  font-weight: 750;
  left: 50%;
  padding: 10px 16px;
  position: fixed;
  top: 8px;
  transform: translate(-50%, -160%);
  transition: transform 180ms ease;
  z-index: 100;
}

.skip-link:focus { transform: translate(-50%, 0); }

.topbar {
  align-items: center;
  background: rgba(2, 4, 7, 0.82);
  backdrop-filter: blur(18px);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: max(12px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 12px max(18px, env(safe-area-inset-left));
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-size: 13px;
  font-weight: 750;
  gap: 9px;
  letter-spacing: 0.055em;
  min-height: 44px;
  text-decoration: none;
  text-transform: uppercase;
}

.brand svg {
  fill: none;
  height: 34px;
  stroke: var(--gold);
  stroke-width: 1;
  width: 34px;
}

.brand .brand-star { fill: var(--gold-pale); stroke: none; }

.network {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  gap: 8px;
}

.network i {
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(232, 189, 101, 0.12);
  height: 7px;
  width: 7px;
}

main {
  display: grid;
  gap: 26px;
  margin: 0 auto;
  max-width: 980px;
  padding: 42px 24px max(56px, env(safe-area-inset-bottom));
}

.claim-panel,
.token-section,
.manual-guide {
  background: linear-gradient(145deg, rgba(11, 24, 38, 0.94), rgba(5, 12, 20, 0.95));
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 232, 174, 0.08), 0 24px 60px rgba(0, 0, 0, 0.2);
}

.claim-panel { padding: clamp(22px, 4vw, 38px); }

form > label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.address-row {
  align-items: stretch;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.address-row:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 189, 101, 0.12);
}

input {
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
  min-height: 54px;
  min-width: 0;
  padding: 0 16px;
  width: 100%;
}

input:focus { outline: 0; }
input::placeholder { color: #756f66; }

.paste-button {
  background: rgba(232, 189, 101, 0.08);
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--gold-pale);
  font-weight: 700;
  min-height: 54px;
  min-width: 68px;
  transition: background 180ms ease;
}

.paste-button:hover { background: rgba(232, 189, 101, 0.15); }

.field-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 21px;
  margin: 7px 0 2px;
}

.turnstile { min-height: 66px; }

.claim-button {
  align-items: center;
  background: linear-gradient(110deg, var(--gold-pale), var(--gold));
  border: 0;
  border-radius: 12px;
  color: #161006;
  display: flex;
  font-size: 16px;
  font-weight: 800;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  transition: filter 180ms ease, opacity 180ms ease;
  width: 100%;
}

.claim-button svg {
  fill: none;
  height: 22px;
  margin-left: 8px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 22px;
}

.claim-button:hover:not(:disabled) { filter: brightness(1.06); }
.claim-button:disabled {
  background: #5a554b;
  color: #e2dacb;
  cursor: not-allowed;
  opacity: 1;
}

.claim-status {
  color: var(--muted);
  font-size: 13px;
  min-height: 21px;
  margin-top: 12px;
  text-align: center;
}

.claim-status[data-tone="success"] { color: var(--success); }
.claim-status[data-tone="error"] { color: var(--danger); }

.token-section { padding: 12px; }

.section-line {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  padding: 10px 8px 16px;
}

.section-line h1 { font-size: 16px; margin: 0; }
.section-line span { color: var(--quiet); font-size: 11px; }

.token-list { display: grid; gap: 8px; }

.token-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 13px;
  display: grid;
  gap: 12px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  min-height: 76px;
  padding: 10px 12px;
}

.token-mark {
  background: linear-gradient(145deg, var(--gold-pale), var(--gold-deep));
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  height: 38px;
  position: relative;
  width: 38px;
}

.token-mark::after {
  border: 1px solid rgba(25, 17, 6, 0.55);
  border-radius: 50%;
  content: "";
  inset: 7px;
  position: absolute;
}

.token-info { min-width: 0; }
.token-info > div { align-items: baseline; display: flex; gap: 8px; }
.token-symbol { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.token-name { color: var(--quiet); font-size: 12px; }

.copy-address {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  gap: 8px;
  margin: 5px 0 0;
  min-height: 30px;
  max-width: 100%;
  padding: 0;
}

.token-address {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-address span:last-child { color: var(--gold); font-family: inherit; }
.copy-address:disabled { color: var(--quiet); cursor: not-allowed; opacity: 0.66; }
.copy-address:disabled span:last-child { color: var(--quiet); }

.watch-token {
  background: rgba(232, 189, 101, 0.1);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--gold-pale);
  font-size: 12px;
  font-weight: 750;
  min-height: 44px;
  padding: 0 13px;
  transition: background 180ms ease;
}

.watch-token:hover { background: rgba(232, 189, 101, 0.17); }
.watch-token:disabled {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line-soft);
  color: var(--quiet);
  cursor: not-allowed;
}

.manual-guide { padding: 0 20px; }

.manual-guide summary {
  align-items: center;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  min-height: 56px;
}

.manual-guide summary::after {
  color: var(--gold);
  content: "+";
  font-size: 20px;
  margin-left: auto;
}

.manual-guide[open] summary::after { content: "−"; }
.manual-guide ol { color: var(--muted); font-size: 13px; margin: 0; padding: 0 0 20px 22px; }
.manual-guide li + li { margin-top: 8px; }

@media (min-width: 820px) {
  main { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .claim-panel { align-self: start; position: sticky; top: 104px; }
  .manual-guide { grid-column: 2; }
}

@media (max-width: 560px) {
  .topbar { min-height: 64px; }
  .brand span { display: none; }
  main { gap: 14px; padding: 22px 12px max(36px, env(safe-area-inset-bottom)); }
  .claim-panel { padding: 18px 14px; }
  .token-section { padding: 8px; }
  .token-row { gap: 9px; grid-template-columns: 34px minmax(0, 1fr); padding: 10px; }
  .token-mark { height: 34px; width: 34px; }
  .watch-token { grid-column: 2; justify-self: stretch; width: 100%; }
  .section-line { padding: 9px 7px 13px; }
}

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