:root {
  --bg: #0b0b10;
  --panel: #14141c;
  --line: #262635;
  --ink: #ece9f5;
  --dim: #8b88a0;
  --rock: #ff7a59;
  --paper: #5ad2ff;
  --scissors: #b18cff;
  --win: #6ee7a8;
  --lose: #ff6b81;
  --draw: #ffd166;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(70ch 60ch at 15% -10%, #1d1630 0%, transparent 60%),
    radial-gradient(60ch 50ch at 100% 0%, #10202b 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, 'Segoe UI', Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  padding: clamp(1.2rem, 4vw, 3rem) 1.2rem 3rem;
}

main {
  width: min(52rem, 100%);
  display: flex;
  flex-direction: column;
  gap: clamp(1.1rem, 3vw, 1.9rem);
}

.top h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.1rem);
  letter-spacing: -0.04em;
  font-weight: 650;
}

.top h1 span {
  color: var(--dim);
  font-weight: 350;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--dim);
  font-size: clamp(0.92rem, 2.4vw, 1.02rem);
  max-width: 34ch;
}

.board {
  background: linear-gradient(180deg, #16161f 0%, #12121a 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1rem, 3.4vw, 1.6rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem;
}

.side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.who {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.hand {
  font-size: clamp(2.6rem, 11vw, 4.2rem);
  line-height: 1;
  height: 1.25em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease;
  filter: saturate(1.1);
}

.hand.empty {
  font-size: 1.7rem;
  font-weight: 300;
  color: var(--dim);
  opacity: 0.45;
}

.hand.pop {
  animation: pop 420ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes pop {
  0% {
    transform: scale(0.6) rotate(-8deg);
    opacity: 0.2;
  }
  60% {
    transform: scale(1.12) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.vs {
  color: var(--dim);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-top: 0.4rem;
}

.verdict {
  margin: 0;
  min-height: 2.9rem;
  text-align: center;
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  line-height: 1.45;
  color: var(--ink);
  opacity: 0.92;
  transition: color 160ms ease;
}

.verdict.win {
  color: var(--win);
}
.verdict.lose {
  color: var(--lose);
}
.verdict.draw {
  color: var(--draw);
}
.verdict.thinking {
  color: var(--dim);
}

.throws {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.throws button {
  appearance: none;
  cursor: pointer;
  background: #1b1b26;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  font: inherit;
  padding: 0.85rem 0.4rem 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.throws button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #20202d;
}

.throws button[data-move='rock']:hover:not(:disabled) {
  border-color: var(--rock);
}
.throws button[data-move='paper']:hover:not(:disabled) {
  border-color: var(--paper);
}
.throws button[data-move='scissors']:hover:not(:disabled) {
  border-color: var(--scissors);
}

.throws button:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

.throws button:disabled {
  cursor: progress;
  opacity: 0.55;
}

.throws .glyph {
  font-size: 1.6rem;
  line-height: 1;
}

.throws .name {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  text-transform: lowercase;
}

.crowd {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.crowd h2 {
  margin: 0 0 0.9rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.bar {
  display: grid;
  grid-template-columns: 7.4rem 1fr 3rem;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.86rem;
}

.bar-name {
  color: var(--ink);
  opacity: 0.85;
  white-space: nowrap;
}

.track {
  height: 0.62rem;
  border-radius: 99px;
  background: #21212e;
  overflow: hidden;
}

.fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width 520ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.bar[data-move='rock'] .fill {
  background: var(--rock);
}
.bar[data-move='paper'] .fill {
  background: var(--paper);
}
.bar[data-move='scissors'] .fill {
  background: var(--scissors);
}

.bar-pct {
  text-align: right;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.bar.picked .bar-name {
  opacity: 1;
  font-weight: 600;
}

.bar.picked .track {
  box-shadow: 0 0 0 1px #3a3a4d;
}

.tell {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--dim);
}

.tell strong {
  color: var(--ink);
  font-weight: 600;
}

.stats {
  margin: 1.1rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.15rem;
}

.stats dt {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.stats dd {
  margin: 0;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

footer p {
  margin: 0;
  color: var(--dim);
  font-size: 0.78rem;
  line-height: 1.55;
  max-width: 58ch;
}

@media (max-width: 30rem) {
  .bar {
    grid-template-columns: 5.6rem 1fr 2.6rem;
  }
}
