/* nimiq.win — Nimiq-correct default styling.
 *
 * @nimiq/style sets html { font-size: 8px } → 1rem = 8px. Every custom
 * value below is in px to dodge that trap. Surfaces are solid white nq-cards
 * (NO glassmorphism, no translucent rgba cards). Navy radial-gradient body.
 * Gold (#E9B213) is reserved for the prize number ONLY. Green is success only.
 */

:root {
  --navy: #1f2348;
  --navy-bg: radial-gradient(100% 100% at bottom right, #260133, #1f2348);
  --green-bg: radial-gradient(100% 100% at bottom right, #41a38e, #21bca5);
  --gold: #e9b213;
  --green: #21bca5;
  --light-blue: #0582ca;
  --red: #d94432;
  --ink: #1f2348;
  --ink-50: rgba(31, 35, 72, 0.5);
  --ink-12: rgba(31, 35, 72, 0.12);
  --white-60: rgba(255, 255, 255, 0.6);
}

body {
  font-family: "Mulish", "Muli", system-ui, sans-serif !important;
  background-image: var(--navy-bg);
  background-attachment: fixed;
  color: #fff;
  margin: 0;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ── Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 20px;
}
.app-header .logo {
  height: 22px;
  display: block;
}
.app-header .wordmark {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1.1;
}
.app-header .tagline {
  font-size: 12px;
  font-weight: 600;
  color: var(--white-60);
  margin-top: 2px;
}
.app-header .net-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--white-60);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ── Cards ── */
.card {
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.18);
  padding: 24px;
  margin-bottom: 16px;
}
.card-pad-lg {
  padding: 28px 24px;
}

/* ── Prize hero ── */
.prize-card {
  text-align: center;
}
.prize-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-50);
  margin: 0 0 6px;
}
.prize-number {
  font-family: "Fira Mono", monospace;
  font-size: 52px;
  font-weight: 500;
  color: var(--gold);
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.prize-unit {
  font-size: 18px;
  color: var(--ink-50);
  margin-left: 6px;
  font-family: "Mulish", sans-serif;
  font-weight: 700;
}
.prize-sub {
  font-size: 14px;
  color: var(--ink-50);
  margin: 8px 0 0;
}

/* ── Pool stats row ── */
.stats {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.stat {
  flex: 1;
  text-align: center;
  /* The stats row sits on the navy body, not inside a white card, so it needs a
     light-on-dark surface + white text (a dark tint + --ink text is invisible here). */
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 14px 8px;
}
.stat .val {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.stat .lbl {
  font-size: 12px;
  color: var(--white-60);
  margin-top: 2px;
}

/* ── Countdown ── */
.countdown {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-50);
}
.countdown .clock {
  font-family: "Fira Mono", monospace;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ── Section headings ── */
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 16px;
}

/* ── My deposit ── */
.my-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.identicon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.identicon svg,
.identicon img {
  width: 100%;
  height: 100%;
  display: block;
}
.my-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.my-amount .unit {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-50);
  margin-left: 4px;
}
.my-meta {
  font-size: 13px;
  color: var(--ink-50);
  margin-top: 2px;
}
.my-addr {
  font-family: "Fira Mono", monospace;
  font-size: 12px;
  color: var(--ink-50);
  word-break: break-all;
}

/* ── Amount input + actions ── */
.amount-field {
  margin: 14px 0 16px;
}
.amount-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-50);
  margin-bottom: 8px;
}
.actions {
  display: flex;
  gap: 12px;
}
.actions .nq-button {
  flex: 1;
  min-width: 0;
}
.btn-ghost {
  flex: 1;
  border: none;
  background: rgba(31, 35, 72, 0.07);
  color: var(--ink);
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  height: 47px;
  transition: transform 0.2s cubic-bezier(0.25, 0, 0, 1);
}
.btn-ghost:hover:not(:disabled) {
  transform: translateY(-2px);
}
.btn-ghost:disabled,
.nq-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
/* On the winner screen the ghost button lives in a flex COLUMN, where `flex: 1`
   (basis 0 + grow) would override its 47px height and stretch it into a tall pill.
   Pin it to its natural size there. */
.winner-screen .btn-ghost {
  flex: 0 0 auto;
  width: 100%;
  max-width: 240px;
  margin-top: 16px;
}

/* ── Commitment (plain English) ── */
.commit-card .commit-line {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.commit-hash {
  font-family: "Fira Mono", monospace;
  font-size: 12px;
  color: var(--ink-50);
  word-break: break-all;
  margin-top: 8px;
  background: rgba(31, 35, 72, 0.04);
  border-radius: 6px;
  padding: 10px 12px;
}
.disclosure {
  margin-top: 12px;
}
.disclosure summary {
  font-size: 13px;
  color: var(--light-blue);
  cursor: pointer;
  font-weight: 600;
}
.disclosure p {
  font-size: 13px;
  color: var(--ink-50);
  line-height: 1.5;
  margin: 10px 0 0;
}

/* ── Principal-safety line (loudest reassurance) ── */
.safety {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
  margin: 4px 0 20px;
}

/* ── Draw history ── */
.draw-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-12);
  cursor: pointer;
}
.draw-row:last-child {
  border-bottom: none;
}
.draw-row .draw-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.draw-row .draw-winner {
  font-family: "Fira Mono", monospace;
  font-size: 12px;
  color: var(--ink-50);
}
.draw-row .draw-prize {
  margin-left: auto;
  font-family: "Fira Mono", monospace;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.empty-note {
  font-size: 14px;
  color: var(--ink-50);
}

/* ── Demo run button (only shown when a draw is due) ── */
.run-row {
  margin-bottom: 16px;
}
.run-row .nq-button {
  width: 100%;
}

/* ── Legal disclosure (small, honest, not alarming) ── */
.legal {
  font-size: 12px;
  color: var(--white-60);
  line-height: 1.5;
  text-align: center;
  padding: 8px 8px 0;
}
.legal a {
  color: rgba(255, 255, 255, 0.8);
}

/* ── No-provider note ── */
.provider-note {
  font-size: 13px;
  color: var(--white-60);
  text-align: center;
  margin-bottom: 12px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 60;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────────────────────────
 * Winner "wow" screen — full-bleed GREEN (success only).
 * ───────────────────────────────────────────────────────────── */
.winner-screen {
  position: fixed;
  inset: 0;
  background-image: var(--green-bg);
  color: #fff;
  z-index: 80;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
}
.winner-screen.show {
  display: flex;
}
.winner-screen .won-label {
  font-size: 16px;
  font-weight: 700;
  opacity: 0.85;
}
.winner-screen .won-amount {
  font-family: "Fira Mono", monospace;
  font-size: 56px;
  font-weight: 500;
  margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}
.winner-screen .won-amount .unit {
  font-family: "Mulish", sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin-left: 6px;
}
.winner-screen .won-who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 8px;
}
.winner-screen .won-who .identicon {
  width: 44px;
  height: 44px;
}
.winner-screen .won-addr {
  font-family: "Fira Mono", monospace;
  font-size: 13px;
  word-break: break-all;
  max-width: 320px;
}
.winner-screen .won-sub {
  font-size: 14px;
  opacity: 0.85;
  text-align: center;
  margin-top: 8px;
}

/* Verify panel on the winner screen (white card on green) */
.verify-panel {
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}
.verify-panel h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
}
.verify-panel .verify-intro {
  font-size: 13px;
  color: var(--ink-50);
  line-height: 1.5;
  margin: 0 0 14px;
}
.verify-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ink-12);
}
.verify-row:last-of-type {
  border-bottom: none;
}
.verify-row .k {
  color: var(--ink-50);
  flex-shrink: 0;
}
.verify-row .v {
  font-family: "Fira Mono", monospace;
  font-size: 12px;
  text-align: right;
  word-break: break-all;
}
.verify-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.verify-result.match {
  background: rgba(33, 188, 165, 0.12);
  color: #1a9683;
}
.verify-result.mismatch {
  background: rgba(217, 68, 50, 0.1);
  color: var(--red);
}
.verify-result.pending {
  background: rgba(31, 35, 72, 0.05);
  color: var(--ink-50);
  font-weight: 600;
}
.explorer-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--light-blue);
  text-decoration: none;
}
.winner-close {
  margin-top: 24px;
  width: 100%;
  max-width: 380px;
}

/* #20 — shareable fairness receipt: history-row link + winner-screen share row */
.draw-row .draw-receipt {
  margin-left: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.draw-row .draw-receipt:hover {
  color: var(--light-blue);
}
.verify-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.verify-share .explorer-link {
  margin-top: 0;
}
.verify-share .btn-ghost {
  width: auto;
  padding: 6px 14px;
}

/* Provable-fairness proof card (#7 / #19): surface the glass-box re-run on first paint */
.proof-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 20px;
}
.proof-card .proof-text {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.proof-card .proof-check {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-image: var(--green-bg);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.proof-card .nq-button-s {
  flex: none;
  white-space: nowrap;
}

/* Sponsor deposits (#25): prize-boost line + deposit-form sponsor toggle */
.prize-boost {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}
.sponsor-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--ink-50);
  line-height: 1.4;
  cursor: pointer;
}
.sponsor-toggle input {
  margin-top: 2px;
  flex: none;
  accent-color: var(--green);
}

/* Onboarding faucet link (#16): get testnet NIM so an empty wallet can deposit */
.faucet-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s var(--ease, ease);
}
.faucet-link:hover {
  color: var(--light-blue);
}
