:root {
  --bg: #fff5fb;
  --ink: #243047;
  --muted: #735d91;
  --line: #f0b7d4;
  --panel: #fffafe;
  --green: #27ae60;
  --red: #e74c3c;
  --orange: #f39c12;
  --yellow: #f1c40f;
  --blue: #3498db;
  --purple: #8e44ad;
  --pink: #e84393;
  --shadow: 0 16px 38px rgba(116, 64, 154, 0.18);
  --game-token-size: 48px;
  --token-preview-size: 92px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(232, 67, 147, 0.26) 0 72px, transparent 74px),
    radial-gradient(circle at 92% 18%, rgba(241, 196, 15, 0.32) 0 82px, transparent 84px),
    radial-gradient(circle at 18% 86%, rgba(52, 152, 219, 0.28) 0 78px, transparent 80px),
    radial-gradient(circle at 86% 82%, rgba(39, 174, 96, 0.24) 0 88px, transparent 90px),
    linear-gradient(135deg, #ffe1ef 0%, #fff7c2 32%, #dff9ff 66%, #e7ffe8 100%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 8px 12px;
}

.welcome,
.setup,
.first-player {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
}

.welcome {
  position: relative;
  overflow: hidden;
}

.welcome__decorations {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.welcome__inner {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  min-height: calc(100vh - 88px);
  padding: 28px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 28px;
  align-items: center;
  text-align: center;
}

.welcome__copy {
  display: grid;
  gap: 18px;
}

.welcome__copy p {
  color: var(--muted);
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.15;
}

.welcome__button {
  align-self: end;
}

.welcome-capybara {
  position: absolute;
  display: block;
  left: clamp(18px, 8vw, 112px);
  bottom: clamp(100px, 16vh, 154px);
  width: clamp(54px, 10vw, 86px);
  height: clamp(54px, 10vw, 86px);
  transform: rotate(-7deg);
  filter: drop-shadow(0 14px 16px rgba(116, 64, 154, 0.2));
}

.welcome-decoration {
  --decoration-color: var(--pink);
  position: absolute;
  pointer-events: none;
}

.welcome-decoration::before,
.welcome-decoration::after {
  content: "";
  position: absolute;
  display: block;
}

.welcome-decoration--star {
  top: clamp(44px, 10vh, 92px);
  right: clamp(32px, 13vw, 184px);
  width: clamp(48px, 9vw, 82px);
  height: clamp(48px, 9vw, 82px);
  background: linear-gradient(135deg, #fff7a8, var(--yellow));
  clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 55%, 79% 91%, 50% 69%, 21% 91%, 32% 55%, 2% 35%, 39% 34%);
  filter: drop-shadow(0 8px 7px rgba(116, 64, 154, 0.18));
  transform: rotate(12deg);
}

.welcome-decoration--candy {
  --decoration-color: #ff6fae;
  top: clamp(116px, 24vh, 220px);
  left: clamp(24px, 13vw, 176px);
  width: clamp(70px, 12vw, 108px);
  height: clamp(34px, 6vw, 52px);
  border-radius: 999px;
  background:
    repeating-linear-gradient(115deg, white 0 10px, transparent 10px 20px),
    linear-gradient(145deg, #ff8fc2, var(--decoration-color));
  border: 3px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 5px 0 rgba(255, 255, 255, 0.42),
    inset 0 -5px 0 rgba(137, 45, 107, 0.12),
    0 9px 14px rgba(116, 64, 154, 0.16);
  transform: rotate(-14deg);
}

.welcome-decoration--candy::before,
.welcome-decoration--candy::after {
  top: 50%;
  width: 36%;
  height: 86%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), transparent 42%),
    var(--decoration-color);
  clip-path: polygon(0 50%, 18% 7%, 100% 28%, 100% 72%, 18% 93%);
  transform: translateY(-50%);
}

.welcome-decoration--candy::before {
  left: -29%;
}

.welcome-decoration--candy::after {
  right: -29%;
  transform: translateY(-50%) rotate(180deg);
}

.welcome-decoration--gumdrop {
  --decoration-color: var(--green);
  right: clamp(20px, 9vw, 132px);
  bottom: clamp(116px, 18vh, 186px);
  width: clamp(54px, 10vw, 88px);
  height: clamp(44px, 8vw, 70px);
  border-radius: 50% 50% 32% 32%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), var(--decoration-color) 36%, color-mix(in srgb, var(--decoration-color), #111827 18%));
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.5), 0 10px 16px rgba(116, 64, 154, 0.16);
  transform: rotate(9deg);
}

.welcome-decoration--lollipop {
  --decoration-color: var(--pink);
  right: clamp(18px, 20vw, 260px);
  top: clamp(160px, 32vh, 280px);
  width: clamp(44px, 8vw, 72px);
  height: clamp(76px, 14vw, 126px);
  transform: rotate(15deg);
}

.welcome-decoration--lollipop::before {
  left: 50%;
  top: 42%;
  width: 9%;
  height: 58%;
  border-radius: 999px;
  background: #9b6a4d;
  transform: translateX(-50%);
}

.welcome-decoration--lollipop::after {
  top: 0;
  left: 50%;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    conic-gradient(from 25deg, white 0 16%, var(--decoration-color) 16% 34%, white 34% 50%, var(--decoration-color) 50% 68%, white 68% 84%, var(--decoration-color) 84% 100%);
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.55), 0 8px 13px rgba(116, 64, 154, 0.2);
  transform: translateX(-50%);
}

.setup__inner {
  width: min(620px, 100%);
  padding: 28px;
  background:
    linear-gradient(white, white) padding-box,
    linear-gradient(135deg, var(--pink), var(--yellow), var(--blue), var(--green)) border-box;
  border: 3px solid transparent;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.first-player__inner {
  width: min(760px, 100%);
  padding: 24px;
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.first-player__header h1 {
  margin-bottom: 0;
}

.wheel-stage {
  position: relative;
  width: min(560px, 88vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  border-left: 24px solid transparent;
  border-right: 24px solid transparent;
  border-top: 44px solid var(--ink);
  filter: drop-shadow(0 5px 5px rgba(36, 48, 71, 0.22));
  transform: translateX(-50%);
}

.player-wheel {
  --wheel-segment: 60deg;
  position: relative;
  width: 100%;
  height: 100%;
  border: 8px solid #fffafe;
  border-radius: 999px;
  box-shadow:
    inset 0 0 0 3px rgba(36, 48, 71, 0.18),
    inset 0 0 0 18px rgba(255, 255, 255, 0.22),
    0 24px 58px rgba(116, 64, 154, 0.24);
  overflow: hidden;
  transition: transform 3.9s cubic-bezier(0.12, 0.76, 0.08, 1);
}

.player-wheel::before {
  content: "";
  position: absolute;
  inset: 50%;
  z-index: 2;
  width: 74px;
  height: 74px;
  border: 6px solid white;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff7a8, #fffafe);
  box-shadow: 0 8px 18px rgba(36, 48, 71, 0.24);
  transform: translate(-50%, -50%);
}

.player-wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-conic-gradient(from -90deg, rgba(255, 255, 255, 0.72) 0 1deg, transparent 1deg var(--wheel-segment));
  opacity: 0.48;
  pointer-events: none;
}

.player-wheel:disabled {
  cursor: wait;
}

.player-wheel__label {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: white;
  font-size: clamp(0.8rem, 2.2vw, 1.05rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.32);
}

.player-wheel__label .token {
  width: 50px;
  height: 50px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.24));
}

.first-player__result {
  min-height: 30px;
  color: var(--ink);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 900;
}

.first-player__button {
  width: min(320px, 100%);
}

.first-player__button:disabled {
  cursor: wait;
  opacity: 0.72;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 4.8rem);
  line-height: 0.98;
  margin-bottom: 26px;
}

h2 {
  font-size: 1.45rem;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  font-weight: 700;
}

select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: white;
  padding: 0 12px;
}

.token-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.token-choice {
  min-height: 116px;
  border: 2px solid transparent;
  border-radius: 8px;
  background:
    linear-gradient(#fff9fd, #fff9fd) padding-box,
    linear-gradient(135deg, rgba(232, 67, 147, 0.5), rgba(52, 152, 219, 0.5)) border-box;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.token-choice.is-selected {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.token,
.token-preview {
  position: relative;
  display: inline-block;
  width: var(--token-preview-size);
  height: var(--token-preview-size);
  flex: 0 0 auto;
}

.token {
  width: var(--game-token-size);
  height: var(--game-token-size);
}

.token--moving {
  transform-origin: 50% 100%;
  z-index: 4;
  filter: drop-shadow(0 8px 8px rgba(31, 41, 51, 0.28));
}

.token--moving .capybara__ear,
.token--moving .animal__ear {
  animation: capybara-ear-wiggle 0.72s ease-out;
  transform-origin: 50% 100%;
}

.token--moving .capybara__nose,
.token--moving .animal__nose {
  animation: capybara-nose-bob 0.72s ease-out;
}

.token-preview {
  width: var(--token-preview-size);
  height: var(--token-preview-size);
}

.animal__face,
.animal__ear,
.animal__eye,
.animal__nose,
.animal__blush,
.animal__detail,
.animal__tail {
  position: absolute;
  display: block;
}

.animal__face {
  inset: 11% 6% 3%;
  z-index: 1;
  border: 2px solid rgba(75, 48, 34, 0.5);
  border-radius: 48% 48% 44% 44%;
  background:
    radial-gradient(circle at 50% 75%, rgba(255, 240, 216, 0.46) 0 17%, transparent 19%),
    linear-gradient(150deg, color-mix(in srgb, var(--animal-color), white 22%), var(--animal-color));
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.42),
    0 1px 3px rgba(72, 43, 28, 0.18);
}

.animal__ear {
  top: 4%;
  z-index: 0;
  width: 22%;
  height: 22%;
  border: 2px solid rgba(75, 48, 34, 0.46);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--animal-accent), white 32%) 0 32%, transparent 34%),
    var(--animal-color);
}

.animal__ear--left {
  left: 21%;
}

.animal__ear--right {
  right: 21%;
}

.animal__eye {
  top: 38%;
  z-index: 3;
  width: 15%;
  height: 19%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, white 0 16%, transparent 18%),
    radial-gradient(circle at 62% 70%, rgba(255, 255, 255, 0.65) 0 8%, transparent 10%),
    #1d1a1a;
}

.animal__eye--left {
  left: 30%;
}

.animal__eye--right {
  right: 30%;
}

.animal__nose {
  left: 50%;
  bottom: 24%;
  z-index: 3;
  width: 16%;
  height: 11%;
  border-radius: 999px;
  background: #2d1d16;
  transform: translateX(-50%);
}

.animal__blush {
  top: 59%;
  z-index: 3;
  width: 16%;
  height: 10%;
  border-radius: 999px;
  background: rgba(255, 139, 168, 0.7);
  filter: blur(0.2px);
}

.animal__blush--left {
  left: 16%;
}

.animal__blush--right {
  right: 16%;
}

.animal__detail,
.animal__tail {
  z-index: 2;
}

.animal--cat .animal__ear {
  top: -2%;
  width: 38%;
  height: 31%;
  border-radius: 12px 12px 7px 7px;
  background:
    radial-gradient(ellipse at 50% 68%, #ffe1c7 0 31%, transparent 33%),
    var(--animal-color);
  clip-path: polygon(42% 0, 58% 0, 96% 100%, 4% 100%);
}

.animal--cat .animal__ear--left {
  left: 14%;
  transform: rotate(-8deg);
}

.animal--cat .animal__ear--right {
  right: 14%;
  transform: rotate(8deg);
  background:
    radial-gradient(ellipse at 50% 68%, #ffe1c7 0 31%, transparent 33%),
    linear-gradient(135deg, var(--animal-accent) 0 35%, var(--animal-color) 37%);
}

.animal--cat .animal__detail {
  display: none;
}

.animal--dog .animal__ear {
  top: 12%;
  width: 27%;
  height: 45%;
  border-radius: 60% 60% 70% 70%;
  background: var(--animal-accent);
}

.animal--dog .animal__ear--left {
  left: 1%;
  transform: rotate(18deg);
}

.animal--dog .animal__ear--right {
  right: 1%;
  transform: rotate(-18deg);
}

.animal--dog .animal__detail {
  left: 39%;
  bottom: 17%;
  width: 22%;
  height: 21%;
  border-radius: 50%;
  background: rgba(255, 240, 216, 0.72);
}

.animal--fish .animal__face {
  inset: 18% 11% 15% 9%;
  border-radius: 58% 44% 44% 58%;
}

.animal--fish .animal__ear {
  display: none;
}

.animal--fish .animal__tail {
  top: 30%;
  right: -1%;
  width: 31%;
  height: 39%;
  clip-path: polygon(0 50%, 100% 0, 82% 50%, 100% 100%);
  background: var(--animal-accent);
}

.animal--fish .animal__detail {
  left: 18%;
  top: 42%;
  width: 17%;
  height: 20%;
  border-radius: 50% 0 0 50%;
  border-left: 2px solid rgba(255, 255, 255, 0.75);
}

.animal--fish .animal__eye--left {
  left: 32%;
}

.animal--fish .animal__eye--right {
  display: none;
}

.animal--fish .animal__nose {
  left: 24%;
  bottom: 40%;
  width: 8%;
  height: 8%;
}

.animal--fish .animal__blush {
  display: none;
}

.animal--monkey .animal__face {
  background:
    radial-gradient(circle at 31% 44%, var(--animal-accent) 0 17%, transparent 19%),
    radial-gradient(circle at 69% 44%, var(--animal-accent) 0 17%, transparent 19%),
    radial-gradient(ellipse at 50% 67%, var(--animal-accent) 0 31%, transparent 33%),
    var(--animal-color);
}

.animal--monkey .animal__ear {
  top: 32%;
  width: 25%;
  height: 25%;
  background:
    radial-gradient(circle at 50% 55%, var(--animal-accent) 0 42%, transparent 44%),
    var(--animal-color);
}

.animal--monkey .animal__ear--left {
  left: -2%;
}

.animal--monkey .animal__ear--right {
  right: -2%;
}

.animal--panda .animal__ear,
.animal--panda .animal__detail {
  background: var(--animal-accent);
}

.animal--panda .animal__detail {
  top: 32%;
  left: 22%;
  width: 56%;
  height: 23%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 18% 50%, var(--animal-accent) 0 30%, transparent 32%),
    radial-gradient(circle at 82% 50%, var(--animal-accent) 0 30%, transparent 32%);
}

.animal--panda .animal__eye {
  background:
    radial-gradient(circle at 35% 25%, white 0 18%, transparent 20%),
    #1d1a1a;
}

.animal--elephant .animal__ear {
  top: 22%;
  width: 30%;
  height: 38%;
  border-radius: 48% 48% 58% 58%;
  background:
    radial-gradient(circle at 50% 55%, var(--animal-accent) 0 38%, transparent 40%),
    var(--animal-color);
}

.animal--elephant .animal__ear--left {
  left: 2%;
}

.animal--elephant .animal__ear--right {
  right: 2%;
}

.animal--elephant .animal__nose {
  left: 50%;
  bottom: 6%;
  width: 16%;
  height: 35%;
  border-radius: 999px;
  background: color-mix(in srgb, var(--animal-color), #5d6678 20%);
}

.animal--penguin .animal__face {
  inset: 8% 7% 2%;
  border-color: rgba(17, 24, 39, 0.5);
  border-radius: 50% 50% 44% 44%;
  background:
    radial-gradient(ellipse at 50% 62%, var(--animal-accent) 0 39%, transparent 40%),
    radial-gradient(circle at 36% 35%, var(--animal-accent) 0 19%, transparent 20%),
    radial-gradient(circle at 64% 35%, var(--animal-accent) 0 19%, transparent 20%),
    linear-gradient(145deg, #4b5870, var(--animal-color));
}

.animal--penguin .animal__ear {
  display: none;
}

.animal--penguin .animal__detail {
  left: 50%;
  top: 53%;
  z-index: 4;
  width: 18%;
  height: 13%;
  border-radius: 50% 50% 60% 60%;
  background: #ffb23f;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translateX(-50%);
}

.animal--penguin .animal__eye {
  top: 34%;
  width: 13%;
  height: 16%;
}

.animal--penguin .animal__eye--left {
  left: 32%;
}

.animal--penguin .animal__eye--right {
  right: 32%;
}

.animal--penguin .animal__nose {
  display: none;
}

.animal--penguin .animal__blush {
  top: 58%;
  background: rgba(255, 143, 189, 0.72);
}

.animal--penguin .animal__blush--left {
  left: 21%;
}

.animal--penguin .animal__blush--right {
  right: 21%;
}

.animal--penguin .animal__tail {
  left: 50%;
  bottom: -3%;
  z-index: 0;
  width: 58%;
  height: 16%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 24% 54%, #ffb23f 0 24%, transparent 25%),
    radial-gradient(circle at 76% 54%, #ffb23f 0 24%, transparent 25%);
  transform: translateX(-50%);
}

.capybara__face,
.capybara__ear,
.capybara__eye,
.capybara__nose,
.capybara__blush,
.capybara__accessory {
  position: absolute;
  display: block;
}

.capybara__face {
  inset: 10% 4% 2%;
  border: 2px solid rgba(103, 64, 39, 0.58);
  border-radius: 48% 48% 44% 44%;
  background:
    radial-gradient(circle at 50% 76%, rgba(255, 224, 186, 0.42) 0 19%, transparent 21%),
    linear-gradient(150deg, #d99b61 0%, #b97642 68%, #8b552f 100%);
  box-shadow:
    inset 0 3px 0 rgba(255, 238, 211, 0.46),
    0 1px 3px rgba(72, 43, 28, 0.18);
}

.capybara__ear {
  top: 3%;
  width: 20%;
  height: 20%;
  border: 2px solid rgba(103, 64, 39, 0.58);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 52%, #efbd88 0 30%, transparent 32%),
    #9f6338;
}

.capybara__ear--back {
  left: 22%;
}

.capybara__ear--front {
  right: 22%;
}

.capybara__eye {
  top: 37%;
  width: 16%;
  height: 20%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, white 0 16%, transparent 18%),
    radial-gradient(circle at 62% 70%, rgba(255, 255, 255, 0.65) 0 8%, transparent 10%),
    #1d1a1a;
}

.capybara__eye--left {
  left: 29%;
}

.capybara__eye--right {
  right: 29%;
}

.capybara__nose {
  left: 50%;
  bottom: 24%;
  width: 17%;
  height: 12%;
  border-radius: 999px;
  background: #2d1d16;
  transform: translateX(-50%);
}

.capybara__blush {
  top: 58%;
  width: 16%;
  height: 10%;
  border-radius: 999px;
  background: rgba(255, 139, 168, 0.68);
  filter: blur(0.2px);
}

.capybara__blush--left {
  left: 17%;
}

.capybara__blush--right {
  right: 17%;
}

.capybara__accessory {
  z-index: 2;
}

.capybara__accessory::before,
.capybara__accessory::after {
  content: "";
  position: absolute;
  display: block;
}

.capybara--pink-bows .capybara__accessory {
  inset: 0;
}

.capybara--pink-bows .capybara__accessory::before,
.capybara--pink-bows .capybara__accessory::after {
  top: 1%;
  width: 26%;
  height: 18%;
  background:
    radial-gradient(circle at 22% 50%, #ff8fbd 0 38%, transparent 40%),
    radial-gradient(circle at 78% 50%, #ff8fbd 0 38%, transparent 40%),
    radial-gradient(circle at 50% 50%, #ffe1ed 0 14%, transparent 16%);
}

.capybara--pink-bows .capybara__accessory::before {
  left: 6%;
  rotate: -16deg;
}

.capybara--pink-bows .capybara__accessory::after {
  right: 6%;
  rotate: 16deg;
}

.capybara--pearl-necklace .capybara__accessory {
  left: 23%;
  bottom: 4%;
  width: 54%;
  height: 18%;
  border-bottom: 4px dotted #fffaf0;
  border-radius: 0 0 999px 999px;
  filter: drop-shadow(0 1px 0 rgba(87, 65, 42, 0.28));
}

.capybara--dark-sunglasses .capybara__accessory {
  top: 39%;
  left: 18%;
  width: 27%;
  height: 18%;
  background: #101014;
  border: 2px solid #050506;
  border-radius: 999px;
  box-shadow: 16px 0 0 0 #101014, 16px 0 0 2px #050506;
}

.capybara--dark-sunglasses .capybara__accessory::before {
  top: 45%;
  left: 100%;
  width: 16px;
  height: 2px;
  background: #050506;
}

.capybara--chef-hat .capybara__accessory {
  top: -8%;
  left: 26%;
  width: 48%;
  height: 25%;
  border: 1px solid rgba(139, 148, 158, 0.55);
  border-radius: 6px 6px 2px 2px;
  background:
    radial-gradient(circle at 22% 20%, #ffffff 0 26%, transparent 28%),
    radial-gradient(circle at 50% 5%, #ffffff 0 30%, transparent 32%),
    radial-gradient(circle at 78% 20%, #ffffff 0 26%, transparent 28%),
    linear-gradient(#ffffff, #eef2f7);
  box-shadow: inset 0 -3px 0 rgba(226, 232, 240, 0.9);
}

.capybara--polka-bow-tie .capybara__accessory {
  left: 28%;
  bottom: 4%;
  width: 44%;
  height: 17%;
  background:
    radial-gradient(circle at 25% 50%, #8e44ad 0 30%, transparent 32%),
    radial-gradient(circle at 75% 50%, #8e44ad 0 30%, transparent 32%),
    radial-gradient(circle at 50% 50%, #f4d7ff 0 8%, transparent 10%),
    radial-gradient(circle at 18% 34%, white 0 5%, transparent 6%),
    radial-gradient(circle at 82% 66%, white 0 5%, transparent 6%);
}

.capybara--red-rose .capybara__accessory {
  top: 0;
  right: 7%;
  width: 27%;
  height: 29%;
  background:
    radial-gradient(circle at 44% 48%, #ff7182 0 16%, transparent 17%),
    radial-gradient(circle at 34% 36%, #d9162f 0 24%, transparent 25%),
    radial-gradient(circle at 63% 38%, #b90f25 0 22%, transparent 23%),
    radial-gradient(circle at 50% 64%, #e83349 0 24%, transparent 25%);
}

.capybara--red-rose .capybara__accessory::after {
  left: 50%;
  top: 72%;
  width: 2px;
  height: 12px;
  background: #168246;
  rotate: 20deg;
}

.capybara--green-earrings .capybara__accessory {
  inset: 0;
}

.capybara--green-earrings .capybara__accessory::before,
.capybara--green-earrings .capybara__accessory::after {
  top: 31%;
  width: 8%;
  height: 27%;
  border-radius: 999px;
  background: linear-gradient(#d8ffb9, #9be66d 58%, #5ebd38);
  box-shadow: 0 6px 0 -2px #9be66d;
}

.capybara--green-earrings .capybara__accessory::before {
  left: 9%;
}

.capybara--green-earrings .capybara__accessory::after {
  right: 9%;
}

.capybara--none .capybara__accessory {
  display: none;
}

.primary,
.ghost {
  min-height: 44px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 800;
}

.primary {
  width: 100%;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--blue));
  color: white;
  box-shadow: 0 8px 18px rgba(142, 68, 173, 0.24);
}

.ghost {
  background: #fff0a8;
  color: var(--ink);
}

.game {
  display: grid;
  gap: 8px;
}

.topbar,
.controls {
  display: grid;
  gap: 14px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0;
}

.topbar h2 {
  line-height: 1;
}

.eyebrow {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.board-area {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 104px 150px;
  column-gap: 14px;
  row-gap: 6px;
  align-items: end;
}

.start-arrow {
  position: relative;
  min-height: 62px;
  width: 92px;
  justify-self: end;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  border-radius: 8px 0 0 8px;
  font-size: 0.85rem;
  font-weight: 900;
  margin-bottom: 10px;
}

.start-arrow__tokens {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
}

.start-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -30px;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-top: 31px solid transparent;
  border-bottom: 31px solid transparent;
  border-left: 30px solid var(--green);
}

.board {
  display: grid;
  grid-template-columns: repeat(15, minmax(0, 1fr));
  grid-template-rows: repeat(10, minmax(0, 1fr));
  gap: 0;
  width: min(100%, 1460px, clamp(820px, calc((100vh - 150px) * 1.62), 1460px));
  min-width: 0;
  min-height: 0;
  justify-self: start;
  aspect-ratio: 1.62 / 1;
  padding: 12px;
  border: 3px solid transparent;
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 18%, rgba(232, 67, 147, 0.22) 0 14px, transparent 15px),
    radial-gradient(circle at 72% 70%, rgba(52, 152, 219, 0.22) 0 17px, transparent 18px),
    radial-gradient(circle at 48% 42%, rgba(241, 196, 15, 0.24) 0 13px, transparent 14px),
    radial-gradient(circle at 84% 24%, rgba(39, 174, 96, 0.2) 0 15px, transparent 16px),
    linear-gradient(#fffdf8, #fffdf8) padding-box,
    linear-gradient(135deg, var(--pink), var(--orange), var(--yellow), var(--green), var(--blue), var(--purple)) border-box;
}

.space {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  color: rgba(0, 0, 0, 0.62);
  font-size: 0.72rem;
  font-weight: 900;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.54),
    inset 0 -4px 0 rgba(116, 64, 154, 0.12);
}

.space--start,
.space--end,
.space--turn {
  border-radius: 18px;
}

.space--connect-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.space--connect-right {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.space--connect-up {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.space--connect-down {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.space--start.space--connect-right,
.space--end.space--connect-right {
  border-radius: 18px 0 0 18px;
}

.space--start.space--connect-left,
.space--end.space--connect-left {
  border-radius: 0 18px 18px 0;
}

.space--start.space--connect-down,
.space--end.space--connect-down {
  border-radius: 18px 18px 0 0;
}

.space--start.space--connect-up,
.space--end.space--connect-up {
  border-radius: 0 0 18px 18px;
}

.board-decoration {
  --decoration-color: var(--pink);
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  pointer-events: none;
}

.board-decoration::before,
.board-decoration::after {
  content: "";
  position: absolute;
  display: block;
}

.board-decoration--lollipop {
  width: 34px;
  height: 48px;
}

.board-decoration--lollipop::before {
  left: 50%;
  top: 20px;
  width: 4px;
  height: 26px;
  border-radius: 999px;
  background: #9b6a4d;
  transform: translateX(-50%) rotate(10deg);
}

.board-decoration--lollipop::after {
  top: 0;
  left: 50%;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background:
    conic-gradient(from 25deg, white 0 16%, var(--decoration-color) 16% 34%, white 34% 50%, var(--decoration-color) 50% 68%, white 68% 84%, var(--decoration-color) 84% 100%);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55), 0 4px 8px rgba(116, 64, 154, 0.2);
  transform: translateX(-50%);
}

.board-decoration--gumdrop {
  width: 36px;
  height: 30px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), var(--decoration-color) 36%, color-mix(in srgb, var(--decoration-color), #111827 18%));
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.5), 0 5px 10px rgba(116, 64, 154, 0.16);
}

.board-decoration--star {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #fff7a8, var(--decoration-color));
  clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 55%, 79% 91%, 50% 69%, 21% 91%, 32% 55%, 2% 35%, 39% 34%);
  filter: drop-shadow(0 5px 5px rgba(116, 64, 154, 0.18));
}

.board-decoration--candy {
  width: 48px;
  height: 24px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(115deg, white 0 6px, transparent 6px 12px),
    linear-gradient(145deg, color-mix(in srgb, var(--decoration-color), white 36%), var(--decoration-color));
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.42),
    inset 0 -3px 0 rgba(137, 45, 107, 0.12),
    0 4px 8px rgba(116, 64, 154, 0.16);
}

.board-decoration--candy::before,
.board-decoration--candy::after {
  top: 50%;
  width: 36%;
  height: 86%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), transparent 42%),
    var(--decoration-color);
  clip-path: polygon(0 50%, 18% 7%, 100% 28%, 100% 72%, 18% 93%);
  transform: translateY(-50%);
}

.board-decoration--candy::before {
  left: -29%;
}

.board-decoration--candy::after {
  right: -29%;
  transform: translateY(-50%) rotate(180deg);
}

.space--finish {
  color: white;
  background: #111827;
}

.space--shortcut {
  outline: 3px solid #111827;
}

.shortcut-mark {
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: #111827;
  font-size: 1rem;
}

.space__tokens,
.start-arrow__tokens,
.jail__tokens {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 2px;
}

.space__tokens {
  inset: 4px;
}

.board-side-decor {
  position: relative;
  width: 100%;
  min-height: 320px;
  align-self: center;
}

.board-side-decor__item {
  --decoration-color: var(--pink);
  position: absolute;
  display: block;
  pointer-events: none;
}

.board-side-decor__item::before,
.board-side-decor__item::after {
  content: "";
  position: absolute;
  display: block;
}

.board-side-decor__item--star {
  top: 0;
  right: 36px;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, #fff7a8, var(--yellow));
  clip-path: polygon(50% 0, 61% 34%, 98% 35%, 68% 55%, 79% 91%, 50% 69%, 21% 91%, 32% 55%, 2% 35%, 39% 34%);
  filter: drop-shadow(0 5px 5px rgba(116, 64, 154, 0.18));
  rotate: 11deg;
}

.board-side-decor__item--candy {
  --decoration-color: var(--blue);
  top: 30%;
  left: 8px;
  width: 64px;
  height: 32px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(115deg, white 0 6px, transparent 6px 12px),
    linear-gradient(145deg, color-mix(in srgb, var(--decoration-color), white 36%), var(--decoration-color));
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.42),
    inset 0 -3px 0 rgba(137, 45, 107, 0.12),
    0 4px 8px rgba(116, 64, 154, 0.16);
  rotate: -14deg;
}

.board-side-decor__item--candy::before,
.board-side-decor__item--candy::after {
  top: 50%;
  width: 36%;
  height: 86%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), transparent 42%),
    var(--decoration-color);
  clip-path: polygon(0 50%, 18% 7%, 100% 28%, 100% 72%, 18% 93%);
  transform: translateY(-50%);
}

.board-side-decor__item--candy::before {
  left: -29%;
}

.board-side-decor__item--candy::after {
  right: -29%;
  transform: translateY(-50%) rotate(180deg);
}

.board-side-decor__item--gumdrop {
  top: 58%;
  right: 36px;
  width: 48px;
  height: 40px;
  border-radius: 24px 24px 13px 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), var(--green) 36%, color-mix(in srgb, var(--green), #111827 18%));
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.5), 0 5px 10px rgba(116, 64, 154, 0.16);
  rotate: 7deg;
}

.board-side-decor__item--lollipop {
  bottom: 0;
  left: 12px;
  width: 42px;
  height: 64px;
  rotate: 15deg;
}

.board-side-decor__item--lollipop::before {
  left: 50%;
  top: 30px;
  width: 5px;
  height: 34px;
  border-radius: 999px;
  background: #9b6a4d;
  transform: translateX(-50%);
}

.board-side-decor__item--lollipop::after {
  top: 0;
  left: 50%;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background:
    conic-gradient(from 25deg, white 0 16%, var(--pink) 16% 34%, white 34% 50%, var(--pink) 50% 68%, white 68% 84%, var(--pink) 84% 100%);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.55), 0 4px 8px rgba(116, 64, 154, 0.2);
  transform: translateX(-50%);
}

.jail {
  position: relative;
  grid-column: 4;
  width: 150px;
  min-height: 210px;
  border: 4px solid #7b5cff;
  border-radius: 8px;
  background: linear-gradient(135deg, #e9e4ff, #dff9ff);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.jail strong {
  position: relative;
  z-index: 2;
  font-size: 1.15rem;
}

.jail__bars {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 16px, rgba(31, 41, 51, 0.45) 16px 22px);
}

.jail__tokens {
  z-index: 3;
  left: 8px;
  right: 8px;
  bottom: 8px;
  top: auto;
  min-height: 44px;
}

.controls {
  grid-template-columns: minmax(260px, 460px);
  justify-content: start;
  gap: 6px;
}

.draw-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 12;
  width: min(520px, calc(100vw - 36px));
  padding: 16px;
  border: 3px solid rgba(36, 48, 71, 0.24);
  background:
    linear-gradient(#fffafe, #fffafe) padding-box,
    linear-gradient(135deg, var(--pink), var(--yellow), var(--green), var(--blue)) border-box;
  box-shadow: 0 24px 70px rgba(36, 48, 71, 0.34);
  transform: translate(-50%, -50%);
}

.draw-popup::before {
  content: "";
  position: fixed;
  inset: -100vmax;
  z-index: -1;
  background: rgba(36, 48, 71, 0.32);
  pointer-events: none;
}

.draw-popup .eyebrow {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 1rem;
  text-align: center;
}

.draw-popup .deck-grid {
  gap: 10px;
}

.draw-popup .deck-button {
  min-height: 58px;
  font-size: 1.05rem;
}

.last-card-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 13;
  width: min(420px, calc(100vw - 36px));
  padding: 16px;
  border: 3px solid rgba(36, 48, 71, 0.24);
  background:
    linear-gradient(#fffafe, #fffafe) padding-box,
    linear-gradient(135deg, var(--pink), var(--yellow), var(--green), var(--blue)) border-box;
  box-shadow: 0 24px 70px rgba(36, 48, 71, 0.34);
  transform: translate(-50%, -50%);
}

.last-card-popup::before {
  content: "";
  position: fixed;
  inset: -100vmax;
  z-index: -1;
  background: rgba(36, 48, 71, 0.32);
  pointer-events: none;
}

.last-card-popup .eyebrow {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 1rem;
  text-align: center;
}

.card-panel__button {
  margin-top: 12px;
}

.panel {
  min-width: 0;
  padding: 6px;
  background: rgba(255, 250, 254, 0.9);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(116, 64, 154, 0.1);
}

.deck-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.deck-button {
  min-height: 30px;
  border-radius: 6px;
  color: white;
  font-weight: 900;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.deck-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.drawn-card {
  min-height: 60px;
  padding: 6px 8px;
  border-radius: 8px;
  color: white;
  background: #4b5563;
  display: grid;
  align-content: center;
  gap: 8px;
}

.drawn-card strong {
  display: block;
  font-size: 1.05rem;
}

.players {
  display: grid;
  gap: 3px;
  padding-left: 20px;
  margin: 0;
}

.players li {
  padding: 3px 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, #fff0fa, #eefcff);
}

.players li.is-active {
  box-shadow: inset 0 0 0 2px var(--pink), 0 0 0 3px rgba(241, 196, 15, 0.35);
}

.log {
  min-height: 34px;
  padding: 6px 10px;
  color: #374151;
  background: rgba(255, 250, 212, 0.82);
  border: 2px solid #f8d767;
  border-radius: 8px;
}

.win-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 41, 51, 0.55);
  overflow: hidden;
}

.win-screen {
  position: relative;
  z-index: 2;
  width: min(420px, 100%);
  padding: 34px;
  border: 3px solid transparent;
  border-radius: 8px;
  background:
    linear-gradient(#fffafe, #fffafe) padding-box,
    linear-gradient(135deg, var(--pink), var(--yellow), var(--green), var(--blue)) border-box;
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  gap: 22px;
  text-align: center;
}

.win-screen h2 {
  font-size: clamp(2.6rem, 11vw, 5rem);
  line-height: 0.95;
}

.win-token {
  width: 208px;
  height: 208px;
  border-radius: 999px;
  background: #f3efe5;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 2px white, 0 10px 22px rgba(31, 41, 51, 0.18);
}

.win-token .token {
  width: 156px;
  height: 128px;
}

.confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.confetti__piece {
  position: absolute;
  top: -24px;
  width: 10px;
  height: 18px;
  border-radius: 2px;
  opacity: 0.95;
  box-shadow:
    inset 2px 0 2px rgba(255, 255, 255, 0.68),
    inset -2px 0 2px rgba(0, 0, 0, 0.22),
    0 2px 8px rgba(255, 255, 255, 0.18);
  animation-name: confetti-rain;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.confetti__piece--blue {
  background: linear-gradient(105deg, #0d5e94 0%, #81d8ff 28%, #1f8ed3 48%, #e8fbff 58%, #126da8 100%);
}

.confetti__piece--green {
  background: linear-gradient(105deg, #087743 0%, #7ef0aa 28%, #19ad63 48%, #e6fff0 58%, #0c8a4e 100%);
}

@keyframes capybara-hop {
  0% {
    transform: translateY(0) scaleX(1) scaleY(1);
  }

  18% {
    transform: translateY(2px) scaleX(1.08) scaleY(0.9);
  }

  42% {
    transform: translateY(-13px) rotate(-7deg) scaleX(0.96) scaleY(1.08);
  }

  68% {
    transform: translateY(-5px) rotate(5deg);
  }

  84% {
    transform: translateY(1px) scaleX(1.04) scaleY(0.96);
  }

  100% {
    transform: translateY(0) rotate(0) scaleX(1) scaleY(1);
  }
}

@keyframes capybara-ear-wiggle {
  0%,
  100% {
    transform: rotate(0);
  }

  35% {
    transform: rotate(-12deg);
  }

  70% {
    transform: rotate(10deg);
  }
}

@keyframes capybara-nose-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  45% {
    transform: translateX(-50%) translateY(-1px);
  }
}

@keyframes confetti-rain {
  0% {
    translate: 0 -10vh;
    rotate: 0deg;
  }

  100% {
    translate: 28px 115vh;
    rotate: 540deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  .token--moving,
  .token--moving .capybara__ear,
  .token--moving .capybara__nose,
  .player-wheel {
    animation: none;
    transition-duration: 0.01ms;
  }
}

@media (max-width: 980px) {
  .board-area,
  .controls {
    grid-template-columns: 1fr;
  }

  .board-side-decor {
    width: min(320px, 100%);
    min-height: 76px;
    justify-self: center;
  }

  .board-side-decor__item--star {
    top: 12px;
    left: 8%;
    right: auto;
  }

  .board-side-decor__item--candy {
    top: 22px;
    left: 34%;
  }

  .board-side-decor__item--gumdrop {
    top: 18px;
    right: 28%;
  }

  .board-side-decor__item--lollipop {
    top: 6px;
    right: 6%;
    bottom: auto;
    left: auto;
  }

  .start-arrow {
    width: min(220px, 100%);
    min-height: 70px;
    justify-self: center;
    margin-bottom: 0;
    border-radius: 8px 8px 0 0;
  }

  .start-arrow::after {
    top: auto;
    right: auto;
    bottom: -34px;
    left: 50%;
    transform: translateX(-50%);
    border-left-width: 44px;
    border-right-width: 44px;
    border-top-width: 34px;
    border-bottom-width: 0;
    border-left-color: transparent;
    border-right-color: transparent;
    border-top-color: var(--green);
  }

  .jail {
    grid-column: auto;
    min-height: 120px;
  }
}

@media (max-width: 720px) {
  .app {
    padding: 12px;
  }

  .first-player__inner {
    padding: 10px 0;
    gap: 14px;
  }

  .wheel-stage {
    width: min(430px, 92vw);
  }

  .wheel-pointer {
    border-left-width: 18px;
    border-right-width: 18px;
    border-top-width: 34px;
  }

  .player-wheel {
    border-width: 6px;
  }

  .player-wheel::before {
    width: 58px;
    height: 58px;
  }

  .player-wheel__label {
    gap: 3px;
    font-size: 0.72rem;
  }

  .player-wheel__label .token {
    width: 38px;
    height: 38px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .board {
    grid-template-columns: repeat(15, minmax(0, 1fr));
    grid-template-rows: repeat(10, minmax(0, 1fr));
    gap: 0;
    min-height: 440px;
    padding: 8px;
  }

  .space {
    font-size: 0.6rem;
  }

  .deck-grid,
  .token-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draw-popup {
    top: auto;
    bottom: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    transform: none;
  }

  .last-card-popup {
    top: auto;
    bottom: 12px;
    left: 12px;
    width: calc(100vw - 24px);
    transform: none;
  }
}
