/* ----------------------------------------------------
   MURDER MYSTERY - PREMIUM STYLING SYSTEM
---------------------------------------------------- */

:root {
  /* Colors */
  --bg-app: #08090f;
  --bg-card: rgba(18, 20, 32, 0.55);
  --bg-card-hover: rgba(25, 28, 45, 0.7);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 255, 255, 0.15);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --color-primary: hsl(217, 91%, 60%); /* Sleek Neon Blue */
  --color-accent: hsl(280, 80%, 65%); /* Purple Glow */
  --color-danger: hsl(346, 84%, 55%); /* Crimson Red */

  /* Role Colors */
  --color-innocent: hsl(142, 70%, 50%); /* Bright Green */
  --color-sheriff: hsl(217, 91%, 60%); /* Mid-tone Blue */
  --color-murderer: hsl(346, 84%, 50%); /* Bright Red */

  /* Shadows */
  --shadow-sm:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --shadow-glow-blue: 0 0 25px rgba(37, 99, 235, 0.35);
  --shadow-glow-purple: 0 0 25px rgba(168, 85, 247, 0.35);
  --shadow-glow-green: 0 0 30px rgba(16, 185, 129, 0.45);
  --shadow-glow-red: 0 0 35px rgba(239, 68, 68, 0.55);
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Plus Jakarta Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox older versions */
  -ms-user-select: none; /* Internet Explorer/Edge older versions */
  user-select: none; /* Standard syntax */
}

/* ----------------------------------------------------
   BACKGROUND DECORATIVE ORBS
---------------------------------------------------- */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.3;
  pointer-events: none;
}
.orb-1 {
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
  top: -10%;
  left: -10%;
}
.orb-2 {
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
  bottom: -5%;
  right: -10%;
}
.orb-3 {
  width: 30vw;
  height: 30vw;
  background: radial-gradient(circle, var(--color-danger) 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.15;
}

/* ----------------------------------------------------
   LAYOUTS
---------------------------------------------------- */
.app-container {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.app-header {
  text-align: center;
  margin-bottom: 2.5rem;
  width: 100%;
}

.logo {
  font-family: "Outfit", sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.logo-red {
  color: var(--color-murderer);
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}
.logo-blue {
  color: var(--color-sheriff);
  text-shadow: 0 0 15px rgba(37, 99, 235, 0.4);
}
.logo-purple {
  color: var(--shadow-glow-purple);
  text-shadow: 0 0 15px var(--shadow-glow-purple);
  background-image: linear-gradient(
    135deg,
    var(--color-accent) 0%,
    #7e22ce 100%
  );
  /* box-shadow: var(--shadow-glow-purple); */
  /* Step 2: Clip the background to the text */
  -webkit-background-clip: text; /* Required for Chrome, Safari, and Edge */
  background-clip: text;

  /* Step 3: Make the text itself transparent */
  -webkit-text-fill-color: transparent; /* Webkit specific property for text fill */
  color: transparent;

  /* Optional: Ensure the gradient doesn't stretch too far */
  display: inline-block;
  font-style: italic;
  will-change: transform;
}

.logo-purple.logo-purple-intro {
  animation: mystery-ghost-float 5s ease-in-out 1 both;
}

@keyframes mystery-ghost-float {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  12% {
    transform: translate3d(2px, -4px, 0) rotate(-1deg);
  }
  24% {
    transform: translate3d(-3px, -2px, 0) rotate(1deg);
  }
  38% {
    transform: translate3d(3px, -5px, 0) rotate(-1.2deg);
  }
  52% {
    transform: translate3d(-2px, 1px, 0) rotate(0.8deg);
  }
  68% {
    transform: translate3d(2px, -3px, 0) rotate(-0.8deg);
  }
  84% {
    transform: translate3d(-1px, 1px, 0) rotate(0.4deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
}

.logo-green {
  color: var(--color-innocent);
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}
.logo-divider {
  color: var(--text-muted);
  font-weight: 300;
}

@media (max-width: 600px) {
  .logo {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    line-height: 0.95;
    font-size: clamp(2rem, 9vw, 2.6rem);
    letter-spacing: 0.06em;
  }

  .logo-divider {
    display: none;
  }
}

.tagline {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.app-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  width: 100%;
}

.install-banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(92vw, 560px);
  z-index: 10001;
  background: rgba(18, 20, 32, 0.94);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.85rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.install-banner-text {
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.35;
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .install-banner {
    align-items: stretch;
    flex-direction: column;
    text-align: center;
    bottom: 0.75rem;
    padding: 0.85rem;
  }

  .install-banner-actions {
    width: 100%;
    justify-content: center;
  }

  .install-banner-actions .btn {
    flex: 1;
  }
}

/* Views Management */
.view {
  display: none;
  width: 100%;
  animation: fadeIn 0.4s ease-out forwards;
}
.view.active {
  display: block;
}

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

/* ----------------------------------------------------
   CARDS & GLASSMORPHISM
---------------------------------------------------- */
.card {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-glass);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
}

.glass-card:hover {
  border-color: var(--border-glow);
}

/* Welcome Card */
.welcome-card {
  max-width: 480px;
  margin: 0 auto;
}

/* Lobby Card */
.lobby-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
}

/* Tabs */
.tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-light);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Forms */
.form-content {
  display: none;
  padding: 2.2rem;
}
.form-content.active {
  display: block;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.input-group input {
  width: 100%;
  padding: 0.95rem 1.1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.25s ease;
  outline: none;
}

.input-group input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
  background: rgba(0, 0, 0, 0.45);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.8rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  gap: 0.5rem;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1d4ed8 100%);
  color: white;
  box-shadow: var(--shadow-glow-blue);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.5);
  filter: brightness(1.1);
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent) 0%, #7e22ce 100%);
  color: white;
  box-shadow: var(--shadow-glow-purple);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
  filter: brightness(1.1);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger) 0%, #be123c 100%);
  color: white;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.45);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.btn:disabled,
button:disabled {
  background: #27272a !important;
  color: #71717a !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: not-allowed;
  border: 1px solid rgba(255, 255, 255, 0.02) !important;
}

/* ----------------------------------------------------
   LOBBY ROOM SPECIFICS
---------------------------------------------------- */
.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1.8rem;
}

.lobby-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 0.3rem;
}

.lobby-code-display {
  font-family: "Outfit", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.15em;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.player-list-section {
  margin-bottom: 2rem;
}

.player-list-section h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 600;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Custom Scrollbar for Player List */
.player-list::-webkit-scrollbar {
  width: 6px;
}
.player-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
.player-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.player-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  animation: slideIn 0.3s ease-out forwards;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.player-details {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-accent) 100%
  );
  color: white;
}

.player-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.player-badges {
  display: flex;
  gap: 0.5rem;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-host {
  background: rgba(168, 85, 247, 0.15);
  color: var(--color-accent);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-you {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Waiting / Loading indicators */
.lobby-actions {
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
}

.action-panel {
  width: 100%;
}
.action-panel.hidden {
  display: none;
}

.status-tip {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 0.8rem;
}

.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.5rem 0;
}

.pulse-dots {
  display: flex;
  gap: 0.4rem;
}

.pulse-dots div {
  width: 10px;
  height: 10px;
  background-color: var(--color-primary);
  border-radius: 50%;
  animation: pulse-wave 1.4s infinite ease-in-out both;
}

.pulse-dots div:nth-child(1) {
  animation-delay: -0.32s;
}
.pulse-dots div:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes pulse-wave {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.3;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.status-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ----------------------------------------------------
   GAME & DRAMATIC REVEAL SCREEN
---------------------------------------------------- */
.game-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.2rem;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .game-layout {
    grid-template-columns: 1.4fr 1fr;
  }
}

/* Reveal Container & Flip Card */
.reveal-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

.card-flip-container {
  perspective: 1200px;
  width: 100%;
  max-width: 320px;
  height: 420px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-flip-container.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Card FRONT Style (Mysterious) */
.card-front {
  background: radial-gradient(circle at top left, #1a1d30, #0c0e18);
  border: 2px solid var(--border-light);
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.5),
    0 0 25px rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease;
}

.card-front:hover {
  border-color: var(--color-primary);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.6),
    var(--shadow-glow-blue);
  transform: translateY(-4px);
}

.question-mark {
  font-family: "Outfit", sans-serif;
  font-size: 5.5rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--text-primary) 30%,
    var(--text-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.15));
  animation: floatQuestion 3s infinite ease-in-out;
}

@keyframes floatQuestion {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.card-front h2 {
  font-family: "Outfit", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.reveal-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reveal-hint-peek {
  font-size: 0.88rem;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
  font-weight: 600;
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
  letter-spacing: 0.02em;
}

/* Card BACK Styles */
.card-back {
  transform: rotateY(180deg);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.card-back::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 80%
  );
  z-index: 1;
  pointer-events: none;
}

.card-back .card-content {
  z-index: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
}

.role-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.35rem 0.85rem;
  border-radius: 30px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.role-title {
  font-family: "Outfit", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin: 1.2rem 0 0.5rem;
}

.role-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  max-width: 240px;
  margin-bottom: 2rem;
}

/* Card Back Dynamic Colors */

/* Innocent (Green) Theme */
.card-back.role-innocent {
  background: radial-gradient(circle at top, #0f2419 0%, #060e0a 100%);
  border: 3px solid var(--color-innocent);
  box-shadow: var(--shadow-glow-green);
}
.card-back.role-innocent .role-title {
  color: var(--color-innocent);
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}
.card-back.role-innocent .role-badge {
  color: var(--color-innocent);
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
}

/* Sheriff (Blue) Theme */
.card-back.role-sheriff {
  background: radial-gradient(circle at top, #0f1c30 0%, #060b13 100%);
  border: 3px solid var(--color-sheriff);
  box-shadow: var(--shadow-glow-blue);
}
.card-back.role-sheriff .role-title {
  color: var(--color-sheriff);
  text-shadow: 0 0 15px rgba(37, 99, 235, 0.5);
}
.card-back.role-sheriff .role-badge {
  color: var(--color-sheriff);
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.1);
}

/* Murderer (Red) Theme */
.card-back.role-murderer {
  background: radial-gradient(circle at top, #2e0d16 0%, #100407 100%);
  border: 3px solid var(--color-murderer);
  box-shadow: var(--shadow-glow-red);
  animation: heartbeat-glow 2s infinite ease-in-out;
}
.card-back.role-murderer .role-title {
  color: var(--color-murderer);
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}
.card-back.role-murderer .role-badge {
  color: var(--color-murderer);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
}

@keyframes heartbeat-glow {
  0%,
  100% {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.45);
  }
  50% {
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.75);
  }
}

/* Graphical Role Icon Holders */
.role-icon-holder {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.icon-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.1));
}

/* Sidebar list in Game */
.game-sidebar {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 380px;
}

.game-sidebar h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  font-weight: 600;
}

.player-list.compact {
  max-height: 230px;
}

.player-list.compact .player-item {
  padding: 0.7rem 0.95rem;
}

.game-actions {
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.loader-container.compact {
  flex-direction: row;
  justify-content: flex-start;
  padding: 0;
}

.pulse-dots.small div {
  width: 7px;
  height: 7px;
}

.status-text.small {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------
   TOAST NOTIFICATION ENGINE
---------------------------------------------------- */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: rgba(18, 20, 32, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 4px solid var(--color-danger);
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.95rem 1.4rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 380px;
  pointer-events: auto;
  animation:
    toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards,
    toastFadeOut 0.3s ease-out 3.7s forwards;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%) translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateX(0) translateY(0);
    opacity: 1;
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.toast-icon {
  flex-shrink: 0;
  color: var(--color-danger);
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

/* Hide helper classes */
.hidden {
  display: none !important;
}

/* SVG icons utilities */
.icon {
  vertical-align: middle;
}

/* ----------------------------------------------------
   SHERIFF CHALLENGE & MURDERER KILL INTERACTIVE PANEL
---------------------------------------------------- */
.player-actions-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-action {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

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

.btn-challenge {
  background: linear-gradient(135deg, var(--color-sheriff) 0%, #1d4ed8 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-challenge:hover {
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.6);
  transform: translateY(-1px);
}

.btn-kill {
  background: linear-gradient(135deg, var(--color-murderer) 0%, #991b1b 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: pulse-kill 2s infinite ease-in-out;
}

.btn-kill:hover {
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.7);
  transform: translateY(-1px);
  animation-play-state: paused;
}

@keyframes pulse-kill {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  }
}

/* Dead State Styling */
.player-dead {
  opacity: 0.45;
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px dashed rgba(255, 255, 255, 0.05) !important;
}

.player-dead .player-avatar {
  background: #3f3f46 !important;
  color: #71717a !important;
}

.player-dead .player-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.dead-badge {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

/* Card Back Dead State */
.card-back.role-dead {
  background: radial-gradient(circle at top, #1f2029 0%, #0d0e12 100%);
  border: 3px dashed var(--text-muted);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}
.card-back.role-dead .role-title {
  color: var(--text-muted);
  text-shadow: none;
}
.card-back.role-dead .role-badge {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

/* ----------------------------------------------------
   GAME OVER FULL-SCREEN VICTORY OVERLAY
---------------------------------------------------- */
#game-over-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  background: rgba(6, 7, 12, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#game-over-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

#game-over-overlay.fade-out {
  opacity: 0;
}

.game-over-content {
  text-align: center;
  padding: 3rem;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.85);
  opacity: 0;
  animation: overlay-reveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s forwards;
}

@keyframes overlay-reveal {
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.trophy-glow {
  font-size: 5.5rem;
  line-height: 1;
  margin-bottom: 1.5rem;
  animation: trophy-bounce 2.5s infinite ease-in-out;
}

@keyframes trophy-bounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-12px) scale(1.05);
  }
}

.victory-title {
  font-family: "Outfit", sans-serif;
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.won-survivors .victory-title {
  color: var(--color-innocent);
  text-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
}

.won-survivors .trophy-glow {
  filter: drop-shadow(0 0 25px rgba(16, 185, 129, 0.4));
}

.won-murderer .victory-title {
  color: var(--color-murderer);
  text-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
  animation: heartbeat-glow 1.5s infinite ease-in-out;
}

.won-murderer .trophy-glow {
  filter: drop-shadow(0 0 30px rgba(239, 68, 68, 0.5));
}

.victory-msg {
  font-size: 1.22rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2.2rem;
  font-weight: 500;
}

.auto-lobby-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 0.05em;
}

/* ----------------------------------------------------
   PRESS AND HOLD PEEK MECHANIC
---------------------------------------------------- */
.card-flip-container.peeking .card-inner {
  transform: rotateY(15deg) scale(0.97) translateY(-2px);
  transition: transform 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-flip-container.peeking .card-front {
  transition: all 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Color leaks in the center + soft boundary glows depending on secret role */

/* Peek Innocent (Green) */
.card-flip-container.peek-innocent .card-front {
  background: radial-gradient(
    circle at center,
    rgba(16, 185, 129, 0.25) 0%,
    #0c0e18 75%
  ) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(16, 185, 129, 0.3) !important;
}

/* Peek Sheriff (Blue) */
.card-flip-container.peek-sheriff .card-front {
  background: radial-gradient(
    circle at center,
    rgba(37, 99, 235, 0.25) 0%,
    #0c0e18 75%
  ) !important;
  border-color: rgba(37, 99, 235, 0.4) !important;
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(37, 99, 235, 0.3) !important;
}

/* Peek Murderer (Red) */
.card-flip-container.peek-murderer .card-front {
  background: radial-gradient(
    circle at center,
    rgba(239, 68, 68, 0.25) 0%,
    #0c0e18 75%
  ) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(239, 68, 68, 0.3) !important;
}

/* Peek Dead (Gray) */
.card-flip-container.peek-dead .card-front {
  background: radial-gradient(
    circle at center,
    rgba(113, 113, 122, 0.15) 0%,
    #0c0e18 75%
  ) !important;
  border-color: rgba(113, 113, 122, 0.3) !important;
}

/* ----------------------------------------------------
   ANONYMOUS CLICKABLE PLAYERS & ACTION CONFIRMATION MODAL
---------------------------------------------------- */
.clickable-player {
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.clickable-player:hover {
  background: var(--bg-card-hover) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  transform: translateX(3px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.2),
    0 0 10px rgba(255, 255, 255, 0.02);
}

.clickable-player:active {
  transform: scale(0.98) translateX(2px);
}

/* Glassmorphic Stealth Modal */
.confirm-modal {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  max-width: 320px;
  padding: 1.25rem 1.5rem;
  z-index: 10000;
  border-radius: 16px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.5),
    var(--shadow-glass);
  animation: modal-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

@keyframes modal-slide-in {
  from {
    transform: translateY(50px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.confirm-modal.fade-out {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
}

.confirm-modal-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.confirm-modal-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
  text-align: center;
}

.confirm-modal-title strong {
  color: var(--color-accent);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.confirm-modal-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.confirm-modal-buttons .btn {
  flex: 1;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

/* ----------------------------------------------------
   ROCK PAPER SCISSORS MODAL
---------------------------------------------------- */
.rps-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  animation: rps-fade-in 0.25s ease;
}

.rps-modal.rps-fade-out {
  animation: rps-fade-out 0.3s ease forwards;
}

@keyframes rps-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rps-fade-out {
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

.rps-modal-content {
  width: min(420px, 92vw);
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  border-radius: 20px;
  animation: rps-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes rps-slide-up {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.rps-header {
  margin-bottom: 1.5rem;
}

.rps-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.4rem;
}

.rps-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.rps-vs {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.rps-vs strong {
  color: var(--color-primary);
}

/* Choice buttons */
.rps-choices {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.rps-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-light);
  border-radius: 14px;
  cursor: pointer;
  font-size: 2rem;
  color: var(--text-primary);
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
  min-width: 90px;
}

.rps-btn span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.rps-btn:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.06);
  border-color: var(--color-primary);
  background: rgba(37, 99, 235, 0.12);
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.3);
}

.rps-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.rps-btn-selected {
  border-color: var(--color-primary) !important;
  background: rgba(37, 99, 235, 0.18) !important;
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.4) !important;
  opacity: 1 !important;
}

.rps-status {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-height: 1.2rem;
  transition: color 0.2s;
}

/* Result state */
.rps-result {
  padding: 0.5rem 0;
}

.rps-result-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.rps-result-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.rps-big-emoji {
  font-size: 3rem;
  line-height: 1;
}

.rps-choice-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
}

.rps-vs-badge {
  font-family: "Outfit", sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.rps-result-text {
  font-family: "Outfit", sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.rps-result-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rps-result-win .rps-result-text {
  color: var(--color-innocent);
  text-shadow: 0 0 20px hsla(142, 70%, 50%, 0.5);
}

.rps-result-lose .rps-result-text {
  color: var(--color-murderer);
  text-shadow: 0 0 20px hsla(346, 84%, 50%, 0.5);
}
