/* Let it ride. A white sheet, crayon lines, the meme's bold caption; colour only where a roulette has it. */

:root {
  --paper: #ffffff;
  --text: #000000;
  --ink: #141414; /* the crayon of the drawings */
  --pencil: #767676; /* second-rank text, like the artist's grey signature */
  --red: #d3302a;
  --black: #1b1b1b;
  --felt: #1f6b3f;
  --felt-deep: #17532f;
  --sketch: 255px 18px 225px 18px / 18px 225px 18px 255px; /* a hand-drawn box */
  --wide: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 17px/1.5 "Figtree", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; }
h2 { font-weight: 900; font-size: clamp(30px, 5vw, 46px); letter-spacing: -0.02em; }
h3 { font-weight: 800; font-size: 19px; }
code, .bet-example { font: 800 1em/1.2 "Figtree", system-ui, sans-serif; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
#wallet-body:focus { outline: none; }

/* ── header ── */
.top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  max-width: var(--wide); margin: 0 auto; padding: 16px 16px 0;
}
.mark { font-weight: 900; font-size: 24px; letter-spacing: -0.03em; text-decoration: none; }
.top-nav { display: flex; align-items: center; gap: 14px; }
.buy { font-weight: 800; text-decoration: none; }
.buy:hover { color: var(--red); }
/* the token address, copied on a click */
.ca {
  font: 800 15px/1 "Figtree", system-ui, sans-serif; color: var(--text); background: var(--paper); cursor: copy;
  border: 3px dashed var(--ink); border-radius: var(--sketch); padding: 9px 14px; display: inline-flex; gap: 8px; align-items: center;
  transition: background-color .15s, color .15s;
}
.ca-label { color: var(--pencil); }
.ca.copied .ca-label { color: inherit; }
@media (max-width: 700px) { .ca { order: 3; flex-basis: 100%; justify-content: center; } }
.x-link svg { width: 22px; height: 22px; fill: var(--ink); display: block; }

.btn {
  font: 800 16px/1 "Figtree", system-ui, sans-serif;
  color: var(--text); background: var(--paper);
  border: 3px solid var(--ink); border-radius: var(--sketch);
  padding: 11px 18px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover { background: #f3f3f3; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--red); border-color: var(--red); }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ── hero ── */
.hero { max-width: var(--wide); margin: 0 auto; padding: 18px 16px 56px; text-align: center; }
.caption {
  font-weight: 900; font-size: clamp(64px, 15vw, 172px); letter-spacing: -0.045em; line-height: 0.9;
  margin-top: 8px;
}
.stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; margin-top: 30px; }
.wheel-box { position: relative; width: min(440px, 86vw); aspect-ratio: 1; }
.wheel-spin, .wheel { width: 100%; height: 100%; }
.wheel { transform-origin: 50% 50%; will-change: transform; }
.pointer { position: absolute; top: -10px; left: 50%; width: 30px; transform: translateX(-50%); fill: var(--paper); stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.ball {
  position: absolute; left: 50%; top: 14.7%; width: 4.6%; aspect-ratio: 1; margin-left: -2.3%;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 50%;
}
.ball.drop { animation: drop 520ms cubic-bezier(.3, 1.6, .5, 1); }
@keyframes drop { from { transform: translateY(-140%) scale(1.3); opacity: 0; } to { transform: none; opacity: 1; } }
.giggle {
  width: min(330px, 62vw); margin-top: -12%; margin-left: 30%; position: relative; z-index: 1; pointer-events: none;
}
@media (min-width: 900px) {
  .stage { grid-template-columns: 1fr auto 1fr; align-items: end; }
  .wheel-box { grid-column: 2; }
  .giggle { grid-column: 3; justify-self: start; width: 380px; margin: 0 0 -20px -36px; }
}
.status { font-weight: 800; font-size: clamp(20px, 3vw, 26px); margin: 22px 0 14px; }
.status .when { color: var(--red); }
.bet-line { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.bet-example {
  font-size: clamp(20px, 4vw, 28px); background: none; color: var(--text);
  border: 3px dashed var(--ink); border-radius: var(--sketch); padding: 10px 18px; cursor: copy;
  transition: background-color .15s, color .15s;
}
/* copied: the box is stamped in ink and a crayon tick draws itself */
.bet-example.copied, .ca.copied { background: var(--ink); color: var(--paper); border-style: solid; animation: stamp 420ms cubic-bezier(.3, 1.6, .5, 1); }
@keyframes stamp { 35% { transform: scale(.93) rotate(-1.5deg); } 100% { transform: none; } }
.tick { display: inline-block; width: 1.05em; height: .85em; margin-right: .4em; vertical-align: -0.04em; overflow: visible; }
.tick path { fill: none; stroke: currentColor; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 360ms 110ms ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.prizes { color: var(--pencil); margin: 16px auto 0; max-width: 34em; }
.prizes b { color: var(--text); }

/* ── the felt ── */
.felt { position: relative; background: var(--felt); color: var(--paper); margin: 24px 0; }
.felt .edge { position: absolute; left: 0; width: 100%; height: 22px; fill: var(--felt); }
.felt .edge-top { top: -21px; }
.felt .edge-bottom { bottom: -21px; }
.felt-inner { max-width: var(--wide); margin: 0 auto; padding: 40px 16px 48px; }
.round-tag { font-weight: 600; font-size: 0.5em; opacity: 0.75; letter-spacing: 0; margin-left: 8px; }
.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
@media (max-width: 640px) { .columns { grid-template-columns: minmax(0, 1fr); } }
.column { border: 3px solid rgba(255, 255, 255, .85); border-radius: var(--sketch); padding: 14px 16px; min-height: 120px; }
.column h3 { display: flex; align-items: center; gap: 10px; }
.chip { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--paper); display: inline-block; }
.chip.red { background: var(--red); }
.chip.black { background: var(--black); }
.chip.green { background: var(--felt-deep); }
.total { font-weight: 900; font-size: 30px; margin: 8px 0 6px; }
.total small { font-weight: 600; font-size: 15px; opacity: .75; }
.bets { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.bets li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.bets .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bets .amt { font-weight: 800; }
.bets .empty { opacity: .65; }
.unlinked { margin: 18px 0 0; font-size: 15px; }
.unlinked button { font: inherit; font-weight: 800; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ── results ── */
.results, .leaders { max-width: var(--wide); margin: 0 auto; padding: 56px 16px 24px; }
.spins { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.spins li {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: var(--paper); border: 3px solid var(--ink);
}
.spins .c1 { background: var(--red); }
.spins .c2 { background: var(--black); }
.spins .c3 { background: var(--felt); }
.spins .void { background: var(--paper); color: var(--pencil); border-style: dashed; }
.last { margin-top: 26px; }
.last h3 { font-size: 22px; }
.last h3 .pocket { color: var(--red); }
.last h3 .pocket.c2 { color: var(--black); }
.last h3 .pocket.c3 { color: var(--felt); }
.last p { color: var(--pencil); margin: 6px 0 0; }
.payouts { width: 100%; max-width: 760px; border-collapse: collapse; margin-top: 14px; font-size: 16px; }
.payouts td { padding: 7px 8px 7px 0; border-bottom: 2px solid #ececec; vertical-align: top; }
.payouts td:last-child { text-align: right; padding-right: 0; }
.payouts .won { font-weight: 800; }
.payouts .lost { color: var(--pencil); }

/* ── how to play ── */
.how {
  max-width: var(--wide); margin: 0 auto; padding: 64px 16px 24px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: end;
}
.roy { width: 150px; justify-self: end; margin-bottom: -40px; }
@media (min-width: 900px) {
  .how { grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
  .roy { width: 230px; justify-self: start; margin: 0; }
}
.how-text { max-width: 40em; }
/* every step gets the same height (the tallest one's), so the numbers sit at an even rhythm */
.steps { margin: 22px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; grid-auto-rows: 1fr; row-gap: 16px; }
.steps li { counter-increment: step; position: relative; padding: 6px 0 0 54px; min-height: 38px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 38px; height: 38px;
  display: grid; place-items: center; font-weight: 900; border: 3px solid var(--ink); border-radius: 50%;
}
.steps b { font-weight: 800; }
.example { white-space: nowrap; }
.rules { margin-top: 26px; border-top: 3px solid var(--ink); padding-top: 12px; }
.rules summary { font-weight: 800; cursor: pointer; }
.rules ul { padding-left: 20px; color: #333; }
.rules li { margin: 6px 0; }

/* ── leaders ── */
.leaderboard { margin: 18px 0 0; padding: 0 0 0 26px; max-width: 760px; }
.leaderboard li { padding: 6px 0; border-bottom: 2px solid #ececec; }
.leaderboard .row { display: flex; justify-content: space-between; gap: 12px; }
.leaderboard .eth { font-weight: 800; }

/* ── footer ── */
.foot { max-width: var(--wide); margin: 40px auto 0; padding: 24px 16px 40px; color: var(--pencil); font-size: 15px; border-top: 3px solid var(--ink); }
.foot p { margin: 6px 0; }
.addr { font-weight: 600; color: var(--text); background: none; border: 0; padding: 0; cursor: copy; font: inherit; text-decoration: underline dotted; }

/* ── wallet sheet ── */
.sheet {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 22px 22px 26px;
  border: 3px solid var(--ink); border-radius: var(--sketch); color: var(--text); background: var(--paper);
}
.sheet::backdrop { background: rgba(255, 255, 255, .78); }
.sheet-close { position: absolute; right: 10px; top: 6px; }
.close { font-size: 30px; line-height: 1; background: none; border: 0; cursor: pointer; padding: 4px 8px; }
.sheet h2 { font-size: 30px; }
.sheet h3 { margin-top: 22px; }
.sheet .muted { color: var(--pencil); font-size: 15px; margin: 4px 0 0; }
.figure { font-weight: 900; font-size: 26px; margin: 4px 0 0; }
.row-form { display: flex; gap: 8px; margin-top: 10px; }
.row-form input {
  flex: 1; min-width: 0; font: 600 17px/1.2 "Figtree", system-ui, sans-serif; padding: 10px 12px;
  border: 3px solid var(--ink); border-radius: 12px 4px 10px 4px / 4px 10px 4px 12px; background: var(--paper);
}
.code-box { font-weight: 900; font-size: 24px; border: 3px dashed var(--ink); border-radius: var(--sketch); padding: 10px 14px; margin: 10px 0; text-align: center; }

.toast {
  margin: auto auto 24px; inset: auto 0 0 0; width: fit-content; max-width: calc(100vw - 32px);
  font-weight: 800; background: var(--ink); color: var(--paper); border: 0; padding: 12px 18px; border-radius: var(--sketch);
}
.demo-note { position: fixed; left: 12px; bottom: 12px; font-size: 13px; font-weight: 800; background: var(--paper); border: 2px dashed var(--pencil); color: var(--pencil); padding: 4px 10px; border-radius: 10px; z-index: 5; }

/* before the launch: the page blurred behind a card (#preview or #demo shows the page) */
body.prelaunch > header, body.prelaunch > main, body.prelaunch > footer { filter: blur(6px); pointer-events: none; user-select: none; }
body.prelaunch .demo-note { display: none; }
.soon { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(255, 255, 255, .55); }
.soon-card {
  width: min(440px, 100%); text-align: center; background: var(--paper); padding: 26px 24px 28px;
  border: 3px solid var(--ink); border-radius: var(--sketch);
}
.soon-card img { width: 72%; margin: 0 auto 6px; }
.soon-card h2 { font-size: clamp(44px, 10vw, 64px); letter-spacing: -0.04em; }
.soon-card p { margin: 10px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .ball.drop, .bet-example.copied, .ca.copied { animation: none; }
  .tick path { animation: none; stroke-dashoffset: 0; }
}
