:root {
  --ink: #0b0e11;
  --deep: #181a20;
  --paper: #f5f5f0;
  --jade: #e8deb8;
  --jade-dark: #917522;
  --cinnabar: #b93a2d;
  --gold: #f0b90b;
  --text: #f5f5f0;
  --muted: #c4c5c7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--text); font-family: "Noto Sans SC", sans-serif; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  width: 100%;
  height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 68px);
  background: rgba(11, 14, 17, .96);
  border-bottom: 1px solid rgba(240, 185, 11, .3);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; text-decoration: none; font-family: "Noto Serif SC", serif; font-weight: 700; font-size: 20px; }
.brand-icon { display: block; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
nav { display: flex; gap: clamp(20px, 3vw, 42px); }
nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover { color: var(--gold); }
.network { justify-self: end; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.network i { width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); }

.hero {
  position: relative;
  min-height: 760px;
  height: min(900px, 100vh);
  overflow: hidden;
  background: var(--ink) url("assets/dragon-gate-hero-v5.png") center / cover no-repeat;
}
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: opacity 1.1s linear; }
.hero-media-ambient { opacity: 0; }
.hero.is-ambient .hero-media-intro { opacity: 0; }
.hero.is-ambient .hero-media-ambient { opacity: 1; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(11,14,17,.72), transparent 35%, transparent 72%, rgba(11,14,17,.55)); }
.hero-copy { position: absolute; z-index: 3; left: clamp(24px, 5vw, 88px); top: 126px; width: min(430px, 36vw); }
.wordmark { display: flex; align-items: flex-end; gap: 14px; margin: 0 0 24px; font-family: "Noto Serif SC", serif; font-weight: 900; font-size: clamp(58px, 7vw, 104px); line-height: .9; letter-spacing: -.03em; }
.wordmark span { padding-bottom: .12em; color: var(--gold); font-size: .34em; letter-spacing: .08em; }
h1, h2 { margin: 0; font-family: "Noto Serif SC", serif; text-wrap: balance; letter-spacing: -.03em; }
h1 { max-width: 8em; font-size: clamp(36px, 4vw, 60px); line-height: 1.15; }
h2 { margin-bottom: 12px; font-size: clamp(34px, 4vw, 58px); }
.hero-intro { max-width: 31em; margin: 22px 0 0; color: var(--muted); font-size: 17px; line-height: 1.85; }
.hero-wallet { position: absolute; z-index: 4; right: clamp(24px, 5vw, 88px); bottom: clamp(34px, 6vh, 68px); width: min(340px, calc(100% - 48px)); padding: 22px; color: var(--paper); background: rgba(11,14,17,.92); border-top: 1px solid var(--gold); box-shadow: 0 14px 34px rgba(0,0,0,.34); opacity: 0; visibility: hidden; transform: translateY(14px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1), visibility 0s .7s; }
.hero.is-ambient .hero-wallet { opacity: 1; visibility: visible; transform: none; transition-delay: .2s; }
.wallet-state { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; color: var(--gold); font-size: 13px; }
.wallet-state i { width: 7px; height: 7px; background: var(--cinnabar); transform: rotate(45deg); }
.hero-wallet h2 { margin-bottom: 7px; font-size: 24px; }
.hero-wallet > p:not(.wallet-state) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.hero-wallet button { border-radius: 4px; cursor: pointer; font-weight: 600; }
.hero-wallet > button { width: 100%; min-height: 48px; margin-top: 18px; border: 1px solid #ffd13c; color: var(--ink); background: var(--gold); }
.hero-wallet > button:hover { background: #ffd13c; }
.hero-wallet button:disabled { cursor: default; opacity: .62; }
.hero-wallet form { margin-top: 15px; padding-top: 14px; border-top: 1px solid rgba(245,245,240,.15); }
.hero-wallet label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.wallet-address-entry { display: grid; grid-template-columns: minmax(0,1fr) auto; }
.wallet-address-entry input { min-width: 0; height: 42px; padding: 0 11px; border: 1px solid rgba(245,245,240,.32); border-right: 0; border-radius: 4px 0 0 4px; color: var(--paper); background: rgba(0,0,0,.25); font: inherit; font-size: 16px; }
.wallet-address-entry input::placeholder { color: #9b9c9e; }
.wallet-address-entry input[aria-invalid="true"] { border-color: var(--cinnabar); }
.wallet-address-entry button { min-height: 42px; padding: 0 15px; border: 1px solid rgba(245,245,240,.5); border-radius: 0 4px 4px 0; color: var(--paper); background: transparent; }
.wallet-address-entry button:hover { border-color: var(--gold); color: var(--gold); }
.wallet-error { margin: 7px 0 0; color: #ef9c91; font-size: 12px; line-height: 1.5; }
.wallet-error:empty { display: none; }

.ledger { position: relative; z-index: 6; padding: 74px clamp(24px, 6vw, 96px) 88px; color: #202225; background-color: var(--paper); background-image: linear-gradient(rgba(90,74,24,.06) 1px, transparent 1px); background-size: 100% 32px; border-top: 8px solid var(--gold); }
.ledger-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; max-width: 1400px; margin: auto; }
.ledger-heading p { margin: 0; color: #506056; }
.ledger-note { max-width: 20em; text-align: right; }
.ledger-workspace { max-width: 1400px; margin: 36px auto 0; border: 1px solid #8f8365; background: rgba(245,245,240,.84); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 62px; padding: 8px 12px; color: var(--paper); background: var(--ink); border-bottom: 1px solid #544a32; }
.table-tabs { display: inline-flex; align-items: center; padding: 3px; border: 1px solid rgba(232,222,184,.34); }
.table-tabs button { min-height: 40px; padding: 0 18px; border: 0; color: #c4c5c7; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; }
.table-tabs button:hover { color: var(--paper); background: rgba(245,245,240,.07); }
.table-tabs button[aria-selected="true"] { color: var(--ink); background: var(--gold); }
.table-tabs button:focus-visible { outline-offset: 2px; }
.table-status { display: flex; align-items: center; gap: 9px; margin: 0; color: #b8b3a5; font-size: 12px; white-space: nowrap; }
.table-status span { width: 7px; height: 7px; background: var(--cinnabar); transform: rotate(45deg); }
.table-panel[hidden] { display: none; }
.table-scroll { overflow-x: auto; scrollbar-color: #857650 #ded7c3; }
.table-scroll:focus-visible { outline-offset: -3px; }
.holder-table { width: 100%; min-width: 780px; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.holder-table th, .holder-table td { height: 56px; padding: 0 18px; border-right: 1px solid rgba(96,82,48,.16); border-bottom: 1px solid rgba(96,82,48,.24); text-align: left; white-space: nowrap; }
.holder-table th:last-child, .holder-table td:last-child { border-right: 0; }
.holder-table thead { color: #dad1b8; background: #25271f; }
.holder-table th { height: 42px; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.holder-table tbody tr { background: rgba(245,245,240,.74); }
.holder-table tbody tr:nth-child(even) { background: rgba(232,222,184,.2); }
.holder-table tbody tr:hover { background: rgba(240,185,11,.13); }
.holder-table tbody tr:last-child td { border-bottom: 0; }
.bucket-table th:nth-child(1), .bucket-table td:nth-child(1) { width: 11%; }
.bucket-table th:nth-child(2), .bucket-table td:nth-child(2) { width: 17%; }
.bucket-table th:nth-child(3), .bucket-table td:nth-child(3) { width: 38%; }
.bucket-table th:nth-child(4), .bucket-table td:nth-child(4) { width: 14%; }
.bucket-table th:nth-child(5), .bucket-table td:nth-child(5) { width: 20%; }
.row-gate { font-family: "Noto Serif SC", serif; color: var(--cinnabar); font-weight: 700; }
.count-cell { display: grid; grid-template-columns: minmax(58px, auto) 1fr; align-items: center; gap: 16px; }
.bar { height: 8px; background: rgba(85,117,99,.13); }
.bar i { display: block; height: 100%; background: var(--gold); }
.next-stage { color: #596258; font-size: 13px; }
.leaderboard-table th:nth-child(1), .leaderboard-table td:nth-child(1) { width: 9%; }
.leaderboard-table th:nth-child(2), .leaderboard-table td:nth-child(2) { width: 31%; }
.leaderboard-table th:nth-child(3), .leaderboard-table td:nth-child(3) { width: 18%; }
.leaderboard-table th:nth-child(4), .leaderboard-table td:nth-child(4) { width: 24%; }
.leaderboard-table th:nth-child(5), .leaderboard-table td:nth-child(5) { width: 18%; }
.rank { color: #73632f; font-family: "Noto Serif SC", serif; font-weight: 700; }
.rank.is-top { color: var(--cinnabar); font-size: 18px; }
.wallet-address { color: #202225; font-weight: 600; letter-spacing: .02em; }
.stage-mark { display: inline-flex; align-items: center; gap: 8px; }
.stage-mark::before { content: ""; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }
.duration { font-weight: 700; }
.demo-label { color: #7d2d24; font-size: 12px; }
.table-disclosure { margin: 0; padding: 13px 18px; color: #5a5b50; background: #e4ddca; border-top: 1px solid rgba(96,82,48,.24); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.reward-section { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(48px, 10vw, 150px); padding: 110px clamp(24px, 7vw, 112px); background: var(--deep); }
.reward-copy p { max-width: 36em; color: var(--muted); line-height: 1.9; }
.reward-note { font-size: 13px; }
.reward-waves { list-style: none; padding: 0; margin: 0; }
.reward-waves li { display: grid; grid-template-columns: .65fr 1.2fr .8fr; align-items: center; gap: 18px; min-height: 88px; border-bottom: 1px solid rgba(232,220,192,.18); }
.reward-waves span { color: var(--gold); font-size: 13px; }
.reward-waves strong { font-family: "Noto Serif SC", serif; font-size: 21px; }
.reward-waves time { justify-self: end; color: var(--muted); font-size: 13px; }

.rules-section { padding: 100px clamp(24px, 7vw, 112px) 110px; color: #202225; background: #ded7c3; }
.rules-heading { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(48px, 10vw, 150px); align-items: end; }
.rules-heading p { max-width: 40em; margin: 0 0 14px; color: #4f574f; line-height: 1.8; }
.rules-list { margin: 46px 0 0; border-top: 1px solid #8f8365; }
.rules-list div { display: grid; grid-template-columns: .7fr 2fr .6fr; gap: 24px; align-items: center; min-height: 92px; border-bottom: 1px solid rgba(95,79,43,.28); }
.rules-list dt { font-family: "Noto Serif SC", serif; font-size: 21px; font-weight: 700; }
.rules-list dd { margin: 0; color: #4f574f; line-height: 1.7; }
.rules-list span { justify-self: end; color: #7d2d24; font-size: 13px; }

footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 34px clamp(24px, 6vw, 96px); color: #aeb0b3; background: #080a0d; font-size: 12px; }
.footer-brand { color: var(--paper); font-size: 16px; }
footer a:last-child { color: var(--paper); }

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; }
  nav { display: none; }
  .hero { min-height: 900px; height: 100vh; max-height: 980px; background-position: 57% center; }
  .hero-media { object-position: 57% center; }
  .hero-copy { width: 48vw; }
  .reward-section, .rules-heading { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { height: 58px; padding-inline: 18px; }
  .network { font-size: 0; }
  .network::after { content: "BSC"; font-size: 12px; }
  .hero { min-height: 760px; height: 100svh; max-height: 900px; background-size: auto 62%; background-position: 58% bottom; }
  .hero-media { inset: auto auto 0 58%; width: auto; min-width: 100%; height: 62%; transform: translateX(-58%); }
  .hero::after { background: linear-gradient(180deg, rgba(11,14,17,.22), rgba(11,14,17,.88) 37%, rgba(11,14,17,.48)); }
  .hero-copy { top: 94px; left: 20px; width: calc(100% - 40px); }
  .wordmark { margin-bottom: 16px; font-size: 64px; }
  h1 { font-size: 34px; }
  .hero-intro { margin-top: 16px; font-size: 15px; line-height: 1.7; }
  .hero-wallet { right: 20px; bottom: 24px; width: calc(100% - 40px); padding: 18px; }
  .ledger { padding: 52px 20px 64px; }
  .ledger-heading { align-items: start; flex-direction: column; }
  .ledger-note { text-align: left; }
  .ledger-workspace { margin-top: 26px; }
  .table-toolbar { align-items: stretch; flex-direction: column; gap: 8px; padding: 10px; }
  .table-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .table-tabs button { padding-inline: 12px; }
  .table-status { padding: 3px 5px 0; white-space: normal; }
  .holder-table { min-width: 720px; }
  .holder-table th, .holder-table td { padding-inline: 14px; }
  .bucket-table th:first-child, .bucket-table td:first-child,
  .leaderboard-table th:first-child, .leaderboard-table td:first-child { position: sticky; z-index: 2; left: 0; background: #eee9da; box-shadow: 1px 0 rgba(96,82,48,.25); }
  .bucket-table thead th:first-child, .leaderboard-table thead th:first-child { z-index: 4; color: #dad1b8; background: #25271f; }
  .leaderboard-table th:nth-child(2), .leaderboard-table td:nth-child(2) { position: sticky; z-index: 2; left: 64px; background: #eee9da; box-shadow: 1px 0 rgba(96,82,48,.25); }
  .leaderboard-table thead th:nth-child(2) { z-index: 4; color: #dad1b8; background: #25271f; }
  .reward-section, .rules-section { padding: 76px 20px; }
  .reward-waves li { grid-template-columns: .8fr 1.2fr; padding: 18px 0; }
  .reward-waves time { grid-column: 2; justify-self: start; }
  .rules-list div { grid-template-columns: 1fr auto; gap: 8px 18px; padding: 20px 0; }
  .rules-list dd { grid-column: 1 / 3; grid-row: 2; }
  .rules-list span { grid-column: 2; grid-row: 1; }
  footer { flex-direction: column; align-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-media { display: none; }
  .hero-wallet { opacity: 1; visibility: visible; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
