#cursorField {
  position: relative;
  height: 100%;
  width: 100%;
  pointer-events: none;
}

.cursor {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  transition:
    left 0.05s linear,
    top 0.05s linear;
}

.shape-square {
  border-radius: 2px;
}
.shape-circle {
  border-radius: 50%;
}
.shape-triangle {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}
.shape-diamond {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.shape-star {
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}
.shape-hexagon {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
.shape-octagon {
  clip-path: polygon(
    30% 0%,
    70% 0%,
    100% 30%,
    100% 70%,
    70% 100%,
    30% 100%,
    0% 70%,
    0% 30%
  );
}
.shape-trapezoid {
  clip-path: polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%);
}

.cursor-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 66.6667%;
  height: 66.6667%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sonar {
  position: absolute;
  border: 2px solid;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: sonarExpand 0.8s ease-out forwards;
}

@keyframes sonarExpand {
  from {
    width: 0;
    height: 0;
    opacity: 0.8;
  }
  to {
    width: 120px;
    height: 120px;
    opacity: 0;
  }
}

.cursor.spin {
  animation: cursorSpin 0.2s ease-in-out;
}

@keyframes cursorSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.cursor.jump {
  animation: cursorJump 0.3s ease;
}

@keyframes cursorJump {
  0% {
    transform: translate(-50%, -50%) translateY(0);
  }
  40% {
    transform: translate(-50%, -50%) translateY(-14px);
  }
  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
}

.key-container {
  position: absolute;
  pointer-events: none;
  transition:
    left 0.05s linear,
    top 0.05s linear;
}

.key-letter {
  position: absolute;
  top: 0;
  font-family: "3270", sans-serif;
  font-size: 36px;
  line-height: 1;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, calc(-100% - 20px));
  transition: left 0.15s ease;
  animation:
    keyFadeUp 0.2s ease-out forwards,
    keyFadeOut 0.3s ease-in 4.7s forwards;
}

@keyframes keyFadeUp {
  from {
    opacity: 0;
    transform: translate(-50%, -50%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 20px));
  }
}

@keyframes keyFadeOut {
  to {
    opacity: 0;
  }
}

.key-letter.clearing {
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  transform: translate(-50%, calc(-100% - 20px)) scale(0);
  opacity: 0;
}

.alt-menu {
  position: absolute;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #fff;
  padding: 8px 12px;
  font-family: "3270", sans-serif;
  font-size: 20px;
  color: #fff;
  white-space: nowrap;
  z-index: 2;
  transform: translate(12px, -50%);
}

.alt-menu-item {
  cursor: pointer;
  padding: 2px 0;
}

.alt-menu-item:hover {
  color: #ffdd55;
}

.selecting-ring {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-bottom-color: transparent;
  border-left-color: transparent;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 0.05s linear, top 0.05s linear;
  animation: selectingPulse 1s ease-in-out infinite;
}

@keyframes selectingPulse {
  0% { transform: translate(-50%, -50%) rotate(0deg)}
  100% { transform: translate(-50%, -50%) rotate(360deg)}
}

.join-halo {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 0.05s linear, top 0.05s linear;
}

.area-circle {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 0.05s linear, top 0.05s linear;
}

.area-circle-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 10px);
  font-family: "3270", sans-serif;
  font-size: 18px;
  color: #fff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.cursor.lobby-member {
  border-radius: 50% !important;
  clip-path: none !important;
}

.cursor.lobby-member .cursor-inner {
  display: none;
}

.cursor.reject-flash {
  animation: rejectShake 0.25s ease;
}

@keyframes rejectShake {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, -50%) scale(0.8); }
}

.select-mode .cursor {
  pointer-events: auto;
}

.select-mode .cursor:hover {
  filter: brightness(1.4);
}

.invite-popup {
  position: absolute;
  top: 100%;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #fff;
  padding: 8px 12px;
  transform: translate(-50%, 12px);
  font-family: "3270", sans-serif;
  color: #fff;
  text-align: center;
  z-index: 3;
  transition: left 0.05s linear, top 0.05s linear;
}

.invite-popup-game {
  font-size: 18px;
  text-transform: uppercase;
  margin-bottom: 6px;
  white-space: nowrap;
}

.invite-popup-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.invite-popup-join,
.invite-popup-x {
  padding: 2px 10px;
  border: 1px solid #fff;
  font-size: 16px;
}

.invite-popup-join:hover {
  background: #ffdd55;
  color: #000;
}

.invite-popup-x:hover {
  background: #ff3b3b;
  color: #000;
}

.start-game-btn {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 30px);
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #fff;
  padding: 6px 14px;
  font-family: "3270", sans-serif;
  color: #fff;
  font-size: 16px;
  white-space: nowrap;
  z-index: 3;
  transition: left 0.05s linear, top 0.05s linear;
}

.start-game-btn:hover {
  background: #ffdd55;
  color: #000;
}

.game-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.game-dealer {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.85);
  border: 3px solid #fff;
  padding: 16px 24px;
  min-width: 260px;
  text-align: center;
  color: #fff;
  font-family: "3270", sans-serif;
  font-size: 1.3em;
}

.game-players {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.game-slot {
  position: relative;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #fff;
  padding: 10px 14px;
  width: fit-content;
  height: fit-content;
  text-align: center;
  color: #fff;
  font-family: "3270", sans-serif;
}

.game-slot.active-turn {
  border-color: #ffdd55;
  box-shadow: 0 0 8px #ffdd55;
}

.game-quit-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  line-height: 18px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  font-size: 12px;
}

.game-quit-btn:hover {
  background: #ff3b3b;
}

.game-slot-name {
  font-size: 16px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.card-mount {
  display: flex;
  justify-content: center;
}

.card-pocket {
  position: relative;
  height: 82px;
  margin: 6px 0;
  overflow: hidden;
}

.card-pocket-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  border-radius: 3px;
  z-index: 0;
}

.playing-card {
  position: absolute;
  bottom: -33px;
  width: 50px;
  height: 100px;
  background: #f5f2ea;
  border: 1px solid #999;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transform-origin: bottom center;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.15s ease;
  font-family: "3270", sans-serif;
}

.playing-card:hover {
  transform: rotate(var(--rot, 0deg)) translateY(-15px);
  z-index: 999 !important;
}

.card-corner {
  position: absolute;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
}

.card-corner-tl { top: 4px; left: 4px; }
.card-corner-tr { top: 4px; right: 4px; }
.card-corner-bl { bottom: 4px; left: 4px; transform: rotate(180deg); }
.card-corner-br { bottom: 4px; right: 4px; transform: rotate(180deg); }

.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-weight: bold;
}

.card-back {
  background: repeating-linear-gradient(45deg, #16305c, #16305c 6px, #0b1c38 6px, #0b1c38 12px);
}

.playing-card.clickable {
  cursor: pointer;
}

.uno-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.uno-pile {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 130px;
  height: 100px;
  pointer-events: none;
}

.uno-draw-pile {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
}

.uno-draw-pile.clickable {
  cursor: pointer;
}

.uno-discard-top {
  position: absolute;
  left: 55px;
  top: 0;
  pointer-events: none;
}

.uno-color-tag {
  position: absolute;
  left: 55px;
  top: -14px;
  width: 40px;
  height: 8px;
  border-radius: 4px;
}

.uno-wild {
  background: conic-gradient(#d1263a 0deg 90deg, #f4c430 90deg 180deg, #2e8b57 180deg 270deg, #3a6fd1 270deg 360deg);
}

.uno-wild .card-corner,
.uno-wild .card-center {
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 3px #000;
}

.uno-pending-badge {
  position: absolute;
  right: -30px;
  top: 30px;
  background: #ff3b3b;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 10px;
  padding: 2px 8px;
  font-family: "3270", sans-serif;
  font-size: 14px;
  font-weight: bold;
}

.uno-pass-btn {
  margin-top: 6px;
  display: inline-block;
  padding: 4px 14px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #fff;
  color: #fff;
  font-family: "3270", sans-serif;
  font-size: 14px;
  pointer-events: auto;
}

.uno-pass-btn:hover {
  background: #fff;
  color: #000;
}

.uno-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.uno-seat-name {
  font-family: "3270", sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

.uno-seat-count {
  display: inline-block;
  margin-top: 4px;
  min-width: 24px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #fff;
  border-radius: 12px;
  color: #fff;
  font-family: "3270", sans-serif;
  font-size: 14px;
}

.uno-seat.active-turn .uno-seat-count {
  border-color: #ffdd55;
  box-shadow: 0 0 8px #ffdd55;
}

.uno-hand {
  position: relative;
  height: 82px;
  pointer-events: auto;
}

.uno-hand .playing-card {
  bottom: 0;
}

.uno-color-picker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #fff;
  pointer-events: auto;
  z-index: 20;
}

.uno-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.uno-winner-banner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  border: 3px solid #ffdd55;
  color: #ffdd55;
  font-family: "3270", sans-serif;
  font-size: 2em;
  padding: 16px 32px;
  pointer-events: none;
}

.game-slot-total {
  font-size: 18px;
  font-weight: bold;
  opacity: 0.85;
}

.game-slot-result {
  font-size: 20px;
  font-weight: bold;
  margin-top: 4px;
}

.game-slot-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.game-btn {
  border: 1px solid #fff;
  padding: 4px 12px;
  font-size: 20px;
}

.game-btn:hover {
  background: #fff;
  color: #000;
}

.game-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.game-indicator {
  position: absolute;
  left: 50%;
  pointer-events: none;
  font-family: "3270", sans-serif;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  z-index: 1;
  transition: left 0.05s linear, top 0.05s linear;
}

.game-indicator-above {
  transform: translate(-50%, -200%);
}

.game-indicator-below {
  transform: translate(-50%, 20px);
}