.uno-scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  overflow: auto;
  padding: 56px 12px 72px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  color: var(--tool-text);
}

.uno-scene[hidden] {
  display: none;
}

.uno-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(980px, 100%);
  margin: auto;
}

.uno-opponents {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 18px 64px;
  width: 100%;
}

.uno-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.uno-seat-name {
  margin: 0;
  font: var(--type-body);
}

.uno-seat.is-turn .uno-seat-name {
  font-weight: 750;
}

.uno-stack {
  --card-w: 108px;
  --card-h: 156px;
  position: relative;
  width: calc(var(--card-w) + (var(--depth) - 1) * 4px);
  height: calc(var(--card-h) + (var(--depth) - 1) * 5px);
}

.uno-stack .uno-card {
  position: absolute;
  left: calc(var(--i) * 4px);
  top: calc((var(--depth) - 1 - var(--i)) * 5px);
  z-index: calc(var(--i) + 1);
}

.uno-back-oval {
  position: absolute;
  top: 14%;
  right: 2%;
  bottom: 14%;
  left: 2%;
  background: #e10600;
  border-radius: 50%;
  transform: rotate(-24deg);
}

.uno-pile,
.uno-hand,
.uno-actions,
.uno-reveal-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.uno-card {
  container-type: inline-size;
  position: relative;
  display: flex;
  width: 108px;
  height: 156px;
  min-height: 156px;
  padding: 6px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: #fff;
  box-shadow: 0 1px 0 rgb(0 0 0 / 16%);
}

.uno-face {
  position: relative;
  flex: 1;
  border-radius: 9px;
  background: #111;
  overflow: hidden;
}

.uno-oval {
  position: absolute;
  top: 15%;
  right: 11%;
  bottom: 15%;
  left: 11%;
  display: grid;
  place-items: center;
  border: max(2px, 0.7cqw) solid currentColor;
  border-radius: 50%;
}

.uno-oval.is-quarters {
  border-color: #fff;
  background:
    linear-gradient(#1a5fd0, #1a5fd0) 0 0 / 50% 50% no-repeat,
    linear-gradient(#1f9d3a, #1f9d3a) 100% 0 / 50% 50% no-repeat,
    linear-gradient(#e10600, #e10600) 0 100% / 50% 50% no-repeat,
    linear-gradient(#f5c400, #f5c400) 100% 100% / 50% 50% no-repeat;
}

.uno-glyph {
  display: grid;
  place-items: center;
  font: 800 56cqw/0.85 "Arial Rounded MT Bold", "Nunito", ui-rounded, sans-serif;
  letter-spacing: -0.04em;
  transform: rotate(-16deg);
}

.uno-glyph svg {
  width: 62cqw;
  height: 62cqw;
}

.uno-corner {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  font: 800 18cqw/1 "Arial Rounded MT Bold", "Nunito", ui-rounded, sans-serif;
}

.uno-corner svg {
  width: 16cqw;
  height: 16cqw;
}

.uno-corner.is-tl {
  top: 4%;
  left: 7%;
  transform: rotate(-12deg);
}

.uno-corner.is-br {
  right: 7%;
  bottom: 4%;
  transform: rotate(168deg);
}

.uno-mini-wild {
  display: block;
  width: 14cqw;
  height: 18cqw;
  border: 1px solid #fff;
  border-radius: 50%;
  background:
    linear-gradient(#1a5fd0, #1a5fd0) 0 0 / 50% 50% no-repeat,
    linear-gradient(#1f9d3a, #1f9d3a) 100% 0 / 50% 50% no-repeat,
    linear-gradient(#e10600, #e10600) 0 100% / 50% 50% no-repeat,
    linear-gradient(#f5c400, #f5c400) 100% 100% / 50% 50% no-repeat;
}

.uno-blocks.is-pair {
  position: relative;
  width: 50cqw;
  height: 54cqw;
}

.uno-blocks.is-pair i {
  position: absolute;
  width: 24cqw;
  height: 38cqw;
  border-radius: 12%;
  background: currentColor;
}

.uno-blocks.is-pair i:first-child {
  top: 22%;
  left: 0;
}

.uno-blocks.is-pair i:last-child {
  top: 0;
  left: 46%;
}

.uno-blocks.is-quad {
  display: flex;
  flex-direction: column;
  gap: 1.4cqw;
  transform: rotate(-12deg);
}

.uno-blocks.is-quad i {
  display: block;
  width: 44cqw;
  height: 13cqw;
  border-radius: 10%;
  box-shadow: 1cqw 0.7cqw 0 rgb(0 0 0 / 30%);
}

.uno-blocks .is-yellow { background: #f5c400; }
.uno-blocks .is-blue { background: #1a5fd0; }
.uno-blocks .is-red { background: #e10600; }
.uno-blocks .is-green { background: #1f9d3a; }

button.uno-card {
  cursor: pointer;
}

button.uno-card:disabled {
  cursor: default;
  opacity: 0.45;
}

.uno-card[data-color="red"] .uno-face {
  background: #e10600;
}

.uno-card[data-color="yellow"] .uno-face {
  background: #f5c400;
  color: #1a1a1a;
}

.uno-card[data-color="green"] .uno-face {
  background: #1f9d3a;
}

.uno-card[data-color="blue"] .uno-face {
  background: #1a5fd0;
}

.uno-card[data-color="wild"] .uno-face {
  background: #161616;
  color: #fff;
}

.uno-card.is-discard {
  width: 132px;
  height: 190px;
  min-height: 190px;
}

.uno-note,
.uno-reveal {
  margin: 0;
  max-width: 36em;
  text-align: center;
  font: var(--type-body);
}

.uno-color {
  min-width: 92px;
}

.uno-color.is-red { background: var(--red); color: #fff; }
.uno-color.is-yellow { background: var(--gold); color: #222; }
.uno-color.is-green { background: #2f6f4e; color: #fff; }
.uno-color.is-blue { background: #2c4f8f; color: #fff; }

.uno-card:focus-visible,
.uno-actions button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (max-width: 680px) {
  .uno-scene {
    padding-top: 72px;
  }

  .uno-card {
    width: 88px;
    height: 128px;
    min-height: 128px;
    padding: 5px;
    border-radius: 12px;
  }

  .uno-card.is-discard {
    width: 104px;
    height: 150px;
    min-height: 150px;
  }

  .uno-stack {
    --card-w: 88px;
    --card-h: 128px;
  }
}
