[x-cloak] {
  display: none!important;
}
:root {
  --ink: #f7f8ff;
  --muted: #a9aec8;
  --midnight: #080b1c;
  --surface: #141a35;
  --line: rgba(255,255,255,.12);
  --red: #ff4d61;
  --red-dark: #dc2945;
  --yellow: #ffc52e;
  --green: #27d99b;
  --blue: #5789ff;
  font-family: Inter,ui-rounded,"Avenir Next","Segoe UI",sans-serif;
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
html,body {
  margin: 0;
  min-height: 100vh;
  background: #080b1c;
  color: var(--ink);
}
body:before,body:after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}
body:before {
  inset: 0;
  background: radial-gradient(circle at 16% 12%,rgba(87,137,255,.28),transparent 25rem),radial-gradient(circle at 86% 76%,rgba(255,77,97,.24),transparent 24rem),radial-gradient(circle at 50% 108%,rgba(39,217,155,.14),transparent 28rem),linear-gradient(135deg,#111944 0%,#090d23 47%,#160d2e 100%);
}
body:after {
  inset: 0;
  opacity: .24;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.045) 1px,transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom,rgba(0,0,0,.8),transparent 85%);
}
button,input {
  font: inherit;
}
button {
  -webkit-tap-highlight-color: transparent;
}
#app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.screen {
  width: 100%;
  display: flex;
  justify-content: center;
}
.card {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 410px;
  padding: 32px 26px 30px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 26px;
  background: linear-gradient(145deg,rgba(38,49,96,.94),rgba(16,20,50,.94));
  box-shadow: 0 26px 80px rgba(0,0,0,.42),inset 0 1px rgba(255,255,255,.12);
}
.card:before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 220px;
  height: 220px;
  top: -140px;
  right: -72px;
  border-radius: 50%;
  background: var(--red);
  opacity: .2;
  filter: blur(20px);
}
h1 {
  margin: 0 0 6px;
  font-size: clamp(1.8rem,7vw,2.45rem);
  letter-spacing: -.07em;
  line-height: .95;
}
h1:first-letter {
  color: var(--yellow);
}
h2 {
  margin: 24px 0 10px;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}
.subtitle {
  margin: 0 0 18px;
  color: var(--muted);
}
.field {
  display: block;
  margin: 16px 0;
}
.field span {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
input[type=text],.share-box input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: rgba(4,7,23,.42);
  transition: border-color .18s,box-shadow .18s,background .18s;
}
input[type=text]::placeholder {
  color: #79809c;
}
input[type=text]:focus,.share-box input:focus {
  border-color: var(--blue);
  background: rgba(5,9,27,.65);
  box-shadow: 0 0 0 4px rgba(87,137,255,.18);
}
.btn {
  width: 100%;
  min-height: 47px;
  margin-top: 9px;
  padding: 11px 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255,255,255,.1);
  font-size: .94rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.1);
  transition: transform .16s,background .16s,box-shadow .16s;
}
.btn:not(:disabled):hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.17);
}
.btn:not(:disabled):active {
  transform: translateY(1px) scale(.98);
}
.btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg,#ff6674,var(--red-dark));
  box-shadow: 0 8px 20px rgba(220,41,69,.3),inset 0 1px rgba(255,255,255,.25);
}
.btn--primary:not(:disabled):hover {
  background: linear-gradient(135deg,#ff7a85,#e63850);
  box-shadow: 0 12px 26px rgba(220,41,69,.45);
}
.or-join {
  margin-top: 23px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}
.or-divider {
  display: block;
  margin-bottom: 9px;
  text-align: center;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.share-box {
  display: flex;
  gap: 8px;
  margin-top: 13px;
}
.share-box input {
  flex: 1;
  min-width: 0;
  padding: 10px 11px;
  font-size: .78rem;
}
.share-box .btn {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 9px 12px;
  white-space: nowrap;
  font-size: .8rem;
}
.qr-code {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.qr-code svg {
  width: 150px;
  height: 150px;
  padding: 10px;
  border: 5px solid var(--yellow);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}
.room-code {
  display: inline-block;
  color: var(--yellow);
  font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing: .08em;
  text-shadow: 0 0 20px rgba(255,197,46,.45);
}
.players {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 0;
  margin: 8px 0 17px;
  list-style: none;
}
.players li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(3,6,22,.26);
  font-size: .92rem;
  font-weight: 700;
}
.badge,.disconnected-badge {
  padding: 3px 7px;
  border-radius: 999px;
  color: #10152f;
  background: var(--yellow);
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.you {
  color: var(--muted);
  font-size: .8rem;
}
.disconnected-badge {
  color: var(--ink);
  background: #59617e;
}
.error {
  margin: 13px 0 0;
  color: #ff8492;
  font-size: .84rem;
  font-weight: 650;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: var(--ink);
  text-align: center;
  background: rgba(5,7,22,.78);
  backdrop-filter: blur(14px);
}
.overlay>p {
  margin: 0;
  font-weight: 850;
  font-size: 1.06rem;
}
.overlay .btn {
  width: auto;
  min-height: 0;
  padding: 11px 20px;
}
.toast {
  position: fixed;
  z-index: 60;
  top: max(16px,env(safe-area-inset-top));
  left: 50%;
  padding: 9px 17px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  color: #031912;
  background: var(--green);
  font-size: .82rem;
  font-weight: 900;
  box-shadow: 0 9px 24px rgba(0,0,0,.3);
  transform: translateX(-50%);
}

/* Game table */.app--game {
  display: block;
  padding: 0;
}
.app--game .screen {
  padding: 0;
}
.game-screen {
  width: 100%;
  max-width: 900px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(15px,env(safe-area-inset-top)) 16px 210px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--ink);
}
.game-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.game-header__topline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.room-chip {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b8bfdd;
  background: rgba(8,11,28,.38);
  font-family: ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.music-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #c5cce6;
  background: rgba(8,11,28,.38);
  font-size: .66rem;
  font-weight: 800;
  cursor: pointer;
}
.music-toggle:hover {
  border-color: rgba(255,197,46,.75);
  color: var(--yellow);
}
.music-toggle span:first-child {
  font-size: .92rem;
  line-height: 1;
}
.turn-banner {
  margin: 0;
  padding: 8px 17px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  color: #c3c9e2;
  background: rgba(7,10,28,.36);
  font-size: clamp(.88rem,3vw,1.03rem);
  font-weight: 800;
  text-align: center;
}
.turn-banner--you {
  border-color: rgba(39,217,155,.7);
  color: #c5ffe9;
  background: rgba(39,217,155,.13);
  box-shadow: 0 0 26px rgba(39,217,155,.18);
  animation: turnPulse 1.6s ease-in-out infinite;
}
@keyframes turnPulse {
  0%,100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}
.opponents {
  display: flex;
  gap: 8px;
  margin: 0;
  /* The current-turn chip lifts by 2px and has a glow. Reserve space for
     both so the horizontally scrolling strip does not crop it. */
  padding: 6px 10px 12px;
  margin: -6px -10px -5px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}
.opponents::-webkit-scrollbar {
  display: none;
}
.opponents__item {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: rgba(7,10,28,.4);
  box-shadow: inset 0 1px rgba(255,255,255,.05);
  font-size: .8rem;
  font-weight: 800;
  transition: transform .2s,border-color .2s,background .2s;
}
.opponents__item--turn {
  border-color: var(--yellow);
  background: rgba(255,197,46,.13);
  box-shadow: 0 0 20px rgba(255,197,46,.15),inset 0 1px rgba(255,255,255,.1);
  transform: translateY(-2px);
}
.opponents__minihand {
  display: inline-flex;
  align-items: center;
}
.mini-card {
  width: 11px;
  height: 17px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 3px;
  background: linear-gradient(135deg,#ff5669,#7e1938);
  box-shadow: 1px 2px 3px rgba(0,0,0,.25);
}
.mini-card+.mini-card {
  margin-left: -6px;
}
.opponents__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 50%;
  color: #131833;
  background: var(--ink);
  font-size: .7rem;
  font-weight: 900;
}
.opponents__uno {
  color: var(--yellow);
  font-size: .71rem;
  font-weight: 950;
  text-shadow: 0 0 12px rgba(255,197,46,.6);
}
.opponents__disconnected {
  color: #9198b4;
  font-size: .66rem;
  font-style: italic;
}
.opponents__catch {
  padding: 4px 9px;
  border: 0;
  border-radius: 999px;
  color: #271708;
  background: var(--yellow);
  font-size: .67rem;
  font-weight: 950;
  cursor: pointer;
  animation: turnPulse 1s ease-in-out infinite;
}
.table-center {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 34px;
  overflow: hidden;
  background: radial-gradient(ellipse at center,rgba(34,50,105,.64),rgba(9,13,36,.45) 66%);
  box-shadow: inset 0 0 90px rgba(0,0,0,.22);
}
.table-center:before {
  content: "";
  position: absolute;
  width: min(60vw,440px);
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(255,255,255,.025),0 0 0 55px rgba(255,255,255,.018);
}
.pile-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(32px,10vw,76px);
}
.pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
  background: none;
}
.pile--deck {
  cursor: pointer;
}
.pile--deck:disabled {
  cursor: not-allowed;
  opacity: .42;
}
.pile--deck:not(:disabled):hover .card-stack {
  transform: translateY(-7px) rotate(-3deg);
}
.pile--deck:not(:disabled):active .card-stack {
  transform: scale(.94);
}
.card-stack {
  position: relative;
  display: block;
  width: 78px;
  height: 112px;
  transition: transform .18s ease;
}
.card-stack__layer {
  position: absolute;
  inset: 0;
  border-radius: 15px;
}
.card-stack__layer--3 {
  transform: rotate(8deg) translate(4px,4px);
  opacity: .3;
}
.card-stack__layer--2 {
  transform: rotate(-5deg) translate(-3px,2px);
  opacity: .58;
}
.card-stack__layer--1 {
  transform: none;
}
.pile__back {
  border: 3px solid #f6f7ff;
  background: linear-gradient(135deg,#ff5368,#a61943);
  box-shadow: 0 10px 22px rgba(0,0,0,.42);
}
.pile__back:after {
  content: "UNO";
  position: absolute;
  inset: 12px 8px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 50%;
  color: #fff;
  font-size: .95rem;
  font-weight: 950;
  font-style: italic;
  letter-spacing: -.1em;
  transform: rotate(-26deg);
}
.pile__count {
  color: #b4bcd7;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.uno-card {
  width: 78px;
  height: 112px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  overflow: hidden;
  border: 3px solid #f9faff;
  border-radius: 15px;
  color: #fff;
  box-shadow: 0 9px 19px rgba(0,0,0,.4);
  font-size: 2.6rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  transition: transform .16s ease,box-shadow .16s ease,filter .16s ease;
}
.uno-card:before {
  content: "";
  position: absolute;
  z-index: 0;
  width: 145%;
  height: 62%;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  transform: rotate(-42deg);
}
.uno-card>span {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.18));
}
.uno-card--red {
  background: linear-gradient(135deg,#ff6070,#d91f46);
}
.uno-card--yellow {
  background: linear-gradient(135deg,#ffd950,#df9310);
}
.uno-card--green {
  background: linear-gradient(135deg,#4ae8ad,#119a70);
}
.uno-card--blue {
  background: linear-gradient(135deg,#78a3ff,#3d59d9);
}
.uno-card--wild {
  background: conic-gradient(from 45deg,#ff5369,#ffd33d,#36d99e,#598cff,#ff5369);
}
.uno-card--disabled {
  cursor: not-allowed;
  filter: saturate(.55) brightness(.75);
}
.pile--discard .uno-card {
  cursor: default;
}
.hand button.uno-card {
  --raise: 0;
  margin-right: var(--card-gap,8px);
  transform: translateY(calc(var(--raise) * -17px));
}
.hand button.uno-card:not(.uno-card--disabled) {
  box-shadow: 0 11px 22px rgba(0,0,0,.42);
}
@media (hover:hover) {
  .hand button.uno-card:hover {
    z-index: 2;
    transform: translateY(calc(var(--raise) * -24px)) scale(1.04);
    box-shadow: 0 18px 26px rgba(0,0,0,.45);
  }
}
.hand button.uno-card:active {
  transform: translateY(calc(var(--raise) * -9px)) scale(.96);
}
.hand-tray {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 14px 12px max(12px,env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(to top,rgba(5,7,22,.98),rgba(8,11,28,.92) 78%,rgba(8,11,28,.2));
  backdrop-filter: blur(12px);
}
.hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-height: 45vh;
  /* Playable cards rise 17px and hover adds another 7px. Keep a little
     extra headroom because this element is also the hand's scroll box. */
  padding: 34px 12px 10px;
  overflow-y: auto;
  row-gap: 11px;
}
.uno-fab {
  position: fixed;
  z-index: 40;
  right: max(16px,env(safe-area-inset-right));
  bottom: max(158px,calc(158px + env(safe-area-inset-bottom)));
  width: 66px;
  height: 66px;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #311609;
  background: linear-gradient(135deg,#ffe168,var(--yellow));
  box-shadow: 0 10px 30px rgba(255,197,46,.42);
  font-size: .87rem;
  font-weight: 950;
  cursor: pointer;
  animation: unoFabPulse 1.4s ease-in-out infinite;
}
.uno-fab:active {
  transform: scale(.92);
}
@keyframes unoFabPulse {
  0%,100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.075);
  }
}
.draw-prompt {
  position: fixed;
  z-index: 45;
  right: 0;
  bottom: max(155px,calc(155px + env(safe-area-inset-bottom)));
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  width: max-content;
  max-width: min(90vw,330px);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 19px;
  background: rgba(20,27,59,.96);
  box-shadow: 0 16px 42px rgba(0,0,0,.48);
}
.draw-prompt .uno-card {
  width: 60px;
  height: 86px;
  border-radius: 12px;
  font-size: 1.9rem;
}
.draw-prompt__label {
  margin: 0;
  color: #c1c8e2;
  font-size: .82rem;
  font-weight: 650;
  text-align: center;
}
.draw-prompt__actions {
  display: flex;
  gap: 8px;
  width: 100%;
}
.draw-prompt__actions .btn {
  flex: 1;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 10px;
  font-size: .8rem;
  white-space: nowrap;
}
.challenge-prompt {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(100%, 340px);
  padding: 22px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 19px;
  background: rgba(20,27,59,.96);
  box-shadow: 0 16px 42px rgba(0,0,0,.48);
}
.challenge-prompt__title,
.challenge-prompt__copy {
  margin: 0;
}
.challenge-prompt__title {
  font-size: 1.1rem;
  font-weight: 900;
}
.challenge-prompt__copy {
  color: #c1c8e2;
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.45;
}
.log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 460px;
  max-height: 84px;
  margin: 0 auto;
  padding: 10px 13px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 13px;
  color: #aeb6d0;
  background: rgba(6,9,26,.28);
  font-size: .72rem;
  list-style: none;
  text-align: center;
}
.color-picker {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 13px;
}
.color-swatch {
  width: 68px;
  height: 68px;
  border: 3px solid rgba(255,255,255,.9);
  border-radius: 18px;
  cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.4),0 7px 14px rgba(0,0,0,.22);
  transition: transform .15s;
}
.color-swatch:hover {
  transform: scale(1.08) rotate(3deg);
}
.color-swatch--red {
  background: var(--red);
}
.color-swatch--yellow {
  background: var(--yellow);
}
.color-swatch--green {
  background: var(--green);
}
.color-swatch--blue {
  background: var(--blue);
}
.game-over__title {
  font-size: clamp(1.45rem,7vw,2.2rem)!important;
  letter-spacing: -.04em;
}
@media (min-width:640px) {
  .game-screen {
    padding-right: 24px;
    padding-left: 24px;
  }
  .table-center {
    min-height: 300px;
  }
  .card-stack {
    transform: scale(1.1);
  }
  .pile--deck:not(:disabled):hover .card-stack {
    transform: translateY(-7px) rotate(-3deg) scale(1.1);
  }
}
@media (max-height:650px) {
  .game-screen {
    padding-bottom: 175px;
    gap: 9px;
  }
  .table-center {
    min-height: 160px;
  }
  .uno-card {
    width: 66px;
    height: 95px;
    font-size: 2.2rem;
  }
  .card-stack {
    width: 66px;
    height: 95px;
  }
  .hand {
    max-height: 39vh;
    padding-top: 30px;
  }
}
@media (prefers-reduced-motion:reduce) {
  *,*:before,*:after {
    scroll-behavior: auto!important;
    animation-duration: .01ms!important;
    animation-iteration-count: 1!important;
    transition-duration: .01ms!important;
  }
}
