/*
 * The lottery. Like blackjack and roulette it has no theme of its own: it sits on the shared felt
 * (common.css) and is built from the shared pieces - plates, labels, .bet-amount and a
 * .segmented choice. This only lays out the pot, the stats and the lists.
 */

/* ------------------------------------------------------------------ stage */

.lt-stage {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* The pot: the number everyone's here for. */
.lt-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 14px 12px;
  text-align: center;
}

/* .bet-amount, as roulette's pot is, only bigger: it's the number everyone's here for. */
.lt-pot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.1;
}

.lt-pot-chip {
  width: 0.62em;
  height: 0.62em;
}

/* How close the pot is to the cap that guarantees a winner. */
.lt-cap {
  width: min(100%, 360px);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.lt-cap-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.5s ease;
}

.lt-hero .small { margin: 0; }

.lt-countdown {
  margin: 4px 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Maxed out: the pot glows until the draw. */
.lt.guaranteed .lt-hero {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 25%, transparent);
}

.lt-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.lt-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 11px;
  min-width: 0;
}

.lt-stat .label { font-size: 10px; }

.lt-stat-value {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lt-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.lt-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  min-width: 0;
}

.lt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
}

.lt-row.me .lt-name { color: var(--gold); }

.lt-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lt-when {
  flex: none;
  font-size: 12px;
}

/* A draw nobody won, in the avatar's place. */
.lt-none {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-dim);
}

/* ------------------------------------------------------------------ controls */

.lt-actions {
  justify-content: center;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ small frames */

@media (max-width: 640px) {
  .lt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lt-columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 460px) {
  .lt-stage { padding: 10px; }
  .lt-actions .button.big { width: 100%; }
}
