:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #1a1d22;
  --panel-strong: #23272e;
  --text: #f3f5f7;
  --muted: #a7b0ba;
  --line: #343a44;
  --lime: #b8ff5c;
  --cyan: #54d6ff;
  --coral: #ff7b68;
  --gold: #ffd166;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(16, 17, 20, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--lime);
  color: #101114;
  font-size: 0.8rem;
}

.nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.avatar {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 72px);
  padding: clamp(42px, 8vw, 92px) clamp(18px, 4vw, 56px);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 20%, rgba(84, 214, 255, 0.24), transparent 26%),
    linear-gradient(135deg, rgba(184, 255, 92, 0.18), transparent 36%),
    #111318;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 17, 20, 0.92) 0%, rgba(16, 17, 20, 0.72) 48%, rgba(16, 17, 20, 0.2) 100%);
}

.arena-grid {
  position: absolute;
  inset: 22% -10% -18% 35%;
  transform: perspective(700px) rotateX(58deg) rotateZ(-7deg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.13) 1px, transparent 1px);
  background-size: 46px 46px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.scoreboard,
.player-card {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(26, 29, 34, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.scoreboard {
  right: 10vw;
  top: 16vh;
  display: grid;
  gap: 4px;
  min-width: 150px;
  padding: 18px;
  border-radius: 8px;
}

.scoreboard span {
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--coral);
  color: #101114;
  font-size: 0.72rem;
  font-weight: 800;
}

.scoreboard strong {
  font-size: 2.8rem;
  line-height: 1;
}

.scoreboard small,
.player-card small {
  color: var(--muted);
}

.player-card {
  display: grid;
  gap: 6px;
  width: 210px;
  padding: 16px;
  border-radius: 8px;
}

.card-one {
  right: 28vw;
  bottom: 20vh;
}

.card-two {
  right: 8vw;
  bottom: 34vh;
}

.rank {
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(184, 255, 92, 0.18);
  color: var(--lime);
  font-size: 0.75rem;
  font-weight: 800;
}

.rank.alt {
  background: rgba(84, 214, 255, 0.18);
  color: var(--cyan);
}

.hero-content {
  position: relative;
  z-index: 3;
  align-self: center;
  max-width: 700px;
  padding-bottom: 9vh;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
}

.hero-copy {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
}

.hero-actions,
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  background: var(--lime);
  color: #101114;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.compact {
  min-height: 40px;
  padding: 0 14px;
}

.full {
  width: 100%;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.status-strip div {
  display: grid;
  gap: 5px;
  padding: 18px clamp(18px, 4vw, 42px);
  border-right: 1px solid var(--line);
}

.status-strip span {
  color: var(--muted);
  font-size: 0.82rem;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 330px;
  gap: 22px;
  padding: 28px clamp(18px, 4vw, 56px);
}

.sidebar,
.create-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel,
.create-panel,
.challenge-card,
.steps article,
.modal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel,
.create-panel,
.wallet-panel {
  padding: 18px;
}

.panel h2,
.create-panel h2,
.wallet-panel h2 {
  margin-bottom: 18px;
  font-size: 1.1rem;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  color: var(--text);
  padding: 12px;
}

textarea {
  resize: vertical;
  min-height: 104px;
}

.range-value {
  color: var(--text);
  font-weight: 800;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  margin: 0;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #111318;
  border: 1px solid var(--line);
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.switch input:checked + span::after {
  transform: translateX(20px);
  background: var(--lime);
}

.compliance ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

.account-summary,
.auth-stack,
.action-stack {
  display: grid;
  gap: 10px;
}

.account-summary p,
.auth-stack p,
.action-stack p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.tab-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111318;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab-button.active {
  background: var(--panel-strong);
  color: var(--text);
}

.mini-form {
  display: grid;
  gap: 10px;
}

.mini-form label {
  margin-bottom: 0;
}

.checkbox-label {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.checkbox-label input {
  width: auto;
  margin-top: 3px;
}

.content-column {
  min-width: 0;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 18px;
}

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

.matches-panel {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.matches-panel:empty {
  display: none;
}

.match-row,
.compliance-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.match-row span,
.compliance-box span {
  color: var(--muted);
  line-height: 1.45;
}

.challenge-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  min-height: 245px;
}

.challenge-top,
.challenge-meta,
.challenge-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--gold);
  font-weight: 900;
}

.challenge-card p {
  color: var(--muted);
  line-height: 1.5;
}

.wallet-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 209, 102, 0.28);
}

.wallet-panel h2 {
  margin-bottom: 0;
}

.wallet-address {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.wallet-address span {
  color: var(--muted);
  font-size: 0.8rem;
}

.wallet-address strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.bitcoin-row {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.08);
}

.bitcoin-row code {
  color: var(--gold);
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.stake {
  color: var(--lime);
  font-size: 1.5rem;
  font-weight: 900;
}

.sats {
  display: block;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.steps {
  padding: 42px clamp(18px, 4vw, 56px) 70px;
  border-top: 1px solid var(--line);
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.steps article {
  padding: 22px;
}

.steps span {
  color: var(--coral);
  font-weight: 900;
}

.steps p {
  color: var(--muted);
  line-height: 1.55;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  padding: 24px;
  box-shadow: var(--shadow);
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #111318;
  color: var(--text);
  cursor: pointer;
}

.notice {
  margin: 18px 0;
  padding: 12px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 209, 102, 0.1);
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-actions:empty {
  display: none;
}

.modal-actions .mini-form {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.admin-section {
  padding: 42px clamp(18px, 4vw, 56px) 70px;
  border-top: 1px solid var(--line);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.admin-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

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

  .create-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .nav {
    display: none;
  }

  .hero {
    min-height: 760px;
  }

  .hero-media::after {
    background: linear-gradient(180deg, rgba(16, 17, 20, 0.96) 0%, rgba(16, 17, 20, 0.8) 68%, rgba(16, 17, 20, 0.42) 100%);
  }

  .scoreboard {
    right: 20px;
    top: auto;
    bottom: 155px;
  }

  .card-one {
    left: 20px;
    right: auto;
    bottom: 62px;
  }

  .card-two {
    display: none;
  }

  .status-strip,
  .workspace,
  .challenge-grid,
  .step-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .status-strip div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
