/*
 * TickerWheel, the wheel itself.
 *
 * A horizontal reel of coins under a fixed centre marker, the same shape as
 * the skin roulettes this takes its rhythm from. Three sides repeat across the
 * strip in a fixed order, the coins away from the centre sit back in the dark,
 * and the badge in the middle carries the clock while it rolls and the winner
 * when it stops.
 *
 * The marks on the coins are drawn here in SVG rather than borrowed: an
 * ascending step for Pumpfun, an arrow for Robinhood, an arc for Arc.
 */

:root {
  --bg: #080c14;
  --bg-deep: #05080e;
  --panel: #0e1626;
  --line: #1c2941;
  --line-2: #27385a;

  --text: #e8eefc;
  --text-dim: #93a3c0;
  --text-faint: #5f708f;

  /*
   * The action colour.
   *
   * Robinhood's lime, because this site settles on their chain: it is what a
   * button is made of here, and black sits on it the way it does on their
   * own mark. Gold stays where money is written, so a figure and a button are
   * never the same colour.
   */
  --lime: #ccff00;
  --lime-dark: #a5d000;
  --lime-soft: #dcff4d;
  --on-lime: #10140a;

  /*
   * The accent, everywhere.
   *
   * It was gold; it is the Robinhood lime now, because this site settles on
   * their chain. The names are kept so that every rule written against them
   * follows along, and black sits on it the way it does on their own mark.
   */
  --gold: var(--lime);
  --gold-dark: var(--lime-dark);
  /** The lit version, for a button under the pointer. */
  --gold-soft: var(--lime-soft);
  --up: #34d399;
  --down: #f87171;

  --solana: #22c55e;
  --robinhood: #3b82f6;
  --arc: var(--lime);

  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /*
   * The display face.
   *
   * Be Vietnam Pro at 800, which is what the board this is measured against
   * uses for anything that shouts. It is wider than the condensed face it
   * replaces, so the tracking on uppercase headings comes down a notch to
   * stop them running into each other.
   */
  --display: 'Be Vietnam Pro', 'Inter', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --radius: 8px;
  --coin: 104px;
  --gap: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

/*
 * Hidden means hidden.
 *
 * The attribute is only a default of display:none, and any rule that sets a
 * display on the same element quietly beats it. That has bitten this page
 * more than once: a balance chip showing a zero to somebody who is not signed
 * in, a badge showing a nought, a slot showing its decoration with no button
 * under it. One rule, at the top, and the attribute means what it says.
 */
[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 58px;
  padding: 0 16px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(140deg, var(--gold), var(--gold-dark));
}

.wordmark {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 700;
}

.wordmark em {
  font-style: normal;
  color: var(--gold);
}

.topbar-right {
  margin-left: auto;
}

.balance {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.balance-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.balance-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

/* ----------------------------------------------------------------- stage */

.stage {
  padding: 18px 12px;
  max-width: 1280px;
  margin: 0 auto;
}

.wheel-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ------------------------------------------------------------------ reel */

.reel {
  position: relative;
  height: 216px;
  overflow: hidden;
  background:
    radial-gradient(70% 120% at 50% 50%, rgba(66, 92, 140, 0.16), transparent 70%),
    var(--bg-deep);
}

.reel-track {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--gap);
  will-change: transform;
}

/*
 * Every coin is dimmed. The centre badge sits over the one being rolled, and
 * the winner is lit only once the wheel has stopped, so nothing on screen
 * gives away the result a moment early.
 */
.coin {
  flex: none;
  width: var(--coin);
  height: var(--coin);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 35%, var(--tint-soft), var(--tint-deep));
  border: 2px solid var(--tint-edge);
  opacity: 0.52;
  filter: saturate(0.8);
  transition:
    opacity 260ms ease,
    filter 260ms ease,
    transform 260ms ease;
}

.coin svg {
  width: 46%;
  height: 46%;
  opacity: 0.85;
}

.coin.solana {
  --tint-soft: #17492c;
  --tint-deep: #0b2517;
  --tint-edge: #1f7a45;
  color: var(--solana);
}

.coin.robinhood {
  --tint-soft: #16305c;
  --tint-deep: #0a1a33;
  --tint-edge: #2a5fb0;
  color: var(--robinhood);
}

.coin.arc {
  --tint-soft: #4a3611;
  --tint-deep: #261b07;
  --tint-edge: #a07724;
  color: var(--arc);
}

.coin.winner {
  opacity: 1;
  filter: saturate(1.1);
  transform: scale(1.06);
  box-shadow:
    0 0 0 3px rgba(245, 185, 66, 0.25),
    0 0 26px rgba(245, 185, 66, 0.35);
}

.reel-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 220px;
  z-index: 2;
  pointer-events: none;
}

.reel-fade.left {
  left: 0;
  background: linear-gradient(90deg, var(--bg-deep) 10%, transparent);
}

.reel-fade.right {
  right: 0;
  background: linear-gradient(270deg, var(--bg-deep) 10%, transparent);
}

/* ------------------------------------------------------------ the marker */

.centre {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: radial-gradient(circle at 50% 35%, #131c2c, #070b12);
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 6px rgba(8, 12, 20, 0.85),
    0 0 30px rgba(245, 185, 66, 0.22);
  z-index: 4;
}

.centre.settled {
  border-color: var(--up);
  box-shadow:
    0 0 0 6px rgba(8, 12, 20, 0.85),
    0 0 30px rgba(52, 211, 153, 0.25);
}

.centre-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.centre-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.centre-value.small {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.centre-value.up {
  color: var(--up);
}

.centre-value.down {
  color: var(--down);
}

/* ----------------------------------------------------------------- timer */

.timer {
  height: 3px;
  background: var(--line);
}

.timer-fill {
  height: 100%;
  width: 0;
  background: var(--up);
  transition: width 200ms linear;
}

.timer-fill.locked {
  background: var(--gold);
}

/* ---------------------------------------------------------------- footer */

.footer {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 16px 24px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
}

.conn::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 6px;
  vertical-align: middle;
}

.conn.live::before {
  background: var(--up);
}

.conn.down::before {
  background: var(--down);
}

/* ----------------------------------------------------------------- toast */

.toasts {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
  max-width: 320px;
}

.toast {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-left-width: 3px;
  border-radius: 6px;
  background: var(--panel);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.toast.good {
  border-left-color: var(--up);
}

.toast.bad {
  border-left-color: var(--down);
}

.toast.info {
  border-left-color: var(--robinhood);
}

@media (prefers-reduced-motion: reduce) {
  .reel-track {
    transition: none !important;
  }
}

@media (max-width: 720px) {
  :root {
    --coin: 72px;
    --gap: 12px;
  }

  .reel {
    height: 158px;
  }

  .centre {
    width: 86px;
    height: 86px;
  }

  .centre-value {
    font-size: 18px;
  }

  .reel-fade {
    width: 110px;
  }
}

/* --------------------------------------------------------------- buttons */

.button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #121c2f;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    filter 120ms ease,
    border-color 120ms ease;
}

.button:hover:not(:disabled) {
  filter: brightness(1.2);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.gold,
.button.primary {
  background: linear-gradient(180deg, var(--lime), var(--lime-dark));
  border-color: var(--lime-dark);
  color: var(--on-lime);
}

.button.gold:hover:not(:disabled),
.button.primary:hover:not(:disabled) {
  filter: none;
  background: linear-gradient(180deg, var(--lime-soft), var(--lime));
}

.button.ghost {
  background: transparent;
}

.balance-unit {
  font-size: 11px;
  color: var(--text-faint);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ---------------------------------------------------------------- betbar */

.betbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex-wrap: wrap;
}

.amount {
  display: flex;
  align-items: center;
  gap: 8px;
}

.amount-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-deep);
}

.amount-field span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.amount-field input {
  width: 92px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.amount-field em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-faint);
}

.amount-quick {
  display: flex;
  gap: 6px;
}

.amount-quick .button {
  height: 36px;
  padding: 0 11px;
  font-family: var(--mono);
  font-size: 12px;
}

.betbar-hint {
  margin: 0 0 0 auto;
  font-size: 12px;
  color: var(--text-faint);
  text-align: right;
}

/* ------------------------------------------------------------- bet boxes */

.boxes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.box {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition:
    box-shadow 200ms ease,
    opacity 200ms ease;
}

.box.won {
  box-shadow: 0 0 0 1px var(--up) inset;
}

.box.lost {
  opacity: 0.55;
}

.box-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.box-coin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: radial-gradient(circle at 50% 35%, var(--tint-soft), var(--tint-deep));
  border: 2px solid var(--tint-edge);
}

.box-coin svg {
  width: 52%;
  height: 52%;
}

.box-place {
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tint-edge);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-weight: 700;
}

.box-place:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.box-win {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.box-win strong {
  color: var(--text-dim);
  font-weight: 600;
}

.box-sub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--line);
}

.box-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.box-total {
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.box-total.up {
  color: var(--up);
}

.box-total.down {
  color: var(--down);
}

.box-bets {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 120px;
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.box-bets li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
}

.box-bets li + li {
  border-top: 1px solid rgba(28, 41, 65, 0.55);
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--mono);
  color: #08101c;
}

.box-bets .who {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.box-bets .who.me {
  color: var(--gold);
  font-weight: 600;
}

.box-bets .how-much {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.box-bets .none {
  justify-content: center;
  color: var(--text-faint);
  font-size: 12px;
  padding: 16px 12px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 999px;
}

/* ----------------------------------------------------------------- modal */

.modal {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  padding: 0;
  max-width: 430px;
  width: calc(100% - 32px);
}

.modal::backdrop {
  background: rgba(3, 6, 12, 0.75);
}

.modal-inner {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  text-transform: uppercase;
}

.modal p {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 13px;
}

.modal code {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-deep);
  word-break: break-all;
}

.modal .amount-field {
  width: 100%;
}

.modal .amount-field input {
  flex: 1;
  width: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 0;
}

@media (max-width: 860px) {
  .boxes {
    grid-template-columns: minmax(0, 1fr);
  }

  .betbar-hint {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
}

.box-headtext {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.box-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.coin.dice {
  --tint-soft: #4a3611;
  --tint-deep: #261b07;
  --tint-edge: #d09a2c;
  color: var(--gold);
}

.box.dice .box-place {
  color: var(--gold);
}

/* Your own artwork, when public/emblems holds any. See that folder's README. */
.emblem {
  width: 58%;
  height: 58%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.box-coin .emblem {
  width: 64%;
  height: 64%;
}

/* The house plays with a few accounts of its own. They say so. */
.bot-tag {
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: #17223a;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}
