.kitty-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 182, 217, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.kitty-popup.hidden {
  display: none;
}

.kitty-popup-box {
  background: linear-gradient(135deg, #FFECF6, #FFD6E8);
  border: 3px solid #FFB6D9;
  border-radius: 26px;
  padding: 24px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 10px 20px rgba(255, 105, 180, 0.35);
  animation: popupFadeIn 0.25s ease-out;
}

.kitty-popup-header {
  font-size: 1.4rem;
  font-weight: 800;
  color: #FF5FA2;
  margin-bottom: 12px;
}

/* Rules popup list */
.rules-list-popup {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.rules-list-popup li {
  background: linear-gradient(135deg, #FFECF6, #FFD6E8);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
  font-weight: 600;
  color: #5A3A4C;
  border: 2px solid #FFB6D9;
  box-shadow: 0 6px 12px rgba(255, 105, 180, 0.25);
  font-size: 0.95rem;
}

:root[data-theme="dark"] .rules-list-popup li {
  background: linear-gradient(135deg, #3a1a28, #5a0038);
  color: #ffeaf4;
  border-color: #ff7eb6;
}

/* Waiting banner */
.waiting-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #FFECF6, #FFD6E8);
  border: 3px solid #FFB6D9;
  border-radius: 20px;
  padding: 12px 18px;
  margin-bottom: 20px;
  box-shadow: 0 8px 16px rgba(255, 105, 180, 0.25);
  font-weight: 700;
  color: #A65C87;
  font-size: 1rem;
  animation: fadeIn 0.4s ease;
}

.waiting-banner.hidden {
  display: none;
}

/* Spinner */
.kitty-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 4px solid #FF9EC9;
  border-top-color: #FF5FA2;
  animation: spin 1s linear infinite;
  position: relative;
}

.kitty-spinner::after {
  content: "🎀";
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
}

/* Player grid */
.players-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 1rem;
  font-weight: 500;
  animation: playerJoin 0.35s ease-out;
}

.player-card.empty {
  justify-content: center;
  color: #aaa;
  background: #f7f7f7;
}

.player-card .role-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f3c2d1;
}

/* Role badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  margin-left: auto;
  position: relative;
  cursor: default;
}

.role-badge.host {
  background: #ff6fae;
  box-shadow: 0 0 6px rgba(255, 111, 174, 0.5);
}

.role-badge.mrx {
  background: #3a3a3a;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
}

.role-badge.detective {
  background: #5aa9ff;
  box-shadow: 0 0 6px rgba(90, 169, 255, 0.5);
}

.role-badge .emoji {
  margin-right: 6px;
  font-size: 1rem;
}

/* Tooltip */
.role-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
}

.role-badge::before {
  content: "";
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.role-badge:hover::after,
.role-badge:hover::before {
  opacity: 1;
}

/* Animations */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popupFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes playerJoin {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes playersNeededFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.players-needed {
  text-align: center;
  font-weight: 700;
  color: #A65C87;
  margin-bottom: 12px;
  font-size: 1rem;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.players-needed.fade {
  animation: playersNeededFade 0.35s ease-out;
}
