/* ==========================================================================
   BLUEBIRD CLICKER — MASTER STYLESHEET (100% Fluid Units, Mobile, Tablet, PC)
   Titanium & Saphir UI Architecture — Zero Hardcoded PX, Pure Fluid Scaling (vh, dvh, vw, dvw, vmin, clamp, rem, %)
   ========================================================================== */

:root {
  /* --- Palette Chromatique & Design Tokens --- */
  --bg-primary: #050811;
  --bg-secondary: #090e1a;
  --bg-tertiary: #0e1526;
  --surface-card: rgba(14, 21, 38, 0.82);
  --surface-card-hover: rgba(20, 30, 54, 0.95);
  --surface-card-active: rgba(26, 38, 68, 0.98);
  --surface-border: rgba(255, 255, 255, 0.09);
  --surface-border-subtle: rgba(56, 189, 248, 0.16);
  --surface-border-hover: rgba(56, 189, 248, 0.5);

  /* Accents Néon, Saphir & Cyan */
  --accent-blue: #0284c7;
  --accent-cyan: #38bdf8;
  --accent-deep: #0369a1;
  --accent-glow: rgba(56, 189, 248, 0.35);

  /* Or Mythique & Améthyste Céleste */
  --gold-primary: #f59e0b;
  --gold-light: #fbbf24;
  --gold-glow: rgba(245, 158, 11, 0.45);
  --cosmic-purple: #c084fc;
  --cosmic-glow: rgba(192, 132, 252, 0.45);

  /* Nuances de Texte & Typographie (Contraste AAA) */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Rôles Sémantiques */
  --discord-brand: #5865f2;
  --discord-hover: #4752c4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);

  /* Polices Google Fonts */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Courbes d'Animation */
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  /* Espacements Fluides */
  --space-3xs: clamp(0.15rem, 0.4vw, 0.25rem);
  --space-2xs: clamp(0.25rem, 0.6vw, 0.4rem);
  --space-xs: clamp(0.4rem, 0.9vw, 0.6rem);
  --space-sm: clamp(0.6rem, 1.4vw, 0.85rem);
  --space-md: clamp(0.85rem, 2vw, 1.25rem);
  --space-lg: clamp(1.2rem, 2.8vw, 1.85rem);
  --space-xl: clamp(1.6rem, 3.8vw, 2.5rem);

  /* Rayons de Courbure Fluides */
  --radius-xs: clamp(0.35rem, 0.8vw, 0.45rem);
  --radius-sm: clamp(0.5rem, 1.1vw, 0.65rem);
  --radius-md: clamp(0.75rem, 1.6vw, 0.95rem);
  --radius-lg: clamp(1rem, 2.2vw, 1.35rem);
  --radius-pill: 9999px;
}

/* ==========================================================================
   RESET GLOBAL & PRÉVENTION DU ZOOM INTEMPESTIF MOBILE
   ========================================================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  width: 100%;
  min-height: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  display: flex;
  flex-direction: column;
  background: 
    radial-gradient(circle at 35% 35%, rgba(2, 132, 199, 0.16) 0%, transparent 60%),
    radial-gradient(circle at 80% 15%, rgba(56, 189, 248, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(3, 105, 161, 0.13) 0%, transparent 55%),
    linear-gradient(180deg, #03060c 0%, #080d18 100%);
  transition: background 0.4s ease;
}

/* Verrouillage du scroll arrière-plan quand une modale est ouverte */
body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* Thème Tempête de Plumes Dorées (Frenzy Mode) */
body.frenzy-active {
  background: 
    radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.22) 0%, transparent 65%),
    radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.14) 0%, transparent 50%),
    linear-gradient(180deg, #0d0a04 0%, #1c1405 100%);
}

/* Trame Cyber / Grain Subtil */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 0.0625rem, transparent 0);
  background-size: clamp(1.25rem, 2.5vw, 1.85rem) clamp(1.25rem, 2.5vw, 1.85rem);
  pointer-events: none;
  z-index: 1;
}

/* Scrollbar Fluide & Élégante Saphir */
::-webkit-scrollbar {
  width: clamp(0.35rem, 0.8vw, 0.5rem);
  height: clamp(0.35rem, 0.8vw, 0.5rem);
}
::-webkit-scrollbar-track {
  background: rgba(4, 6, 11, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-xs);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.65);
}

/* Canvas des Particules */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 5;
}

/* Supernova Flash Overlay */
.supernova-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, #ffffff 0%, rgba(56, 189, 248, 0.95) 30%, rgba(192, 132, 252, 0.85) 70%, transparent 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.8s var(--ease-smooth);
}
.supernova-overlay.flash {
  opacity: 1;
}

/* ==========================================================================
   ICÔNES SVG & UTILITAIRES DE TEXTE
   ========================================================================== */

.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.text-cyan { color: var(--accent-cyan); stroke: var(--accent-cyan); }
.text-gold { color: var(--gold-light); stroke: var(--gold-light); }
.text-purple { color: var(--cosmic-purple); stroke: var(--cosmic-purple); }
.text-danger { color: #f87171; stroke: #f87171; }
.text-accent { color: var(--accent-cyan); }
.text-green { color: var(--success); }

/* ==========================================================================
   NOTIFICATIONS TOAST (Succès, Quêtes, Alertes)
   ========================================================================== */

.achievement-toast-container {
  position: fixed;
  bottom: clamp(0.75rem, 3vh, 2rem);
  right: clamp(0.5rem, 2.5vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  z-index: 2000000 !important;
  pointer-events: none;
  max-width: min(90vw, 22rem);
}

.achievement-toast {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: rgba(11, 16, 29, 0.98);
  border: 0.0625rem solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-sm);
  padding: clamp(0.42rem, 1.1vh, 0.6rem) clamp(0.65rem, 1.6vw, 0.9rem);
  box-shadow: 
    0 0.5rem 1.5rem rgba(0, 0, 0, 0.7),
    0 0 1rem rgba(245, 158, 11, 0.2);
  color: #fff;
  pointer-events: auto;
  animation: slideInToast 0.3s var(--ease-smooth);
  max-width: 100%;
}

.achievement-toast.dismiss {
  animation: slideOutToast 0.28s var(--ease-smooth) forwards;
}

@keyframes slideInToast {
  from { transform: translateX(100%) scale(0.92); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes slideOutToast {
  to { transform: translateX(110%) scale(0.92); opacity: 0; }
}

.toast-icon {
  width: clamp(1.75rem, 4.5vw, 2.1rem);
  height: clamp(1.75rem, 4.5vw, 2.1rem);
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.08));
  border: 0.0625rem solid rgba(245, 158, 11, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.toast-title {
  font-size: clamp(0.76rem, 1.7vw, 0.85rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-reward {
  font-size: clamp(0.65rem, 1.4vw, 0.72rem);
  color: var(--text-muted);
  line-height: 1.3;
  word-break: break-word;
}

/* ==========================================================================
   PLUME DORÉE VOLANTE (Frenzy Trigger)
   ========================================================================== */

.golden-feather-entity {
  position: fixed;
  z-index: 80;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 0 1.25rem rgba(255, 215, 0, 0.85));
  animation: floatFeather 3s infinite ease-in-out;
  transition: transform 0.2s ease, opacity 0.3s ease;
  touch-action: manipulation;
}

.golden-feather-entity.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.golden-feather-entity:hover {
  transform: scale(1.22) rotate(12deg);
}

.golden-feather-entity:active {
  transform: scale(0.95) rotate(-6deg);
}

.feather-glow {
  position: absolute;
  inset: -0.65rem;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.55) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(0.6rem);
  animation: pulseGold 1.5s infinite alternate;
}

@keyframes pulseGold {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.25); opacity: 1; }
}

@keyframes floatFeather {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-0.75rem) rotate(8deg); }
}

.feather-tag {
  font-family: var(--font-mono);
  font-size: clamp(0.62rem, 1.6vw, 0.7rem);
  font-weight: 800;
  color: #fff;
  background: rgba(217, 119, 6, 0.92);
  border: 0.0625rem solid var(--gold-light);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   MAINTENANCE GATE & OVERLAY (Verrouillage Administrateur)
   ========================================================================== */

.maintenance-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(circle at 50% 35%, rgba(217, 119, 6, 0.18) 0%, rgba(2, 6, 23, 0.98) 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2rem);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s var(--ease-smooth), visibility 0.4s var(--ease-smooth), transform 0.4s var(--ease-smooth);
}

.maintenance-gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.03);
}

.maintenance-card {
  width: 100%;
  max-width: min(92vw, 32rem);
  background: rgba(11, 17, 32, 0.96);
  border: 0.0625rem solid rgba(245, 158, 11, 0.45);
  box-shadow: 
    0 1.5rem 5rem rgba(0, 0, 0, 0.9),
    0 0 3rem rgba(245, 158, 11, 0.2),
    inset 0 0 1.5rem rgba(245, 158, 11, 0.05);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4.5vw, 2.5rem) clamp(1.2rem, 3.5vw, 2.2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.maintenance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #38bdf8, #f59e0b);
  background-size: 200% 100%;
  animation: shimmerBorder 3s infinite linear;
}

@keyframes shimmerBorder {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.maintenance-icon-wrapper {
  position: relative;
  width: clamp(6rem, 16vw, 7.5rem);
  height: clamp(6rem, 16vw, 7.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.maintenance-aura {
  position: absolute;
  inset: -0.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, rgba(56, 189, 248, 0.15) 50%, transparent 70%);
  filter: blur(1rem);
  animation: pulseMaintenanceAura 3s infinite ease-in-out;
}

@keyframes pulseMaintenanceAura {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
}

.maintenance-gear-rotator {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.gear-svg {
  position: absolute;
  filter: drop-shadow(0 0 0.75rem rgba(245, 158, 11, 0.5));
}

.gear-primary {
  color: #f59e0b;
  animation: spinSlow 9s infinite linear;
}

.gear-secondary {
  color: #38bdf8;
  top: 0.3rem;
  right: 0.4rem;
  filter: drop-shadow(0 0 0.75rem rgba(56, 189, 248, 0.5));
  animation: spinReverse 6s infinite linear;
}

.maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(245, 158, 11, 0.15);
  border: 0.0625rem solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.8vw, 0.75rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-xs);
}

.maintenance-badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0.5rem #f59e0b;
  animation: blinkDot 1.4s infinite ease-in-out;
}

@keyframes blinkDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.maintenance-title {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: var(--space-xs);
}

.maintenance-title span {
  color: #fbbf24;
  text-shadow: 0 0 1rem rgba(245, 158, 11, 0.4);
}

.maintenance-message-box {
  background: rgba(6, 10, 20, 0.85);
  border: 0.0625rem solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: clamp(0.75rem, 2vw, 1rem) clamp(0.85rem, 2.5vw, 1.25rem);
  margin: var(--space-xs) 0 var(--space-sm);
  width: 100%;
  box-shadow: inset 0 0 1rem rgba(0, 0, 0, 0.5);
}

.maintenance-message-text {
  font-size: clamp(0.82rem, 2vw, 0.92rem);
  line-height: 1.6;
  color: #f1f5f9;
  font-weight: 500;
}

.maintenance-subhint {
  font-size: clamp(0.72rem, 1.8vw, 0.8rem);
  line-height: 1.5;
  color: #94a3b8;
  margin-bottom: var(--space-sm);
}

.btn-maintenance-login {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 1.5rem rgba(245, 158, 11, 0.35);
  margin-bottom: var(--space-xs);
}

.btn-maintenance-login:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 0 2rem rgba(245, 158, 11, 0.6);
  transform: translateY(-0.125rem);
}

.maintenance-server-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: clamp(0.65rem, 1.6vw, 0.72rem);
  color: #64748b;
  margin-top: var(--space-xs);
}

.status-warning {
  background: #f59e0b;
  box-shadow: 0 0 0.4rem #f59e0b;
}

/* ==========================================================================
   LOGIN GATE DISCORD (Écran de Connexion Obligatoire)
   ========================================================================== */

.login-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: radial-gradient(circle at 50% 40%, rgba(2, 132, 199, 0.22) 0%, rgba(5, 8, 14, 0.98) 75%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2rem);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s var(--ease-smooth), visibility 0.4s var(--ease-smooth), transform 0.4s var(--ease-smooth);
}

.login-gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.03);
}

.login-card {
  width: 100%;
  max-width: min(92vw, 27.5rem);
  background: rgba(13, 19, 33, 0.94);
  border: 0.0625rem solid rgba(56, 189, 248, 0.35);
  box-shadow: 
    0 1.5rem 4.5rem rgba(0, 0, 0, 0.85),
    0 0 2.5rem rgba(2, 132, 199, 0.2);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 4vw, 2.25rem) clamp(1rem, 3vw, 1.85rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-bird-preview {
  position: relative;
  width: clamp(5.5rem, 16vw, 7.5rem);
  height: clamp(5.5rem, 16vw, 7.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.login-aura {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45) 0%, transparent 70%);
  filter: blur(0.9rem);
  animation: pulseLoginAura 3s infinite ease-in-out;
}

@keyframes pulseLoginAura {
  0%, 100% { transform: scale(0.9); opacity: 0.65; }
  50% { transform: scale(1.18); opacity: 1; }
}

.login-bird-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.5rem 1.25rem rgba(2, 132, 199, 0.6));
  z-index: 2;
}

.login-title {
  font-size: clamp(1.25rem, 3.8vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.25rem;
}
.login-title span { color: var(--accent-cyan); }

.login-subtitle {
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.login-desc {
  font-size: clamp(0.8rem, 2vw, 0.86rem);
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.btn-discord-login-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  min-height: clamp(2.85rem, 6vh, 3.2rem);
  padding: 0.75rem 1.25rem;
  background: var(--discord-brand);
  color: #fff;
  text-decoration: none;
  font-size: clamp(0.88rem, 2.5vw, 0.96rem);
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: 
    0 0.5rem 1.5rem rgba(88, 101, 242, 0.4),
    inset 0 0.0625rem 0.0625rem rgba(255, 255, 255, 0.25);
  transition: all 0.2s var(--ease-smooth);
  touch-action: manipulation;
}

.btn-discord-login-large:hover {
  background: var(--discord-hover);
  transform: translateY(-0.1rem);
  box-shadow: 
    0 0.75rem 2rem rgba(88, 101, 242, 0.55),
    inset 0 0.0625rem 0.0625rem rgba(255, 255, 255, 0.35);
}

.login-server-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: var(--space-sm);
  font-size: clamp(0.68rem, 1.8vw, 0.75rem);
  color: var(--text-dim);
}

/* ==========================================================================
   STRUCTURE GLOBALE DE L'APPLICATION
   ========================================================================== */

#app-wrapper {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  overflow-x: hidden;
}

/* ==========================================================================
   HEADER SUPÉRIEUR FLUIDE & ADAPTATIF
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  padding: clamp(0.45rem, 1.2vh, 0.75rem) clamp(0.65rem, 2.5vw, 1.75rem);
  background: rgba(9, 14, 25, 0.98);
  border-bottom: 0.0625rem solid var(--surface-border-subtle);
  max-width: 100vw;
  overflow-x: hidden;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: clamp(0.45rem, 1vw, 0.75rem);
  flex-shrink: 0;
}

.brand-mini-logo {
  width: clamp(2rem, 4.5vw, 2.5rem);
  height: clamp(2rem, 4.5vw, 2.5rem);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(56, 189, 248, 0.08));
  border: 0.0625rem solid rgba(56, 189, 248, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0.25rem 0.75rem rgba(2, 132, 199, 0.25);
}

.brand-mini-logo img {
  width: 75%;
  height: 75%;
  object-fit: contain;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: clamp(0.86rem, 2vw, 1.12rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-title span { color: var(--accent-cyan); }

.brand-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.brand-discord-link {
  color: #5865f2;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.brand-discord-link:hover {
  color: #7983f5;
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(88, 101, 242, 0.6);
  transform: translateX(1px);
}

.status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0.5rem var(--success);
  animation: pulseStatus 2s infinite ease-in-out;
}

@keyframes pulseStatus {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 0.7vw, 0.55rem);
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

/* Boutons Pilules & Raccourcis du Header */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: clamp(0.35rem, 0.8vh, 0.45rem) clamp(0.5rem, 1vw, 0.8rem);
  border-radius: var(--radius-sm);
  font-size: clamp(0.72rem, 1.6vw, 0.78rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  border: 0.0625rem solid var(--surface-border);
  text-decoration: none;
  background: var(--surface-card);
  color: var(--text-main);
  line-height: 1;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn-pill:hover {
  background: var(--surface-card-hover);
  border-color: var(--surface-border-hover);
  color: #fff;
  transform: translateY(-0.0625rem);
}

.btn-pill:active {
  transform: translateY(0.0625rem);
}

.btn-skin-glow {
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(56, 189, 248, 0.06));
}
.btn-skin-glow:hover {
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.28), rgba(56, 189, 248, 0.15));
}

.btn-achieve-glow {
  border-color: rgba(245, 158, 11, 0.28);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(217, 119, 6, 0.05));
  color: var(--gold-light);
}
.btn-achieve-glow:hover {
  border-color: var(--gold-light);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.12));
}

.btn-action-glow {
  border-color: rgba(56, 189, 248, 0.25);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(2, 132, 199, 0.05));
  color: var(--accent-cyan);
  position: relative;
}

.btn-prestige-glow {
  border-color: rgba(192, 132, 252, 0.3);
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.14), rgba(99, 102, 241, 0.06));
  color: var(--cosmic-purple);
}
.btn-prestige-glow:hover {
  border-color: var(--cosmic-purple);
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.25), rgba(99, 102, 241, 0.14));
}

.badge-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0.5rem var(--danger);
  animation: pulseDot 1.2s infinite;
}
.badge-dot.hidden { display: none; }

@keyframes pulseDot {
  0%, 100% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.6; }
}

.btn-icon {
  width: clamp(2rem, 4.5vw, 2.3rem);
  height: clamp(2rem, 4.5vw, 2.3rem);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  touch-action: manipulation;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  border-color: var(--surface-border-hover);
  color: var(--accent-cyan);
  transform: translateY(-0.0625rem);
}

.btn-discord {
  background: var(--discord-brand);
  color: #fff;
  border: none;
  box-shadow: 0 0.25rem 0.85rem rgba(88, 101, 242, 0.35);
}
.btn-discord:hover {
  background: var(--discord-hover);
  box-shadow: 0 0.4rem 1.2rem rgba(88, 101, 242, 0.5);
}

.btn-admin-badge {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.08));
  border: 0.0625rem solid rgba(245, 158, 11, 0.4);
  color: var(--gold-light);
}

/* User Card in Header */
.user-card {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.6rem 0.25rem 0.35rem;
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border-subtle);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.user-avatar {
  width: clamp(1.45rem, 3.5vw, 1.75rem);
  height: clamp(1.45rem, 3.5vw, 1.75rem);
  border-radius: 50%;
  object-fit: cover;
  border: 0.1rem solid var(--accent-cyan);
}

.user-name {
  font-size: clamp(0.72rem, 1.8vw, 0.8rem);
  font-weight: 700;
  color: #fff;
  max-width: clamp(4.5rem, 12vw, 7rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   BANNIÈRES BROADCAST & FRENZY MODE
   ========================================================================= */

/* ==========================================================================
   BANNIÈRE BROADCAST OFFICIELLE ULTRA-VISIBLE & THÈMES NÉON
   ========================================================================= */

.global-broadcast-banner {
  width: 100%;
  position: relative;
  z-index: 38;
  overflow: hidden;
  padding: clamp(0.45rem, 1.2vh, 0.7rem) clamp(0.75rem, 2vw, 1.5rem);
  box-sizing: border-box;
  animation: slideDownBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.global-broadcast-banner.hidden {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@keyframes slideDownBanner {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Shimmer animated top bar */
.broadcast-shimmer-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
  background-size: 200% 100%;
  animation: broadcastTrackShimmer 2.5s infinite linear;
}

@keyframes broadcastTrackShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.broadcast-container {
  max-width: 90rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 1.5vw, 1rem);
}

/* Animated Badge */
.broadcast-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: clamp(0.68rem, 1.8vw, 0.76rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}

.broadcast-badge-pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: broadcastPulseDot 1.4s infinite ease-in-out;
}

@keyframes broadcastPulseDot {
  0%, 100% { transform: scale(0.85); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.5; }
}

.broadcast-badge-icon {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.broadcast-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

.broadcast-text {
  font-size: clamp(0.82rem, 2.2vw, 0.96rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  word-break: break-word;
}

.broadcast-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn-broadcast-dismiss {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  width: 1.85rem;
  height: 1.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.btn-broadcast-dismiss:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.08);
}

.btn-broadcast-dismiss:active {
  transform: scale(0.92);
}

/* ==========================================================================
   THÈMES VISUELS BROADCAST (NÉON 5 COULEURS)
   ========================================================================== */

/* 1. Theme INFO : Cyan Néon */
.global-broadcast-banner.broadcast-theme-info {
  background: linear-gradient(90deg, rgba(6, 40, 70, 0.96) 0%, rgba(2, 132, 199, 0.92) 50%, rgba(6, 40, 70, 0.96) 100%);
  border-bottom: 2px solid #38bdf8;
  box-shadow: 0 4px 25px rgba(56, 189, 248, 0.35), inset 0 -1px 12px rgba(56, 189, 248, 0.2);
}
.global-broadcast-banner.broadcast-theme-info .broadcast-badge {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 1px solid #38bdf8;
  color: #e0f2fe;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}
.global-broadcast-banner.broadcast-theme-info .broadcast-text {
  color: #f0f9ff;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

/* 2. Theme WARNING / ALERTE : Ambre / Or Néon */
.global-broadcast-banner.broadcast-theme-warning {
  background: linear-gradient(90deg, rgba(69, 26, 3, 0.96) 0%, rgba(217, 119, 6, 0.92) 50%, rgba(69, 26, 3, 0.96) 100%);
  border-bottom: 2px solid #ffd700;
  box-shadow: 0 4px 28px rgba(245, 158, 11, 0.45), inset 0 -1px 14px rgba(255, 215, 0, 0.25);
}
.global-broadcast-banner.broadcast-theme-warning .broadcast-badge {
  background: linear-gradient(135deg, #d97706, #b45309);
  border: 1px solid #ffd700;
  color: #fffbeb;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}
.global-broadcast-banner.broadcast-theme-warning .broadcast-text {
  color: #fffbeb;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}

/* 3. Theme EVENT : Cosmique Violet Néon */
.global-broadcast-banner.broadcast-theme-event {
  background: linear-gradient(90deg, rgba(46, 16, 101, 0.96) 0%, rgba(126, 34, 206, 0.92) 50%, rgba(46, 16, 101, 0.96) 100%);
  border-bottom: 2px solid #c084fc;
  box-shadow: 0 4px 28px rgba(168, 85, 247, 0.45), inset 0 -1px 14px rgba(192, 132, 252, 0.25);
}
.global-broadcast-banner.broadcast-theme-event .broadcast-badge {
  background: linear-gradient(135deg, #9333ea, #7e22ce);
  border: 1px solid #c084fc;
  color: #faf5ff;
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.6);
}
.global-broadcast-banner.broadcast-theme-event .broadcast-text {
  color: #faf5ff;
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.6);
}

/* 4. Theme DANGER / URGENT : Rouge Sang / Alerte Néon */
.global-broadcast-banner.broadcast-theme-danger {
  background: linear-gradient(90deg, rgba(69, 10, 10, 0.96) 0%, rgba(220, 38, 38, 0.92) 50%, rgba(69, 10, 10, 0.96) 100%);
  border-bottom: 2px solid #ff4d4d;
  box-shadow: 0 4px 30px rgba(239, 68, 68, 0.55), inset 0 -1px 16px rgba(239, 68, 68, 0.3);
}
.global-broadcast-banner.broadcast-theme-danger .broadcast-badge {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  border: 1px solid #f87171;
  color: #fef2f2;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.7);
}
.global-broadcast-banner.broadcast-theme-danger .broadcast-text {
  color: #fff1f2;
  text-shadow: 0 0 12px rgba(248, 113, 113, 0.7);
}

/* 5. Theme SUCCESS / ÉMERAUDE : Vert Émeraude Néon */
.global-broadcast-banner.broadcast-theme-success {
  background: linear-gradient(90deg, rgba(6, 78, 59, 0.96) 0%, rgba(5, 150, 105, 0.92) 50%, rgba(6, 78, 59, 0.96) 100%);
  border-bottom: 2px solid #34d399;
  box-shadow: 0 4px 25px rgba(16, 185, 129, 0.4), inset 0 -1px 12px rgba(52, 211, 153, 0.2);
}
.global-broadcast-banner.broadcast-theme-success .broadcast-badge {
  background: linear-gradient(135deg, #059669, #047857);
  border: 1px solid #34d399;
  color: #ecfdf5;
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.55);
}
.global-broadcast-banner.broadcast-theme-success .broadcast-text {
  color: #f0fdf4;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
}

@media (max-width: 768px) {
  .broadcast-container {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .broadcast-badge {
    font-size: 0.64rem;
    padding: 0.18rem 0.5rem;
  }
  .broadcast-text {
    font-size: 0.8rem;
    text-align: left;
  }
}

.frenzy-banner {
  position: relative;
  z-index: 25;
  background: linear-gradient(90deg, #78350f 0%, #b45309 25%, #d97706 50%, #b45309 75%, #78350f 100%);
  background-size: 200% 100%;
  animation: frenzyGoldShimmer 4s linear infinite, frenzySlideDown 0.4s var(--ease-smooth);
  border-bottom: 0.125rem solid #ffd700;
  box-shadow: 0 0.25rem 2rem rgba(255, 215, 0, 0.45), inset 0 0 1.5rem rgba(255, 215, 0, 0.2);
  padding: clamp(0.45rem, 1.2vh, 0.75rem) var(--space-sm);
  width: 100%;
}

.frenzy-banner.hidden {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@keyframes frenzyGoldShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes frenzySlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.frenzy-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  color: #fff;
  font-size: clamp(0.74rem, 2vw, 0.88rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-shadow: 0 0.1rem 0.35rem rgba(0, 0, 0, 0.6);
  flex-wrap: wrap;
  text-align: center;
}

.frenzy-icon {
  font-size: 1.1rem;
  color: #ffd700;
  filter: drop-shadow(0 0 0.5rem #ffd700);
  display: flex;
  align-items: center;
}

.frenzy-countdown {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.55);
  border: 0.0625rem solid #ffd700;
  color: #ffe066;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: clamp(0.78rem, 2vw, 0.85rem);
  font-weight: 800;
  box-shadow: 0 0 0.75rem rgba(255, 215, 0, 0.35);
}

.frenzy-progress-track {
  width: 100%;
  max-width: 32rem;
  height: 0.28rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-pill);
  margin: 0.4rem auto 0;
  overflow: hidden;
  border: 0.0625rem solid rgba(255, 215, 0, 0.3);
}

.frenzy-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #fff3a8, #ffd700, #f59e0b);
  box-shadow: 0 0 0.6rem #ffd700;
  transition: width 0.1s linear;
}

/* ==========================================================================
   ARÈNE DE BOSS : L'INVASION DU FAUCON NOIR
   ========================================================================== */

.boss-arena {
  position: relative;
  z-index: 25;
  width: min(94vw, 75rem);
  margin: clamp(0.4rem, 1vh, 0.75rem) auto 0 auto;
  padding: clamp(0.65rem, 1.8vw, 1.15rem);
  background: 
    radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.28) 0%, rgba(25, 6, 14, 0.96) 75%),
    linear-gradient(180deg, rgba(40, 10, 20, 0.95) 0%, rgba(15, 4, 8, 0.98) 100%);
  border: 0.1rem solid rgba(239, 68, 68, 0.75);
  border-radius: var(--radius-md);
  box-shadow: 
    0 0.75rem 2.5rem rgba(239, 68, 68, 0.35),
    0 0 1.25rem rgba(239, 68, 68, 0.2),
    inset 0 0 1.5rem rgba(239, 68, 68, 0.12);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  animation: bossSlideDown 0.45s var(--ease-smooth) forwards;
}

.boss-arena.hidden {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@keyframes bossSlideDown {
  from { transform: translateY(-1.5rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.boss-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.boss-hazard-icon {
  display: flex;
  align-items: center;
  color: #ff3344;
  filter: drop-shadow(0 0 0.6rem rgba(239, 68, 68, 0.9));
  animation: pulseDanger 0.9s infinite alternate ease-in-out;
}

@keyframes pulseDanger {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 1rem rgba(239, 68, 68, 1)); }
}

.boss-title-text {
  font-size: clamp(0.82rem, 2.2vw, 1rem);
  font-weight: 800;
  color: #ff4d4d;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 0.9rem rgba(239, 68, 68, 0.8);
  flex: 1;
}

.boss-countdown {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.65);
  border: 0.0625rem solid rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 0.85rem rgba(239, 68, 68, 0.35);
  color: #fecaca;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: clamp(0.78rem, 2vw, 0.85rem);
}

.boss-hud {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.boss-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: clamp(0.74rem, 2vw, 0.85rem);
}

.boss-name-tag {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  color: #fff;
}

.boss-hp-label {
  font-family: var(--font-mono);
  font-weight: 800;
  color: #fca5a5;
  text-shadow: 0 0 0.5rem rgba(239, 68, 68, 0.6);
}

.boss-dps-badge {
  font-family: var(--font-mono);
  background: rgba(239, 68, 68, 0.25);
  border: 0.0625rem solid rgba(239, 68, 68, 0.55);
  color: #ff6b6b;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: clamp(0.72rem, 1.8vw, 0.78rem);
  font-weight: 800;
}

.boss-hp-track {
  width: 100%;
  height: clamp(0.65rem, 1.8vh, 0.85rem);
  background: rgba(0, 0, 0, 0.75);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 0.0625rem solid rgba(239, 68, 68, 0.4);
  position: relative;
}

.boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444 0%, #f97316 50%, #ef4444 100%);
  background-size: 200% 100%;
  box-shadow: 0 0 0.85rem rgba(239, 68, 68, 0.85);
  animation: hpBarShimmer 2.5s linear infinite;
  transition: width 0.12s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes hpBarShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.boss-sprite-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.25rem;
}

.boss-click-target {
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  width: clamp(4.5rem, 14vmin, 6rem);
  height: clamp(4.5rem, 14vmin, 6rem);
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  touch-action: manipulation;
  transition: transform 0.1s var(--ease-elastic);
}

.boss-click-target:hover { transform: scale(1.12); }
.boss-click-target:active { transform: scale(0.9) rotate(-4deg); }

.boss-aura-crimson {
  position: absolute;
  width: 120%;
  height: 120%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.5) 0%, rgba(168, 85, 247, 0.25) 50%, transparent 72%);
  filter: blur(0.75rem);
  pointer-events: none;
  animation: pulseDanger 1.1s infinite alternate;
}

.boss-silhouette {
  width: 90%;
  height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.boss-falcon-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 0.85rem rgba(239, 68, 68, 0.95)) drop-shadow(0 0 1.5rem rgba(168, 85, 247, 0.5));
}

/* ==========================================================================
   SCÈNE PRINCIPALE & DISPOSITION FLUIDE (DESKTOP, TABLETTE & SMARTPHONE)
   ========================================================================== */

.main-stage {
  position: relative;
  z-index: 10;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 32rem);
  gap: clamp(1rem, 2.5vw, 2.2rem);
  padding: clamp(0.75rem, 1.8vh, 1.5rem) clamp(0.75rem, 2.5vw, 2rem) clamp(3.5rem, 8vh, 5rem);
  max-width: 92rem;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

/* Onglets Mobiles / Tablettes Tactiles */
.mobile-section-tabs {
  display: none;
  grid-column: 1 / -1;
  width: min(94vw, 24rem);
  margin: 0.25rem auto 0.75rem;
  background: rgba(13, 19, 33, 0.94);
  border: 0.0625rem solid var(--surface-border-subtle);
  border-radius: var(--radius-md);
  padding: 0.25rem;
  gap: 0.35rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
}

.tab-btn {
  flex: 1;
  min-height: clamp(2.6rem, 5.5vh, 2.85rem);
  border-radius: var(--radius-sm);
  font-size: clamp(0.82rem, 2.4vw, 0.92rem);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  border: 0.0625rem solid transparent;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s var(--ease-smooth);
  touch-action: manipulation;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.35), rgba(56, 189, 248, 0.18));
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0.25rem 0.85rem rgba(2, 132, 199, 0.3);
}

/* --- COLONNE 1 : OISEAU & SCORE --- */
.clicker-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: clamp(0.6rem, 1.5vh, 1.15rem);
  width: 100%;
}

.score-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.score-label {
  font-size: clamp(0.68rem, 1.6vw, 0.78rem);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.score-display {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-shadow: 
    0 0 1.5rem rgba(56, 189, 248, 0.45),
    0 0 3rem rgba(2, 132, 199, 0.25);
  line-height: 1.05;
  transition: transform 0.08s ease;
  word-break: break-all;
}

.score-meta-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(0.25rem, 0.8vw, 0.45rem);
  margin-top: var(--space-xs);
  max-width: 100%;
}

.meta-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 0.0625rem solid var(--surface-border);
  padding: 0.25rem clamp(0.45rem, 1vw, 0.65rem);
  border-radius: var(--radius-pill);
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.meta-pill strong {
  color: #fff;
  font-family: var(--font-mono);
}

.combo-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem clamp(0.45rem, 1vw, 0.65rem);
  border-radius: var(--radius-pill);
  border: 0.0625rem solid var(--surface-border);
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--text-muted);
  line-height: 1;
}

.combo-badge.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
  animation: pulseCombo 0.6s infinite alternate ease-in-out;
}

@keyframes pulseCombo {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

.active-skin-badge {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(56, 189, 248, 0.08));
  border: 0.0625rem solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  font-weight: 700;
  padding: 0.25rem clamp(0.45rem, 1vw, 0.65rem);
  border-radius: var(--radius-pill);
  line-height: 1;
}

.prestige-badge {
  background: rgba(192, 132, 252, 0.15);
  border: 0.0625rem solid rgba(192, 132, 252, 0.4);
  color: var(--cosmic-purple);
  font-family: var(--font-mono);
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  font-weight: 700;
  padding: 0.25rem clamp(0.45rem, 1vw, 0.65rem);
  border-radius: var(--radius-pill);
  line-height: 1;
}
.prestige-badge.hidden { display: none; }

/* Scène Centrale de l'Oiseau Cliquable */
.bird-stage-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: clamp(0.4rem, 1.5vw, 1.25rem) 0;
}

.bird-click-target {
  position: relative;
  width: clamp(11.5rem, 42vmin, 18rem);
  height: clamp(11.5rem, 42vmin, 18rem);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  outline: none;
  background: transparent;
  border: none;
  border-radius: 50%;
}

.bird-aura {
  position: absolute;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, rgba(2, 132, 199, 0.15) 50%, transparent 70%);
  filter: blur(1.5rem);
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1;
}

.bird-click-target:hover .bird-aura {
  transform: scale(1.2);
  opacity: 0.95;
}

.bird-ring {
  position: absolute;
  width: 96%;
  height: 96%;
  border-radius: 50%;
  border: 0.0625rem solid rgba(56, 189, 248, 0.25);
  background: radial-gradient(circle, rgba(14, 22, 36, 0.45) 0%, rgba(9, 13, 21, 0.88) 100%);
  box-shadow: 
    inset 0 0 2rem rgba(2, 132, 199, 0.18),
    0 0.8rem 2.2rem rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 2;
  transition: all 0.25s ease;
}

.bird-click-target:hover .bird-ring {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 
    inset 0 0 2.5rem rgba(56, 189, 248, 0.3),
    0 1rem 3rem rgba(2, 132, 199, 0.35);
}

.bird-img-wrapper {
  position: relative;
  z-index: 3;
  width: 78%;
  height: 78%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s var(--ease-elastic);
  will-change: transform;
  transform-origin: center bottom;
}

.bird-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0.6rem 1.5rem rgba(2, 132, 199, 0.5));
  pointer-events: none;
}

.bird-click-target.clicking .bird-img-wrapper {
  transform: scale(0.92, 0.88) translateY(0.35rem);
  transition: transform 0.05s cubic-bezier(0.2, 0.8, 0.4, 1);
}

.bird-click-target.rebound .bird-img-wrapper {
  transform: scale(1.06, 1.09) translateY(-0.25rem);
  transition: transform 0.14s var(--ease-elastic);
}

/* Skins d'oiseaux visuels */
.skin-cyber .bird-aura { background: radial-gradient(circle, rgba(56, 189, 248, 0.45) 0%, rgba(217, 70, 239, 0.25) 60%, transparent 70%); }
.skin-cyber .bird-ring { border-color: rgba(56, 189, 248, 0.5); box-shadow: inset 0 0 2rem rgba(217, 70, 239, 0.25), 0 0.8rem 2.5rem rgba(56, 189, 248, 0.3); }

.skin-phoenix .bird-aura { background: radial-gradient(circle, rgba(245, 158, 11, 0.5) 0%, rgba(239, 68, 68, 0.3) 60%, transparent 70%); }
.skin-phoenix .bird-ring { border-color: rgba(245, 158, 11, 0.6); box-shadow: inset 0 0 2rem rgba(245, 158, 11, 0.3), 0 0.8rem 2.5rem rgba(239, 68, 68, 0.35); }

.skin-cosmic .bird-aura { background: radial-gradient(circle, rgba(192, 132, 252, 0.5) 0%, rgba(56, 189, 248, 0.3) 60%, transparent 70%); }
.skin-cosmic .bird-ring { border-color: rgba(192, 132, 252, 0.6); box-shadow: inset 0 0 2.5rem rgba(192, 132, 252, 0.3), 0 0.8rem 2.5rem rgba(192, 132, 252, 0.35); }

/* Popups Flottants de Clics */
.click-popup {
  position: fixed;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(0.95rem, 2.6vw, 1.45rem);
  color: #ffffff;
  text-shadow: 0 0.125rem 0.65rem rgba(0, 160, 255, 0.9), 0 0 1.25rem rgba(0, 210, 255, 0.5);
  pointer-events: none;
  z-index: 9995;
  animation: floatFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
  white-space: nowrap;
}

.click-popup.crit {
  color: #00f0ff;
  font-size: clamp(1.1rem, 3.2vw, 1.7rem);
  text-shadow: 0 0.125rem 0.85rem rgba(0, 240, 255, 1), 0 0 1.5rem rgba(0, 160, 255, 0.8);
}

.click-popup.gold {
  color: #fbbf24;
  font-size: clamp(1.1rem, 3.2vw, 1.7rem);
  text-shadow: 0 0.125rem 0.85rem rgba(251, 191, 36, 1), 0 0 1.5rem rgba(245, 158, 11, 0.9);
}

.click-popup.crimson {
  color: #ef4444;
  font-size: clamp(1.05rem, 2.9vw, 1.55rem);
  text-shadow: 0 0.125rem 0.85rem rgba(239, 68, 68, 1), 0 0 1.5rem rgba(185, 28, 28, 0.9);
}

@keyframes floatFade {
  0% { opacity: 1; transform: translate(-50%, -20%) scale(0.8) rotate(var(--rot, 0deg)); }
  30% { opacity: 1; transform: translate(-50%, -70%) scale(1.06) rotate(var(--rot, 0deg)); }
  100% { opacity: 0; transform: translate(-50%, -135%) scale(0.8) rotate(var(--rot, 0deg)); }
}

/* --- COLONNE 2 : SANCTUAIRE & BÂTIMENTS --- */
.buildings-section {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(13, 20, 36, 0.96) 0%, rgba(8, 12, 22, 0.98) 100%);
  border: 0.0625rem solid rgba(56, 189, 248, 0.32);
  border-radius: var(--radius-lg);
  padding: clamp(0.85rem, 1.8vw, 1.35rem);
  box-shadow: 
    0 1rem 3rem rgba(0, 0, 0, 0.65),
    0 0 2rem rgba(2, 132, 199, 0.15),
    inset 0 0.0625rem 0 rgba(255, 255, 255, 0.08);
  width: 100%;
}

.buildings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 0.0625rem solid rgba(56, 189, 248, 0.2);
  margin-bottom: 0.75rem;
  gap: var(--space-xs);
}

.buildings-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.buildings-title {
  font-size: clamp(0.92rem, 1.6vw, 1.08rem);
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.buildings-subtitle {
  font-size: clamp(0.72rem, 1.6vw, 0.78rem);
  color: #94a3b8;
  font-weight: 500;
}

.total-cps-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(56, 189, 248, 0.12) 100%);
  border: 0.0625rem solid rgba(56, 189, 248, 0.45);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 0.75rem rgba(56, 189, 248, 0.15);
  flex-shrink: 0;
}

.total-cps-pill span:first-child {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cbd5e1;
}

.total-cps-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.total-cps-pill strong {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  font-weight: 800;
  color: #38bdf8;
  line-height: 1.1;
  text-shadow: 0 0 0.6rem rgba(56, 189, 248, 0.6);
}

.total-cps-pill .cps-unit {
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
}

/* Barre d'Achat (x1, x10, x100, MAX + Tout Acheter MAX) */
.buildings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: var(--space-xs);
  padding: 0.35rem 0.55rem;
  background: rgba(10, 16, 30, 0.85);
  border: 0.0625rem solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.buy-mode-selector {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.buy-mode-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.buy-mode-pills {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(6, 10, 20, 0.9);
  padding: 0.15rem;
  border-radius: var(--radius-sm);
  border: 0.0625rem solid rgba(255, 255, 255, 0.08);
}

.btn-buy-mode {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.8vw, 0.75rem);
  font-weight: 700;
  padding: 0.2rem clamp(0.4rem, 1vw, 0.55rem);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.18s ease;
  touch-action: manipulation;
}

.btn-buy-mode:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-buy-mode.active {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 0.6rem rgba(56, 189, 248, 0.5);
}

.btn-buy-mode.btn-mode-max.active {
  background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
  box-shadow: 0 0 0.75rem rgba(251, 191, 36, 0.6);
  color: #040914;
}

.btn-buy-all-max {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(180, 83, 9, 0.15) 100%);
  border: 0.0625rem solid rgba(251, 191, 36, 0.5);
  color: #fbbf24;
  font-family: var(--font-main);
  font-size: clamp(0.7rem, 1.8vw, 0.75rem);
  font-weight: 800;
  padding: 0.3rem clamp(0.5rem, 1vw, 0.75rem);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 0.6rem rgba(245, 158, 11, 0.2);
  touch-action: manipulation;
  white-space: nowrap;
}

.btn-buy-all-max:hover:not(:disabled) {
  background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
  color: #040914;
  border-color: #ffffff;
  box-shadow: 0 0 1rem rgba(251, 191, 36, 0.7);
  transform: scale(1.02);
}

.btn-buy-all-max:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

/* Liste des Cartes de Bâtiments */
.buildings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-height: clamp(24rem, 58vh, 42rem);
  overflow-y: auto;
  padding-right: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.building-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: clamp(0.65rem, 1.5vw, 0.85rem);
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.building-card:hover {
  background: var(--surface-card-hover);
  border-color: var(--surface-border-hover);
}

.building-icon-box {
  width: clamp(2.6rem, 6vw, 3.2rem);
  height: clamp(2.6rem, 6vw, 3.2rem);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 0.0625rem solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nest-theme { background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, #0d1424 80%); border-color: rgba(245, 158, 11, 0.35); }
.quantum-theme { background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, #0d1424 80%); border-color: rgba(56, 189, 248, 0.4); }
.datacenter-theme { background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, #0d1424 80%); border-color: rgba(14, 165, 233, 0.4); }
.forge-theme { background: radial-gradient(circle, rgba(192, 132, 252, 0.25) 0%, #0d1424 80%); border-color: rgba(192, 132, 252, 0.4); }

.building-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.building-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.building-name {
  font-size: clamp(0.84rem, 1.8vw, 0.94rem);
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.building-count-badge {
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.6vw, 0.8rem);
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 0.0625rem solid rgba(56, 189, 248, 0.3);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
}

.building-desc {
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--text-muted);
  line-height: 1.35;
}

.building-stats-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  font-weight: 600;
  color: var(--accent-cyan);
  margin-top: 0.1rem;
}

.stat-total {
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Zone Datacenter Overclock */
.datacenter-overclock-zone {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.btn-overclock {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
  border: 0.0625rem solid rgba(245, 158, 11, 0.4);
  color: var(--gold-light);
  font-size: clamp(0.65rem, 1.6vw, 0.72rem);
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.18s ease;
  touch-action: manipulation;
  white-space: nowrap;
}

.btn-overclock:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.35);
  border-color: var(--gold-light);
}

.btn-overclock:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.overclock-gauge-track {
  flex: 1;
  height: 0.35rem;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 0.0625rem solid rgba(255, 255, 255, 0.08);
}

.overclock-gauge-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.1s linear;
}

/* Boutons d'Achat Bâtiments */
.btn-buy-building {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: clamp(4.4rem, 11vw, 5.5rem);
  min-height: clamp(2.6rem, 5.5vh, 3.1rem);
  padding: 0.35rem 0.55rem;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(56, 189, 248, 0.12) 100%);
  border: 0.0625rem solid rgba(56, 189, 248, 0.45);
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
  flex-shrink: 0;
  touch-action: manipulation;
}

.btn-buy-building:hover:not(:disabled) {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  border-color: #fff;
  box-shadow: 0 0 0.85rem rgba(56, 189, 248, 0.5);
  transform: translateY(-0.0625rem);
}

.btn-buy-building:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.buy-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #cbd5e1;
}

.buy-cost-row {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.buy-cost {
  font-family: var(--font-mono);
  font-size: clamp(0.8rem, 1.8vw, 0.92rem);
  font-weight: 800;
  color: #fff;
}

/* ==========================================================================
   FOOTER & DOCK DE NAVIGATION FLUIDE (DESKTOP & MOBILE)
   ========================================================================== */

.app-footer {
  position: relative;
  z-index: 30;
  background: rgba(8, 13, 24, 0.98);
  border-top: 0.0625rem solid var(--surface-border-subtle);
  padding: clamp(0.45rem, 1.2vh, 0.75rem) clamp(0.65rem, 2.5vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  width: 100%;
}

.footer-stats {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1rem);
  font-size: clamp(0.72rem, 1.8vw, 0.78rem);
  color: var(--text-muted);
}

.footer-stat-item strong {
  color: #fff;
  font-family: var(--font-mono);
}

.sync-status-box {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.25rem, 0.8vw, 0.45rem);
}

.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem clamp(0.45rem, 1vw, 0.75rem);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  color: var(--text-main);
  font-size: clamp(0.72rem, 1.6vw, 0.78rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  white-space: nowrap;
  text-decoration: none;
}

.nav-link-btn:hover {
  background: var(--surface-card-hover);
  border-color: var(--surface-border-hover);
  color: #fff;
  transform: translateY(-0.0625rem);
}

/* ==========================================================================
   MODALES UNIVERSELLES & CONTENEURS (100% FLUIDE)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.94);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.45rem, 2.5vw, 1.5rem);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-smooth);
}

.modal-backdrop.open,
#modal-arcade.open,
#modal-genetics.open,
#modal-dimensions.open,
#modal-runes.open,
#modal-astrolabe.open,
#modal-skins.open,
#modal-achievements.open,
#modal-quests.open,
#modal-prestige.open,
#modal-leaderboard.open,
#modal-fivem.open,
#modal-gamepad.open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 10000 !important;
}

.modal-container {
  width: min(94vw, 36rem);
  max-height: min(90dvh, calc(100vh - 1.5rem));
  background: linear-gradient(180deg, rgba(16, 23, 40, 0.98) 0%, rgba(10, 15, 26, 0.99) 100%);
  border: 0.0625rem solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 
    0 1.5rem 4.5rem rgba(0, 0, 0, 0.85),
    0 0 2rem rgba(2, 132, 199, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateY(1.25rem) scale(0.97);
  transition: transform 0.25s var(--ease-elastic);
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-backdrop.open .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(0.65rem, 1.5vh, 0.95rem) clamp(0.75rem, 2.5vw, 1.25rem);
  border-bottom: 0.0625rem solid var(--surface-border-subtle);
  background: rgba(13, 19, 33, 0.98);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 25;
}

.modal-title {
  font-size: clamp(0.86rem, 2.2vw, 1.05rem);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #fff;
}

.modal-close {
  background: rgba(255, 255, 255, 0.06);
  border: 0.0625rem solid var(--surface-border);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(2rem, 4.5vw, 2.25rem);
  height: clamp(2rem, 4.5vw, 2.25rem);
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
  flex-shrink: 0;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.modal-body {
  padding: clamp(0.65rem, 2vw, 1.15rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Modale Skins */
.modal-skins-container { width: min(94vw, 42rem); }

.skins-intro-card {
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  font-size: clamp(0.74rem, 1.8vw, 0.82rem);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.boss-summon-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding-top: 0.45rem;
  border-top: 0.0625rem solid var(--surface-border);
  flex-wrap: wrap;
}

.btn-boss-summon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(185, 28, 28, 0.1));
  border: 0.0625rem solid rgba(239, 68, 68, 0.45);
  color: #f87171;
}
.btn-boss-summon:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #f87171;
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(11rem, 40vw, 18rem), 1fr));
  gap: var(--space-xs);
}

.skin-card {
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: all 0.2s ease;
}

.skin-card:hover {
  border-color: var(--surface-border-hover);
  background: var(--surface-card-hover);
}

.skin-card.locked { opacity: 0.75; }

.skin-preview-box {
  position: relative;
  width: 100%;
  height: clamp(4.5rem, 12vh, 5.5rem);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0.0625rem solid rgba(255, 255, 255, 0.05);
}

.preview-classic { background: radial-gradient(circle, rgba(2, 132, 199, 0.25) 0%, #0c1220 80%); }
.preview-cyber { background: radial-gradient(circle, rgba(56, 189, 248, 0.3) 0%, rgba(217, 70, 239, 0.15) 70%, #0c1220 100%); }
.preview-phoenix { background: radial-gradient(circle, rgba(245, 158, 11, 0.3) 0%, rgba(239, 68, 68, 0.2) 70%, #0c1220 100%); }
.preview-cosmic { background: radial-gradient(circle, rgba(192, 132, 252, 0.35) 0%, rgba(56, 189, 248, 0.2) 70%, #0c1220 100%); }

.skin-preview-img {
  width: clamp(3rem, 7vw, 3.5rem);
  height: clamp(3rem, 7vw, 3.5rem);
  object-fit: contain;
  z-index: 2;
}

.skin-lock-icon {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  color: var(--text-dim);
  z-index: 3;
}

.skin-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.skin-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.skin-name {
  font-size: clamp(0.8rem, 1.8vw, 0.88rem);
  font-weight: 700;
  color: #fff;
}

.skin-tag {
  font-size: 0.65rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.skin-tag.tag-unlocked {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 0.0625rem solid rgba(16, 185, 129, 0.4);
}

.skin-desc {
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--text-muted);
  line-height: 1.35;
}

.skin-perk {
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  font-weight: 600;
  color: var(--accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.1rem;
}

.btn-skin-action {
  width: 100%;
  min-height: clamp(2.3rem, 5vh, 2.5rem);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  font-size: clamp(0.74rem, 1.8vw, 0.8rem);
  font-weight: 700;
  cursor: pointer;
  background: var(--bg-tertiary);
  border: 0.0625rem solid var(--surface-border);
  color: var(--text-main);
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.btn-skin-action:hover:not(:disabled) {
  background: rgba(2, 132, 199, 0.25);
  border-color: var(--accent-cyan);
  color: #fff;
}

.btn-skin-action.active {
  background: #10b981;
  color: #000;
  border-color: #10b981;
  cursor: default;
}

.btn-skin-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Modale Succès */
.modal-achievements-container { width: min(94vw, 42rem); }

.achievements-summary-card {
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.achievements-progress-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: clamp(0.7rem, 1.8vw, 0.8rem);
  flex-wrap: wrap;
  gap: 0.35rem;
}

.achievements-counter strong {
  color: var(--gold-light);
  font-family: var(--font-mono);
}

.achievements-progress-track {
  width: 100%;
  height: 0.4rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 0.0625rem solid rgba(255, 255, 255, 0.05);
}

.achievements-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-light), #f59e0b);
  transition: width 0.3s ease;
}

.achievements-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: clamp(0.6rem, 1.5vw, 0.75rem);
  transition: all 0.2s ease;
}

.achievement-card.unlocked {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, var(--surface-card) 100%);
}

.achievement-card.locked { opacity: 0.6; }

.achieve-icon-box {
  width: clamp(2.2rem, 5vw, 2.6rem);
  height: clamp(2.2rem, 5vw, 2.6rem);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 0.0625rem solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.achieve-info {
  flex: 1;
  min-width: 0;
}

.achieve-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.achieve-title {
  font-size: clamp(0.8rem, 1.8vw, 0.88rem);
  font-weight: 700;
  color: #fff;
}

.achieve-badge {
  font-size: 0.65rem;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
}

.achieve-badge.badge-done {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 0.0625rem solid rgba(16, 185, 129, 0.4);
}

.achieve-badge.badge-lock {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.achieve-desc {
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.achieve-reward {
  font-size: clamp(0.65rem, 1.6vw, 0.72rem);
  color: var(--gold-light);
  font-weight: 600;
  margin-top: 0.15rem;
}

/* Modale Quêtes & Daily Streak */
.modal-quests-container { width: min(94vw, 38rem); }

.streak-section {
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
}

.streak-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.streak-title {
  font-size: clamp(0.84rem, 2vw, 0.92rem);
  font-weight: 800;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.streak-subtitle {
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.streak-current-badge {
  background: rgba(245, 158, 11, 0.2);
  border: 0.0625rem solid rgba(245, 158, 11, 0.4);
  color: var(--gold-light);
  font-size: clamp(0.7rem, 1.8vw, 0.76rem);
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.streak-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: clamp(0.2rem, 0.6vw, 0.35rem);
  margin-bottom: var(--space-xs);
}

.streak-day-card {
  background: var(--bg-tertiary);
  border: 0.0625rem solid var(--surface-border);
  border-radius: var(--radius-xs);
  padding: 0.4rem 0.2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.streak-day-card.claimed {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.15);
}

.streak-day-card.current {
  border-color: var(--gold-light);
  background: rgba(245, 158, 11, 0.18);
  box-shadow: 0 0 0.75rem rgba(245, 158, 11, 0.3);
}

.day-label {
  font-size: clamp(0.58rem, 1.4vw, 0.65rem);
  color: var(--text-muted);
  text-transform: uppercase;
}

.day-reward-icon { display: inline-flex; align-items: center; justify-content: center; }

.day-mult {
  font-size: clamp(0.64rem, 1.6vw, 0.72rem);
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}

.streak-claim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn-glow-gold {
  background: linear-gradient(135deg, #b45309, #d97706);
  border: 0.0625rem solid var(--gold-light);
  color: #fff;
  font-weight: 800;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 0.25rem 0.85rem rgba(217, 119, 6, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: clamp(0.74rem, 1.8vw, 0.8rem);
  min-height: clamp(2.3rem, 5vh, 2.5rem);
  touch-action: manipulation;
}

.btn-glow-gold:hover:not(:disabled) {
  transform: translateY(-0.0625rem);
  box-shadow: 0 0.4rem 1.2rem rgba(217, 119, 6, 0.5);
}

.btn-glow-gold:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.streak-status-hint {
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--text-muted);
}

.quests-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.quests-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.quests-title {
  font-size: clamp(0.84rem, 2vw, 0.92rem);
  font-weight: 800;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-pill {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.quests-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.quest-item-card {
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.quest-item-card.completed { border-color: rgba(16, 185, 129, 0.4); }

.quest-info { flex: 1; min-width: 0; }

.quest-desc {
  font-size: clamp(0.78rem, 1.8vw, 0.85rem);
  font-weight: 700;
  color: #fff;
}

.quest-reward {
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--gold-light);
  font-weight: 600;
  margin-top: 0.1rem;
}

.quest-progress-track {
  width: 100%;
  height: 0.3rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-pill);
  margin-top: 0.35rem;
  overflow: hidden;
}

.quest-progress-fill {
  height: 100%;
  background: var(--accent-cyan);
  transition: width 0.2s ease;
}

.quest-progress-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.btn-claim-quest {
  padding: 0.4rem 0.75rem;
  min-height: clamp(2.2rem, 4.8vh, 2.4rem);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.15));
  border: 0.0625rem solid #10b981;
  color: #34d399;
  font-size: clamp(0.72rem, 1.8vw, 0.78rem);
  font-weight: 800;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  touch-action: manipulation;
}

.btn-claim-quest:hover:not(:disabled) {
  background: #10b981;
  color: #000;
}

.btn-claim-quest:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--surface-border);
  color: var(--text-dim);
}

/* Modale Prestige */
.modal-prestige-container { width: min(94vw, 36rem); }

.prestige-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
}

.prestige-galaxy-visual {
  position: relative;
  width: clamp(4.5rem, 12vh, 5.5rem);
  height: clamp(4.5rem, 12vh, 5.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.galaxy-core {
  position: absolute;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cosmic-purple) 0%, rgba(147, 51, 234, 0.3) 60%, transparent 80%);
  filter: blur(0.6rem);
  animation: pulseCosmic 2.5s infinite ease-in-out;
}

.galaxy-ring {
  position: absolute;
  border-radius: 50%;
  border: 0.0625rem dashed rgba(192, 132, 252, 0.45);
}

.ring-1 { width: 4.5rem; height: 4.5rem; animation: spinSlow 8s infinite linear; }
.ring-2 { width: 5.5rem; height: 5.5rem; animation: spinReverse 12s infinite linear; }

@keyframes pulseCosmic {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.cosmic-icon {
  color: #fff;
  text-shadow: 0 0 1rem var(--cosmic-purple);
  z-index: 2;
  display: inline-flex;
}

.prestige-title {
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 800;
  color: #fff;
}

.prestige-desc {
  font-size: clamp(0.76rem, 1.8vw, 0.84rem);
  color: var(--text-muted);
  line-height: 1.5;
}

.prestige-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
  width: 100%;
}

.pstat-card {
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.pstat-card.highlight {
  border-color: rgba(192, 132, 252, 0.5);
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.15) 0%, var(--surface-card) 100%);
}

.pstat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pstat-value {
  font-family: var(--font-mono);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 800;
  margin: 0.15rem 0;
}

.pstat-sub {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.prestige-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.btn-prestige-execute {
  width: 100%;
  min-height: clamp(2.85rem, 6vh, 3.2rem);
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #7e22ce, #a855f7);
  border: 0.0625rem solid var(--cosmic-purple);
  color: #fff;
  font-size: clamp(0.85rem, 2vw, 0.94rem);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0.4rem 1.5rem rgba(168, 85, 247, 0.4);
  transition: all 0.2s var(--ease-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  touch-action: manipulation;
}

.btn-prestige-execute:hover:not(:disabled) {
  transform: translateY(-0.1rem);
  box-shadow: 0 0.6rem 2.2rem rgba(168, 85, 247, 0.6);
}

.btn-prestige-execute:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.prestige-hint {
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  color: var(--text-muted);
}

/* Modale Classement (Leaderboard) */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(0.55rem, 1.5vw, 0.75rem) clamp(0.65rem, 2vw, 0.95rem);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  border: 0.0625rem solid var(--surface-border);
  gap: var(--space-xs);
}

.leaderboard-item.top-1 {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, var(--surface-card) 100%);
}
.leaderboard-item.top-2 {
  border-color: rgba(192, 192, 192, 0.4);
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.1) 0%, var(--surface-card) 100%);
}
.leaderboard-item.top-3 {
  border-color: rgba(205, 127, 50, 0.4);
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.1) 0%, var(--surface-card) 100%);
}

.rank-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(0.82rem, 2vw, 0.92rem);
  width: 1.75rem;
  color: var(--text-muted);
  text-align: center;
}

.top-1 .rank-badge { color: var(--gold-light); }
.top-2 .rank-badge { color: #e2e8f0; }
.top-3 .rank-badge { color: #f97316; }

.player-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
}

.player-avatar {
  width: clamp(1.85rem, 4.5vw, 2.2rem);
  height: clamp(1.85rem, 4.5vw, 2.2rem);
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.player-name {
  font-size: clamp(0.8rem, 1.8vw, 0.88rem);
  font-weight: 700;
  color: #fff;
  max-width: clamp(6.5rem, 20vw, 12rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-score {
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 2vw, 0.92rem);
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
}

/* Modale FiveM Guide */
.fivem-guide-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  border: 0.0625rem solid var(--surface-border);
  font-size: clamp(0.76rem, 1.8vw, 0.84rem);
  line-height: 1.55;
}

.code-box {
  background: #060910;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 1.6vw, 0.76rem);
  color: var(--accent-cyan);
  overflow-x: auto;
  margin: 0.45rem 0;
  border: 0.0625rem solid rgba(255, 255, 255, 0.06);
}

.fivem-section-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-cyan);
  margin-bottom: 0.3rem;
  font-size: clamp(0.84rem, 2vw, 0.92rem);
  font-weight: 700;
}

.fivem-section-title:not(:first-child) {
  margin-top: var(--space-sm);
}

/* ==========================================================================
   PANEL ADMINISTRATEUR AVANCÉ (ACNESIA ROOT MASTER)
   ========================================================================== */

.modal-admin-container {
  width: min(96vw, 56rem);
  max-height: min(92dvh, calc(100vh - 1.5rem));
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.admin-tag.founder {
  font-size: 0.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.35) 100%);
  color: #fbbf24;
  border: 0.0625rem solid rgba(251, 191, 36, 0.5);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
}

.admin-header-quick-info {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.admin-time-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 0.0625rem solid rgba(56, 189, 248, 0.3);
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-xs);
}

.btn-icon-admin {
  background: rgba(255, 255, 255, 0.06);
  border: 0.0625rem solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  width: clamp(1.85rem, 4vw, 2.1rem);
  height: clamp(1.85rem, 4vw, 2.1rem);
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon-admin:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
}

.admin-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  overflow-y: auto;
  padding: clamp(0.75rem, 2vw, 1.25rem);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(7.5rem, 20vw, 9.5rem), 1fr));
  gap: var(--space-xs);
}

.admin-stat-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 16, 30, 0.98) 100%);
  border: 0.0625rem solid rgba(56, 189, 248, 0.2);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
}

.admin-stat-icon {
  width: clamp(1.85rem, 4vw, 2.2rem);
  height: clamp(1.85rem, 4vw, 2.2rem);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-stat-details {
  display: flex;
  flex-direction: column;
}

.admin-stat-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.admin-stat-value {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.admin-nav-tabs {
  display: flex;
  gap: 0.35rem;
  background: rgba(6, 10, 20, 0.85);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 0.0625rem solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem clamp(0.65rem, 1.5vw, 0.95rem);
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-main);
  font-size: clamp(0.74rem, 1.8vw, 0.82rem);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.admin-tab-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.admin-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.9) 0%, rgba(56, 189, 248, 0.8) 100%);
  box-shadow: 0 0.15rem 0.75rem rgba(56, 189, 248, 0.35);
}

.admin-tab-view { display: none; flex-direction: column; gap: var(--space-sm); }
.admin-tab-view.active { display: flex; }

.admin-search-toolbar {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  flex-wrap: wrap;
}

.admin-search-input-box {
  flex: 1;
  min-width: clamp(12rem, 35vw, 18rem);
  position: relative;
  display: flex;
  align-items: center;
}

.search-prefix-icon {
  position: absolute;
  left: 0.75rem;
  color: #64748b;
  pointer-events: none;
}

.admin-search-input {
  width: 100%;
  background: #060910;
  border: 0.0625rem solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem 0.5rem 2.2rem;
  color: #fff;
  font-family: var(--font-main);
  font-size: clamp(0.76rem, 1.8vw, 0.84rem);
  outline: none;
}

.admin-filter-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.admin-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.admin-select {
  background: #060910;
  border: 0.0625rem solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  color: #fff;
  font-family: var(--font-main);
  font-size: clamp(0.74rem, 1.8vw, 0.8rem);
  outline: none;
}

.admin-players-container {
  max-height: clamp(18rem, 50vh, 28rem);
  overflow-y: auto;
  padding-right: 0.25rem;
  -webkit-overflow-scrolling: touch;
}

.admin-players-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.admin-player-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: var(--space-sm);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88) 0%, rgba(10, 16, 28, 0.94) 100%);
  border: 0.0625rem solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.35);
}

.admin-player-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.admin-player-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.admin-player-avatar-wrap { position: relative; }

.admin-player-avatar {
  width: clamp(2.2rem, 5vw, 2.6rem);
  height: clamp(2.2rem, 5vw, 2.6rem);
  border-radius: 50%;
  object-fit: cover;
  background: #0b1120;
  border: 0.125rem solid rgba(56, 189, 248, 0.4);
}

.admin-player-skin-badge {
  position: absolute;
  bottom: -0.1rem;
  right: -0.1rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  border: 0.125rem solid #0b1120;
}

.admin-player-skin-badge.skin-classic { background: #38bdf8; }
.admin-player-skin-badge.skin-cyber { background: #06b6d4; }
.admin-player-skin-badge.skin-phoenix { background: #f59e0b; }
.admin-player-skin-badge.skin-cosmic { background: #a855f7; }

.admin-player-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.admin-player-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.admin-player-username {
  font-size: clamp(0.85rem, 2vw, 0.92rem);
  font-weight: 800;
  color: #fff;
}

.admin-player-id-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #64748b;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-xs);
}

.admin-player-pills-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.badge-tag-mini {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
}

.badge-tag-fivem { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 0.0625rem solid rgba(52, 211, 153, 0.35); }
.badge-tag-prestige { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 0.0625rem solid rgba(192, 132, 252, 0.35); }
.badge-tag-skin { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 0.0625rem solid rgba(56, 189, 248, 0.35); }

.admin-player-scores-summary {
  display: flex;
  align-items: center;
  gap: clamp(0.65rem, 2vw, 1.25rem);
  text-align: right;
}

.score-col { display: flex; flex-direction: column; }
.score-col-label { font-size: 0.62rem; font-weight: 700; color: #64748b; text-transform: uppercase; }
.score-col-value { font-family: var(--font-mono); font-size: clamp(0.85rem, 2vw, 0.95rem); font-weight: 800; color: #38bdf8; }
.score-col-value.lifetime { color: #fbbf24; }

.admin-player-buildings-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: clamp(0.68rem, 1.6vw, 0.72rem);
  color: #94a3b8;
  flex-wrap: wrap;
}

.building-chip { display: inline-flex; align-items: center; gap: 0.2rem; }
.building-chip strong { color: #fff; font-family: var(--font-mono); }

.admin-player-actions-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.06);
  padding-top: 0.55rem;
}

.btn-admin-act {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem clamp(0.45rem, 1vw, 0.65rem);
  border-radius: var(--radius-xs);
  font-family: var(--font-main);
  font-size: clamp(0.68rem, 1.6vw, 0.74rem);
  font-weight: 700;
  cursor: pointer;
  border: 0.0625rem solid transparent;
  transition: all 0.18s ease;
  touch-action: manipulation;
}

.btn-admin-points { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.btn-admin-prestige { background: rgba(168, 85, 247, 0.18); color: #c084fc; border-color: rgba(192, 132, 252, 0.4); }
.btn-admin-skin { background: rgba(56, 189, 248, 0.18); color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); }
.btn-admin-achieve { background: rgba(16, 185, 129, 0.18); color: #34d399; border-color: rgba(16, 185, 129, 0.4); }
.btn-admin-reset { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); }
.btn-admin-delete { background: rgba(220, 38, 38, 0.25); color: #f87171; border-color: rgba(220, 38, 38, 0.45); }

/* Événements & Commandes Serveur */
.admin-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(clamp(16rem, 45vw, 22rem), 1fr));
  gap: var(--space-sm);
}

.admin-event-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 16, 30, 0.98) 100%);
  border: 0.0625rem solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.event-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.event-icon-box {
  width: clamp(2.4rem, 5.5vw, 2.8rem);
  height: clamp(2.4rem, 5.5vw, 2.8rem);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.event-card-title {
  font-size: clamp(0.88rem, 2vw, 0.98rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.2rem;
}

.event-card-desc {
  font-size: clamp(0.72rem, 1.6vw, 0.78rem);
  color: #94a3b8;
  line-height: 1.4;
}

.event-controls-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.event-duration-select {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.event-duration-select label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.btn-event-dur {
  background: rgba(255, 255, 255, 0.06);
  border: 0.0625rem solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-event-dur.active {
  background: #f59e0b;
  color: #0b1120;
  font-weight: 800;
  border-color: #fff;
}

.btn-event-action {
  width: 100%;
  justify-content: center;
  padding: 0.55rem 0.85rem;
  font-size: clamp(0.78rem, 1.8vw, 0.85rem);
}

.btn-event-boss-trigger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #fff;
  border: 0.0625rem solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 1rem rgba(239, 68, 68, 0.4);
}

.event-live-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-xs);
}

/* Outils BDD */
.admin-database-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.database-hero-box {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15) 0%, rgba(56, 189, 248, 0.08) 100%);
  border: 0.0625rem solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  flex-wrap: wrap;
}

.database-hero-icon {
  width: clamp(3rem, 7vw, 3.8rem);
  height: clamp(3rem, 7vw, 3.8rem);
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.database-hero-content h3 {
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.25rem;
}

.database-hero-content p {
  font-size: clamp(0.74rem, 1.8vw, 0.8rem);
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 0.65rem;
}

.admin-db-stats-panel {
  background: rgba(10, 16, 30, 0.95);
  border: 0.0625rem solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.db-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: clamp(0.72rem, 1.8vw, 0.78rem);
  padding-bottom: 0.35rem;
  border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.04);
}

.db-stat-name { color: #94a3b8; font-weight: 600; }
.db-stat-val { font-family: var(--font-mono); font-weight: 700; }

/* Sous-Modales Admin */
.admin-submodal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: clamp(0.45rem, 2vw, 1rem);
}

.admin-submodal-backdrop.open { display: flex; animation: fadeInModal 0.2s ease forwards; }

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.admin-submodal-card {
  width: min(94vw, 26rem);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 16, 30, 0.99) 100%);
  border: 0.0625rem solid rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  box-shadow: 0 0.75rem 2.5rem rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.submodal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.08);
}

.submodal-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: clamp(0.86rem, 2vw, 0.95rem);
  font-weight: 800;
  color: #fff;
}

.submodal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

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

.submodal-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.submodal-target-user {
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 0.0625rem solid rgba(56, 189, 248, 0.25);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-xs);
}

.submodal-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.quick-points-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
  gap: 0.35rem;
}

.btn-quick-point {
  background: rgba(245, 158, 11, 0.15);
  border: 0.0625rem solid rgba(251, 191, 36, 0.35);
  color: #fbbf24;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-quick-point:hover {
  background: #f59e0b;
  color: #0b1120;
}

.submodal-input-row { display: flex; gap: 0.45rem; }

.submodal-input {
  flex: 1;
  background: #060910;
  border: 0.0625rem solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-xs);
  padding: 0.45rem 0.65rem;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  outline: none;
}

.submodal-select {
  background: #060910;
  border: 0.0625rem solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-xs);
  padding: 0.45rem 0.55rem;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.76rem;
  outline: none;
  cursor: pointer;
}

.submodal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border-top: 0.0625rem solid rgba(255, 255, 255, 0.06);
}

.skin-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.skin-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 0.0625rem solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.45rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.skin-choice-btn:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
}

.skin-choice-icon { font-size: 1.35rem; }
.skin-choice-title { font-size: 0.82rem; font-weight: 800; color: #fff; }
.skin-choice-sub { font-size: 0.65rem; color: #94a3b8; }

.admin-building-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  border: 0.0625rem solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.55rem;
}

.admin-bldg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.admin-bldg-label { font-size: 0.74rem; font-weight: 700; color: #cbd5e1; }
.admin-bldg-field { max-width: 5rem; padding: 0.3rem 0.45rem; font-size: 0.78rem; text-align: right; }

.btn-quick-building {
  background: rgba(6, 182, 212, 0.15);
  border: 0.0625rem solid rgba(6, 182, 212, 0.35);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.35rem 0.3rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
}

.btn-quick-building:hover { background: #0284c7; color: #fff; }

/* ==========================================================================
   BREAKPOINTS RESPONSIVE (SMARTPHONE, TABLETTE PORTRAIT/PAYSAGE, DESKTOP)
   ========================================================================== */

/* --- TABLETTES EN MODE PAYSAGE & DESKTOP COMPACT (864px à 1024px) --- */
@media (min-width: 54.01rem) and (max-width: 64rem) {
  .main-stage {
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem);
    gap: 1.25rem;
    padding: 0.75rem 1.25rem 4rem;
  }

  .mobile-section-tabs { display: none !important; }
  .buildings-section { display: flex !important; }
  .clicker-section { display: flex !important; }

  .bird-click-target {
    width: clamp(10.5rem, 36vmin, 14.5rem);
    height: clamp(10.5rem, 36vmin, 14.5rem);
  }
}

/* --- TABLETTES EN MODE PORTRAIT & ÉCRANS MOYENS (600px à 864px) --- */
@media (min-width: 37.51rem) and (max-width: 54rem) {
  .app-header {
    padding: 0.45rem 1rem;
    justify-content: space-between;
  }

  /* Masquage des 4 raccourcis dupliqués dans le header (accessibles dans le footer) */
  .app-header #btn-open-skins,
  .app-header #btn-open-achievements,
  .app-header #btn-open-quests,
  .app-header #btn-open-prestige {
    display: none !important;
  }

  .brand-status { display: none !important; }

  .main-stage {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
    padding: 0.5rem 1rem clamp(4.5rem, 9vh, 6rem);
  }

  .mobile-section-tabs {
    display: flex !important;
    position: sticky;
    top: 3.5rem;
    z-index: 30;
  }

  .clicker-section.mobile-hidden,
  .clicker-section.hidden-mobile {
    display: none !important;
  }

  .buildings-section {
    display: none !important;
    padding: 0.75rem;
  }

  .buildings-section.mobile-active {
    display: flex !important;
  }

  .buildings-toolbar {
    position: sticky;
    top: 6.8rem;
    z-index: 20;
    background: rgba(10, 16, 30, 0.98);
  }

  .buildings-list {
    max-height: none;
    padding-bottom: 2rem;
  }

  .bird-click-target {
    width: clamp(11rem, 46vmin, 16rem);
    height: clamp(11rem, 46vmin, 16rem);
  }

  .app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0.4rem 1rem max(0.5rem, env(safe-area-inset-bottom));
  }
}

/* --- SMARTPHONES & FORMAT 9:16 (< 600px / 37.5rem) --- */
@media (max-width: 37.5rem) {
  .app-header {
    padding: 0.35rem clamp(0.45rem, 2vw, 0.75rem);
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    min-height: 3rem;
    position: sticky;
    top: 0;
    z-index: 45;
  }

  .brand-section {
    gap: 0.4rem;
    min-width: 0;
    flex-shrink: 1;
    display: flex;
    align-items: center;
  }

  .brand-mini-logo {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    flex-shrink: 0;
  }

  .brand-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .brand-title {
    font-size: clamp(0.78rem, 2.2vw, 0.88rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
  }

  .brand-status {
    display: flex !important;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.62rem;
    line-height: 1;
  }

  .brand-discord-link {
    font-size: 0.62rem;
    display: inline-flex;
    align-items: center;
  }

  .brand-discord-link span {
    font-size: 0.62rem;
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Header action items single-line on small screens */
  .header-actions {
    gap: 0.25rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    align-items: center;
  }

  /* Currency chips on small mobile */
  .minigames-currencies-bar {
    padding: 2px 6px;
    gap: 5px;
    font-size: 0.68rem;
    border-radius: 9999px;
  }

  /* Compact Astrolabe badge on small mobile */
  #astrolabe-header-badge.era-header-badge {
    padding: 2px 6px;
    font-size: 0.68rem;
    gap: 3px;
  }
  #header-era-timer {
    display: none;
  }

  /* Hide FiveM phone simulator toggle button on real mobile devices to streamline header */
  #btn-toggle-phone {
    display: none !important;
  }

  .btn-icon {
    width: 2.1rem;
    height: 2.1rem;
    min-width: 2.1rem;
    min-height: 2.1rem;
    border-radius: 8px;
  }

  .user-card {
    padding: 0.12rem 0.4rem 0.12rem 0.2rem;
    gap: 0.3rem;
  }

  .user-avatar {
    width: 1.55rem;
    height: 1.55rem;
  }

  .user-name {
    max-width: 4rem;
    font-size: 0.72rem;
  }

  .main-stage {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
    padding: 0.35rem 0.55rem calc(5.5rem + env(safe-area-inset-bottom, 0px)) 0.55rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Mobile Tabs Switcher */
  .mobile-section-tabs {
    display: flex !important;
    position: sticky;
    top: calc(3rem + env(safe-area-inset-top, 0px));
    z-index: 35;
    width: 100%;
    max-width: 100%;
    margin: 0.2rem 0 0.5rem 0;
    background: rgba(10, 16, 30, 0.98);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    padding: 3px;
    gap: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 10px rgba(56, 189, 248, 0.15);
  }

  .tab-btn {
    flex: 1;
    min-height: 2.65rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: manipulation;
  }

  .tab-btn:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.05);
  }

  .tab-btn.active {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.9) 0%, rgba(56, 189, 248, 0.8) 100%);
    border-color: #38bdf8;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 2px 12px rgba(56, 189, 248, 0.45);
  }

  .clicker-section {
    gap: 0.55rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: clip;
  }

  .clicker-section.mobile-hidden,
  .clicker-section.hidden-mobile {
    display: none !important;
  }

  .score-display {
    font-size: clamp(2.3rem, 11vw, 3.6rem) !important;
    margin: 0.1rem 0 0.25rem 0;
  }

  .score-meta-grid {
    gap: 0.25rem;
    padding: 0 0.1rem;
    justify-content: center;
  }

  .meta-pill, .combo-badge, .active-skin-badge, .prestige-badge, .dimension-status-tag {
    font-size: 0.68rem;
    padding: 0.2rem 0.45rem;
  }

  .bird-stage-wrapper {
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: visible;
  }

  .bird-click-target {
    width: clamp(10.5rem, 54vmin, 15.5rem);
    height: clamp(10.5rem, 54vmin, 15.5rem);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .buildings-section {
    display: none !important;
    padding: 0.65rem 0.5rem;
    border-radius: var(--radius-md);
    width: 100%;
  }

  .buildings-section.mobile-active {
    display: flex !important;
  }

  .buildings-toolbar {
    position: sticky;
    top: calc(6.2rem + env(safe-area-inset-top, 0px));
    z-index: 20;
    background: rgba(10, 16, 30, 0.99);
    margin-bottom: 0.55rem;
    padding: 0.35rem 0.45rem;
    border-radius: var(--radius-sm);
  }

  .buildings-list {
    max-height: none;
    padding-right: 0;
    padding-bottom: 2.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .building-card {
    padding: 0.65rem 0.55rem;
    gap: 0.55rem;
  }

  .building-icon-box {
    width: 2.65rem;
    height: 2.65rem;
    flex-shrink: 0;
  }

  .btn-buy-building {
    min-width: 4.6rem;
    min-height: 2.85rem;
    padding: 0.3rem 0.45rem;
    touch-action: manipulation;
  }

  /* Dock Inférieur Fixe Mobile */
  .app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(7, 12, 22, 0.99);
    border-top: 0.0625rem solid var(--surface-border-subtle);
    padding: 0.35rem 0.45rem max(0.45rem, env(safe-area-inset-bottom, 0px));
    flex-direction: column;
    gap: 0.3rem;
  }

  .footer-stats {
    width: 100%;
    justify-content: space-between;
    font-size: 0.7rem;
    padding: 0 0.25rem;
  }

  .footer-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    width: 100%;
    gap: 0.2rem;
  }

  .nav-link-btn {
    padding: 0.35rem 0.1rem;
    font-size: 0.62rem;
    flex-direction: column;
    gap: 0.15rem;
    justify-content: center;
    text-align: center;
    border-radius: var(--radius-xs);
    min-height: 2.75rem;
    touch-action: manipulation;
  }

  .nav-link-btn span {
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Modales Plein Écran Ergonomiques */
  .modal-backdrop {
    padding: clamp(0.35rem, 2vw, 0.65rem);
    align-items: center;
    justify-content: center;
  }

  .modal-container {
    width: 100%;
    max-width: 100vw;
    max-height: calc(100dvh - 1rem);
    border-radius: var(--radius-md);
  }

  .modal-header {
    padding: 0.65rem 0.85rem;
    position: sticky;
    top: 0;
    z-index: 25;
  }

  .modal-close,
  .btn-dialog-close,
  .custom-dialog-close-btn {
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    touch-action: manipulation;
    cursor: pointer;
  }

  .modal-body {
    padding: 0.75rem 0.65rem;
    gap: 0.65rem;
    -webkit-overflow-scrolling: touch;
  }

  .skins-grid { grid-template-columns: 1fr; }
  .prestige-stats-grid { grid-template-columns: 1fr; gap: 0.4rem; }
  .streak-calendar { gap: 0.2rem; }
  .streak-day-card { padding: 0.35rem 0.15rem; }
  .day-label { font-size: 0.58rem; }
  .day-mult { font-size: 0.62rem; }

  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-player-top-row { flex-direction: column; align-items: flex-start; gap: 0.45rem; }
  .admin-player-scores-summary { width: 100%; justify-content: space-between; text-align: left; }
}

/* --- PETITS SMARTPHONES (< 360px) --- */
@media (max-width: 22.5rem) {
  .brand-title span { display: none; }
  .footer-nav { grid-template-columns: repeat(3, 1fr); }
  .btn-buy-mode { padding: 0.15rem 0.35rem; }
}

/* ==========================================================================
   MODE SIMULATEUR TÉLÉPHONE FIVEM (phone-frame-active)
   ========================================================================== */

body.phone-frame-active {
  background: #030508;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 1rem);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

body.phone-frame-active #app-wrapper {
  width: min(94vw, 25.5rem);
  height: min(94dvh, 52rem);
  max-height: 94dvh;
  border-radius: 2.5rem;
  border: 0.55rem solid #151d2c;
  box-shadow: 
    0 0 0 0.125rem rgba(255, 255, 255, 0.1),
    0 1.8rem 5rem rgba(0, 0, 0, 0.95);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}

body.phone-frame-active .main-stage {
  grid-template-columns: 1fr !important;
  padding: 0.35rem 0.55rem 3.8rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

body.phone-frame-active .mobile-section-tabs { display: flex !important; }
body.phone-frame-active .buildings-section { display: none !important; }
body.phone-frame-active .buildings-section.mobile-active { display: flex !important; }
body.phone-frame-active .clicker-section.mobile-hidden { display: none !important; }
body.phone-frame-active .modal-container { max-width: 95%; max-height: 88%; }

/* ==========================================================================
   CUSTOM CONFIRM & ALERT DIALOG MODAL (100% Fluid, Cosmic Glow, Zero Native Popups)
   ========================================================================== */

.custom-dialog-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(3, 7, 18, 0.95) !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s ease;
}

.custom-dialog-backdrop.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 1000000 !important;
}

.custom-dialog-backdrop.hidden {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.custom-dialog-card {
  position: relative;
  width: min(92vw, 480px);
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.98) 0%, rgba(7, 12, 24, 0.99) 100%);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.12);
  padding: 24px;
  overflow: hidden;
  transform: scale(0.93) translateY(12px);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s ease;
  color: #f8fafc;
  font-family: var(--font-main, 'Plus Jakarta Sans', system-ui, sans-serif);
}

.custom-dialog-backdrop.open .custom-dialog-card {
  transform: scale(1) translateY(0);
}

.custom-dialog-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
  z-index: 0;
  opacity: 0.7;
}

.custom-dialog-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.custom-dialog-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(56, 189, 248, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.custom-dialog-title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.custom-dialog-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.custom-dialog-subtitle {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.custom-dialog-close-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.custom-dialog-close-btn:hover {
  color: #cbd5e1;
  transform: scale(1.1);
}

.custom-dialog-body {
  position: relative;
  z-index: 1;
  margin-bottom: 22px;
}

.custom-dialog-message {
  font-size: 0.94rem;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-line;
  word-break: break-word;
}

.custom-dialog-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.custom-dialog-btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
}

.btn-dialog-cancel {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}

.btn-dialog-cancel:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-dialog-confirm {
  color: #ffffff;
  font-weight: 700;
}

.btn-glow-cyan {
  background: linear-gradient(135deg, #0284c7, #06b6d4) !important;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #ffffff !important;
}

.btn-glow-cyan:hover {
  box-shadow: 0 6px 22px rgba(6, 182, 212, 0.65) !important;
  transform: translateY(-1px);
}

.btn-glow-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35) !important;
  border-color: rgba(255, 100, 100, 0.4) !important;
  color: #ffffff !important;
}

.btn-glow-danger:hover {
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.65) !important;
  transform: translateY(-1px);
}

.btn-glow-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35) !important;
  border-color: rgba(255, 200, 50, 0.4) !important;
  color: #ffffff !important;
}

.btn-glow-gold:hover {
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.65) !important;
  transform: translateY(-1px);
}

.btn-glow-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35) !important;
  border-color: rgba(52, 211, 153, 0.4) !important;
  color: #ffffff !important;
}

.btn-glow-success:hover {
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.65) !important;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   FLOATING CHAT BUBBLE & POPUP MODAL (#btn-chat-bubble & #bluebird-chat-dock)
   Dark Sapphire Titanium Theme (FiveM CEF Compliant - Zero Blur)
   -------------------------------------------------------------------------- */

/* 1. Floating Chat Bubble Button in Bottom-Left */
.floating-chat-bubble {
  position: fixed;
  bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
  left: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 9999;
  width: 3.35rem;
  height: 3.35rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #0d1b33 0%, #060c18 100%);
  border: 2px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 16px rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  touch-action: manipulation;
}

.floating-chat-bubble:hover {
  transform: scale(1.08) translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.95), 0 0 24px rgba(56, 189, 248, 0.65);
}

.floating-chat-bubble:active {
  transform: scale(0.95);
}

.chat-bubble-icon {
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.floating-chat-bubble:hover .chat-bubble-icon {
  transform: rotate(-8deg) scale(1.08);
}

.chat-bubble-online-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #060c18;
  box-shadow: 0 0 8px #10b981;
  animation: pulseOnlineDot 2s infinite ease-in-out;
}

.chat-bubble-badge {
  position: absolute;
  bottom: -2px;
  right: -4px;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  border: 1.5px solid #060c18;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  display: none;
}

.chat-bubble-badge.visible {
  display: inline-block;
}

/* 2. Floating Chat Popup Window (Above the bubble) */
#bluebird-chat-dock,
.bluebird-chat-dock {
  position: fixed;
  bottom: calc(8.4rem + env(safe-area-inset-bottom, 0px));
  left: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 10000;
  width: min(calc(100vw - 1.5rem), 380px);
  height: 480px;
  max-height: min(450px, calc(100dvh - 12rem));
  background: rgba(8, 14, 26, 0.98);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.92), 0 0 30px rgba(56, 189, 248, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

#bluebird-chat-dock.hidden,
.bluebird-chat-dock.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.95);
}

/* Header Bar */
.chat-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, rgba(17, 28, 52, 0.98) 0%, rgba(11, 19, 36, 0.98) 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.chat-brand-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.chat-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.5));
}

.chat-title-meta {
  display: flex;
  align-items: center;
}

.chat-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.chat-online-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  margin-left: 0.25rem;
}

.chat-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseOnlineDot 2s infinite ease-in-out;
}

@keyframes pulseOnlineDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.chat-header-actions {
  display: flex;
  align-items: center;
}

.btn-chat-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chat-icon:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  transform: scale(1.08);
}

/* Expanded Body */
.chat-expanded-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Tabs Bar */
.chat-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  background: rgba(10, 16, 30, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-tab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
}

.chat-tab-btn.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
}

/* Views */
.chat-view-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.chat-view-container.hidden {
  display: none !important;
}

/* Messages Stream */
.chat-messages-stream {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  scroll-behavior: smooth;
}

.chat-messages-stream::-webkit-scrollbar,
.chat-players-stream::-webkit-scrollbar {
  width: 5px;
}

.chat-messages-stream::-webkit-scrollbar-track,
.chat-players-stream::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}

.chat-messages-stream::-webkit-scrollbar-thumb,
.chat-players-stream::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 4px;
}

.chat-messages-stream::-webkit-scrollbar-thumb:hover,
.chat-players-stream::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.65);
}

/* Message Item */
.chat-msg-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.5rem 0.65rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: background 0.15s ease;
}

.chat-msg-item:hover {
  background: rgba(30, 41, 59, 0.75);
}

.chat-msg-item.self-msg {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.28);
}

.chat-msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
  flex-shrink: 0;
  border: 1.5px solid rgba(56, 189, 248, 0.3);
}

.chat-msg-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chat-msg-username {
  font-size: 0.76rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-msg-badge {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chat-msg-badge.badge-admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.chat-msg-badge.badge-founder {
  background: rgba(168, 85, 247, 0.25);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.chat-msg-badge.badge-player {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

.chat-msg-time {
  font-size: 0.65rem;
  color: #64748b;
  margin-left: auto;
  font-family: var(--font-mono);
}

.chat-msg-body {
  font-size: 0.8rem;
  color: #cbd5e1;
  word-break: break-word;
  line-height: 1.4;
  user-select: text;
}

/* Chat Input Bar */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.75rem;
  background: rgba(15, 23, 42, 0.98);
  border-top: 1px solid rgba(56, 189, 248, 0.2);
}

.chat-input-field {
  flex: 1;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  color: #f8fafc;
  font-size: 0.8rem;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input-field:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  background: rgba(30, 41, 59, 1);
}

.chat-input-field::placeholder {
  color: #64748b;
}

.btn-chat-send {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.4);
  flex-shrink: 0;
}

.btn-chat-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.7);
}

.btn-chat-send:active {
  transform: translateY(0);
}

/* Online Players List */
.chat-players-stream {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chat-player-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: background 0.15s ease;
}

.chat-player-item:hover {
  background: rgba(30, 41, 59, 0.75);
}

.chat-player-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.chat-player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #1e293b;
  border: 1.5px solid rgba(56, 189, 248, 0.3);
}

.chat-player-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #090e1a;
  box-shadow: 0 0 6px #10b981;
}

.chat-player-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.chat-player-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-player-username {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-player-score {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: #38bdf8;
}

.chat-empty-hint {
  text-align: center;
  color: #64748b;
  font-size: 0.8rem;
  padding: 2rem 0.5rem;
  line-height: 1.5;
}

/* Chat Admin Actions & Controls */
.btn-chat-clear-all {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-chat-clear-all:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.btn-chat-clear-all.hidden {
  display: none !important;
}

.chat-msg-admin-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

.btn-chat-admin-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 0.68rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  touch-action: manipulation;
  flex-shrink: 0;
}

.btn-chat-admin-act.btn-act-del {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.btn-chat-admin-act.btn-act-del:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.55);
}

.btn-chat-admin-act.btn-act-mute {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.btn-chat-admin-act.btn-act-mute:hover {
  background: rgba(245, 158, 11, 0.4);
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.55);
}

.btn-chat-admin-act.btn-act-ban {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.45);
  color: #f87171;
}

.btn-chat-admin-act.btn-act-ban:hover {
  background: rgba(220, 38, 38, 0.45);
  border-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.65);
}

.chat-player-admin-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Responsive adjustments for smaller devices */
@media (max-width: 768px) {
  .floating-chat-bubble {
    bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px));
    left: clamp(0.75rem, 2vw, 1.25rem);
  }

  #bluebird-chat-dock,
  .bluebird-chat-dock {
    bottom: calc(8.4rem + env(safe-area-inset-bottom, 0px));
    left: clamp(0.75rem, 2vw, 1.25rem);
    width: min(calc(100vw - 1.5rem), 380px);
    max-height: min(450px, calc(100dvh - 12rem));
  }
}

