@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Chicle&family=Fredoka:wght@300..700&family=Press+Start+2P&display=swap');

/* =========================================
   KISSBOOK GAMES - STYLE PRINCIPAL
   ========================================= */

/* --- 1. Container & Layout --- */
/* --- 1. Container & Layout --- */
#kbg-container {
  width: 100%;
  max-width: 100% !important;
  /* Full Window PC/Tab */
  margin: 0 auto;
  background: #0f172a;
  /* Slate 900 */
  border-radius: 0;
  /* Remove radius for full immersion */
  box-shadow: none;
  /* Remove shadow for full width */
  overflow: hidden;
  position: relative;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #cbd5e1;
  /* Slate 300 */
  box-sizing: border-box;
  min-height: 80vh;
  /* Ensure plausible height on PC */
}

/* Mobile Fullscreen Override */
@media (max-width: 768px) {
  #kbg-container {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    /* On top of WP Header/Footer */
    margin: 0 !important;
    border: none !important;
  }

  /* Hide potential overflow from body when game is open */
  body {
    overflow: hidden;
  }
}

/* --- 2. Header & Top Bar --- */
#kbg-topbar,
.kbg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #1e293b;
  /* Slate 800 */
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 20000;
  height: 60px;
  box-sizing: border-box;
}

#kbg-topbar.kbg-in-game {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
}

#kbg-game-title,
.kbg-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
}

#kbg-controls,
.kbg-controls {
  display: flex;
  gap: 10px;
}

.kbg-btn,
button {
  background: #334155;
  border: none;
  color: #e2e8f0;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.kbg-btn:hover,
button:hover {
  background: #475569;
  transform: translateY(-1px);
}

.kbg-btn:active,
button:active {
  transform: translateY(0);
}

/* --- 2b. Toolbar & Filters (Missing in V3.33) --- */
#kbg-games-toolbar {
  padding: 15px 20px;
  background: transparent;
  border-bottom: none;
}

#kbg-filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Info Bar (New) --- */
#kbg-games-info-bar {
  display: none !important;
  /* Totalement supprimé comme demandé */
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: transparent;
  border-bottom: none;
  color: #94a3b8;
  font-size: 0.9rem;
}

#kbg-games-info-bar>div {
  display: flex;
  align-items: center;
  gap: 10px;
}

#kbg-search {
  width: 150px;
  padding: 8px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  border-radius: 6px;
}

#kbg-cat-filter,
#kbg-type-filter {
  padding: 8px 30px 8px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
}


/* --- 3. Stage (Canvas Area) --- */
#kbg-games-stage {
  width: 100%;
  /* height set by JS via aspect/settings */
  background: #000;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Iframe du jeu */
#kbg-games-iframe {
  width: 100%;
  height: calc(100vh - 60px);
  border: none;
  display: none;
  background: #000;
}

#kbg-container:fullscreen #kbg-games-iframe,
#kbg-container.kbg-fullscreen #kbg-games-iframe {
  height: 100vh;
}


/* --- 4. Placeholder / Menu --- */
#kbg-games-intro-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  z-index: 10;
  text-align: center;
  padding: 20px;
  transition: opacity 0.5s, z-index 0s 0.5s;
  /* Delay z-index change */
}

#kbg-games-intro-placeholder.is-hidden {
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.kbg-ph-content h2 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 10px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.kbg-ph-content p {
  font-size: 1.1rem;
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto 30px auto;
}

.kbg-play-btn {
  background: linear-gradient(to right, #ec4899, #8b5cf6);
  color: white;
  font-size: 1.5rem;
  padding: 15px 40px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.kbg-play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.7);
}


/* --- 5. Info Bar (Footer) --- */
.kbg-infobar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #1e293b;
  border-top: 1px solid #334155;
  font-size: 0.9rem;
}

.kbg-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kbg-stat strong {
  color: #fff;
}


/* --- 6. Modal / Overlay System (Alarmes, Settings) --- */
.kbg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
}

.kbg-modal {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  opacity: 0;
  animation: kbg-slide-up 0.3s forwards;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@keyframes kbg-slide-up {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.kbg-modal-header {
  background: #0f172a;
  padding: 15px 20px;
  border-bottom: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kbg-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.kbg-modal-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.kbg-modal-close:hover {
  color: #fff;
}

.kbg-modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}


/* --- 7. Clock & Alarm Specifics --- */
.kbg-clock-display {
  font-family: 'Courier New', monospace;
  font-size: 1.2rem;
  background: #000;
  color: #22c55e;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #22c55e;
  cursor: pointer;
}

.kbg-clock-display:hover {
  background: #052e16;
}

/* Alarm List Items */
.kbg-alarm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #334155;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  border-left: 4px solid #3b82f6;
}

.kbg-alarm-item.disabled {
  opacity: 0.6;
  border-left-color: #64748b;
}

.kbg-alarm-info {
  display: flex;
  flex-direction: column;
}

.kbg-alarm-time {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
}

.kbg-alarm-meta {
  font-size: 0.8rem;
  color: #94a3b8;
}

.kbg-alarm-actions {
  display: flex;
  gap: 8px;
}

/* Time Picker Custom */
.kbg-time-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: #020617;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #1e293b;
}

.kbg-tp-display {
  display: flex;
  align-items: center;
  font-size: 2.5rem;
  font-weight: bold;
  color: #fff;
}

.kbg-tp-val {
  min-width: 60px;
  text-align: center;
}

.kbg-tp-controls {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kbg-tp-btn-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kbg-tp-btn {
  background: #334155;
  border: none;
  color: #fff;
  width: 40px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kbg-tp-btn:hover {
  background: #475569;
}

.kbg-tp-btn:active {
  background: #1e293b;
}


/* --- 8. Animations (Intro / Alarm Ringing) --- */
@keyframes kbg-pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    border-color: #dc2626;
  }

  70% {
    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    border-color: #ef4444;
  }

  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    border-color: #dc2626;
  }
}

.kbg-server-ringing {
  animation: kbg-pulse-red 1s infinite;
  position: relative;
  z-index: 10001;
  /* Above almost everything */
}


/* ALARM OVERLAY (User visual Feedback) */
#kbg-alarm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  pointer-events: none;
  /* Let clicks pass through usually, unless active? */
  z-index: 99999;
  mix-blend-mode: overlay;
  transition: background-color 0.5s;
}

#kbg-alarm-overlay.ringing {
  pointer-events: auto;
  /* Catch clicks to dismiss if we want */
  cursor: pointer;
  animation: kbg-flash-screen 0.5s infinite alternate;
}

@keyframes kbg-flash-screen {
  from {
    background-color: rgba(255, 0, 0, 0.1);
  }

  to {
    background-color: rgba(255, 0, 0, 0.4);
  }
}

/* Shake Animation */
@keyframes kbg-shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }

  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }

  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }

  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }

  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }

  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }

  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }

  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }

  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }

  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }

  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

.kbg-shake {
  animation: kbg-shake 0.5s;
  animation-iteration-count: infinite;
}

/* --- 9. Cinema Intro Specifics --- */
.intro-logo {
  opacity: 0;
  transform: scale(0.8);
  animation: introLogoPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  animation-delay: 0.5s;
}

@keyframes introLogoPop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.intro-title {
  opacity: 0;
  transform: translateY(20px);
  animation: introTitleSlide 0.8s ease-out forwards;
  animation-delay: 0.8s;
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  margin: 0;
  line-height: 1.2;
}

@keyframes introTitleSlide {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loader Styles (V3) */
.kbg-intro-loader {
  opacity: 0;
  transition: opacity 0.5s;
  text-align: center;
  color: #fff;
}

.kbg-loader-text-step {
  font-size: 0.9rem;
  margin-bottom: 5px;
  font-family: monospace;
  opacity: 0.8;
}

.kbg-loader-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.kbg-loader-bar-fill {
  width: 0%;
  height: 100%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
  transition: width 0.1s linear;
}

.kbg-loader-end-msg {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  color: #22c55e;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
}

.kbg-loader-end-msg.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* --- 10. Helper Utilities --- */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

/* --- 11. Fonts Classes (Cinema Editor) --- */
.kbg-font-comic {
  font-family: 'Bangers', cursive;
  letter-spacing: 2px;
}

.kbg-font-cartoon {
  font-family: 'Fredoka', sans-serif;
}

.kbg-font-bubble {
  font-family: 'Chicle', cursive;
}

.kbg-font-retro {
  font-family: 'Press Start 2P', cursive;
  text-transform: uppercase;
  font-size: 0.8em;
}


/* =========================================
   12. GRID & GAME CARDS (PRO VERSION)
   ========================================= */

#kbg-games-grid {
  display: grid;
  /* Wider cards for better readability */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  padding: 25px;
}

.kbg-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  /* Fill the grid cell height perfectly */
  /* background moved to .kbg-card-content */
  border: 1px solid #334155;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.kbg-card-content {
  background: #1e293b;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.kbg-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #38bdf8;
  /* Sky 400 highlight */
  z-index: 5;
}

.kbg-card.is-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.kbg-card.kbg-dimmed {
  opacity: 0.3;
  filter: grayscale(100%);
}

/* Image Container */
.kbg-card-img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: #0f172a;
  overflow: hidden;
  /* separate img from content visually */
  border-bottom: 1px solid #1e293b;
}

.kbg-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.kbg-card:hover .kbg-card-img-wrap img {
  transform: scale(1.08);
  /* Subtle zoom */
}

/* Card Content Wrapper */
/* Note: Since we don't have a wrapper div in JS, we style the children to act like one.
   But to make flex-grow work on Description, the parent is .kbg-card (flex-col).
*/

.kbg-card .title {
  padding: 16px 20px 8px 20px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  /* Slate 50 */
  /* Allow title to wrap? Or truncate? Let's truncate for tidiness */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Description - The Flex Grower */
.kbg-card .desc {
  padding: 0 20px 16px 20px;
  font-size: 0.95rem;
  color: #cbd5e1;
  /* Slate 300 - Lighter for readability */
  line-height: 1.6;
  flex-grow: 1;
  /* Pushes footer down */
  display: flex;
  flex-direction: column;
}

/* Handle overflow descriptions elegantly */
.kbg-card .desc:not(.expanded) {
  /* Multiline truncate fallback */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kbg-card .desc.expanded {
  overflow-y: auto;
  max-height: 200px;
  /* Safety cap */
  -webkit-line-clamp: unset;
}

.kbg-read-more {
  color: #38bdf8;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  display: inline-block;
}

.kbg-read-more:hover {
  text-decoration: underline;
}

/* Tags List */
.kbg-tags-list {
  padding: 0 20px 10px 20px;
}

/* Footer / Badges Area */
.kbg-badges {
  margin-top: auto;
  /* Double ensure it sits at bottom */
  padding: 12px 20px;
  background: #0f172a;
  /* Slate 900 */
  border-top: 1px solid #334155;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 55px;
  /* Ensure uniform footer height visually */
}

/* Badge Styles */
.kbg-badge {
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Cartoon Compatibility Icons */
.kbg-badge.icon img {
  width: 28px;
  height: auto;
  vertical-align: middle;
  transition: transform 0.2s;
  display: block;
  /* Fix vertical alignment issues */
}

.kbg-badge.icon:hover img {
  transform: scale(1.2) rotate(-5deg);
}

.kbg-badge.icon {
  background: transparent;
  /* Remove background for cleaner look on icons if desired, or keep */
  border: none;
  padding: 0 4px;
}



.kbg-badge.online {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.kbg-badge.local {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.kbg-badge.solo {
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
  border: 1px solid rgba(203, 213, 225, 0.2);
}

.kbg-badge.beta {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Compatibility Icons */
.kbg-badge.icon {
  padding: 4px 6px;
  font-size: 1rem;
  background: transparent;
  color: #94a3b8;
}

/* Separator in badges */
.kbg-sep {
  color: #475569;
  font-size: 1.2rem;
  font-weight: 300;
  margin: 0 2px;
}

/* Status Row (Jouable / Dev) */
.kbg-status-row {
  font-size: 0.8rem;
  padding: 4px 12px;
  margin: 0 20px 10px 20px;
  /* Below tags, above footer */
  border-radius: 4px;
  display: inline-block;
  font-weight: 600;
}

.kbg-status-row.play {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  width: fit-content;
}

.kbg-status-row.maint {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  width: fit-content;
}

/* Dev Block Progress */
.kbg-dev-block {
  margin: 0 20px 10px 20px;
}

.kbg-dev-label {
  font-size: 0.8rem;
  color: #fca5a5;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.kbg-progress-track {
  width: 100%;
  height: 6px;
  background: #334155;
  border-radius: 3px;
  overflow: hidden;
}

.kbg-progress-fill {
  display: block;
  height: 100%;
  background: #f43f5e;
}

/* Pagination */
#kbg-pagination button.active {
  background: #38bdf8 !important;
  color: #0f172a !important;
  border-color: #38bdf8 !important;
}

/* =======================================================
   ❤️ SWIPE FEATURE (Rencontres)
   ======================================================= */
#kbg-swipe-section {
  margin: 20px 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 12px;
}

#kbg-swipe-container {
  position: relative;
  width: 300px;
  height: 400px;
  margin: 0 auto 15px auto;
}

#kbg-swipe-stack {
  position: relative;
  width: 100%;
  height: 100%;
}

.kbg-swipe-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: flex;
  flex-direction: column;
}

.kbg-swipe-card:active {
  cursor: grabbing;
}

.kbg-card-image {
  flex: 1;
  background-size: cover;
  background-position: center;
}

.kbg-card-info {
  padding: 15px;
  background: linear-gradient(to bottom, #1e293b, #0f172a);
  color: #fff;
  text-align: left;
}

.kbg-card-info h3 {
  margin: 0 0 5px 0;
  font-size: 1.2rem;
  color: #38bdf8;
}

.kbg-card-age {
  font-weight: normal;
  color: #94a3b8;
  font-size: 0.9rem;
}

/* =======================================================
   💌 MULTIPLAYER INVITATIONS
   ======================================================= */
.kbg-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 99999;
  /* Highest priority */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Voice Manager Button */
.kbg-voice-btn {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #22c55e;
  color: #22c55e;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 10px;
  animation: pulse-green 2s infinite;
}

.kbg-voice-btn:hover {
  background: rgba(34, 197, 94, 0.4);
  transform: scale(1.1);
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Voice Manager Modal */
.kbg-voice-list {
  margin-top: 15px;
}

.kbg-voice-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.kbg-voice-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kbg-voice-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.kbg-voice-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kbg-voice-vol {
  width: 80px;
}

.kbg-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  transition: transform 0.2s;
}

.kbg-icon-btn:hover {
  transform: scale(1.1);
}

.kbg-btn-kick {
  color: #ef4444;
}

.kbg-btn-mute {
  color: #94a3b8;
}

.kbg-btn-mute.active {
  color: #ef4444;
}

/* Muted state */

.kbg-modal-content {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 25px;
  width: 90%;
  max-width: 450px;
  position: relative;
  color: white;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.kbg-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
}

.kbg-modal-close:hover {
  color: white;
}

/* Grid for Game Selection */
.kbg-invite-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 15px;
  max-height: 300px;
  overflow-y: auto;
}

.kbg-invite-game-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

.kbg-invite-game-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.kbg-invite-game-card span {
  font-size: 0.85rem;
  line-height: 1.2;
  color: #e2e8f0;
}

/* Incoming Invite Styles */
.kbg-invite-incoming {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.kbg-invite-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #38bdf8;
  object-fit: cover;
}

.kbg-invite-actions {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  width: 100%;
}

.kbg-invite-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  text-transform: uppercase;
}

.kbg-btn-primary {
  background: #38bdf8;
  color: #0f172a;
}

.kbg-btn-primary:hover {
  background: #7dd3fc;
}

.kbg-btn-secondary {
  background: #475569;
  color: white;
}

.kbg-btn-secondary:hover {
  background: #64748b;
}

.kbg-btn-danger {
  background: #ef4444;
  color: white;
}

.kbg-btn-danger:hover {
  background: #f87171;
}

.kbg-spinner {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #38bdf8;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.kbg-error {
  color: #f87171;
  font-size: 0.9rem;
}

.kbg-card-play-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(56, 189, 248, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.kbg-card-play-btn:hover {
  transform: scale(1.1);
  background: #38bdf8;
}

.kbg-card-voice-btn {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(74, 222, 128, 0.9);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.kbg-card-voice-btn:hover {
  transform: scale(1.1);
  background: #4ade80;
}

.kbg-card-info p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.kbg-swipe-overlay {
  position: absolute;
  top: 40px;
  padding: 10px 20px;
  border: 4px solid;
  border-radius: 8px;
  font-size: 2rem;
  font-weight: bold;
  text-transform: uppercase;
  opacity: 0;
  transform: rotate(-15deg);
  pointer-events: none;
  z-index: 10;
}

.kbg-overlay-like {
  left: 20px;
  color: #4ade80;
  border-color: #4ade80;
  transform: rotate(-15deg);
}

.kbg-overlay-pass {
  right: 20px;
  color: #f87171;
  border-color: #f87171;
  transform: rotate(15deg);
}

.kbg-swipe-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.kbg-swipe-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.kbg-swipe-btn:hover {
  transform: scale(1.1);
}

#kbg-swipe-pass-btn {
  background: #ef4444;
  color: #fff;
}

#kbg-swipe-like-btn {
  background: #22c55e;
  color: #fff;
}

.kbg-swipe-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-style: italic;
}

/* =========================================
   SWIPE LAYOUT (Split View) - NEW FOR v3.34
   ========================================= */
.kbg-swipe-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  align-items: flex-start;
  max-width: 1100px;
  margin: 0 auto;
}

/* Left Panel: Detailed Info */
#kbg-swipe-details-panel {
  flex: 1;
  min-width: 300px;
  background: #1e293b;
  border-radius: 12px;
  padding: 25px;
  border: 1px solid #334155;
  text-align: left;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Right Panel: The Stack */
#kbg-swipe-stage {
  flex: 0 0 340px;
  /* Fixed width for card stack container */
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Profile Elements */
.kbg-profile-big-img {
  width: 100%;
  aspect-ratio: 1;
  /* Square for main profile pic */
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  background: #0f172a;
  border: 1px solid #334155;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.kbg-profile-big-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kbg-profile-info h2 {
  margin: 0 0 8px 0;
  color: #f8fafc;
  font-size: 1.8rem;
  font-weight: 700;
}

.kbg-meta-row {
  color: #38bdf8;
  /* Highlight color */
  font-size: 1.1rem;
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  font-weight: 600;
  align-items: center;
}

.kbg-bio-text {
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 25px;
  font-size: 1rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #38bdf8;
}

/* Games List */
.kbg-games-played-section h4 {
  color: #fff;
  margin-bottom: 10px;
  border-bottom: 1px solid #334155;
  padding-bottom: 5px;
}

#kbg-swipe-games-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

#kbg-swipe-games-list li {
  background: #0f172a;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #cbd5e1;
  border: 1px solid #334155;
  text-align: center;
}

/* =========================================
   INTRO CINEMA EDITOR STYLES
   ========================================= */

/* --- Fonts --- */
.kbg-font-bold {
  font-family: 'Segoe UI', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
}

.kbg-font-bangers {
  font-family: 'Bangers', cursive;
  letter-spacing: 2px;
}

.kbg-font-chicle {
  font-family: 'Chicle', serif;
  letter-spacing: 1px;
}

.kbg-font-fredoka {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
}

.kbg-font-press {
  font-family: 'Press Start 2P', cursive;
  font-size: 2rem !important;
}

/* --- Title Animations --- */
.kbg-t-anim-fade {
  animation: introFadeIn 2s ease forwards;
}

.kbg-t-anim-zoom {
  animation: introZoomIn 3s cubic-bezier(0, 1.2, 1, 1) forwards;
}

.kbg-t-anim-slide {
  animation: introSlideUp 1.5s ease-out forwards;
}

.kbg-t-anim-bounce {
  animation: introBounce 1.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
}

.kbg-t-anim-typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: .15em solid orange;
  animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

.kbg-t-anim-neon {
  animation: neonGlow 1.5s ease-in-out infinite alternate;
}

.kbg-t-anim-glitch {
  animation: glitchText 2s infinite;
  position: relative;
}

/* --- Background Animations --- */
/* Kenburns handled via JS scaling, but we can add keyframes if needed. 
   Currently JS sets --kbg-scale-start/end */
.kbg-anim-kenburns_in {
  animation: kenburnsIn 10s linear forwards;
}

.kbg-anim-kenburns_out {
  animation: kenburnsOut 10s linear forwards;
}

.kbg-anim-pan_left {
  animation: panLeft 15s linear infinite;
}

.kbg-anim-pulse {
  animation: bgPulse 5s infinite alternate;
}

/* --- Filters --- */
.kbg-filter-darken::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

.kbg-filter-sepia {
  filter: sepia(0.8);
}

.kbg-filter-bw {
  filter: grayscale(1);
}

.kbg-filter-blur {
  filter: blur(3px);
}

.kbg-filter-vignette::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, transparent 40%, black 100%);
  z-index: 2;
}

/* --- Logo Effects --- */
.kbg-fx-glow {
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.kbg-fx-shadow {
  filter: drop-shadow(5px 5px 5px rgba(0, 0, 0, 0.8));
}

.kbg-fx-mirror {
  transform: scaleY(-1);
  mask-image: linear-gradient(transparent, white);
  opacity: 0.5;
}

/* --- Keyframes --- */
@keyframes introFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes introZoomIn {
  from {
    transform: scale(0.5);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes introSlideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes introBounce {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }

  70% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes neonGlow {
  from {
    text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #e60073, 0 0 40px #e60073, 0 0 50px #e60073, 0 0 60px #e60073, 0 0 70px #e60073;
  }

  to {
    text-shadow: 0 0 20px #fff, 0 0 30px #ff4da6, 0 0 40px #ff4da6, 0 0 50px #ff4da6, 0 0 60px #ff4da6, 0 0 70px #ff4da6, 0 0 80px #ff4da6;
  }
}

@keyframes kenburnsIn {
  from {
    transform: scale(var(--kbg-scale-start, 1));
  }

  to {
    transform: scale(var(--kbg-scale-end, 1.3));
  }
}

@keyframes kenburnsOut {
  from {
    transform: scale(var(--kbg-scale-end, 1.3));
  }

  to {
    transform: scale(var(--kbg-scale-start, 1));
  }
}

@keyframes panLeft {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 100% 50%;
  }
}

/* =========================================
   FULLSCREEN UI OVERRIDES
   ========================================= */

/* 1. Main Container: Hide Scroll & Center */
#kbg-container:fullscreen {
  overflow: hidden !important;
  /* No scroll */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #0f172a;
  padding: 0;
}

/* Hide UI Bars in Fullscreen */
#kbg-container:fullscreen #kbg-topbar,
#kbg-container:fullscreen #kbg-info,
#kbg-container:fullscreen #kbg-toolbar,
#kbg-container:fullscreen #kbg-filters-bar,
#kbg-container:fullscreen #kbg-status {
  display: none !important;
}

/* Ensure Iframe is Visible and fills screen in Fullscreen */
#kbg-container:fullscreen #kbg-iframe {
  display: block !important;
  width: 100vw !important;
  height: 100vh !important;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
  background: black;
  border: none;
}

#kbg-container:fullscreen #kbg-stage {
  display: block !important;
  width: 100vw !important;
  height: 100vh !important;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9998;
  background: #000;
}

#kbg-container:fullscreen #kbg-grid {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  /* Changed from center to allow scroll from top */
  gap: 20px;
  /* Increased gap */
  width: 100%;
  max-width: 100%;
  /* Remove constraint */
  height: 100%;
  overflow-y: auto;
  padding: 60px;
  /* More padding */
  align-content: center;
  /* keep centered vertically if few items */
}

/* 2. Simplified Game Cards (Image Only) */
#kbg-container:fullscreen .kbg-card {
  width: auto;
  max-width: 500px;
  /* Increased from 350px */
  height: auto;
  min-height: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  transform: scale(1);
  transition: transform 0.3s ease, filter 0.3s ease;
}

#kbg-container:fullscreen .kbg-card:hover {
  transform: scale(1.1);
  z-index: 10;
}

#kbg-container:fullscreen .kbg-card.is-active img {
  box-shadow: 0 0 0 4px #38bdf8, 0 0 30px #38bdf8;
  transform: scale(1.15);
}

#kbg-container:fullscreen .kbg-card .kbg-card-img-wrap {
  height: auto;
  border-radius: 16px;
  overflow: visible;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

#kbg-container:fullscreen .kbg-card img {
  border-radius: 16px;
  display: block;
  max-height: 40vh;
  /* Increased from 25vh */
  width: auto;
  object-fit: contain;
}

/* Hide Details */
#kbg-container:fullscreen .kbg-card .kbg-card-content {
  display: none !important;
}

/* 3. Placeholder Centering */
#kbg-container:fullscreen #kbg-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  z-index: 5;
}

/* 4. Fullscreen Swipe (Rencontres) Fixes */
#kbg-container:fullscreen #kbg-rencontres-container {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  background: radial-gradient(circle at center, #1e293b 0%, #000 100%);
}

#kbg-container:fullscreen #kbg-swipe-layout {
  max-width: 1600px !important;
  width: 100% !important;
  height: 100% !important;
  padding: 40px;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

#kbg-container:fullscreen #kbg-swipe-details-panel {
  /* Optionally hide details in full screen to focus on stack, or scale it?
       User said "pas terrible", implying it looks small/bad. 
       Let's keep it but make it look better. */
  flex: 1;
  height: 80vh;
  max-width: 400px;
  background: rgba(15, 23, 42, 0.8);
  /* Darker background */
}

#kbg-container:fullscreen #kbg-swipe-stage {
  flex: 2;
  height: 100%;
  justify-content: center;
  align-items: center;
  padding-top: 0;
}

#kbg-container:fullscreen #kbg-swipe-container {
  width: 100% !important;
  max-width: 60vh !important;
  /* Scale with height */
  height: 80vh !important;
  /* Override fixed 550px */
}

/* =========================================
   13. INTRO ANIMATIONS & EFFECTS (V4)
   ========================================= */

/* --- A. Entrance Animations (Logo/Title) --- */
.kbg-anim-fade {
  animation: kbgFadeIn 1s ease-out forwards;
}

.kbg-anim-zoom_in {
  animation: kbgZoomIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.kbg-anim-zoom_out {
  animation: kbgZoomOut 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.kbg-anim-slide_up {
  animation: kbgSlideUp 0.8s ease-out forwards;
}

.kbg-anim-slide_down {
  animation: kbgSlideDown 0.8s ease-out forwards;
}

.kbg-anim-bounce {
  animation: kbgBounce 1s ease-out forwards;
}

.kbg-anim-rubberBand {
  animation: kbgRubberBand 1s forwards;
}

.kbg-anim-rotateIn {
  animation: kbgRotateIn 1s ease-out forwards;
}

@keyframes kbgFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes kbgZoomIn {
  from {
    opacity: 0;
    transform: scale(0.3);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes kbgZoomOut {
  from {
    opacity: 0;
    transform: scale(1.5);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes kbgSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kbgSlideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kbgBounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-30px);
  }

  60% {
    transform: translateY(-15px);
  }
}

@keyframes kbgRubberBand {
  0% {
    transform: scale3d(1, 1, 1);
  }

  30% {
    transform: scale3d(1.25, 0.75, 1);
  }

  40% {
    transform: scale3d(0.75, 1.25, 1);
  }

  50% {
    transform: scale3d(1.15, 0.85, 1);
  }

  65% {
    transform: scale3d(0.95, 1.05, 1);
  }

  75% {
    transform: scale3d(1.05, 0.95, 1);
  }

  100% {
    transform: scale3d(1, 1, 1);
  }
}

@keyframes kbgRotateIn {
  from {
    transform-origin: center;
    transform: rotate3d(0, 0, 1, -200deg);
    opacity: 0;
  }

  to {
    transform-origin: center;
    transform: none;
    opacity: 1;
  }
}

/* --- B. Loop Effects (Infinite) --- */
.kbg-fx-pulse {
  animation: kbgPulse 2s infinite;
}

.kbg-fx-float {
  animation: kbgFloat 3s ease-in-out infinite;
}

.kbg-fx-glow {
  animation: kbgGlow 2s ease-in-out infinite alternate;
}

.kbg-fx-shake {
  animation: kbgShake 2s infinite;
}

/* Slower shake */
.kbg-fx-neon {
  animation: kbgNeon 1.5s ease-in-out infinite alternate;
}

.kbg-fx-glitch {
  animation: kbgGlitch 2s infinite;
}

@keyframes kbgPulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes kbgFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes kbgGlow {
  from {
    filter: drop-shadow(0 0 2px #fff);
  }

  to {
    filter: drop-shadow(0 0 10px #38bdf8);
  }
}

@keyframes kbgNeon {
  from {
    filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px #ff00de);
  }

  to {
    filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px #ff00de) drop-shadow(0 0 10px #ff00de);
  }
}

/* Reuse kbgShake but generic name collision check? Reuse existing kbg-shake if present */
@keyframes kbgGlitch {

  2%,
  64% {
    transform: translate(2px, 0) skew(0deg);
  }

  4%,
  60% {
    transform: translate(-2px, 0) skew(0deg);
  }

  62% {
    transform: translate(0, 0) skew(5deg);
  }
}

/* --- C. Background Animations (Container Level) --- */
.kbg-bg-kenburns_in {
  animation: kbgBgZoomIn 10s ease-out forwards;
}

.kbg-bg-kenburns_out {
  animation: kbgBgZoomOut 10s ease-out forwards;
}

.kbg-bg-pan_left {
  animation: kbgBgPanLeft 15s linear infinite;
}

.kbg-bg-pan_right {
  animation: kbgBgPanRight 15s linear infinite;
}

.kbg-bg-spin_slow {
  animation: kbgBgSpin 30s linear infinite;
}

.kbg-bg-zoom_pulse {
  animation: kbgBgZoomPulse 5s infinite;
}

@keyframes kbgBgZoomIn {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.15);
  }
}

@keyframes kbgBgZoomOut {
  from {
    transform: scale(1.15);
  }

  to {
    transform: scale(1);
  }
}

@keyframes kbgBgPanLeft {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 100% 50%;
  }
}

@keyframes kbgBgPanRight {
  from {
    background-position: 100% 50%;
  }

  to {
    background-position: 0% 50%;
  }
}

@keyframes kbgBgSpin {
  from {
    transform: rotate(0deg) scale(1.2);
  }

  to {
    transform: rotate(360deg) scale(1.2);
  }
}

@keyframes kbgBgZoomPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

/* --- D. Filters (Classes) --- */
.kbg-filter-blur {
  filter: blur(3px);
}

.kbg-filter-grayscale {
  filter: grayscale(100%);
}

.kbg-filter-sepia {
  filter: sepia(80%);
}

.kbg-filter-darken {
  filter: brightness(0.6);
}

.kbg-filter-vintage {
  filter: sepia(0.5) contrast(1.2) brightness(0.9);
}

.kbg-filter-invert {
  filter: invert(1);
}

/* --- E. Title Animations (Aliased) --- */
.kbg-t-anim-fade {
  animation: kbgFadeIn 1s ease-out forwards;
}

.kbg-t-anim-zoom {
  animation: kbgZoomIn 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.kbg-t-anim-neon {
  animation: kbgNeonText 1.5s ease-in-out infinite alternate;
}

.kbg-t-anim-glitch {
  animation: kbgGlitchText 2s infinite;
}

.kbg-t-anim-bounce {
  animation: kbgBounce 1s ease-out forwards;
}

.kbg-t-anim-typewriter {
  overflow: hidden;
  border-right: .15em solid orange;
  white-space: nowrap;
  animation: kbgTyping 3.5s steps(40, end), kbgBlink .75s step-end infinite;
  max-width: fit-content;
  margin: 0 auto;
}

@keyframes kbgNeonText {
  from {
    text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #ff00de, 0 0 30px #ff00de;
  }

  to {
    text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #ff00de, 0 0 40px #ff00de;
  }
}

@keyframes kbgGlitchText {
  0% {
    transform: translate(0);
  }

  20% {
    transform: translate(-2px, 2px);
  }

  40% {
    transform: translate(-2px, -2px);
  }

  60% {
    transform: translate(2px, 2px);
  }

  80% {
    transform: translate(2px, -2px);
  }

  100% {
    transform: translate(0);
  }
}

@keyframes kbgTyping {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes kbgBlink {

  from,
  to {
    border-color: transparent
  }

  50% {
    border-color: orange;
  }
}

/* =========================================
   13. DIRECTORY GRID (RENCONTRES)
   ========================================= */

.kbg-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

/* Profile Card similar to Game Card but for Users */
.kbg-profile-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

.kbg-profile-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  border-color: #f43f5e;
  /* Rose 500 for romance/dating vibe */
}

/* Header with Image */
.kbg-pcard-header {
  height: 250px;
  /* Portait format */
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #0f172a;
}

.kbg-pcard-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.kbg-profile-card:hover .kbg-pcard-header img {
  transform: scale(1.05);
}

/* Age Badge overlay */
.kbg-pcard-age {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: bold;
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Body Content */
.kbg-pcard-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 5px;
}

.kbg-pcard-body h4 {
  margin: 0;
  color: #f8fafc;
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kbg-pcard-city {
  margin: 0;
  color: #94a3b8;
  font-size: 0.85rem;
}

.kbg-pcard-stats {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #334155;
  font-size: 0.8rem;
  color: #cbd5e1;
  display: flex;
  gap: 10px;
}

.kbg-pcard-view-btn {
  margin-top: 10px;
  width: 100%;
  background: #334155;
  border: 1px solid #475569;
}

.kbg-pcard-view-btn:hover {
  background: #f43f5e;
  color: white;
  border-color: #f43f5e;
}

/* Filter Bar Specifics */
.kbg-directory-filters {
  justify-content: center !important;
  gap: 15px !important;
}

.kbg-directory-filters input,
.kbg-directory-filters select {
  font-size: 1rem !important;
  padding: 10px 15px !important;
}

.kbg-directory-filters input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.kbg-directory-filters input:focus {
  outline: none;
  border-color: #f43f5e;
  background: rgba(0, 0, 0, 0.5);
}

#kbg-dir-page-info {
  color: #94a3b8;
  font-size: 0.9rem;
  min-width: 80px;
  text-align: center;
}

/* Superlike Button Override */
.kbg-swipe-btn.superlike {
  width: 90px !important;
  height: 90px !important;
  font-size: 3rem !important;
  border-color: #ffd700 !important;
  /* Gold */
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6) !important;
}

.kbg-swipe-btn.superlike img {
  width: 80% !important;
  height: 80% !important;
  object-fit: contain;
}

@media (min-width: 992px) {

  /* Enlarge Toolbar Buttons on PC */
  .kbg-btn,
  button,
  .kbg-controls button,
  #kbg-mode-rencontre,
  #kbg-mode-games,
  #kbg-radio-btn,
  #kbg-voice-sound,
  #kbg-voice-mute,
  #kbg-settings-btn,
  #kbg-refresh-btn,
  #kbg-fullscreen,
  #kbg-quit-game {
    font-size: 1.2rem !important;
    padding: 12px 20px !important;
    min-width: 50px;
  }

  /* Buttons within controls specifically */
  #kbg-controls .kbg-btn {
    font-size: 1.3rem !important;
    /* Slightly bigger icons */
  }
}

@keyframes kbgSlideUp {
  from {
    transform: translate(-50%, 50px);
    opacity: 0;
  }

  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}