/**
 * multiplayer.css - Online Multiplayer Lobby, Room Badges & Reaction Animations
 *
 * Provides visual styling for WebRTC room creation, join lobby, copy feedback,
 * live connection dots, and floating emoji banter over the board.
 */

.mp-lobby {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
}

.mp-code-box {
  background: #1c1009;
  border: 2px dashed #e5a959;
  border-radius: 12px;
  padding: 8px 20px;
  margin: 6px 0 10px 0;
  display: inline-block;
}

.mp-code-label {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  color: #d1b79e;
  font-weight: 700;
}

.mp-code-value {
  font-size: 1.8rem;
  font-weight: 950;
  color: #ffe6ba;
  letter-spacing: 4px;
  font-family: monospace;
}

.mp-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid #7a4623;
  background: #27140b;
  color: #fae4c8;
  font-family: monospace;
  text-align: center;
}

.mp-lobby-status {
  margin-top: 10px;
  font-size: 0.88rem;
  color: #ffd899;
  font-weight: 600;
}

.mp-badge {
  background: #244b24 !important;
  border-color: #55a855 !important;
  color: #e9ffe9 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #52e352;
  box-shadow: 0 0 6px #52e352;
  animation: mpPulse 1.8s infinite;
}

@keyframes mpPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.mp-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ffda9933;
  border-top-color: #ffda99;
  border-radius: 50%;
  animation: mpSpin 0.9s linear infinite;
  margin: auto;
}

@keyframes mpSpin {
  to { transform: rotate(360deg); }
}

/* Floating Emoji Reactions */
.floating-emote {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 100;
  animation: floatEmote 2.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.emote-icon {
  font-size: clamp(36px, 8vmin, 56px);
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}

.emote-name {
  font-size: 0.75rem;
  background: #22130be6;
  border: 1px solid #ffda9988;
  color: #fff1d8;
  padding: 2px 8px;
  border-radius: 8px;
  margin-top: 2px;
  white-space: nowrap;
}

@keyframes floatEmote {
  0% {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.6);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -20px) scale(1.15);
  }
  30% {
    transform: translate(-50%, -25px) scale(1);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -55px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -85px) scale(0.85);
  }
}

/* Dynamic QR Code Box */
.mp-qr-box {
  background: #ffffff;
  padding: 12px;
  border-radius: 16px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 6px auto 10px auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.mp-qr-box svg {
  display: block;
  width: clamp(140px, 24vmin, 180px);
  height: clamp(140px, 24vmin, 180px);
}

.mp-qr-caption {
  font-size: 0.76rem;
  color: #3b2210;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: 0.2px;
}

/* Tabs for New Game modal */
.ng-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid #ffffff26;
  padding-bottom: 8px;
}

.ng-tab {
  flex: 1;
  background: #20130b;
  border: 1px solid #7a4623;
  color: #d8c4ab;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.ng-tab.active {
  background: #d97706;
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

.ng-help-box {
  background: #26160d;
  border-left: 3px solid #d97706;
  padding: 8px 12px;
  border-radius: 4px 8px 8px 4px;
  margin: 10px 0;
}

/* Host Lobby Seats Grid */
.mp-seats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 10px 0;
}

.mp-seat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  background: #25150c;
  border: 1px solid #63381a;
  color: #f5e4cf;
}

.mp-seat-pill.claimed {
  border-color: #22c55e;
  background: #14331a;
  color: #bbf7d0;
}

.mp-seat-pill.waiting {
  border-style: dashed;
  opacity: 0.75;
}

.mp-seat-status {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.85;
}

/* Pick Player Seat Cards */
.mp-seats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.mp-seat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #24140b;
  border: 1px solid #75411d;
  transition: border-color 0.15s, background 0.15s;
}

.mp-seat-card.available {
  border-color: #f59e0b;
  background: #331c10;
}

.mp-seat-card.claimed {
  opacity: 0.6;
}

.mp-seat-avatar {
  font-size: 1.8rem;
  line-height: 1;
}

.mp-seat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.mp-seat-info strong {
  font-size: 0.95rem;
  color: #ffeed3;
}

.mp-seat-badge {
  font-size: 0.74rem;
  display: inline-block;
}

.claimed-badge {
  color: #e5a959;
}

.available-badge {
  color: #86efac;
  font-weight: 700;
}

.mp-error-banner {
  background: #7f1d1d;
  color: #fecaca;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  margin-bottom: 10px;
}

/* Floating in-game emoji reaction bar */
.mp-emote-bar {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  background: rgba(28, 16, 9, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.45);
  backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: 24px;
  z-index: 40;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  animation: fadeInEmoteBar 0.3s ease;
}

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

.mp-emote-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 8px;
  transition: transform 0.12s ease, background 0.15s ease;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mp-emote-btn:hover {
  transform: scale(1.35);
  background: rgba(255, 255, 255, 0.12);
}

.mp-emote-btn:active {
  transform: scale(0.95);
}

.mp-presence-offline {
  opacity: 0.55;
  filter: grayscale(0.5);
}

