/*
 * The coin duel. Like the lottery it has no theme of its own: it sits on the shared felt
 * (common.css) and is built from the shared pieces. This only lays out the lists and the coin.
 */

.cd { --accent: #d4a72c; --accent-hover: #e3b93f; }

.cd-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;
}

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

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

.cd-list[hidden] { display: none; }

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

.cd-row.me .cd-name { color: var(--gold); }
.cd-row.lost .cd-name { color: var(--ink-dim); }

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

.cd-left {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.cd-pickable {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.cd-pickable:hover { background: rgba(255, 255, 255, 0.08); }

.cd-picked {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--accent);
  cursor: pointer;
}

.cd-picked[hidden] { display: none; }

.cd-input {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font: inherit;
}

/* The result: a coin that spins, then lands. */
.cd-flip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  text-align: center;
}

.cd-flip[hidden] { display: none; }

.cd-flip.won { border-color: var(--win); }
.cd-flip.lost { border-color: var(--lose); }

/* The air above the table: tall enough for the coin's toss, with the coin's shadow underneath. */
.cd-air {
  position: relative;
  width: 100%;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: hidden;
  perspective: 500px;
}

.cd-coin {
  position: relative;
  width: 84px;
  height: 84px;
  transform-style: preserve-3d;
}

/* Two faces back to back; the coin's own turning decides which one is showing. */
.cd-side {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 800;
  color: #5a4210;
  background: radial-gradient(circle at 35% 30%, #f6dc83, var(--accent));
  border: 4px solid #b58a1a;
  box-sizing: border-box;
  backface-visibility: hidden;
}

.cd-tails { transform: rotateX(180deg); }

.cd-shadow {
  width: 70px;
  height: 10px;
  border-radius: 50%;
  background: #000;
  opacity: 0.45;
  filter: blur(3px);
}

.cd-flip-text { margin: 0; font-weight: 600; }

@media (max-width: 460px) {
  .cd-row { flex-wrap: wrap; }
}
