/* ==========================================================================
   IMPOSTER GAME - HIGH-IMPACT SCI-FI CYBERPUNK DESIGN SYSTEM
   Supports 3 to 10 Players, Ultra-Vibrant Glassmorphism & Neon HUD Aesthetics
   ========================================================================== */

:root {
  /* Curated Cyberpunk Palette */
  --bg-dark: #05060a;
  --bg-card: rgba(14, 19, 36, 0.82);
  --bg-card-hover: rgba(22, 30, 56, 0.92);
  --border-glass: rgba(255, 255, 255, 0.16);
  --border-glass-glow: rgba(0, 240, 255, 0.5);

  /* Neon Accents */
  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.6);
  --neon-pink: #ff0055;
  --neon-pink-glow: rgba(255, 0, 85, 0.65);
  --neon-purple: #9d4edd;
  --neon-purple-glow: rgba(157, 78, 221, 0.55);
  --neon-gold: #ffd700;
  --neon-gold-glow: rgba(255, 215, 0, 0.6);
  --neon-green: #00ff88;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Fonts */
  --font-display: 'Orbitron', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;

  /* Easing Functions */
  --tr-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --tr-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --tr-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Root Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
}

html, body {
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  background: radial-gradient(circle at 20% 20%, #120b2e 0%, #080a1a 40%, #0d061f 75%, #04050d 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

input, button, select, textarea {
  font-size: 16px;
  touch-action: manipulation;
}

/* Atmospheric Animated Background Layer */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.65;
  animation: orbFloat 22s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.orb-blue {
  top: -12%;
  left: -12%;
  width: 65vw;
  height: 65vw;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.42) 0%, rgba(168, 85, 247, 0.28) 50%, transparent 80%);
}

.orb-pink {
  bottom: -15%;
  right: -12%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(255, 0, 85, 0.38) 0%, rgba(112, 0, 255, 0.28) 55%, transparent 80%);
  animation-delay: -11s;
}

.orb-gold {
  top: 40%;
  left: 50%;
  width: 45vw;
  height: 45vw;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, rgba(0, 240, 255, 0.12) 50%, transparent 75%);
  animation: pulseGoldOrb 12s ease-in-out infinite alternate;
}

@keyframes pulseGoldOrb {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.4; }
  100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0.75; }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(0, 240, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 90%);
  animation: gridScan 14s linear infinite;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(100px, 70px) scale(1.18); }
  100% { transform: translate(-70px, 110px) scale(0.92); }
}

@keyframes gridScan {
  0% { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

/* Confetti Layer */
.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}

/* Header Navigation Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 100;
  background: rgba(5, 6, 10, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.logo-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: transform var(--tr-fast);
}

.logo-mini:hover {
  transform: scale(1.06);
}

.logo-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 12px var(--neon-cyan-glow));
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: 4px;
  background: linear-gradient(135deg, #ffffff 0%, var(--neon-cyan) 60%, var(--neon-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 25px var(--neon-cyan-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  transition: all var(--tr-fast);
}

.icon-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 18px var(--neon-cyan-glow);
  transform: translateY(-2px);
}

/* App Main Container */
.app-container {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 100vh;
  padding-top: 90px;
  padding-bottom: 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-screen {
  width: 100%;
  max-width: 680px;
  padding: 0 1.2rem;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.game-screen.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(24px) scale(0.96);
}

/* High-Impact Glassmorphism Cards */
.glass-card {
  background: linear-gradient(145deg, rgba(18, 24, 46, 0.85) 0%, rgba(10, 14, 28, 0.94) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 32px;
  padding: 2.4rem;
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.75),
    0 0 35px rgba(0, 240, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-purple), var(--neon-pink), transparent);
}

/* Corner HUD Notches */
.glass-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 32px;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Hero Section */
.hero-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 1.2rem;
  border-radius: 30px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 3px;
  margin-bottom: 1.6rem;
  box-shadow: 0 0 20px var(--neon-cyan-glow);
}

.main-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 12vw, 6.2rem);
  font-weight: 900;
  letter-spacing: 10px;
  line-height: 1;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #ffffff 30%, var(--neon-cyan) 75%, var(--neon-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 35px var(--neon-cyan-glow));
  animation: glitchGlow 3.5s ease-in-out infinite alternate;
}

@keyframes glitchGlow {
  0% {
    filter: drop-shadow(0 0 25px rgba(0, 240, 255, 0.7));
  }
  50% {
    filter: drop-shadow(0 0 45px rgba(255, 0, 85, 0.8));
  }
  100% {
    filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.9));
  }
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-bottom: 3rem;
  max-width: 460px;
  line-height: 1.6;
}

/* Button System */
.btn {
  font-family: var(--font-body);
  font-weight: 800;
  border: none;
  border-radius: 18px;
  padding: 1.1rem 2.2rem;
  font-size: 1.08rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all var(--tr-fast);
  text-decoration: none;
  user-select: none;
  position: relative;
  z-index: 1;
}

.btn-large {
  padding: 1.25rem 2.6rem;
  font-size: 1.22rem;
  width: 100%;
  border-radius: 20px;
}

.btn-primary {
  background: linear-gradient(135deg, #00d2ff 0%, #0066ff 60%, #7000ff 100%);
  color: #fff;
  box-shadow: 0 8px 25px rgba(0, 102, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(0, 240, 255, 0.75);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-glow {
  overflow: hidden;
}

.btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 70%
  );
  transform: rotate(30deg);
  transition: all 0.7s ease;
}

.btn-glow:hover::after {
  left: 100%;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.btn-utility {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-utility:hover {
  background: var(--neon-cyan);
  color: var(--bg-dark);
  box-shadow: 0 0 25px var(--neon-cyan-glow);
}

.btn-danger-ghost {
  background: transparent;
  border: 1px solid rgba(255, 0, 85, 0.5);
  color: var(--neon-pink);
  font-size: 0.92rem;
  padding: 0.75rem 1.5rem;
  border-radius: 14px;
}

.btn-danger-ghost:hover {
  background: var(--neon-pink);
  color: #fff;
  box-shadow: 0 0 22px var(--neon-pink-glow);
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 350px;
}

/* Telemetry Stats Capsule */
.quick-stats-pill {
  margin-top: 3.5rem;
  padding: 0.75rem 1.8rem;
  border-radius: 35px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  font-size: 0.98rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.2rem;
  align-items: center;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
}

.stat-divider {
  opacity: 0.3;
}

.quick-stats-pill strong {
  color: #fff;
  font-family: var(--font-display);
}

/* Form & Setup Screen (3 - 10 Players) */
.setup-card {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.card-header {
  text-align: center;
  margin-bottom: 0.4rem;
}

.card-header h2 {
  font-family: var(--font-display);
  letter-spacing: 4px;
  font-size: 1.8rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.2rem;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* 3 to 10 Player Choice Grid */
.player-count-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.btn-choice {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.9rem 0;
  border-radius: 16px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
  transition: all var(--tr-fast);
}

.btn-choice:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.15);
  transform: translateY(-2px);
}

.btn-choice.active {
  background: linear-gradient(135deg, var(--neon-cyan), #0066ff);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 22px var(--neon-cyan-glow);
}

/* Dynamic Player Inputs Grid (For up to 10 players) */
.player-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.player-inputs-grid::-webkit-scrollbar {
  width: 6px;
}

.player-inputs-grid::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  border-radius: 3px;
}

.player-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.player-input-wrapper span {
  position: absolute;
  left: 0.9rem;
  font-size: 0.95rem;
}

.custom-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 0.8rem 0.9rem 0.8rem 3.1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.98rem;
  outline: none;
  transition: all var(--tr-fast);
}

.custom-input:focus {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 18px var(--neon-cyan-glow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.full-width {
  grid-column: 1 / -1;
}

.range-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--neon-cyan);
  height: 8px;
  border-radius: 4px;
  cursor: pointer;
}

.badge {
  background: rgba(0, 240, 255, 0.16);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 0.4rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: var(--font-display);
}

.segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  padding: 5px;
  border-radius: 16px;
  border: 1px solid var(--border-glass);
}

.segmented-control input[type="radio"] {
  display: none;
}

.segmented-control label {
  flex: 1;
  text-align: center;
  padding: 0.7rem 0.6rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--tr-fast);
}

.segmented-control input[type="radio"]:checked + label {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.custom-select {
  width: 100%;
  background: rgba(14, 19, 36, 0.95);
  border: 1px solid var(--neon-pink);
  border-radius: 14px;
  padding: 0.85rem;
  color: #fff;
  font-size: 0.98rem;
  outline: none;
}

.text-warning {
  color: var(--neon-pink) !important;
}

.form-actions {
  display: flex;
  gap: 1.1rem;
  margin-top: 1rem;
}

/* Secret Reveal Screen & 3D Card Flip */
.reveal-container {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  align-items: center;
  width: 100%;
}

.reveal-progress {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
  color: var(--text-muted);
}

.progress-bar-track {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  border-radius: 5px;
  transition: width 0.45s ease;
  box-shadow: 0 0 12px var(--neon-cyan-glow);
}

/* 3D Flip Card Container */
.flip-card-wrapper {
  width: 100%;
  perspective: 1400px;
}

.flip-card {
  position: relative;
  width: 100%;
  min-height: 520px;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  padding: 2.2rem 1.8rem;
  border-radius: 36px;
  overflow: hidden;
}

.card-front {
  z-index: 2;
}

.card-back {
  transform: rotateY(180deg);
}

.card-security-badge {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 4px;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid var(--neon-cyan);
  padding: 0.45rem 1.2rem;
  border-radius: 16px;
  margin-bottom: 1.4rem;
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.player-turn-name {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 900;
  margin-bottom: 1.8rem;
  background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 25px rgba(165, 180, 252, 0.5);
}

.secret-shield-icon {
  font-size: 4.2rem;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 30px var(--neon-cyan-glow));
  animation: floatShield 3s ease-in-out infinite alternate;
}

@keyframes floatShield {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-12px) scale(1.06); }
}

.card-hint {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2.4rem;
  max-width: 360px;
}

/* Role Badges */
.role-badge {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 5px;
  padding: 0.55rem 2rem;
  border-radius: 18px;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.crew-role {
  background: rgba(0, 240, 255, 0.18);
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 35px var(--neon-cyan-glow);
}

.imposter-role {
  background: rgba(255, 0, 85, 0.2);
  border: 2px solid var(--neon-pink);
  color: var(--neon-pink);
  box-shadow: 0 0 40px var(--neon-pink-glow);
  animation: pulsePink 1.5s ease-in-out infinite alternate;
}

@keyframes pulsePink {
  0% { box-shadow: 0 0 20px var(--neon-pink-glow); }
  100% { box-shadow: 0 0 50px var(--neon-pink-glow); }
}

/* Word Hologram Box */
.word-box {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(157, 78, 221, 0.16));
  border: 2px dashed var(--neon-cyan);
  border-radius: 24px;
  padding: 1.2rem 1.6rem;
  margin-bottom: 1.2rem;
  width: 100%;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

.word-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 3px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
}

.word-image-icon {
  font-size: 3.2rem;
  margin: 0.2rem 0;
  filter: drop-shadow(0 0 20px var(--neon-cyan-glow));
  animation: pulseWordIcon 2.5s ease-in-out infinite alternate;
}

@keyframes pulseWordIcon {
  0% { transform: scale(1); filter: drop-shadow(0 0 15px var(--neon-cyan-glow)); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 30px var(--neon-cyan-glow)); }
}

.word-text {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 30px var(--neon-cyan-glow);
}

.word-category-tag {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.9rem;
  border-radius: 20px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
}

.imposter-box {
  background: rgba(255, 0, 85, 0.12);
  border: 1px solid rgba(255, 0, 85, 0.45);
  border-radius: 22px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  width: 100%;
  box-shadow: 0 0 25px rgba(255, 0, 85, 0.25);
}

.imposter-warning {
  font-family: var(--font-display);
  color: var(--neon-pink);
  font-size: 1rem;
  letter-spacing: 2px;
  font-weight: 900;
  display: block;
  margin-bottom: 0.6rem;
}

.imposter-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  gap: 1.1rem;
  width: 100%;
  margin-top: auto;
}

.card-actions .btn {
  flex: 1;
}

/* Discussion Phase */
.discussion-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.8rem;
}

.phase-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 3px;
  margin-top: 0.5rem;
}

.phase-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 24px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.red-pulse {
  background: rgba(255, 0, 85, 0.2);
  border: 1px solid var(--neon-pink);
  color: var(--neon-pink);
  animation: pulseRedPill 1.5s infinite;
}

.pink-pulse {
  background: rgba(255, 0, 85, 0.2);
  border: 1px solid var(--neon-pink);
  color: var(--neon-pink);
}

@keyframes pulseRedPill {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Dual Ring Timer Widget */
.timer-display-container {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.7rem 0;
}

.timer-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 12;
}

.timer-ring-fill {
  fill: none;
  stroke: var(--neon-cyan);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 553;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
  filter: drop-shadow(0 0 15px var(--neon-cyan-glow));
}

.timer-text-content {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-clock {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
}

.timer-clock.warning-state {
  color: var(--neon-pink);
  text-shadow: 0 0 30px var(--neon-pink-glow);
  animation: timerWarning 0.5s ease-in-out infinite alternate;
}

@keyframes timerWarning {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.timer-sub {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 4px;
  color: var(--text-muted);
}

.active-players-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.summary-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.players-chips-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.player-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  padding: 0.55rem 1.1rem;
  border-radius: 26px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.55rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.player-chip.eliminated {
  opacity: 0.4;
  text-decoration: line-through;
  border-color: rgba(255, 0, 85, 0.35);
}

.timer-controls {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.timer-controls .btn {
  flex: 1;
}

/* Voting Phase (Scales cleanly for up to 10 players) */
.voting-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.voter-turn-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.9rem 1.5rem;
  border-radius: 18px;
  border: 1px solid var(--border-glass);
  font-size: 1.05rem;
}

.voter-turn-bar strong {
  color: var(--neon-cyan);
  font-family: var(--font-display);
}

.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.candidates-grid::-webkit-scrollbar {
  width: 6px;
}

.candidates-grid::-webkit-scrollbar-thumb {
  background: var(--neon-pink);
  border-radius: 3px;
}

.candidate-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.4rem 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--tr-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  user-select: none;
}

.candidate-card:hover:not(.disabled) {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.12);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px var(--neon-cyan-glow);
}

.candidate-card.selected {
  border-color: var(--neon-pink);
  background: rgba(255, 0, 85, 0.22);
  box-shadow: 0 0 30px var(--neon-pink-glow);
  transform: scale(1.05);
}

.candidate-card.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.85);
}

.candidate-avatar {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
}

.candidate-name {
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
}

.candidate-self-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.voting-footer {
  margin-top: 0.6rem;
}

/* Vote Tally Screen */
.tally-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.tally-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  text-align: left;
  max-height: 360px;
  overflow-y: auto;
}

.tally-item {
  background: rgba(0, 0, 0, 0.45);
  border-radius: 16px;
  padding: 1.1rem 1.5rem;
  border: 1px solid var(--border-glass);
}

.tally-header {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 0.65rem;
}

.tally-progress-track {
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  overflow: hidden;
}

.tally-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-gold));
  border-radius: 7px;
  width: 0%;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 15px var(--neon-pink-glow);
}

/* Result / Winner Screen (Ultra-Celebratory High-Impact) */
.result-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
  position: relative;
}

.victory-aura-bg {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 280px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
  transition: background 0.5s ease;
}

.crew-aura {
  background: radial-gradient(circle, var(--neon-cyan) 0%, var(--neon-purple) 60%, transparent 100%);
}

.imp-aura {
  background: radial-gradient(circle, var(--neon-pink) 0%, #7000ff 60%, transparent 100%);
}

.outcome-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.victory-header-badge {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 4px;
  padding: 0.45rem 1.3rem;
  border-radius: 30px;
  margin-bottom: 1.4rem;
}

.crew-header-tag {
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 22px var(--neon-cyan-glow);
}

.imp-header-tag {
  background: rgba(255, 0, 85, 0.18);
  border: 1px solid var(--neon-pink);
  color: var(--neon-pink);
  box-shadow: 0 0 28px var(--neon-pink-glow);
}

.result-badge-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.result-badge {
  font-size: 5.8rem;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 35px var(--neon-gold-glow));
  animation: bounceWinner 2.2s ease-in-out infinite;
}

.halo-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  animation: rotateHalo 12s linear infinite;
}

@keyframes rotateHalo {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes bounceWinner {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-16px) scale(1.08); }
}

.result-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 6px;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

.win-crew {
  background: linear-gradient(180deg, #ffffff 20%, var(--neon-cyan) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 35px var(--neon-cyan-glow));
}

.win-imp {
  background: linear-gradient(180deg, #ffffff 20%, var(--neon-pink) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 40px var(--neon-pink-glow));
}

.result-sub {
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-bottom: 1.8rem;
  max-width: 480px;
}

.result-details {
  background: linear-gradient(145deg, rgba(10, 14, 28, 0.9) 0%, rgba(18, 24, 48, 0.8) 100%);
  border: 1px solid var(--border-glass);
  border-radius: 26px;
  padding: 1.8rem 2.2rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.elimination-summary-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.summary-label-tag {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-transform: uppercase;
}

#result-eliminated-text {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 700;
  line-height: 1.5;
}

.revealed-word-card {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(157, 78, 221, 0.15));
  border: 2px dashed var(--neon-cyan);
  border-radius: 20px;
  padding: 1.2rem 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.18);
}

.word-card-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 3px;
  color: var(--text-muted);
}

.word-card-content {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.final-word-emoji {
  font-size: 2.8rem;
  filter: drop-shadow(0 0 15px var(--neon-cyan-glow));
  animation: pulseWordIcon 2.5s ease-in-out infinite alternate;
}

.final-word-name {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #fff;
  text-shadow: 0 0 25px var(--neon-cyan-glow);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
  display: none !important;
  opacity: 0;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1.2rem;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 2px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
  transition: color var(--tr-fast);
}

.modal-close:hover {
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.stat-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.5rem 0.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 0.3rem;
}

.crew-stat .stat-num { color: var(--neon-cyan); }
.imp-stat .stat-num { color: var(--neon-pink); }
.total-stat .stat-num { color: var(--neon-gold); }

.stat-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-actions-center {
  text-align: center;
}

.rules-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rule-step {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
}

.step-num {
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-display);
  font-weight: 900;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.rule-step h4 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 0.35rem;
}

.rule-step p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Developer Contact Modal Typography & Card Styling */
.dev-modal-content {
  max-width: 500px;
}

#modal-contact-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 2px;
  background: linear-gradient(90deg, #ffffff 30%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px var(--neon-cyan-glow));
}

.dev-contact-body {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.dev-profile-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0.4rem;
}

.dev-avatar-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.15);
  border: 2px solid var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  box-shadow: 0 0 25px var(--neon-cyan-glow);
  overflow: hidden;
  padding: 2px;
}

.dev-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.dev-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #ffffff 40%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 15px var(--neon-cyan-glow));
}

.dev-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.contact-links-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contact-card-link {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 1rem 1.3rem;
  text-decoration: none;
  color: var(--text-main);
  transition: all var(--tr-fast);
}

.contact-card-link:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--neon-cyan-glow);
}

.instagram-link:hover {
  background: rgba(255, 0, 85, 0.14);
  border-color: var(--neon-pink);
  box-shadow: 0 8px 24px var(--neon-pink-glow);
}

.linkedin-link:hover {
  background: rgba(0, 114, 255, 0.14);
  border-color: #0072ff;
  box-shadow: 0 8px 24px rgba(0, 114, 255, 0.5);
}

.email-link:hover {
  background: rgba(255, 183, 0, 0.14);
  border-color: var(--neon-amber);
  box-shadow: 0 8px 24px rgba(255, 183, 0, 0.5);
}

.link-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.link-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.link-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.link-url {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.3px;
  word-break: break-all;
}

.link-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform var(--tr-fast);
}

.contact-card-link:hover .link-arrow {
  transform: translateX(5px);
  color: #fff;
}

.dev-thank-you-note {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--border-glass);
  border-radius: 14px;
  padding: 1rem;
  text-align: center;
}

.dev-thank-you-note p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Utilities */
.hidden {
  display: none !important;
}

.btn-text-mobile {
  display: none;
}

/* Tablet & Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  .top-bar {
    padding: 0.75rem 1.2rem;
  }

  .app-container {
    padding: 5rem 0.8rem 1.5rem 0.8rem;
  }

  .glass-card {
    padding: 1.8rem 1.4rem;
    border-radius: 24px;
  }

  .main-title {
    font-size: clamp(2.6rem, 9vw, 3.8rem);
    letter-spacing: 3px;
  }

  .player-count-selector {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
  }

  .candidates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .timer-ring-svg {
    width: 180px;
    height: 180px;
  }

  .timer-clock {
    font-size: 3rem;
  }
}

/* Phones & Small Screens (<= 540px) */
@media (max-width: 540px) {
  .top-bar {
    padding: 0.4rem 0.5rem;
    height: 58px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .logo-mini {
    gap: 0.3rem;
  }

  .logo-icon {
    font-size: 1.2rem;
  }

  .logo-text {
    font-size: 0.9rem;
    letter-spacing: 1.2px;
  }

  .header-actions {
    gap: 0.2rem;
  }

  .icon-btn {
    padding: 0.35rem 0.45rem;
    font-size: 0.72rem;
    border-radius: 8px;
    gap: 0.25rem;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .app-container {
    padding: 4.5rem 0.4rem 1.2rem 0.4rem;
    align-items: center;
    overflow-x: hidden;
  }

  .glass-card {
    padding: 1.25rem 0.85rem;
    border-radius: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .hero-content {
    gap: 1rem;
  }

  .main-title {
    font-size: clamp(2.1rem, 10vw, 3.2rem);
    letter-spacing: 2px;
  }

  .subtitle {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .menu-actions {
    width: 100%;
    flex-direction: column;
    gap: 0.7rem;
  }

  .menu-actions .btn {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
  }

  /* Setup Screen Mobile */
  .player-count-selector {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
  }

  .btn-choice {
    padding: 0.55rem 0.3rem;
    font-size: 0.95rem;
    border-radius: 10px;
  }

  .player-inputs-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    max-height: 200px;
    padding-right: 0.2rem;
  }

  .player-input-card {
    padding: 0.45rem 0.7rem;
    border-radius: 12px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .range-wrapper {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
  }

  /* Reveal Screen Mobile */
  .flip-card {
    min-height: 460px;
  }

  .card-face {
    padding: 1.2rem 0.9rem;
    border-radius: 20px;
  }

  .player-turn-name {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
  }

  .secret-shield-icon {
    font-size: 3rem;
    margin-bottom: 0.8rem;
  }

  .role-badge {
    font-size: 1.15rem;
    letter-spacing: 2px;
    padding: 0.4rem 1rem;
    margin-bottom: 0.7rem;
  }

  .word-box {
    padding: 0.8rem 0.7rem;
    border-radius: 16px;
    margin-bottom: 0.8rem;
  }

  .word-image-icon {
    font-size: 2.4rem;
  }

  .word-text {
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    word-break: break-word;
  }

  .word-category-tag {
    font-size: 0.68rem;
    padding: 0.2rem 0.6rem;
  }

  .card-actions {
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
  }

  .card-actions .btn {
    width: 100%;
    padding: 0.8rem 0.9rem;
    font-size: 0.9rem;
  }

  /* Responsive Button Text on Mobile */
  .btn-text-full {
    display: none !important;
  }
  .btn-text-mobile {
    display: inline !important;
  }

  /* Discussion Screen Mobile */
  .timer-ring-svg {
    width: 145px;
    height: 145px;
  }

  .timer-clock {
    font-size: 2.3rem;
  }

  .timer-sub {
    font-size: 0.68rem;
    letter-spacing: 2px;
  }

  .timer-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    width: 100%;
    box-sizing: border-box;
  }

  .timer-controls .btn {
    flex: 1 1 0px;
    min-width: 0;
    padding: 0.65rem 0.3rem;
    font-size: 0.82rem;
    white-space: nowrap;
    text-align: center;
    border-radius: 12px;
  }

  .players-chips-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    max-height: 140px;
    overflow-y: auto;
  }

  .player-chip {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  /* Voting Screen Mobile */
  .candidates-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    max-height: 270px;
    padding: 0.2rem 0.4rem 0.2rem 0.2rem;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .candidate-card {
    padding: 0.6rem 0.4rem;
    border-radius: 14px;
  }

  .candidate-card.selected {
    transform: scale(1.02);
  }

  .candidate-avatar {
    font-size: 1.8rem;
  }

  .candidate-name {
    font-size: 0.82rem;
  }

  /* Result Screen Mobile */
  .result-card {
    gap: 1.1rem;
    padding: 1.2rem 0.95rem;
  }

  .victory-aura-bg {
    height: 160px;
    top: -10%;
  }

  .result-badge {
    font-size: 3.8rem;
  }

  .halo-ring {
    width: 80px;
    height: 80px;
  }

  .result-title {
    font-size: clamp(1.8rem, 7.5vw, 2.7rem);
    letter-spacing: 2px;
  }

  .result-sub {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    line-height: 1.35;
  }

  .result-details {
    padding: 0.95rem 0.85rem;
    gap: 0.75rem;
    border-radius: 16px;
  }

  .revealed-word-card {
    padding: 0.75rem 0.8rem;
  }

  .final-word-emoji {
    font-size: 2rem;
  }

  .final-word-name {
    font-size: 1.4rem;
    letter-spacing: 1.5px;
    word-break: break-word;
  }

  .result-actions {
    width: 100%;
    max-width: 100%;
    gap: 0.6rem;
  }

  .result-actions .btn {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
  }

  /* Modals Mobile */
  .modal-overlay {
    padding: 0.4rem;
  }

  .modal-content {
    max-height: 86dvh;
    padding: 1.1rem 0.85rem;
    border-radius: 18px;
    overflow-x: hidden;
  }

  .dev-modal-content {
    width: 95%;
    max-width: 440px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }

  .stat-card {
    padding: 0.7rem 0.25rem;
  }

  .stat-num {
    font-size: 1.35rem;
  }

  .contact-card-link {
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }

  .link-icon {
    font-size: 1.25rem;
  }

  .link-url {
    font-size: 0.78rem;
  }
}

/* Extra Small Phones (<= 380px) */
@media (max-width: 380px) {
  .top-bar {
    padding: 0.35rem 0.35rem;
  }

  .logo-text {
    font-size: 0.8rem;
    letter-spacing: 0.5px;
  }

  .icon-btn {
    padding: 0.3rem 0.35rem;
    font-size: 0.68rem;
  }

  .btn-label {
    font-size: 0.68rem;
  }

  .main-title {
    font-size: 1.9rem;
  }

  .player-turn-name {
    font-size: 1.6rem;
  }

  .word-text {
    font-size: 1.3rem;
  }

  .candidates-grid {
    grid-template-columns: 1fr;
  }

  .timer-controls .btn {
    padding: 0.55rem 0.2rem;
    font-size: 0.75rem;
  }
}
