/* Custom Properties and Design System */
:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #111115;
  --bg-card: rgba(25, 25, 35, 0.45);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --color-accent: #5865F2; /* Discord Blurple */
  --color-accent-hover: #4752C4;
  --color-success: #23A55A; /* Discord Green */
  --color-danger: #F23F43; /* Discord Red */
  --color-warning: #FEE75C; /* Yellow */
  
  --text-main: #f2f3f5;
  --text-muted: #b5bcc4; /* éclairci pour la lisibilité (contraste ~9.8:1 sur les cartes) */
  --text-inverse: #ffffff;
  
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 8px 32px 0 rgba(88, 101, 242, 0.15);
}

/* Reset and Global Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Background Glowing Accents */
.bg-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
}
.bg-glow-1 {
  background-color: var(--color-accent);
  top: -50px;
  right: -50px;
}
.bg-glow-2 {
  background-color: #9b5de5;
  bottom: -50px;
  left: -50px;
}

/* Container */
.app-container {
  width: 100%;
  max-width: 500px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
}

/* Glassmorphism Card Style */
.card {
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition-smooth);
}
.card-glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Screen Management */
.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  animation: fadeIn 0.4s ease-out;
}
.screen.active {
  display: flex;
}

/* Buttons */
.btn {
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary {
  background-color: var(--color-accent);
  color: var(--text-inverse);
  box-shadow: var(--shadow-glow);
}
.btn-primary:active {
  transform: scale(0.97);
  background-color: var(--color-accent-hover);
}
.btn-secondary {
  background-color: rgba(255, 255, 255, 0.07);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-secondary:active {
  transform: scale(0.97);
  background-color: rgba(255, 255, 255, 0.12);
}
.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-outline:active {
  background: rgba(255, 255, 255, 0.05);
}
.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
  border-radius: 8px;
}
.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
}
.btn-danger {
  background-color: var(--color-danger);
  color: var(--text-inverse);
}
.btn-success {
  background-color: var(--color-success);
  color: var(--text-inverse);
}
.w-full {
  width: 100%;
}
.mt-4 {
  margin-top: 16px;
}

/* Inputs & Forms */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.input-group input[type="text"],
.input-group input[type="number"],
.custom-mission-input-row input[type="text"] {
  font-family: var(--font-family);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 14px;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
  transition: var(--transition-smooth);
}
.input-group input:focus,
.custom-mission-input-row input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.2);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 16px 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.divider span {
  padding: 0 10px;
}

/* Form card button gap */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

/* ================= HOME SCREEN ================= */
.logo-area {
  text-align: center;
  margin: 40px 0 30px;
}
.logo-icon {
  font-size: 4.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 15px rgba(88, 101, 242, 0.4));
  animation: float 4s ease-in-out infinite;
}
.logo-area h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.1;
}
.logo-area .subtitle {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-accent), #a18cd1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.logo-area .tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ================= LOBBY SCREEN ================= */
.header-compact {
  margin-bottom: 20px;
}
.header-compact h2 {
  font-size: 1.6rem;
  font-weight: 700;
}
.status-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  display: inline-block;
  margin-top: 4px;
}
.pulse {
  animation: pulse-effect 2s infinite;
}

.lobby-code-card {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.lobby-code-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.code-display {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: #fff;
  margin: 10px 0;
  text-shadow: 0 0 15px rgba(255,255,255,0.1);
}
.qr-container-wrapper {
  margin: 20px auto 10px;
  padding: 12px;
  background: white;
  width: 144px;
  height: 144px;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.qr-container-wrapper img {
  width: 120px !important;
  height: 120px !important;
}

/* Players Grid */
.players-list-card h3 {
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.players-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  list-style: none;
}
.player-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.player-chip .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}
.player-chip.is-host {
  border-color: rgba(88, 101, 242, 0.3);
  background: rgba(88, 101, 242, 0.05);
}

/* Host Panel & Configuration */
.host-card {
  border: 1px dashed rgba(88, 101, 242, 0.4);
  background: rgba(88, 101, 242, 0.03);
}
.badge-host-indicator {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-accent);
  background: rgba(88, 101, 242, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: rgba(255,255,255,0.1);
  outline: none;
  margin: 10px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent);
  cursor: pointer;
  transition: transform 0.1s;
}
input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.3);
}

.custom-mission-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.custom-mission-input-row input {
  flex: 1;
}
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.custom-list {
  margin-top: 10px;
  list-style: none;
  max-height: 150px;
  overflow-y: auto;
}
.custom-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,0,0.15);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.03);
}
.lobby-note {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 15px 0;
  font-style: italic;
}

/* ================= GAME SCREEN ================= */
.game-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  margin-bottom: 12px;
}
.player-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-avatar {
  font-size: 1.8rem;
}
.player-name {
  font-size: 0.95rem;
  font-weight: 700;
}
.player-score {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.player-score span {
  font-weight: 800;
  color: var(--color-success);
}
.timer-display {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Navigation Tabs */
.game-tabs {
  display: flex;
  background: rgba(0,0,0,0.25);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.04);
  position: relative;
}
.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 6px;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
}
.tab-btn.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.tab-badge-notification {
  position: absolute;
  top: 4px;
  right: 12px;
  width: 8px;
  height: 8px;
  background-color: var(--color-danger);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--color-danger);
}

.tab-content {
  display: none;
  flex-direction: column;
}
.tab-content.active {
  display: flex;
}
.section-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}

/* ================= MISSIONS DECK ================= */
.missions-deck {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mission-card {
  position: relative;
  background: linear-gradient(135deg, rgba(30, 30, 40, 0.8), rgba(15, 15, 20, 0.8));
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: var(--transition-smooth);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.mission-card.rare {
  border-color: rgba(155, 93, 229, 0.4);
  background: linear-gradient(135deg, rgba(40, 25, 60, 0.8), rgba(20, 10, 30, 0.8));
  box-shadow: 0 8px 24px rgba(155, 93, 229, 0.15);
}
.mission-card.completed {
  border-color: rgba(35, 165, 90, 0.4);
  background: linear-gradient(135deg, rgba(15, 40, 25, 0.8), rgba(5, 20, 10, 0.8));
}

.mission-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.mission-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.06);
}
.mission-card.rare .mission-badge {
  color: #d1b3ff;
  background: rgba(155, 93, 229, 0.2);
}
.mission-card.completed .mission-badge {
  color: #a3ffd0;
  background: rgba(35, 165, 90, 0.2);
}

.mission-points {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-success);
}
.mission-card.rare .mission-points {
  color: #c8a2c8;
}

.mission-text {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 20px;
}

/* ================= FEED (BEREAL STYLE) ================= */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.feed-card-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.feed-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feed-player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.feed-player-nickname {
  font-weight: 700;
  font-size: 0.95rem;
}
.feed-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feed-photo-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background-color: #000;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}
.feed-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Suspense overlay when description is hidden */
.suspense-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 24px 16px 16px;
  text-align: center;
}
.suspense-text {
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.suspense-text.revealed {
  color: var(--color-success);
  background: rgba(35, 165, 90, 0.15);
  border: 1px solid rgba(35, 165, 90, 0.3);
  padding: 10px;
  border-radius: 10px;
  backdrop-filter: blur(8px);
}

/* Vote controls on Card */
.feed-vote-bar {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.1);
}
.vote-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.vote-buttons {
  display: flex;
  gap: 12px;
}
.vote-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.vote-btn-yes {
  background-color: rgba(35, 165, 90, 0.12);
  color: #4cd980;
  border: 1px solid rgba(35, 165, 90, 0.25);
}
.vote-btn-yes.voted {
  background-color: var(--color-success);
  color: #fff;
  box-shadow: 0 0 12px rgba(35, 165, 90, 0.4);
}
.vote-btn-no {
  background-color: rgba(242, 63, 67, 0.12);
  color: #ff6b6e;
  border: 1px solid rgba(242, 63, 67, 0.25);
}
.vote-btn-no.voted {
  background-color: var(--color-danger);
  color: #fff;
  box-shadow: 0 0 12px rgba(242, 63, 67, 0.4);
}

.vote-results {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.vote-results span {
  font-weight: 600;
}

/* Emoji Reactions Area */
.feed-reactions {
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.03);
}
.reaction-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.reaction-chip:active {
  transform: scale(0.9);
}
.reaction-chip.active {
  background: rgba(88, 101, 242, 0.25);
  border-color: var(--color-accent);
  color: #fff;
}
.empty-feed {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

/* ================= LEADERBOARD ================= */
.leaderboard-ranking-card {
  padding: 24px;
}
.leaderboard-ranking-card h3 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-align: center;
}
.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 14px 18px;
  border-radius: 14px;
  transition: var(--transition-smooth);
}
.leaderboard-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rank-badge {
  font-weight: 800;
  font-size: 1.1rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.leaderboard-item:nth-child(1) .rank-badge {
  background: var(--color-warning);
  color: #000;
  box-shadow: 0 0 10px rgba(254, 231, 92, 0.4);
}
.leaderboard-item:nth-child(2) .rank-badge {
  background: #e2e2e2;
  color: #000;
}
.leaderboard-item:nth-child(3) .rank-badge {
  background: #cd7f32;
  color: #fff;
}
.leaderboard-name-block {
  display: flex;
  flex-direction: column;
}
.leaderboard-name {
  font-weight: 700;
}
.leaderboard-badges-row {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.badge-tag {
  font-size: 0.65rem;
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
}

.leaderboard-item-right {
  text-align: right;
}
.leaderboard-pts {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-success);
}
.leaderboard-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toast System */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(20, 20, 25, 0.95);
  border: 1px solid var(--color-accent);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  font-size: 0.9rem;
}
.toast.active {
  transform: translateX(-50%) translateY(0);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-effect {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}
.animate-slide-up {
  animation: fadeIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

/* Floating Emoji Animation */
.floating-emoji {
  position: fixed;
  font-size: 2.2rem;
  pointer-events: none;
  z-index: 1000;
  --drift-x: 0px; /* dérive horizontale aléatoire (définie en JS) */
  --spin: 15deg;  /* rotation aléatoire (définie en JS) */
  animation: floatUpAndFade 1.2s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

@keyframes floatUpAndFade {
  0% {
    transform: translate(0, 0) scale(0.3) rotate(0deg);
    opacity: 0;
  }
  20% {
    transform: translate(calc(var(--drift-x) * 0.2), -15px) scale(1.5) rotate(calc(var(--spin) * -1));
    opacity: 1;
  }
  50% {
    transform: translate(calc(var(--drift-x) * 0.55), -45px) scale(1.2) rotate(var(--spin));
  }
  100% {
    transform: translate(var(--drift-x), -100px) scale(0.6) rotate(0deg);
    opacity: 0;
  }
}

/* Overlay System */
.fullscreen-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 10, 15, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay-content {
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.overlay-img {
  width: 100%;
  border-radius: 12px;
  margin-top: 15px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
@keyframes pop {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.animate-pop {
  animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ================= START CHOOSER ================= */
.btn-back {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: var(--transition-smooth);
}
.btn-back:active { transform: scale(0.96); }

.start-choice-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.game-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 6px;
  padding: 22px;
  border-radius: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  cursor: pointer;
  font-family: var(--font-family);
  color: var(--text-main);
  transition: var(--transition-smooth);
}
.game-type-card:active { transform: scale(0.98); }
.game-type-card .game-type-emoji { font-size: 2.6rem; }
.game-type-card .game-type-title {
  font-size: 1.35rem;
  font-weight: 800;
}
.game-type-card .game-type-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.35;
}
.game-type-card-cards {
  border-color: rgba(155, 93, 229, 0.4);
  background: linear-gradient(135deg, rgba(88,101,242,0.12), rgba(155,93,229,0.12));
}

/* ================= CARDS SETUP ================= */
.setup-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.setup-label .setup-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}
.deck-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.deck-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-family: var(--font-family);
  color: var(--text-main);
  text-align: left;
  transition: var(--transition-smooth);
}
.deck-tile:active { transform: scale(0.97); }
.deck-tile .deck-emoji { font-size: 1.8rem; }
.deck-tile .deck-name { font-weight: 700; font-size: 0.95rem; }
.deck-tile .deck-tagline { font-size: 0.72rem; color: var(--text-muted); line-height: 1.2; }
.deck-tile .deck-adult-badge {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 0.6rem;
  font-weight: 800;
  background: var(--color-danger);
  color: #fff;
  padding: 2px 6px;
  border-radius: 8px;
}
.deck-tile.selected {
  border-color: var(--tile-accent, var(--color-accent));
  background: color-mix(in srgb, var(--tile-accent, var(--color-accent)) 16%, transparent);
  box-shadow: 0 0 0 1px var(--tile-accent, var(--color-accent)), 0 8px 20px rgba(0,0,0,0.3);
}

.cards-player-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cards-player-input-row input {
  flex: 1;
  font-family: var(--font-family);
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
}
.cards-player-input-row input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(88,101,242,0.2);
}
.cards-player-input-row .btn-small { padding: 12px 16px; font-size: 1.1rem; }
.card-players-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.card-players-chips:empty { margin-top: 0; }
.card-player-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(88,101,242,0.15);
  border: 1px solid rgba(88,101,242,0.35);
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}
.card-player-chip .remove-chip {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 800;
  line-height: 1;
}
.card-player-chip .remove-chip:active { color: var(--color-danger); }

.segmented {
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.25);
  border-radius: 14px;
  padding: 4px;
}
.segmented-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 8px;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 0.82rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.segmented-btn.active { background: rgba(255,255,255,0.1); color: #fff; }
.segmented-btn.disabled { opacity: 0.4; cursor: not-allowed; }

/* ================= CARDS GAME ================= */
/* In-game cards screen fills the viewport — no scroll to see whose turn it is */
#screen-cards-game.active {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: 14px 14px 12px;
}
.app-container:has(#screen-cards-game.active) {
  padding: 0;
  min-height: 0;
}
.cards-game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}
.cards-game-top .btn-back { margin-bottom: 0; }
.cards-deck-pill {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.cards-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
.cards-turn-banner {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  margin: 2px 0 10px;
  color: var(--color-warning);
  text-shadow: 0 2px 10px rgba(254,231,92,0.25);
  flex: 0 0 auto;
}

.play-card-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 10px;
}
.play-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  border-radius: 26px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(40,40,55,0.95), rgba(18,18,26,0.95));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  --card-accent: var(--color-accent);
}
.play-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--card-accent) 35%, transparent), transparent 70%);
  opacity: 0.7;
  pointer-events: none;
}
.play-card-type {
  position: relative;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--card-accent) 25%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-accent) 50%, transparent);
  margin-bottom: 18px;
}
.play-card-text {
  position: relative;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  z-index: 1;
  max-height: 100%;
  overflow-y: auto;
}
/* Reactions row + next button stay pinned, never pushed off-screen */
.cards-reactions { flex: 0 0 auto; }
#btn-next-card { flex: 0 0 auto; }

/* Compact spacing on shorter screens */
@media (max-height: 720px) {
  .cards-turn-banner { font-size: 1rem; margin: 0 0 8px; }
  .play-card { padding: 18px 18px; border-radius: 22px; }
  .play-card-type { margin-bottom: 12px; }
  .play-card-text { font-size: 1.25rem; }
  .card-reaction-btn { width: 42px; height: 42px; font-size: 1.15rem; }
  .cards-reactions { gap: 8px; margin-bottom: 10px; }
}
@media (max-height: 600px) {
  .play-card-text { font-size: 1.1rem; }
  .play-card-deco { display: none; }
  #btn-next-card { padding: 12px; }
}
.play-card-text .target-name {
  color: var(--card-accent);
  font-weight: 800;
}
.play-card-deco {
  position: absolute;
  bottom: -10px;
  right: -6px;
  font-size: 6rem;
  opacity: 0.08;
  transform: rotate(-12deg);
  pointer-events: none;
}
.play-card.card-enter {
  animation: cardFlipIn 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.18);
}
@keyframes cardFlipIn {
  0% { transform: translateY(24px) scale(0.9) rotateX(12deg); opacity: 0; }
  100% { transform: translateY(0) scale(1) rotateX(0); opacity: 1; }
}

/* ===== Zone de vote « Qui de vous ? » ===== */
.cards-vote-area {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 4px 0 10px;
  overflow: hidden;
}
/* L'attribut [hidden] doit l'emporter sur display:flex (même spécificité sinon). */
.cards-vote-area[hidden],
.vote-result[hidden] { display: none; }
.vote-status {
  flex: 0 0 auto;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.vote-grid {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.vote-option {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.vote-option:active { transform: scale(0.95); }
.vote-option.selected {
  background: color-mix(in srgb, var(--card-accent) 30%, transparent);
  border-color: var(--card-accent);
  box-shadow: 0 0 0 1px var(--card-accent), 0 6px 18px rgba(0,0,0,0.3);
}
.vote-result {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: cardFlipIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.18);
}
.vote-winner-head {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
}
.vote-winner-head span { color: var(--card-accent); }
.vote-winner-head.muted { font-size: 1.1rem; color: var(--text-muted); }
.vote-winner-head.pop { animation: winnerPop 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.4); }
@keyframes winnerPop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

/* Roulement de tambour avant la révélation */
.vote-suspense {
  text-align: center;
  font-size: 2.4rem;
  animation: drumShake 0.25s ease-in-out infinite;
}
.vote-suspense-dots {
  display: inline-block;
  font-weight: 800;
  animation: dotsBlink 0.6s steps(1) infinite;
}
@keyframes drumShake {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}
@keyframes dotsBlink { 0% { opacity: 0.2; } 50% { opacity: 1; } 100% { opacity: 0.2; } }
.vote-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vote-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.vote-bar-name {
  flex: 0 0 28%;
  text-align: right;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vote-bar-track {
  flex: 1 1 auto;
  height: 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.vote-bar-fill {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: rgba(255,255,255,0.18);
  transition: width 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.1);
}
.vote-bar-count {
  flex: 0 0 auto;
  min-width: 16px;
  text-align: left;
  font-weight: 800;
}
.vote-bar-row.win .vote-bar-name { color: var(--text-main); }
.vote-bar-row.win .vote-bar-fill {
  background: linear-gradient(90deg, var(--card-accent), color-mix(in srgb, var(--card-accent) 50%, #fff));
}
.vote-bar-row.win .vote-bar-count { color: var(--card-accent); }

@media (max-height: 720px) {
  .vote-option { padding: 8px 13px; font-size: 0.88rem; }
  .vote-winner-head { font-size: 1.25rem; }
  .cards-vote-area { gap: 7px; margin: 2px 0 8px; }
}

.cards-reactions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.card-reaction-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  font-size: 1.3rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.card-reaction-btn:active { transform: scale(0.8); background: rgba(255,255,255,0.15); }

.btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  box-shadow: none;
}
#btn-next-card:disabled {
  background-color: rgba(255,255,255,0.08);
  color: var(--text-muted);
}
/* Lobby deck grid is a touch more compact */
#lobby-deck-grid { margin-bottom: 4px; }

/* ================= PREFERENCES (orientation / couple) ================= */
.pref-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: -6px 0 14px;
  line-height: 1.35;
}
.pref-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.pref-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pref-seg { flex-wrap: wrap; }
.pref-seg .segmented-btn { flex: 1 1 auto; min-width: 56px; }
.pref-seg .segmented-btn.active {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 0 10px rgba(88,101,242,0.35);
}
.pref-select,
.cpf-prefs select {
  font-family: var(--font-family);
  background: rgba(0,0,0,0.3);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 1rem; /* 16px : évite le zoom involontaire sur iOS au focus */
  outline: none;
}
.pref-select:focus,
.cpf-prefs select:focus { border-color: var(--color-accent); }

.pref-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
}
.pref-toggle input { width: 18px; height: 18px; accent-color: var(--color-accent); }

/* Prefs completion status (host panel) */
.prefs-status {
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 14px;
}
.prefs-status:empty { display: none; }
.prefs-status.waiting {
  background: rgba(254, 231, 92, 0.1);
  border: 1px solid rgba(254, 231, 92, 0.3);
  color: #f4e08a;
}
.prefs-status.ready {
  background: rgba(35, 165, 90, 0.12);
  border: 1px solid rgba(35, 165, 90, 0.3);
  color: #6ee7a0;
}
.prefs-ready {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 8px 0 4px;
}
.prefs-ready:empty { display: none; }

.prefs-warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}
.prefs-missing-chip {
  background: rgba(254, 231, 92, 0.15);
  border: 1px solid rgba(254, 231, 92, 0.4);
  color: #f4e08a;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Flash the prefs panel when the player gets nudged */
.cards-prefs-flash {
  animation: prefsFlash 0.6s ease 4;
}
@keyframes prefsFlash {
  0%, 100% { box-shadow: 0 8px 32px rgba(0,0,0,0.3); border-color: var(--border-color); }
  50% { box-shadow: 0 0 0 3px var(--color-warning), 0 8px 32px rgba(254,231,92,0.4); border-color: var(--color-warning); }
}

/* Local per-player preference editor */
.card-player-full {
  list-style: none;
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}
.cpf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cpf-name { font-weight: 700; }
.cpf-prefs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cpf-prefs .pl-partner { grid-column: 1 / -1; }
.card-player-full .remove-chip { cursor: pointer; color: var(--text-muted); font-weight: 800; }
.card-player-full .remove-chip:active { color: var(--color-danger); }

/* Bloc Environnement (panneau hôte missions) */
.env-block .env-group { margin-top: 10px; }
.env-group-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; }
.env-seg { flex-wrap: wrap; gap: 6px; }
.env-seg .segmented-btn {
  flex: 1 1 auto;
  min-width: 64px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
}
/* État sélectionné bien visible (accent), priorité sur le style de base */
.env-seg .segmented-btn.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  box-shadow: 0 2px 10px rgba(88, 101, 242, 0.45);
}
.env-seg .segmented-btn:active { transform: scale(0.96); }

/* ===================== L'IMPOSTEUR ===================== */
.game-type-card-imposteur { --tile-accent: #9b5de5; }

#screen-imposteur.active {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: 14px 14px 12px;
}
.app-container:has(#screen-imposteur.active) { padding: 0; min-height: 0; }
#screen-imposteur { --imp-accent: #9b5de5; }

/* Carte rôle (mot privé) */
.imp-role-card {
  flex: 0 0 auto;
  position: relative;
  margin: 6px 0 12px;
  border-radius: 22px;
  padding: 22px 18px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(150deg, rgba(155,93,229,0.22), rgba(18,18,26,0.9));
  border: 1px solid color-mix(in srgb, var(--imp-accent) 45%, transparent);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  transition: transform 0.15s ease;
}
.imp-role-card:active { transform: scale(0.98); }
.imp-role-hint { font-size: 1.05rem; font-weight: 700; color: var(--text-muted); }
.imp-role-word {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  animation: winnerPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.4);
}
.imp-role-word small { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.imp-role-word.is-impostor { color: var(--imp-accent); }

/* Phases */
.imp-phase {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.imp-phase[hidden] { display: none; }

.imp-banner {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
}
.imp-timer {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--imp-accent);
}
.imp-order {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
  counter-reset: imp;
}
.imp-order-item {
  counter-increment: imp;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  font-weight: 600;
}
.imp-order-item::before { content: counter(imp) ". "; color: var(--text-muted); }
.imp-order-item.current {
  background: color-mix(in srgb, var(--imp-accent) 28%, transparent);
  border-color: var(--imp-accent);
  box-shadow: 0 0 0 1px var(--imp-accent);
}

/* Résultat */
.imp-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: cardFlipIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.18);
}
.imp-reveal-line { text-align: center; font-size: 1.1rem; }
.imp-reveal-words { text-align: center; color: var(--text-muted); font-size: 0.95rem; }
.imp-reveal-line b, .imp-reveal-words b { color: var(--imp-accent); }

#screen-imposteur .vote-bar-row.win .vote-bar-fill {
  background: linear-gradient(90deg, var(--imp-accent), color-mix(in srgb, var(--imp-accent) 50%, #fff));
}
#screen-imposteur .vote-bar-row.win .vote-bar-count,
#screen-imposteur .vote-winner-head span { color: var(--imp-accent); }
#screen-imposteur .vote-option.selected {
  background: color-mix(in srgb, var(--imp-accent) 30%, transparent);
  border-color: var(--imp-accent);
  box-shadow: 0 0 0 1px var(--imp-accent), 0 6px 18px rgba(0,0,0,0.3);
}

@media (max-height: 720px) {
  .imp-role-card { min-height: 90px; padding: 16px; margin: 2px 0 8px; }
  .imp-role-word { font-size: 1.7rem; }
}

/* ===================== FIN DE PARTIE (PODIUM) ===================== */
.endgame-box {
  max-width: 440px;
  width: 100%;
  text-align: center;
  padding: 26px 20px 20px;
}
.endgame-title { font-size: 1.6rem; margin-bottom: 20px; }
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin-bottom: 18px;
}
.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 33%;
  max-width: 110px;
}
.podium-medal { font-size: 1.8rem; line-height: 1; }
.podium-avatar { font-size: 2.2rem; line-height: 1; margin: 2px 0; }
.podium-name {
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-block {
  margin-top: 8px;
  width: 100%;
  border-radius: 12px 12px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
  color: #fff;
  transform-origin: bottom;
  background: linear-gradient(180deg, rgba(88,101,242,0.5), rgba(88,101,242,0.15));
  animation: podiumRise 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.2) both;
}
.podium-rank-1 .podium-block { height: 120px; background: linear-gradient(180deg, rgba(254,231,92,0.55), rgba(254,231,92,0.12)); }
.podium-rank-2 .podium-block { height: 90px; }
.podium-rank-3 .podium-block { height: 66px; }
.podium-score { font-size: 1.3rem; font-weight: 800; }
.podium-pts { font-size: 0.7rem; opacity: 0.8; }
@keyframes podiumRise {
  from { transform: scaleY(0.2); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}
.endgame-rest {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}
.endgame-rest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}
.endgame-rest-rank { width: 20px; color: var(--text-muted); font-weight: 700; }
.endgame-rest-av { font-size: 1.2rem; }
.endgame-rest-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endgame-rest-score { font-weight: 700; color: var(--text-muted); }

/* ===================== AVATARS ===================== */
.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avatar-option {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.25);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
.avatar-option:hover { background: rgba(255, 255, 255, 0.08); }
.avatar-option.selected {
  border-color: var(--color-accent);
  background: rgba(88, 101, 242, 0.25);
  transform: scale(1.08);
}
.chip-avatar { font-size: 1.1rem; line-height: 1; }
.leaderboard-avatar {
  font-size: 1.5rem;
  line-height: 1;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

/* ===================== ONBOARDING ===================== */
.onboarding-box {
  position: relative;
  max-width: 400px;
  width: 100%;
  text-align: center;
  padding: 28px 22px 22px;
}
.onboarding-skip {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px;
}
.onboarding-skip:hover { color: var(--text-main); }
.onboarding-slides {
  position: relative;
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.onboarding-slide.active {
  display: flex;
  animation: fadeIn 0.35s ease-out;
}
.onboarding-emoji {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
}
.onboarding-slide h2 {
  font-size: 1.5rem;
  margin: 0;
}
.onboarding-slide p {
  color: var(--text-main);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0;
  max-width: 320px;
}
.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0;
}
.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.onboarding-dot.active {
  background: var(--color-accent);
  width: 22px;
  border-radius: 4px;
}

/* ===================== ACCESSIBILITÉ ===================== */
/* Indicateur de focus clavier net (les boutons/éléments interactifs n'en avaient pas).
   On cible :focus-visible → visible au clavier, discret à la souris/au tap. */
.btn:focus-visible,
.tab-btn:focus-visible,
.segmented-btn:focus-visible,
.deck-tile:focus-visible,
.vote-option:focus-visible,
.game-type-card:focus-visible,
.card-reaction-btn:focus-visible,
.reaction-chip:focus-visible,
.btn-back:focus-visible,
.privacy-link:focus-visible,
.remove-chip:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Respecte le réglage système « réduire les animations » : on coupe
   quasiment toutes les animations et transitions pour les personnes sensibles. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===================== CONFIDENTIALITÉ ===================== */
/* Lien discret vers la page confidentialité (accueil) */
.privacy-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 12px;
  margin-top: 4px;
  cursor: pointer;
  text-decoration: underline;
  align-self: center;
}
.privacy-link:hover { color: var(--text-main); }

/* Contenu de la page confidentialité */
.privacy-card h3 {
  font-size: 1rem;
  margin: 16px 0 6px;
  color: var(--color-accent);
}
.privacy-card h3:first-child { margin-top: 0; }
.privacy-card p {
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

/* ===================== TU PRÉFÈRES ? ===================== */
.pref-question {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  margin: 8px 0 14px;
}
.pref-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.pref-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 18px 16px;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.pref-choice:hover { border-color: var(--color-accent); }
.pref-choice.selected {
  border-color: var(--color-accent);
  background: rgba(88, 101, 242, 0.22);
  transform: scale(1.02);
}
.pref-choice:disabled { cursor: default; opacity: 0.9; }
.pref-choice-tag { font-size: 1.5rem; flex-shrink: 0; }
.pref-vs {
  text-align: center;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.pref-progress {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  min-height: 1.2em;
  margin-bottom: 10px;
}
.game-type-card-preferes .game-type-emoji { filter: drop-shadow(0 4px 10px rgba(88,101,242,0.4)); }

