:root {
  --bg: #0B0D10;
  --bg-raised: #14171C;
  --line: #232830;
  --ink: #F2EFE9;
  --ink-dim: #9098A3;
  --orange: #F7931A;      /* Bitcoin orange */
  --orange-dim: #B5701A;
  --cyan: #47E0C2;        /* Lightning accent */
  --danger: #FF5C5C;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Work Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: var(--cyan); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 .4em;
}

.mono { font-family: var(--font-mono); }

.wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* --- Signature element: the block ticker, styled like a live block-explorer header --- */
.ticker {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-raised), var(--bg));
  overflow: hidden;
  margin-bottom: 24px;
}
.ticker__cell {
  flex: 1;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  position: relative;
}
.ticker__cell:last-child { border-right: none; }
.ticker__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: block;
  margin-bottom: 4px;
}
.ticker__value {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--orange);
}
.ticker__value.cyan { color: var(--cyan); }
.ticker__pulse {
  position: absolute;
  top: 10px; right: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(71,224,194,.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(71,224,194,.5); }
  70% { box-shadow: 0 0 0 8px rgba(71,224,194,0); }
  100% { box-shadow: 0 0 0 0 rgba(71,224,194,0); }
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 8px;
  display: block;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--ink-dim);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
}
.field input:focus, .field select:focus {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 8px;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn-primary { background: var(--orange); color: #17110A; }
.btn-secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-cyan { background: var(--cyan); color: #06231D; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.muted { color: var(--ink-dim); font-size: 14px; line-height: 1.5; }

.error-banner {
  background: rgba(255,92,92,.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.error-banner.show { display: block; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.wallet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  text-decoration: none;
  color: var(--ink);
}
.wallet-option:hover { border-color: var(--orange); }
.wallet-option__name { font-family: var(--font-display); font-weight: 700; }
.wallet-option__note { font-size: 12px; color: var(--ink-dim); }

.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--cyan));
  transition: width .4s ease;
}

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 10px;
  cursor: pointer;
}
.quiz-option:hover { border-color: var(--orange); }
.quiz-option.correct { border-color: var(--cyan); background: rgba(71,224,194,.08); }
.quiz-option.wrong { border-color: var(--danger); background: rgba(255,92,92,.08); }

.clue-box {
  border-left: 3px solid var(--orange);
  padding: 14px 16px;
  background: rgba(247,147,26,.06);
  border-radius: 0 8px 8px 0;
  font-size: 15px;
  line-height: 1.6;
}

table.leaderboard { width: 100%; border-collapse: collapse; }
table.leaderboard th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
table.leaderboard td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
table.leaderboard tr.you { background: rgba(247,147,26,.08); }
.rank { font-family: var(--font-mono); color: var(--orange); }

footer.legal {
  font-size: 11px;
  color: var(--ink-dim);
  text-align: center;
  padding-top: 24px;
}
