/* ===== FONTS & BASE ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@400;500;600;700&display=swap');

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

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --accent: #00ffaa;
  --accent-blue: #00aaff;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;

  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --bg-input: #0d0d14;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7b;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background animated orbs */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
  animation: float 20s ease-in-out infinite;
}

.bg-orb--1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, var(--primary), var(--accent-blue));
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.bg-orb--2 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  top: 50%;
  right: -150px;
  animation-delay: -7s;
}

.bg-orb--3 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, var(--accent-blue), var(--primary-light));
  bottom: -100px;
  left: 30%;
  animation-delay: -14s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(50px, -30px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 40px) scale(0.95);
  }

  75% {
    transform: translate(-40px, -20px) scale(1.02);
  }
}

/* Light mode */
body.lightMode {
  --bg-dark: #f0f2f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f8f9fa;
  --bg-input: #f5f6f8;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #8a8a9a;
}

/* ===== LOBBY CONTAINER ===== */
.lobby-container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 15px 20px;
}

/* ===== HEADER ===== */
.main-header {
  text-align: center;
  margin-bottom: 15px;
  position: relative;
  padding-top: 10px;
}

.logo-wrapper {
  display: inline-block;
  position: relative;
  margin-bottom: 8px;
}

.logo-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  position: relative;
  z-index: 1;
}

.logo-icon {
  font-size: 3rem;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.lobby-title {
  font-family: 'Inter', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}

.title-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #a5b4fc 50%, #00ffaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lobby-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 8px 0 0;
  font-weight: 400;
}

/* Quick Settings */
.quick-settings {
  position: fixed;
  top: 15px;
  right: 15px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.setting-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.setting-toggle svg {
  width: 18px;
  height: 18px;
}

.setting-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: scale(1.05);
}

.setting-toggle.sound-off {
  opacity: 0.5;
}

.icon-sound.muted {
  opacity: 0.4;
}

.sound-wave {
  opacity: 0.6;
  transition: var(--transition);
}

.setting-toggle.sound-off .sound-wave {
  opacity: 0.2;
}

/* ===== WELCOME CARD ===== */
.welcome-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  backdrop-filter: blur(20px);
}

.welcome-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.welcome-text {
  flex: 1;
}

.welcome-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.welcome-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.pseudo-input-wrapper {
  position: relative;
}

.pseudo-input {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}

.pseudo-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.pseudo-input::placeholder {
  color: var(--text-muted);
}

/* ===== ACTIONS GRID ===== */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.action-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.action-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
}

.action-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.action-card:hover .action-glow {
  opacity: 1;
}

.action-card--solo {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.03));
  border-color: rgba(34, 197, 94, 0.2);
}

.action-card--solo:hover {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.2);
}

.action-card--solo .action-glow {
  background: radial-gradient(circle, rgba(34, 197, 94, 0.2) 0%, transparent 50%);
}

.action-card--create {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.03));
  border-color: rgba(99, 102, 241, 0.2);
}

.action-card--create:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.2);
}

.action-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-card--solo .action-icon-wrapper {
  background: rgba(34, 197, 94, 0.15);
}

.action-card--create .action-icon-wrapper {
  background: rgba(99, 102, 241, 0.15);
}

.action-icon {
  font-size: 1.5rem;
}

.action-content {
  flex: 1;
  min-width: 0;
}

.action-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text-primary);
}

.action-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.action-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: var(--transition);
}

.action-card:hover .action-arrow {
  color: var(--primary);
  transform: translateY(-50%) translateX(4px);
}

/* ===== JOIN SECTION ===== */
.join-section {
  margin-bottom: 12px;
}

.join-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.join-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.join-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.join-input-row {
  display: flex;
  gap: 12px;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.input-pulse {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

.input-wrapper:focus-within .input-pulse {
  opacity: 1;
}

.room-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.room-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.room-input::placeholder {
  color: var(--text-muted);
}

.join-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.join-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.join-btn svg {
  transition: var(--transition);
}

.join-btn:hover svg {
  transform: translateX(4px);
}

/* ===== ROOMS SECTION ===== */
.rooms-section {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

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

.refresh-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.refresh-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(180deg);
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.room-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.room-item-info {
  flex: 1;
}

.room-item-id {
  font-family: 'Outfit', monospace;
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-light);
  margin-bottom: 4px;
}

.room-item-host {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.room-item-players {
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 4px;
}

.room-item .neon-btn {
  margin: 0;
}

/* ===== LOBBY SECTION ===== */
.lobby-section {
  margin-bottom: 12px;
}

.lobby-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
  border-bottom: 1px solid var(--border-color);
}

.lobby-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lobby-icon {
  font-size: 1.5rem;
}

.lobby-main-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.room-badge {
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', monospace;
  font-size: 0.9rem;
  color: var(--primary-light);
}

.lobby-body {
  padding: 12px 16px;
}

.room-info-panel {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.lobby-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.players-section {
  min-width: 0;
}

.players-panel {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
}

.players-panel--compact {
  display: flex;
  flex-direction: column;
}

.players-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header--compact {
  padding-bottom: 6px;
}

.panel-icon {
  font-size: 1.1rem;
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

.side-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.side-content--compact {
  gap: 8px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.label-icon {
  font-size: 0.9rem;
}

.player-count {
  color: var(--text-muted);
  margin-left: 4px;
}

/* Players List */
.players-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.players-list--compact {
  gap: 4px;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.player-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.player-item--compact {
  padding: 8px 10px;
}

.player-name {
  font-weight: 500;
  color: var(--text-primary);
}

.player-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
}

.player-status.ready {
  color: var(--success);
}

.player-status.not-ready {
  color: var(--danger);
}

.player-host {
  font-size: 0.75rem;
  color: var(--warning);
  margin-left: 8px;
}

/* Settings Panel */
.settings-panel {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
}

.setting-item {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.setting-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.setting-input:focus {
  border-color: var(--primary);
}

.setting-btn {
  padding: 10px 16px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.setting-btn:hover {
  background: var(--primary-dark);
}

.host-controls {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* Invite Panel */
.invite-panel {
  margin-bottom: 12px;
}

.room-invite-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.invite-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.invite-input:focus {
  border-color: var(--primary);
}

.invite-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.invite-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.invite-btn--share {
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.15), rgba(0, 170, 255, 0.15));
  border-color: rgba(0, 255, 170, 0.3);
  color: #000;
}

.invite-btn--share:hover {
  background: linear-gradient(135deg, rgba(0, 255, 170, 0.25), rgba(0, 170, 255, 0.25));
}

/* Compact versions */
.settings-panel--compact {
  padding: 12px;
}

.settings-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-row:last-child {
  margin-bottom: 0;
}

.setting-input--small {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.setting-input--small:focus {
  border-color: var(--primary);
}

.setting-btn--small {
  padding: 10px 16px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.setting-btn--small:hover {
  background: var(--primary-dark);
}

.add-bot-btn--small {
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  color: var(--success);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.add-bot-btn--small:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  transform: translateY(-1px);
}

.add-bot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  color: var(--success);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.add-bot-btn:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  transform: translateY(-2px);
}

/* Chat Panel */
.chat-panel {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
}

.chat-messages {
  width: 100%;
  min-height: 80px;
  max-height: 120px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  resize: none;
  outline: none;
  transition: var(--transition);
}

.chat-messages:focus {
  border-color: var(--primary);
}

.chat-input-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.chat-input:focus {
  border-color: var(--primary);
}

.send-btn {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.send-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* Compact Chat */
.chat-panel--compact {
  padding: 10px;
}

.chat-messages--compact {
  min-height: 60px;
  max-height: 100px;
  padding: 8px;
  font-size: 0.75rem;
}

.chat-input-row--compact {
  gap: 6px;
  margin-top: 8px;
}

.chat-input--small {
  padding: 8px 10px;
  font-size: 0.8rem;
}

.send-btn--small {
  width: 36px;
  height: 36px;
}

/* Lobby Actions */
.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.lobby-actions--inline {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.ready-section,
.start-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
}

.action-btn--ready {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--success);
}

.action-btn--ready:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(34, 197, 94, 0.15));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.2);
}

.action-btn--start {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.action-btn--start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.action-btn--quit {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.action-btn--quit:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(239, 68, 68, 0.15));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2);
}

.player-kick-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
  margin-left: 8px;
}

.player-kick-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  transform: scale(1.05);
}

.warning-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  color: var(--warning);
  font-size: 0.95rem;
  font-weight: 500;
}

.warning-banner.all-ready {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--success);
}

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

.warning-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 500;
}

.warning-inline.all-ready {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--success);
}

/* ===== RULES SECTION ===== */
.rules-section {
  margin-bottom: 12px;
}

.rules-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

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

.rules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  transition: var(--transition);
}

.rules-card:hover .rules-header {
  background: rgba(255, 255, 255, 0.03);
}

.rules-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

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

.rules-toggle {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.rules-card[aria-expanded="true"] .rules-toggle,
.rules-card:hover .rules-toggle {
  color: var(--primary);
}

.rules-card[aria-expanded="true"] .rules-toggle {
  transform: rotate(180deg);
}

.rules-content {
  display: none;
  padding: 0 20px 20px;
}

.rules-card[aria-expanded="true"] .rules-content {
  display: block;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.rule-block {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.rule-block:hover {
  background: rgba(0, 0, 0, 0.3);
}

.rule-block--objective,
.rule-block--end,
.rule-block--score {
  grid-column: span 1;
}

.rule-icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.rule-block h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.rule-block p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.rule-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.85rem;
}

.rule-list li {
  margin-bottom: 6px;
}

.rule-list strong {
  color: var(--primary-light);
}

/* ===== FOOTER ===== */
.lobby-footer {
  text-align: center;
  padding: 10px 0;
}

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

/* ===== GAME STYLES (existing - keep them) ===== */
.game_display {
  display: none;
}


.game-title span {
  color: #7af8d3;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.35), 0 0 28px rgba(0, 255, 170, 0.2);
}

/* ===== RESPONSIVE ===== */
@media screen and (max-width: 768px) {
  .lobby-container {
    padding: 20px 16px;
  }

  .lobby-title {
    font-size: 2rem;
  }

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

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

  .lobby-content {
    grid-template-columns: 1fr;
  }

  .join-input-row {
    flex-direction: column;
  }

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

  .rule-block--objective,
  .rule-block--end,
  .rule-block--score {
    grid-column: span 1;
  }

  .welcome-header {
    flex-direction: column;
    text-align: center;
  }
}

@media screen and (max-width: 480px) {
  .lobby-title {
    font-size: 1.75rem;
  }

  .action-card {
    padding: 20px 16px;
  }

  .action-arrow {
    display: none;
  }

  .room-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .room-item .neon-btn {
    width: 100%;
  }
}

/* ===== EXISTING GAME STYLES (kept for game display) ===== */
#chat {
  width: 300px;
  height: 400px;
  border: 1px solid #ccc;
  overflow-y: scroll;
  margin-bottom: 10px;
}

.card {
  display: inline-block;
  margin: 5px;
  width: 4rem;
  height: 6rem;
  flex-shrink: 0;
}

.deck-row {
  display: flex;
  gap: 10px;
}

.deck-column {
  display: flex;
  flex-direction: column;
  margin-right: 0;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
}

#players-hands {
  display: flex;
  justify-content: space-evenly;
}

.hand {
  margin-top: 10px;
  background-color: #34495e;
  padding: 1rem;
  border-radius: 10px;
  border: 2px solid rgba(120, 180, 255, 0.2);
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

.hand.turn-active-green {
  border: 3px solid #27ae60 !important;
  box-shadow:
    0 0 10px rgba(39, 174, 96, 0.6),
    0 0 20px rgba(39, 174, 96, 0.4),
    0 0 30px rgba(39, 174, 96, 0.3),
    0 0 40px rgba(39, 174, 96, 0.2),
    inset 0 0 20px rgba(39, 174, 96, 0.1) !important;
  animation: neonPulseGreen 2s ease-in-out infinite;
}

.hand.turn-active-red {
  border: 3px solid #e74c3c !important;
  box-shadow:
    0 0 10px rgba(231, 76, 60, 0.6),
    0 0 20px rgba(231, 76, 60, 0.4),
    0 0 30px rgba(231, 76, 60, 0.3),
    0 0 40px rgba(231, 76, 60, 0.2),
    inset 0 0 20px rgba(231, 76, 60, 0.1) !important;
  animation: neonPulseRed 2s ease-in-out infinite;
}

@keyframes neonPulseGreen {

  0%,
  100% {
    box-shadow:
      0 0 10px rgba(39, 174, 96, 0.6),
      0 0 20px rgba(39, 174, 96, 0.4),
      0 0 30px rgba(39, 174, 96, 0.3),
      0 0 40px rgba(39, 174, 96, 0.2),
      inset 0 0 20px rgba(39, 174, 96, 0.1);
  }

  50% {
    box-shadow:
      0 0 15px rgba(39, 174, 96, 0.8),
      0 0 30px rgba(39, 174, 96, 0.6),
      0 0 45px rgba(39, 174, 96, 0.4),
      0 0 60px rgba(39, 174, 96, 0.3),
      inset 0 0 25px rgba(39, 174, 96, 0.15);
  }
}

@keyframes neonPulseRed {

  0%,
  100% {
    box-shadow:
      0 0 10px rgba(231, 76, 60, 0.6),
      0 0 20px rgba(231, 76, 60, 0.4),
      0 0 30px rgba(231, 76, 60, 0.3),
      0 0 40px rgba(231, 76, 60, 0.2),
      inset 0 0 20px rgba(231, 76, 60, 0.1);
  }

  50% {
    box-shadow:
      0 0 15px rgba(231, 76, 60, 0.8),
      0 0 30px rgba(231, 76, 60, 0.6),
      0 0 45px rgba(231, 76, 60, 0.4),
      0 0 60px rgba(231, 76, 60, 0.3),
      inset 0 0 25px rgba(231, 76, 60, 0.15);
  }
}

.draw-active {
  border: 3px solid #27ae60 !important;
  border-radius: 15px !important;
  box-shadow:
    0 0 10px rgba(39, 174, 96, 0.6),
    0 0 20px rgba(39, 174, 96, 0.4),
    0 0 30px rgba(39, 174, 96, 0.3),
    0 0 40px rgba(39, 174, 96, 0.2),
    inset 0 0 20px rgba(39, 174, 96, 0.1) !important;
  animation: neonPulseGreen 2s ease-in-out infinite;
}

.cursor_pointer {
  cursor: pointer;
}

.rounded {
  border-radius: 10px;
}

.dim {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s;
}

#game-area {
  display: flex;
  justify-content: center;
  width: max-content;
  margin: 20px auto;
  padding: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(140, 210, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  gap: 1rem;
}

.card_pioche,
.card_defausse {
  width: 6rem;
  height: 9rem;
}

#deck,
#discard-pile {
  border-radius: 12px;
  border: 2px solid rgba(140, 210, 255, 0.2);
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

#deck.turn-active-green,
#discard-pile.turn-active-green {
  border: 3px solid #27ae60 !important;
  box-shadow:
    0 0 10px rgba(39, 174, 96, 0.6),
    0 0 20px rgba(39, 174, 96, 0.4),
    0 0 30px rgba(39, 174, 96, 0.3),
    0 0 40px rgba(39, 174, 96, 0.2),
    inset 0 0 20px rgba(39, 174, 96, 0.1) !important;
  animation: neonPulseGreen 2s ease-in-out infinite;
}

/* Turn indicator */
.turn-indicator,
#turn-info {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  padding: 14px 24px;
  margin: 12px auto;
  max-width: 500px;
  border-radius: 12px;
  text-align: center;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, rgba(120, 180, 255, 0.15), rgba(120, 180, 255, 0.05));
  border: 2px solid rgba(120, 180, 255, 0.3);
  color: #9ed6ff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#turn-info.my-turn {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.3), rgba(39, 174, 96, 0.15));
  border: 2px solid rgba(39, 174, 96, 0.8);
  color: #7af8d3;
  box-shadow:
    0 0 20px rgba(39, 174, 96, 0.6),
    0 0 40px rgba(39, 174, 96, 0.4),
    inset 0 0 25px rgba(39, 174, 96, 0.15);
  animation: turnPulseGreen 1.5s ease-in-out infinite;
}

#turn-info.other-turn {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.25), rgba(231, 76, 60, 0.1));
  border: 2px solid rgba(231, 76, 60, 0.6);
  color: #ffb3b3;
  box-shadow:
    0 0 15px rgba(231, 76, 60, 0.5),
    0 0 30px rgba(231, 76, 60, 0.3),
    inset 0 0 20px rgba(231, 76, 60, 0.1);
}

@keyframes turnPulseGreen {

  0%,
  100% {
    box-shadow:
      0 0 15px rgba(39, 174, 96, 0.5),
      0 0 30px rgba(39, 174, 96, 0.3),
      inset 0 0 20px rgba(39, 174, 96, 0.1);
    transform: scale(1);
  }

  50% {
    box-shadow:
      0 0 25px rgba(39, 174, 96, 0.7),
      0 0 45px rgba(39, 174, 96, 0.5),
      inset 0 0 30px rgba(39, 174, 96, 0.15);
    transform: scale(1.02);
  }
}

/* Buttons */
.neon-btn {
  padding: 12px 20px;
  border: 1px solid rgba(140, 210, 255, 0.2);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(10, 26, 38, 0.9), rgba(9, 18, 34, 0.9));
  color: #e6f1ff;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.neon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.12), 0 12px 30px rgba(0, 0, 0, 0.35);
  border-color: rgba(120, 200, 255, 0.45);
}

.neon-btn--small {
  padding: 10px 14px !important;
  font-size: 0.85rem !important;
}

.neon-btn--gradient {
  background: linear-gradient(90deg, rgba(0, 255, 170, 0.25), rgba(0, 170, 255, 0.25));
  border-color: rgba(120, 200, 255, 0.35);
}

/* Scores table */
.scores-table-container {
  background: rgba(11, 18, 32, 0.95);
  border-top: 2px solid rgba(120, 180, 255, 0.3);
  border-bottom: 2px solid rgba(120, 180, 255, 0.3);
  padding: 15px;
  margin-top: 20px;
  margin-bottom: 20px;
  max-height: 40vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Game History - Historique des coups */
.game-history-container {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.03));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 15px;
}

.game-history-title {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: #a5b4fc;
  text-align: center;
  font-weight: 600;
}

.game-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.game-history-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  animation: slideInHistory 0.3s ease-out;
}

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

.game-history-player {
  font-weight: 600;
  color: #78b4ff;
  white-space: nowrap;
  min-width: 80px;
}

.game-history-action {
  color: #e6f1ff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-history-card {
  width: 24px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-history-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.game-history-discard {
  color: #ffb3b3;
}

.game-history-draw {
  color: #7af8d3;
}

.game-history-flip {
  color: #ffd93d;
}

.game-history-replace {
  color: #a5b4fc;
}

.game-history-replaced {
  color: #d1d5db;
  font-size: 0.8rem;
  margin: 0 2px;
}

.game-history-separator {
  color: #666;
  margin: 0 4px;
}

.scores-table-title {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
  color: #78b4ff;
  text-align: center;
}

.scores-table-wrapper {
  overflow-x: auto;
}

.scores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.scores-table thead {
  background-color: rgba(52, 73, 94, 0.6);
}

.scores-table th {
  padding: 8px 6px;
  border: 1px solid rgba(127, 140, 157, 0.3);
  text-align: center;
  font-weight: 600;
  color: #78b4ff;
}

.scores-table td {
  padding: 6px;
  border: 1px solid rgba(127, 140, 157, 0.2);
  text-align: center;
  color: #e6f1ff;
}

.scores-table th:nth-child(1),
.scores-table td:nth-child(1) {
  width: 40%;
  text-align: left;
}

.scores-table th:nth-child(2),
.scores-table td:nth-child(2) {
  width: 20%;
}

.scores-table th:nth-child(3),
.scores-table td:nth-child(3) {
  width: 20%;
}

.scores-table th:nth-child(4),
.scores-table td:nth-child(4) {
  width: 20%;
}

.scores-table tbody tr:nth-child(even) {
  background-color: rgba(52, 73, 94, 0.2);
}

.scores-table tbody tr:hover {
  background-color: rgba(52, 73, 94, 0.4);
}

.round-history-container {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(127, 140, 157, 0.3);
}

.round-history-title {
  margin: 0 0 10px 0;
  font-size: 1rem;
  color: #78b4ff;
  text-align: center;
  font-weight: 600;
}

.round-history-content {
  font-size: 0.85rem;
  color: #e6f1ff;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: auto;
}

.round-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 10px;
}

.round-history-table thead {
  background-color: rgba(52, 73, 94, 0.6);
  position: sticky;
  top: 0;
  z-index: 10;
}

.round-history-table th {
  padding: 6px 4px;
  border: 1px solid rgba(127, 140, 157, 0.3);
  text-align: center;
  font-weight: 600;
  color: #78b4ff;
  font-size: 0.8rem;
}

.round-history-table td {
  padding: 5px 4px;
  border: 1px solid rgba(127, 140, 157, 0.2);
  text-align: center;
  color: #e6f1ff;
  font-size: 0.8rem;
}

.round-history-table tbody tr:nth-child(even) {
  background-color: rgba(52, 73, 94, 0.1);
}

.round-history-table tbody tr:hover {
  background-color: rgba(52, 73, 94, 0.3);
}

/* Mobile responsive for game */
@media screen and (max-width: 768px) {

  /* Faire de game_display un flex column pour contrôler l'ordre */
  .game_display {
    display: flex !important;
    flex-direction: column;
  }

  /* Mettre la pioche en premier (ordre 1) et les joueurs en dessous (ordre 2) */
  #game-area {
    order: 1;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 10px auto;
    padding: 12px;
    gap: 16px;
  }

  #players-hands {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 8px 20px;
    max-width: 100%;
    overflow-x: hidden;
  }

  .hand.turn-active-green,
  .hand.turn-active-red {
    border: 3px solid !important;
  }

  .card_pioche,
  .card_defausse {
    width: 5rem;
    height: 7.5rem;
    flex-shrink: 0;
  }

  .hand:not(.dim) {
    background: rgba(120, 180, 255, 0.08);
    border: 2px solid rgba(120, 180, 255, 0.3);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .hand.dim {
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(120, 180, 255, 0.15);
    opacity: 0.85;
    transform: scale(0.95);
  }

  .hand:not(.dim) .card {
    width: 100%;
    max-width: 5rem;
    height: auto;
    aspect-ratio: 2/3;
    margin: 2px 0;
  }

  .hand.dim .card {
    width: 100%;
    max-width: 3.5rem;
    height: auto;
    aspect-ratio: 2/3;
    margin: 1px 0;
  }

}

/* Toast messages */
.toast-message {
  max-width: 90vw;
  word-wrap: break-word;
  text-align: center;
}

/* Reconnecting indicator */
.reconnecting-indicator {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #ff6b6b;
  border-radius: 12px;
  padding: 15px 30px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  color: #ff6b6b;
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.4);
  animation: slideDown 0.3s ease-out;
}

.reconnecting-indicator .pulse {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  animation: pulse 1s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Share button style */
.share-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-blue)) !important;
  border-color: rgba(0, 255, 170, 0.3) !important;
  color: #000 !important;
  font-weight: 600 !important;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 255, 170, 0.3) !important;
}

/* ===== AUTH STYLES ===== */

/* Auth section */
.auth-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-buttons-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

/* Auth buttons */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  flex: 1;
  white-space: nowrap;
}

.auth-btn--guest {
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: white;
  font-size: 1rem;
  padding: 16px 24px;
}

.auth-btn--guest:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
}

.auth-btn--google {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.auth-btn--google:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

.auth-btn--login {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.auth-btn--login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.auth-btn--register {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #c084fc;
}

.auth-btn--register:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(168, 85, 247, 0.15));
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.3);
}

.auth-btn--logout {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  flex: none;
  padding: 10px 20px;
  font-size: 0.9rem;
}

.auth-btn--logout:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
}

/* User profile card (connected) */
.user-profile-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
}

/* Header profil */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.user-avatar-large {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 3px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
}

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

.user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-username {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edit-username-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.edit-username-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--primary);
  border-color: var(--primary);
}

.user-level {
  display: inline-block;
  padding: 3px 10px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(250, 204, 21, 0.1));
  border: 1px solid rgba(250, 204, 21, 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #facc15;
  margin-top: 4px;
}

/* Bouton déconnexion */
.logout-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}

/* Stats principales */
.user-stats-main {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}

.stat-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card--games .stat-value { color: var(--primary-light); }
.stat-card--wins .stat-value { color: #22c55e; }
.stat-card--winrate .stat-value { color: #a855f7; }
.stat-card--avg .stat-value { color: #f59e0b; }
.stat-card--points .stat-value { color: #00ffaa; }

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Stats détaillées */
.user-stats-detailed {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
}

.stats-grid {
  display: contents;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.stat-item .stat-value {
  font-size: 1rem;
}

.stat-item .stat-label {
  font-size: 0.65rem;
}

/* Responsive mobile */
@media screen and (max-width: 480px) {
  .user-profile-header {
    flex-wrap: wrap;
  }

  .logout-btn {
    position: absolute;
    top: 0;
    right: 0;
  }

  .user-avatar-large {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
  }

  .user-username {
    font-size: 1.1rem;
  }

  .user-stats-main {
    grid-template-columns: repeat(2, 1fr);
  }

  .user-stats-detailed {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Auth Modal */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.auth-modal-content {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-dark));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  position: relative;
  animation: slideUp 0.3s ease-out;
  box-shadow: var(--shadow-lg);
}

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

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  line-height: 1;
}

.auth-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.auth-modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 24px;
  text-align: center;
  color: var(--text-primary);
}

/* Auth message */
.auth-message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 20px;
  text-align: center;
}

.auth-message.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-message.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.auth-message.info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* Auth form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-group input {
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-group small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-submit-btn {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.auth-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.auth-switch-text {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.auth-switch-text a {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch-text a:hover {
  text-decoration: underline;
}

.auth-forgot-text {
  text-align: center;
  margin: 0;
}

.auth-forgot-text a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
}

.auth-forgot-text a:hover {
  color: var(--primary-light);
}

/* Responsive auth */
@media screen and (max-width: 480px) {
  .auth-buttons-row {
    flex-direction: column;
  }

  .auth-btn {
    width: 100%;
  }

  .user-profile-card {
    padding: 16px;
  }

  .user-avatar-large {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .auth-modal-content {
  padding: 24px;
  }
}

/* ===========================================
   RANKING SYSTEM STYLES
   =========================================== */

/* Rank Badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 2px solid;
  font-family: 'Outfit', sans-serif;
  transition: var(--transition);
}

.rank-badge-small {
  padding: 4px 10px;
  gap: 6px;
  font-size: 0.8rem;
}

.rank-badge-small .rank-icon {
  font-size: 1rem;
}

.rank-badge-small .rank-name {
  font-size: 0.75rem;
}

.rank-badge-large {
  padding: 12px 20px;
  gap: 12px;
  font-size: 1.1rem;
}

.rank-badge-large .rank-icon {
  font-size: 1.8rem;
}

.rank-badge-large .rank-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.rank-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.rank-name {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Rank Progress */
.rank-progress-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  width: 100%;
}

.rank-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.rank-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
}

.rank-progress-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

/* Rank Badge in User Profile */
.rank-badge-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.rank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rank-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Leaderboard Styles */
.leaderboard-section {
  margin-top: 16px;
}

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.leaderboard-row:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.leaderboard-rank {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 30px;
}

.leaderboard-rank-1 { color: #FFD700; }
.leaderboard-rank-2 { color: #C0C0C0; }
.leaderboard-rank-3 { color: #CD7F32; }

.leaderboard-icon {
  font-size: 1.5rem;
}

.leaderboard-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
}

.leaderboard-rank-name {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.leaderboard-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.leaderboard-rate {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--success);
  min-width: 50px;
  text-align: right;
}

/* Rank Requirements View */
.rank-requirements {
  padding: 16px;
}

.rank-requirements h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text-primary);
  text-align: center;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-requirement-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-left: 4px solid;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.rank-requirement-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

.rank-req-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.rank-req-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.rank-req-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.rank-req-reqs {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Rank up animation */
.rank-up-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, var(--bg-card), var(--bg-dark));
  border: 2px solid;
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  z-index: 2000;
  text-align: center;
  animation: rankUpPopup 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  box-shadow: var(--shadow-lg);
}

@keyframes rankUpPopup {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(-10deg);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
  }
  100% {
    transform: translate(-50%, -50%) scale(1) rotate(0);
    opacity: 1;
  }
}

.rank-up-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  animation: bounce 1s ease infinite;
}

.rank-up-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.rank-up-new-rank {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0;
}

.rank-up-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition);
}

.rank-up-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

/* Player list with ranks */
.player-item-with-rank {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-rank-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Responsive ranking */
@media screen and (max-width: 480px) {
  .rank-badge {
    padding: 6px 10px;
    gap: 6px;
  }

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

  .rank-name {
    font-size: 0.85rem;
  }

  .leaderboard-row {
    padding: 10px 12px;
    gap: 8px;
  }

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

  .leaderboard-rank-name {
    font-size: 0.75rem;
    padding: 3px 8px;
  }
}

/* ===== AI FEEDBACK PANEL ===== */
.ai-feedback-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(30, 30, 45, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0;
  width: 420px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.2);
  z-index: 1000;
  backdrop-filter: blur(10px);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ai-feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ai-feedback-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-light);
  margin: 0;
}

.ai-feedback-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: var(--transition);
}

.ai-feedback-close:hover {
  color: var(--danger);
}

.ai-feedback-content {
  padding: 16px;
}

.ai-feedback-question {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  text-align: center;
}

.ai-action-text {
  color: var(--accent);
  font-weight: 600;
}

.ai-feedback-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 12px;
}

.ai-feedback-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.ai-btn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.ai-btn--good {
  background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
  color: white;
}

.ai-btn--good:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.ai-btn--bad {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: white;
}

.ai-btn--bad:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.ai-btn--neutral {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}

.ai-btn--neutral:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

.ai-btn--very-good {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-weight: 700;
}

.ai-btn--very-good:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5);
}

/* Layout 4 boutons */
.ai-feedback-buttons--4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.ai-feedback-buttons--4 .ai-btn {
  padding: 8px 6px;
  font-size: 0.75rem;
}

@media screen and (max-width: 400px) {
  .ai-feedback-buttons--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ai-options-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  max-height: 400px;
  overflow-y: auto;
  /* Empêcher le sautillement pendant le chargement */
  transition: max-height 0.3s ease;
}

.ai-options-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-align: center;
}

.ai-options-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 30px;
}

.ai-option-category {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  /* Empêcher l'effondrement */
  contain: content;
}

.ai-option-category:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.ai-category-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.ai-option-item {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  color: var(--text-primary);
  /* Hauteur fixe pour éviter les sauts */
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-option-item:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  transform: translateX(4px);
}

.ai-option-item.selected {
  background: rgba(99, 102, 241, 0.3);
  border-color: var(--primary);
}

.ai-option-score {
  float: right;
  color: var(--accent);
  font-weight: 600;
}

.ai-stats {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.ai-stats-btn,
.ai-reset-btn {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.ai-stats-btn:hover,
.ai-reset-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: var(--text-primary);
}

.ai-reset-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--danger);
  color: var(--danger);
}

.ai-feedback-message {
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.15);
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  color: var(--primary-light);
  font-size: 0.85rem;
  text-align: center;
}

/* Responsive */
@media screen and (max-width: 480px) {
  .ai-feedback-panel {
    bottom: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .ai-feedback-buttons {
    flex-direction: column;
  }

  .ai-stats {
    flex-direction: column;
  }
}