:root {
  --card-w: 76px;
  --card-h: 104px;
}
html,
body,
#app {
  height: 100%;
}

/* PixiJS Canvas */
#pixi-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: none; /* Caché par défaut, affiché quand le jeu démarre */
}
#pixi-canvas.active {
  display: block;
}
/* Quand PixiJS est actif, masquer le DOM du jeu */
body.pixi-active #app {
  display: none;
}
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Responsive utility classes */
.mobile-only {
  display: none !important;
}
@media (max-width: 768px) {
  .mobile-only {
    display: flex !important;
  }
  .desktop-only {
    display: none !important;
  }
}

/* BG */
.bg-skyjo {
  background: radial-gradient(
    1400px 900px at 20% -10%,
    #1a1f3f 0%,
    #0f1331 35%,
    #080a18 70%,
    #03040a 100%
  );
  position: relative;
  overflow: hidden;
}
.bg-skyjo::before,
.bg-skyjo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.bg-skyjo::before {
  /* Étoiles supprimées - ressemblaient à des pixels morts */
}
.bg-skyjo::after {
  background: radial-gradient(
      900px 600px at 70% 30%,
      rgba(99, 102, 241, 0.13),
      transparent 60%
    ),
    radial-gradient(
      1100px 700px at 10% 80%,
      rgba(236, 72, 153, 0.12),
      transparent 70%
    );
  mix-blend-mode: screen;
  filter: blur(0.2px);
}

.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 18px;
  border: none;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  user-select: none;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.card[data-faceup="false"] {
  background: linear-gradient(135deg, #23273a, #121628);
}
.c-neg { background: linear-gradient(135deg, #6d28d9, #7c3aed); }
.c-zero { background: linear-gradient(135deg, #0ea5e9, #22d3ee); }
.c-low { background: linear-gradient(135deg, #10b981, #34d399); }
.c-mid { background: linear-gradient(135deg, #f59e0b, #fb7185); }
.c-hi { background: linear-gradient(135deg, #ec4899, #6366f1); }

.pile {
  width: calc(var(--card-w) * 0.95);
  height: calc(var(--card-h) * 0.95);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.scale-wrap { transform-origin: top left; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0f1020;
}
.avatar video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.btn {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}
.btn.active,
.primary {
  background: rgb(79, 70, 229);
  border-color: transparent;
}
.input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 0.4rem 0.6rem;
  color: #fff;
}
.grid-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  place-items: center;
}
.hidden { display: none; }
.overflow-auto { overflow: auto; }

/* ============================================
   GAME UI - CLEAN MODERN DESIGN
   ============================================ */

/* Header */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.game-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.game-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Turn badge */
.turn-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  font-size: 0.85rem;
}

.turn-badge.my-turn {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
}

.turn-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}

.turn-badge.my-turn .turn-badge-dot {
  background: #22c55e;
}

/* Animations désactivées */

.turn-badge-name {
  font-weight: 600;
  color: #fff;
}

/* Turn timer */
.turn-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  font-variant-numeric: tabular-nums;
}

.turn-timer.timer-urgent {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
  font-size: 1.1rem;
}

/* Notification explosive */
@keyframes notification-explode {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
  70% {
    transform: translate(-50%, -50%) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes notification-pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), 0 0 60px rgba(99, 102, 241, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), 0 0 80px rgba(99, 102, 241, 0.3);
  }
}

@keyframes notification-pulse-green {
  0%, 100% {
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.5), 0 0 70px rgba(34, 197, 94, 0.25);
  }
  50% {
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.7), 0 0 100px rgba(34, 197, 94, 0.35);
  }
}

@keyframes avatar-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.game-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.3);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 280px;
  height: 200px;
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(20, 20, 40, 0.98) 0%, rgba(10, 10, 25, 0.98) 100%);
  border: 2px solid rgba(99, 102, 241, 0.5);
  border-radius: 20px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4), 0 0 60px rgba(99, 102, 241, 0.2), 0 25px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
  color: #fff;
  pointer-events: none;
  opacity: 0;
}

.game-notification.visible {
  opacity: 1;
  animation: notification-explode 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             notification-pulse 2s ease-in-out 0.4s infinite;
}

.game-notification-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
  object-fit: cover;
  flex-shrink: 0;
  animation: avatar-bounce 0.6s ease-out;
  background: #2a2a3e;
}

.game-notification-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
}

.game-notification-player {
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-notification-action {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  font-weight: 500;
}

/* Notification types - Tour: style discret en haut */
.game-notification.type-turn {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  width: auto;
  min-width: 200px;
  max-width: 320px;
  height: auto;
  padding: 0.6rem 1.2rem;
  flex-direction: row;
  gap: 0.75rem;
  border-radius: 50px;
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(20, 20, 40, 0.92);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.game-notification.type-turn.visible {
  transform: translateX(-50%) translateY(0);
  animation: turn-slide-in 0.3s ease-out forwards;
}

.game-notification.type-turn .game-notification-avatar {
  width: 36px;
  height: 36px;
  border-width: 2px;
  animation: none;
}

.game-notification.type-turn .game-notification-content {
  flex-direction: row;
  gap: 0.4rem;
}

.game-notification.type-turn .game-notification-player {
  font-size: 0.95rem;
}

.game-notification.type-turn .game-notification-action {
  font-size: 0.9rem;
}

.game-notification.type-turn.my-turn {
  border-color: rgba(34, 197, 94, 0.6);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.25) 0%, rgba(20, 40, 30, 0.95) 100%);
}

.game-notification.type-turn.my-turn.visible {
  animation: turn-slide-in 0.3s ease-out forwards;
}

.game-notification.type-turn.my-turn .game-notification-avatar {
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.game-notification.type-turn.my-turn .game-notification-player {
  color: #4ade80;
}

.game-notification.type-turn.my-turn .game-notification-action {
  color: #86efac;
}

@keyframes turn-slide-in {
  from { transform: translateX(-50%) translateY(-100px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.game-notification.type-column_removed {
  border-color: rgba(251, 191, 36, 0.6);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.15) 0%, rgba(40, 30, 10, 0.98) 100%);
}

/* Notification fin de manche - style festif */
.game-notification.type-round_finish {
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  width: auto;
  min-width: 220px;
  max-width: 360px;
  height: auto;
  padding: 0.8rem 1.5rem;
  flex-direction: row;
  gap: 0.75rem;
  border-radius: 50px;
  border-color: rgba(251, 191, 36, 0.7);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.3) 0%, rgba(40, 30, 10, 0.95) 100%);
  box-shadow: 0 4px 30px rgba(251, 191, 36, 0.3);
}

.game-notification.type-round_finish.visible {
  transform: translateX(-50%) translateY(0);
  animation: turn-slide-in 0.3s ease-out forwards;
}

.game-notification.type-round_finish .game-notification-avatar {
  width: 40px;
  height: 40px;
  border-width: 2px;
  border-color: rgba(251, 191, 36, 0.8);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.game-notification.type-round_finish .game-notification-content {
  flex-direction: row;
  gap: 0.4rem;
}

.game-notification.type-round_finish .game-notification-player {
  font-size: 1rem;
  color: #fbbf24;
  font-weight: 700;
}

.game-notification.type-round_finish .game-notification-action {
  font-size: 0.95rem;
  color: #fcd34d;
}

.game-notification.type-column_removed .game-notification-avatar {
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

.game-notification.type-column_removed .game-notification-action {
  color: #fbbf24;
}

.game-notification.type-game_over {
  border-color: rgba(251, 191, 36, 0.7);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.2) 0%, rgba(50, 40, 10, 0.98) 100%);
}

.game-notification.type-game_over .game-notification-avatar {
  border-color: rgba(251, 191, 36, 0.8);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.5);
}

.game-notification.type-game_over .game-notification-player {
  color: #fbbf24;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

/* Header buttons */
.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

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

.header-btn.sound-off {
  color: rgba(255, 255, 255, 0.4);
}

.header-btn-primary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border-color: transparent;
  color: #fff;
}

.header-btn-primary:hover {
  background: linear-gradient(135deg, #2dd66b 0%, #1cb055 100%);
}

.header-btn-accent {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-color: transparent;
  color: #fff;
}

.header-btn-shop {
  border-color: rgba(251, 191, 36, 0.3);
}

.header-btn-shop:hover {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.5);
  color: #fbbf24;
}

/* Status badge */
.status-badge {
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Game layout - Hybrid Style (sides + center + top bar) */
.game-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.game-board {
  display: grid;
  grid-template-columns: minmax(380px, 500px) 1fr minmax(380px, 500px);
  grid-template-rows: auto 1fr;
  flex: 1;
  padding: 0.75rem;
  gap: 1rem;
  overflow: hidden;
  max-height: calc(100vh - 56px);
}

/* Top bar for extra opponents (avatars only) */
.top-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.top-bar-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.top-bar-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
  background: #1a1a2e;
}

.top-bar-avatar:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.top-bar-avatar.is-playing {
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.top-bar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-bar-avatar .playing-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a0a14;
}

.top-bar-avatar .bot-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #a855f7;
  border: 2px solid #0a0a14;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  background: #2a2a3e;
  border-radius: inherit;
}

/* Side columns for opponents (2 max each) */
.side-left,
.side-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.25rem;
}

/* Center area */
.center-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 0;
}

/* Player board container */
.player-board-container {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1rem 1.25rem;
  max-width: 450px;
}

.player-board-container.my-turn {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.06);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.2);
  animation: my-turn-glow 2s ease-in-out infinite;
}

@keyframes my-turn-glow {
  0%, 100% {
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.3), 0 0 15px rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.6);
  }
}

/* Opponent card - for side panels (no hover modal, board already visible) */
.opponent-card {
  flex-shrink: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.opponent-card.is-playing {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
  animation: opponent-playing 2s ease-in-out infinite;
}

@keyframes opponent-playing {
  0%, 100% {
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
  }
  50% {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  }
}

.opponent-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.opponent-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  object-fit: cover;
  background: #1a1a2e;
  flex-shrink: 0;
}

.opponent-card.is-playing .opponent-avatar {
  border-color: rgba(34, 197, 94, 0.6);
}

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

.opponent-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.opponent-status {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.opponent-card.is-playing .opponent-status {
  color: #4ade80;
}

.opponent-score {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  flex-shrink: 0;
}

/* Bot badge */
.bot-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.5rem;
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #c084fc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bot-badge svg {
  width: 12px;
  height: 12px;
}

/* Mini board for opponents */
.mini-board {
  display: grid;
  grid-template-columns: repeat(4, auto);
  grid-auto-rows: min-content;
  gap: 4px;
  width: fit-content;
  margin: 0 auto;
}

.mini-cell {
  cursor: default;
  line-height: 0;
  font-size: 0;
  margin: 0;
  padding: 0;
  background: transparent;
}

.mini-cell img {
  display: block;
  width: var(--card-w);
  height: var(--card-h);
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  margin: 0;
  padding: 0;
  background: transparent;
}

.mini-cell.removed {
  opacity: 0.15;
}

.mini-cell .removed-placeholder {
  display: block;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Center section */
.center-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* Piles section */
.piles-section {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 200px; /* Hauteur fixe pour éviter les sauts */
}

.pile-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 90px; /* Largeur min pour stabilité */
}

.pile-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
}

.pile-count {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.35);
}

.pile-card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  cursor: pointer;
  transition: transform 0.1s ease;
  background: transparent;
}

.pile-card:hover:not(.disabled) {
  transform: translateY(-8px);
}

.pile-card:hover:not(.disabled) img {
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.5), 0 0 15px rgba(99, 102, 241, 0.3);
}

.pile-card:active:not(.disabled) {
  transform: translateY(-2px);
  transition: transform 0.1s ease;
}

.pile-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Pulse animation pour indiquer que la pile est cliquable */
@keyframes pile-pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow: 0 4px 25px rgba(99, 102, 241, 0.3), 0 0 10px rgba(99, 102, 241, 0.15);
  }
}

.pile-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: box-shadow 0.1s ease;
  background: transparent;
}

.pile-card:not(.disabled) img {
  animation: pile-pulse 2.5s ease-in-out infinite;
}

/* Carte défausse sélectionnée */
.pile-card.selected {
  transform: translateY(-8px);
}
.pile-card.selected img {
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.6), 0 0 0 3px rgba(34, 197, 94, 0.4);
}

.pile-empty {
  width: 70px;
  height: 100px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
}

/* Card in hand indicator */
.card-in-hand {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--card-w);
  height: var(--card-h);
  z-index: 10;
  animation: card-drawn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             card-float 2s ease-in-out 0.5s infinite;
}

.card-in-hand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5), 0 0 20px rgba(99, 102, 241, 0.3);
  border: 2px solid rgba(99, 102, 241, 0.7);
  animation: card-glow 2s ease-in-out infinite;
  cursor: grab;
  transition: transform 0.2s ease;
}

.card-in-hand img:hover {
  transform: translateY(-3px) rotate(2deg);
}

/* Animation d'entrée de la carte piochée */
@keyframes card-drawn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(60px) scale(0.3) rotate(-10deg);
  }
  60% {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px) scale(1.1) rotate(3deg);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1) rotate(0deg);
  }
}

/* Animation de flottement subtil */
@keyframes card-float {
  0%, 100% {
    transform: translateX(-50%) translateY(0) rotate(0deg);
  }
  25% {
    transform: translateX(-50%) translateY(-5px) rotate(1deg);
  }
  75% {
    transform: translateX(-50%) translateY(-3px) rotate(-1deg);
  }
}

/* Glow pulsant */
@keyframes card-glow {
  0%, 100% {
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5), 0 0 20px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.7);
  }
  50% {
    box-shadow: 0 12px 45px rgba(99, 102, 241, 0.7), 0 0 35px rgba(99, 102, 241, 0.5);
    border-color: rgba(99, 102, 241, 0.9);
  }
}


.discard-btn {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  color: #f87171;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: discard-pulse 1.5s ease-in-out infinite, discard-bounce 2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.discard-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: discard-shine 2s ease-in-out infinite;
}

@keyframes discard-shine {
  0%, 100% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
}

@keyframes discard-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.discard-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(239, 68, 68, 0.2));
  border-color: rgba(239, 68, 68, 0.6);
  animation: none;
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
}

.discard-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.2);
}

@keyframes discard-pulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(239, 68, 68, 0), 0 4px 15px rgba(239, 68, 68, 0.15);
  }
  50% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5), 0 4px 20px rgba(239, 68, 68, 0.25);
  }
}

/* My board section */
.my-board-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1rem;
  min-height: 0;
}

.my-board-section.my-turn {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.03);
}

.my-board-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.my-board-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  object-fit: cover;
  background: #2a2a3e;
}

.my-board-section.my-turn .my-board-avatar {
  border-color: rgba(34, 197, 94, 0.5);
}

.my-board-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

/* Main board grid */
.board-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  grid-auto-rows: min-content;
  gap: 6px;
  justify-content: center;
  align-content: center;
}

.board-cell {
  cursor: pointer;
  transition: transform 0.1s ease;
  line-height: 0;
  font-size: 0;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  background: transparent;
}

.board-cell:hover:not(.removed) {
  transform: translateY(-5px);
}

.board-cell:hover:not(.removed) img {
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.4);
}

.board-cell:active:not(.removed) {
  transform: translateY(-1px);
}

.board-cell.removed {
  opacity: 0.1;
  cursor: default;
}

.board-cell img {
  display: block;
  width: var(--card-w);
  height: var(--card-h);
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  margin: 0;
  padding: 0;
  transition: box-shadow 0.1s ease;
  background: transparent;
}

/* Clickable cell pulse when it's player's turn */
.my-turn .board-cell:not(.removed) {
  cursor: pointer;
}

.my-turn .board-cell:not(.removed) img {
  cursor: pointer;
  animation: cell-ready 2s ease-in-out infinite;
}

.my-turn .board-cell:not(.removed):hover img {
  animation: none;
  box-shadow: 0 12px 35px rgba(34, 197, 94, 0.5), 0 0 15px rgba(34, 197, 94, 0.3);
}

@keyframes cell-ready {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 4px 18px rgba(34, 197, 94, 0.35), 0 0 8px rgba(34, 197, 94, 0.2); }
}

.board-cell .removed-placeholder {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

/* Flying card animation */
.flying-card {
  position: fixed;
  width: var(--card-w);
  height: var(--card-h);
  z-index: 9999;
  pointer-events: none;
  border-radius: 10px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.flying-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

/* Card animations */

/* Flip animation - smooth horizontal flip effect */
@keyframes card-flip {
  0% {
    transform: scaleX(0) scaleY(1.1);
    opacity: 0.7;
  }
  30% {
    transform: scaleX(1.05) scaleY(1.02);
    opacity: 1;
  }
  50% {
    transform: scaleX(0.95) scaleY(1.01);
  }
  70% {
    transform: scaleX(1.02) scaleY(1);
  }
  100% {
    transform: scaleX(1) scaleY(1);
    opacity: 1;
  }
}

/* Flip animation with glow effect */
@keyframes card-flip-glow {
  0% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    filter: brightness(1.3);
  }
  30% {
    box-shadow: 0 10px 35px rgba(99, 102, 241, 0.7), 0 0 25px rgba(99, 102, 241, 0.5);
    filter: brightness(1.2);
  }
  100% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    filter: brightness(1);
  }
}

/* Place animation - card slides in from above */
@keyframes card-place {
  0% {
    transform: scale(0.3) translateY(-50px);
    opacity: 0;
  }
  60% {
    transform: scale(1.15) translateY(5px);
    opacity: 1;
  }
  80% {
    transform: scale(0.95) translateY(-2px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Place glow effect */
@keyframes card-place-glow {
  0% {
    box-shadow: 0 0 0 rgba(34, 197, 94, 0);
  }
  50% {
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.7), 0 0 10px rgba(34, 197, 94, 0.5);
  }
  100% {
    box-shadow: 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Remove animation - card shrinks and fades with sparkle */
@keyframes card-remove {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    filter: brightness(1);
  }
  30% {
    transform: scale(1.2) rotate(5deg);
    opacity: 1;
    filter: brightness(1.3);
  }
  100% {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
    filter: brightness(2);
  }
}

/* Column sparkle effect */
@keyframes column-sparkle {
  0% {
    box-shadow: 0 0 0 rgba(251, 191, 36, 0);
  }
  20% {
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.9), 0 0 50px rgba(251, 191, 36, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(251, 191, 36, 1), 0 0 60px rgba(251, 191, 36, 0.7);
  }
  80% {
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.9), 0 0 50px rgba(251, 191, 36, 0.5);
  }
  100% {
    box-shadow: 0 0 0 rgba(251, 191, 36, 0);
  }
}

/* Take from discard animation - card slides up */
@keyframes card-take-discard {
  0% {
    transform: scale(0.8) translateY(30px);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1) translateY(-10px);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Discard animation - card slides away */
@keyframes card-discard {
  0% {
    transform: scale(1) translateX(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.7) translateX(50px) rotate(15deg);
    opacity: 0;
  }
}

/* Shake animation for invalid action */
@keyframes card-shake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}

/* Hover lift animation */
@keyframes card-hover-lift {
  0% {
    transform: translateY(0) scale(1);
  }
  100% {
    transform: translateY(-8px) scale(1.03);
  }
}

/* Apply animations */
.board-cell.animate-flip,
.mini-cell.animate-flip {
  animation: card-flip-glow 0.5s ease-in-out;
}

.board-cell.animate-flip img,
.mini-cell.animate-flip img {
  animation: card-flip 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-cell.animate-place,
.mini-cell.animate-place {
  animation: card-place 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), card-place-glow 0.5s ease-out;
}

.board-cell.animate-remove,
.mini-cell.animate-remove {
  animation: card-remove 0.5s ease-in forwards;
}

.board-cell.animate-sparkle,
.mini-cell.animate-sparkle {
  animation: column-sparkle 0.6s ease-in-out;
}

.board-cell.animate-take-discard,
.mini-cell.animate-take-discard {
  animation: card-take-discard 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.board-cell.animate-discard,
.mini-cell.animate-discard {
  animation: card-discard 0.3s ease-in forwards;
}

.board-cell.animate-shake,
.mini-cell.animate-shake {
  animation: card-shake 0.4s ease-in-out;
}

/* Enhanced hover for cards */
.board-cell img,
.mini-cell img {
  transition: box-shadow 0.1s ease;
}

.board-cell:not(.removed):hover img,
.mini-cell:not(.removed):hover img {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .board-cell.animate-flip,
  .mini-cell.animate-flip,
  .board-cell.animate-flip img,
  .mini-cell.animate-flip img,
  .board-cell.animate-place,
  .mini-cell.animate-place,
  .board-cell.animate-remove,
  .mini-cell.animate-remove,
  .board-cell.animate-sparkle,
  .mini-cell.animate-sparkle,
  .board-cell.animate-take-discard,
  .mini-cell.animate-take-discard,
  .board-cell.animate-discard,
  .mini-cell.animate-discard,
  .board-cell.animate-shake,
  .mini-cell.animate-shake,
  .card-in-hand,
  .card-in-hand img,
  .discard-btn,
  .discard-btn::before,
  .opponent-card.is-playing,
  .my-turn .board-cell:not(.removed) img,
  .player-board-container.my-turn,
  .pile-card,
  .pile-card img,
  .pile-card:not(.disabled) img {
    animation: none !important;
    transition: none !important;
  }
}

/* Other players bar */
.others-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.others-bar-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-right: 0.5rem;
  display: flex;
  align-items: center;
}

.others-avatar-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.15s ease;
  background: #1a1a2e;
}

.others-avatar-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.others-avatar-btn.is-playing {
  border-color: rgba(99, 102, 241, 0.5);
}

.others-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playing-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #0a0a14;
}

.avatar-bot-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #a855f7;
  border: 2px solid #0a0a14;
}

/* Game over overlay - New design */
.game-over-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: overlay-fade-in 0.3s ease-out;
}

@keyframes overlay-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.game-over-container {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  max-width: 95vw;
  max-height: 90vh;
}

.game-over-scores-panel {
  background: linear-gradient(180deg, rgba(30, 30, 50, 0.98) 0%, rgba(15, 15, 25, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  max-height: 80vh;
  min-width: 350px;
  overflow-x: hidden;
  overflow-y: auto;
  animation: modal-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-over-scores-panel .ranking-title {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  text-align: center;
}

.game-over-scores-panel .score-sheet {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 0.5rem;
  overflow: visible;
}

.game-over-scores-panel .score-table {
  font-size: 1.1rem;
  width: 100%;
  table-layout: auto;
}

.game-over-scores-panel .score-player-name {
  font-size: 1.05rem;
  padding: 0.6rem 1.2rem;
  white-space: nowrap;
}

.game-over-scores-panel .score-cell {
  padding: 0.5rem 1.2rem;
  font-size: 1.05rem;
  white-space: nowrap;
}

.game-over-scores-panel .score-round-num {
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
}

/* Panneau des plateaux finaux */
.game-over-boards-panel {
  background: linear-gradient(180deg, rgba(30, 30, 50, 0.98) 0%, rgba(15, 15, 25, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  max-height: 80vh;
  overflow: auto;
  animation: modal-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.game-over-boards-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.game-over-board-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
}

.game-over-board-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.game-over-board-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.game-over-board-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  flex: 1;
}

.game-over-board-score {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.game-over-board-cards {
  --card-w: 36px;
  --card-h: 50px;
  --card-gap: 3px;
}

@media (max-width: 900px) {
  .game-over-container {
    flex-direction: column;
    align-items: center;
  }

  .game-over-scores-panel,
  .game-over-boards-panel {
    max-height: 40vh;
    width: auto;
    min-width: 300px;
    max-width: 95vw;
  }

  .game-over-scores-panel .score-table {
    font-size: 1rem;
  }

  .game-over-scores-panel .score-player-name,
  .game-over-scores-panel .score-cell {
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 500px) {
  .game-over-scores-panel,
  .game-over-boards-panel {
    max-height: 45vh;
    min-width: unset;
    padding: 1rem 1.25rem;
  }

  .game-over-board-cards {
    --card-w: 30px;
    --card-h: 42px;
  }
}

.game-over-modal {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(30, 30, 50, 0.98) 0%, rgba(15, 15, 25, 0.98) 100%);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.1);
  position: relative;
  animation: modal-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.game-over-confetti {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.1) 0%, transparent 100%);
  pointer-events: none;
}

.game-over-header {
  text-align: center;
  padding: 1.5rem 1.5rem 1rem;
  position: relative;
}

.game-over-trophy {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: trophy-bounce 1s ease-in-out infinite;
}

@keyframes trophy-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.game-over-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.game-over-winner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  margin: 0 1rem;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 16px;
}

.winner-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
  object-fit: cover;
}

.winner-info {
  flex: 1;
}

.winner-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 215, 0, 0.8);
  margin-bottom: 0.2rem;
}

.winner-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.winner-score {
  font-size: 0.9rem;
  color: #ffd700;
  font-weight: 600;
}

.game-over-podium {
  display: none; /* Caché par défaut, optionnel */
}

.game-over-ranking {
  padding: 1rem 1.5rem;
}

.ranking-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.75rem;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.4rem;
  transition: background 0.2s ease;
}

.ranking-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.ranking-row.top-three {
  background: rgba(255, 255, 255, 0.03);
}

.ranking-position {
  width: 28px;
  text-align: center;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.ranking-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.ranking-name {
  flex: 1;
  font-weight: 500;
  color: #fff;
  font-size: 0.9rem;
}

.ranking-score {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.game-over-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  justify-content: center;
}

.game-over-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.game-over-btn.primary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.game-over-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.game-over-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.game-over-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Bouton fermer la modal game-over */
.game-over-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.game-over-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: scale(1.1);
}

/* Bouton flottant pour réafficher les résultats */
.game-over-show-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.9) 0%, rgba(255, 180, 0, 0.9) 100%);
  color: #1a1a2e;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  transition: all 0.3s ease;
  animation: show-btn-pulse 2s ease-in-out infinite;
}

.game-over-show-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
}

@keyframes show-btn-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4), 0 0 30px rgba(255, 215, 0, 0.2); }
  50% { box-shadow: 0 4px 25px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3); }
}

/* Score sheet - style feuille de score traditionnelle */
.score-sheet {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

.score-table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.score-table thead tr {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.score-round-header {
  width: 35px;
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.score-player-name {
  padding: 0.5rem 0.6rem;
  text-align: center;
  font-weight: 600;
  color: #fff;
  font-size: 0.85rem;
  min-width: 70px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.score-player-name.is-playing {
  color: #4ade80;
}

.score-indicator {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.score-indicator.playing {
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

.score-round-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.score-round-row.played:hover {
  background: rgba(255, 255, 255, 0.02);
}

.score-round-row.current-round {
  background: rgba(99, 102, 241, 0.1);
}

.score-round-row.future {
  opacity: 0.35;
}

.score-round-num {
  padding: 0.4rem;
  text-align: center;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.75rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.score-cell {
  padding: 0.4rem 0.6rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  min-width: 50px;
}

.score-cell.doubled {
  color: #f87171;
  font-weight: 600;
}

.doubled-icon {
  display: inline-block;
  font-size: 0.65rem;
  color: #ef4444;
  font-weight: 700;
  vertical-align: super;
  margin-left: 2px;
}

.score-total-row {
  background: rgba(255, 255, 255, 0.05);
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.score-total-label {
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  text-transform: uppercase;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.score-total-cell {
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.finisher-badge {
  color: #fbbf24;
  font-size: 0.7rem;
  margin-left: 2px;
}

.score-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.current-dot {
  color: rgba(99, 102, 241, 0.8);
  font-weight: bold;
}

.score-cell.empty {
  color: rgba(255, 255, 255, 0.1);
}

.score-cell.current {
  color: rgba(99, 102, 241, 0.7);
  font-weight: bold;
}

/* Ancien style (pour compatibilité game-over) */
.scores-table {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.scores-header {
  display: grid;
  grid-template-columns: 1fr 80px 80px;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
}

.scores-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
}

.scores-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.scores-name {
  font-weight: 500;
  color: #fff;
}

.scores-round, .scores-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.scores-round {
  color: rgba(255, 255, 255, 0.6);
}

.scores-total {
  font-weight: 600;
  color: #fff;
}

.game-over-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.game-over-btn {
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.game-over-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.game-over-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.game-over-btn-primary {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: none;
  color: #fff;
}

.game-over-btn-primary:hover {
  background: linear-gradient(135deg, #2dd66b 0%, #1cb055 100%);
}

/* Panels (score, rules) */
.panel {
  background: rgba(15, 15, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 600;
  font-size: 0.95rem;
}

.panel-body {
  padding: 1rem;
}

/* Legacy glass-panel for compatibility */
.glass-panel {
  background: rgba(15, 15, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-active {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.05);
}

/* Foe modal */
.foe-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.foe-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.foe-modal-card {
  max-width: 600px;
  width: 100%;
  background: rgba(15, 15, 25, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.foe-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.foe-modal-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.foe-modal-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  object-fit: cover;
  background: #2a2a3e;
}

.foe-modal-avatar.is-playing {
  border-color: rgba(34, 197, 94, 0.5);
}

.foe-modal-playing {
  color: #4ade80;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

/* Utility classes */
.text-right {
  text-align: right;
}

.flex-1 {
  flex: 1;
}

/* Panel positioning */
.score-panel-position {
  position: absolute;
  right: 1rem;
  top: 64px;
  z-index: 30;
  min-width: 400px;
  max-width: calc(100vw - 2rem);
  width: auto;
}

.rules-panel-position {
  position: absolute;
  right: 380px;
  top: 64px;
  z-index: 30;
  width: 480px;
}

.rules-panel-body {
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.rules-list {
  list-style: disc;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Lobby invite link */
.lobby-invite-wrapper {
  margin-top: 8px;
}

.lobby-invite-link {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  cursor: pointer;
}

/* Hover modal - with clickable backdrop on mobile */
.foe-modal-hover {
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none; /* Let hover events pass through on desktop */
  cursor: pointer;
}

.foe-modal-hover .foe-modal-card {
  pointer-events: auto;
  cursor: default;
  animation: modal-pop 0.15s ease-out;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Sur mobile, l'overlay doit être cliquable pour fermer */
@media (max-width: 768px) {
  .foe-modal-hover {
    pointer-events: auto;
  }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive */
/* Responsive - Tablet */
@media (max-width: 1200px) {
  :root {
    --card-w: 68px;
    --card-h: 93px;
  }

  .game-board {
    grid-template-columns: minmax(280px, 360px) 1fr minmax(280px, 360px);
    gap: 0.75rem;
  }

  .player-board-container {
    max-width: 380px;
    padding: 0.85rem 1rem;
  }

  .opponent-card {
    padding: 0.85rem;
    border-radius: 16px;
  }

  .board-grid {
    gap: 5px;
  }

  .mini-board {
    gap: 5px;
  }

  .mini-card {
    font-size: 1rem;
    border-radius: 7px;
  }

  .opponent-avatar {
    width: 40px;
    height: 40px;
  }

  .opponent-name {
    font-size: 0.95rem;
  }

  .opponent-status {
    font-size: 0.75rem;
  }

  .top-bar-avatar {
    width: 38px;
    height: 38px;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  :root {
    --card-w: 66px;
    --card-h: 92px;
    --mini-card-w: 32px;
    --mini-card-h: 46px;
  }

  .game-board {
    display: flex;
    flex-direction: column;
    padding: 0.4rem;
    gap: 0.4rem;
    height: 100%;
    max-height: calc(100vh - 50px);
    overflow-y: auto;
  }

  /* Top bar en premier */
  .top-bar {
    order: 1;
    padding: 0.35rem 0.6rem;
    gap: 0.4rem;
    flex-shrink: 0;
  }

  .top-bar-avatar {
    width: 30px;
    height: 30px;
  }

  /* Cacher les panneaux adversaires sur mobile - ils sont dans AUTRES */
  .side-left,
  .side-right {
    display: none !important;
  }

  /* Centre (piles + mon board) */
  .center-area {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-height: 0;
  }

  /* Cartes adversaires compactes */
  .opponent-card {
    width: auto;
    min-width: auto;
    flex-shrink: 0;
    padding: 0.4rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .opponent-header {
    gap: 0.35rem;
    margin-bottom: 0.35rem;
  }

  .opponent-avatar {
    width: 26px;
    height: 26px;
  }

  .opponent-name {
    font-size: 0.8rem;
  }

  .opponent-status {
    font-size: 0.65rem;
  }

  .mini-board {
    gap: 2px;
  }

  .mini-cell img {
    width: var(--mini-card-w);
    height: var(--mini-card-h);
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  }

  .mini-cell .removed-placeholder {
    width: var(--mini-card-w);
    height: var(--mini-card-h);
    border-radius: 4px;
  }

  .mini-card {
    border-radius: 4px;
    font-size: 0.75rem;
  }

  /* Piles au centre */
  .piles-section {
    padding: 0.5rem;
    gap: 1rem;
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    background: rgba(8, 10, 24, 0.95);
    border-radius: 12px;
    margin: 0.25rem 0;
  }

  .pile-container {
    width: 56px;
  }

  /* Mon board */
  .player-board-container {
    max-width: 100%;
    width: 100%;
    padding: 0.6rem;
  }

  .board-grid {
    gap: 4px;
  }

  .my-board-header {
    margin-bottom: 0.35rem;
  }

  .my-board-avatar {
    width: 24px;
    height: 24px;
  }

  .my-board-name {
    font-size: 0.8rem;
  }

  .game-header {
    padding: 0.35rem 0.5rem;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .game-header-right {
    gap: 0.25rem;
  }

  .header-btn {
    padding: 0.25rem 0.45rem;
    font-size: 0.6rem;
  }

  /* Notifications mobile */
  .game-notification.type-turn {
    max-width: calc(100vw - 2rem);
    padding: 0.6rem 1rem;
  }

  .game-notification.type-turn .game-notification-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .game-notification.type-turn .game-notification-player {
    font-size: 0.9rem;
    white-space: normal;
  }

  .game-notification.type-turn .game-notification-action {
    font-size: 0.8rem;
  }

  /* Règles et Score - modal centrée sur mobile */
  .rules-panel-position,
  .score-panel-position {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: calc(100vw - 2rem);
    max-width: 90vw;
    max-height: 70vh;
    overflow: auto;
    border-radius: 16px;
    z-index: 100;
  }

  /* Emote picker - centré sur l'écran en mobile */
  .emote-picker {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) scale(0.95) !important;
    opacity: 0;
    visibility: hidden;
    z-index: 1000 !important;
  }

  .emote-picker.visible {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1;
    visibility: visible;
  }
}

/* Responsive - Mobile Small (480px) - Focus joueur actif */
@media (max-width: 480px) {
  :root {
    --card-w: 58px;
    --card-h: 80px;
    --mini-card-w: 28px;
    --mini-card-h: 40px;
  }

  .game-board {
    padding: 0.25rem;
    gap: 0.35rem;
  }

  .top-bar {
    padding: 0.3rem 0.5rem;
    gap: 0.4rem;
  }

  .top-bar-avatar {
    width: 28px;
    height: 28px;
  }

  .top-bar-name {
    font-size: 0.8rem;
  }

  .top-bar-points {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }

  /* Adversaires en carousel compact */
  .side-left,
  .side-right {
    gap: 0.35rem;
    padding: 0.25rem;
  }

  .opponent-card {
    width: 150px;
    padding: 0.4rem;
    border-radius: 10px;
  }

  .opponent-header {
    gap: 0.3rem;
    margin-bottom: 0.3rem;
  }

  .opponent-avatar {
    width: 24px;
    height: 24px;
  }

  .opponent-name {
    font-size: 0.75rem;
  }

  .opponent-status {
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
  }

  .mini-board {
    gap: 3px;
  }

  .mini-card {
    border-radius: 4px;
    font-size: 0.7rem;
  }

  /* Zone centrale compacte */
  .piles-section {
    padding: 0.5rem;
    gap: 0.75rem;
  }

  .pile-container {
    width: 52px;
  }

  .pile-label {
    font-size: 0.6rem;
    margin-top: 0.2rem;
  }

  /* Mon board - Focus principal */
  .my-board-section {
    padding: 0.4rem;
  }

  .player-board-container {
    padding: 0.5rem 0.6rem;
    border-radius: 12px;
  }

  .board-grid {
    gap: 3px;
  }

  .my-board-header {
    margin-bottom: 0.3rem;
  }

  .my-board-avatar {
    width: 22px;
    height: 22px;
  }

  .my-board-name {
    font-size: 0.75rem;
  }

  .game-header {
    padding: 0.3rem 0.5rem;
    gap: 0.3rem;
  }

  .header-btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.6rem;
    border-radius: 6px;
  }

  .header-btn svg {
    width: 12px;
    height: 12px;
  }

  /* Cartes plus petites */
  .sky-card {
    border-radius: 6px;
    font-size: 1rem;
  }

  .sky-card-value {
    font-size: inherit;
  }
}

/* Responsive - Très petit mobile (375px - iPhone SE) */
@media (max-width: 375px) {
  :root {
    --card-w: 50px;
    --card-h: 70px;
    --mini-card-w: 24px;
    --mini-card-h: 34px;
  }

  .game-board {
    padding: 0.15rem;
    gap: 0.25rem;
  }

  .top-bar {
    padding: 0.25rem 0.4rem;
  }

  .top-bar-avatar {
    width: 24px;
    height: 24px;
  }

  .opponent-card {
    width: 130px;
    padding: 0.35rem;
  }

  .opponent-avatar {
    width: 20px;
    height: 20px;
  }

  .opponent-name {
    font-size: 0.7rem;
  }

  .mini-card {
    font-size: 0.6rem;
    border-radius: 3px;
  }

  .pile-container {
    width: 46px;
  }

  .player-board-container {
    padding: 0.4rem 0.5rem;
  }

  .board-grid {
    gap: 2px;
  }

  .sky-card {
    border-radius: 5px;
    font-size: 0.9rem;
  }

  .header-btn {
    padding: 0.2rem 0.35rem;
    font-size: 0.55rem;
  }
}

/* ========== CONFETTI ANIMATION ========== */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10000;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall linear forwards;
  transform-origin: center;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotateZ(0deg) rotateX(0deg);
    opacity: 1;
  }
  25% {
    transform: translateY(25vh) rotateZ(180deg) rotateX(180deg) translateX(20px);
  }
  50% {
    transform: translateY(50vh) rotateZ(360deg) rotateX(360deg) translateX(-20px);
  }
  75% {
    transform: translateY(75vh) rotateZ(540deg) rotateX(540deg) translateX(10px);
    opacity: 0.8;
  }
  100% {
    transform: translateY(110vh) rotateZ(720deg) rotateX(720deg) translateX(-10px);
    opacity: 0;
  }
}

/* ========== EMOTE SYSTEM ========== */
.floating-emote {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  pointer-events: none;
  animation: emote-float 2.5s ease-out forwards;
  transform: translateX(-50%);
}

.floating-emote-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  animation: emote-bounce 0.4s ease-out;
}

.floating-emote-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
}

@keyframes emote-float {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  70% {
    opacity: 1;
    transform: translateX(-50%) translateY(-60px) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-100px) scale(0.8);
  }
}

@keyframes emote-bounce {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* Emote picker */
.emote-picker-wrapper {
  position: relative;
}

.emote-picker {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px) scale(0.95);
  margin-top: 8px;
  display: flex;
  gap: 4px;
  padding: 8px;
  background: rgba(15, 15, 25, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 100;
}

.emote-picker.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.emote-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.1s ease;
}

.emote-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.15);
}

.emote-btn:active {
  transform: scale(0.95);
}

/* Emote trigger button */
.emote-trigger-btn {
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emote-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.emote-trigger-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .emote-btn {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }

  .floating-emote-icon {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .emote-picker {
    padding: 0.4rem;
    gap: 0.3rem;
    border-radius: 10px;
  }

  .emote-btn {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    border-radius: 6px;
  }

  .emote-trigger-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .floating-emote-icon {
    font-size: 1.6rem;
  }

  .floating-emote-name {
    font-size: 0.65rem;
  }

  .spectator-badge {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    gap: 0.3rem;
  }
}

@media (max-width: 375px) {
  .emote-btn {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .emote-trigger-btn {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .floating-emote-icon {
    font-size: 1.4rem;
  }
}

/* ========== SPECTATOR MODE ========== */
.spectator-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 10px;
  color: #c084fc;
  font-size: 0.85rem;
  font-weight: 600;
}

.spectator-icon {
  font-size: 1rem;
}

.spectator-count {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: help;
}

.spectator-notice {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 16px;
}

.spectator-notice-icon {
  font-size: 2rem;
  opacity: 0.8;
}

.spectator-notice-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.spectator-notice-text strong {
  color: #c084fc;
  font-size: 1rem;
}

.spectator-notice-text span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

.spectator-view {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== DISABLE SELECTION ========== */
* {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Autoriser la sélection uniquement dans les inputs */
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* Désactiver le drag d'images */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* Réactiver pointer-events sur les images cliquables */
.pile-card img,
.board-cell img,
.mini-cell img,
button img {
  pointer-events: auto;
}

/* ========== MEDIUM-LARGE SCREENS (1200px+) - légère augmentation ========== */
@media (min-width: 1200px) {
  :root {
    --card-w: 80px;
    --card-h: 110px;
  }

  .game-board {
    grid-template-columns: minmax(380px, 480px) 1fr minmax(380px, 480px);
    gap: 1.1rem;
    padding: 0.9rem;
  }

  .player-board-container {
    max-width: 450px;
    padding: 1.1rem 1.3rem;
  }

  .opponent-card {
    padding: 1.1rem;
    border-radius: 20px;
  }

  .opponent-avatar {
    width: 48px;
    height: 48px;
  }

  .opponent-name {
    font-size: 1.05rem;
  }

  .opponent-status {
    font-size: 0.85rem;
  }

  .board-grid {
    gap: 6px;
  }

  .mini-board {
    gap: 4px;
  }

  .piles-section {
    padding: 1.3rem 1.7rem;
    gap: 2rem;
    min-height: 210px;
  }

  .header-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }

  .top-bar-avatar {
    width: 44px;
    height: 44px;
  }

  .my-board-avatar {
    width: 34px;
    height: 34px;
  }

  .my-board-name {
    font-size: 0.95rem;
  }

  .game-notification {
    width: 290px;
    height: 210px;
  }

  .game-notification-avatar {
    width: 72px;
    height: 72px;
  }
}

/* ========== LARGE SCREENS (1440px+) - ~118% scale ========== */
@media (min-width: 1440px) {
  :root {
    --card-w: 90px;
    --card-h: 123px;
  }

  .game-board {
    grid-template-columns: minmax(456px, 590px) 1fr minmax(456px, 590px);
    gap: 1.4rem;
    padding: 1.15rem;
  }

  .player-board-container {
    max-width: 532px;
    padding: 1.4rem 1.65rem;
  }

  .opponent-card {
    padding: 1.4rem;
    border-radius: 22px;
  }

  .opponent-avatar {
    width: 57px;
    height: 57px;
  }

  .opponent-name {
    font-size: 1.18rem;
  }

  .opponent-status {
    font-size: 0.9rem;
  }

  .board-grid {
    gap: 7px;
  }

  .mini-board {
    gap: 5px;
  }

  .piles-section {
    padding: 1.65rem 2.1rem;
    gap: 2.35rem;
    min-height: 245px;
  }

  .pile-card img {
    border-radius: 12px;
  }

  .board-cell img {
    border-radius: 12px;
  }

  .mini-cell img {
    border-radius: 8px;
  }

  .game-header {
    padding: 1rem 1.75rem;
  }

  .header-btn {
    padding: 0.6rem 1.1rem;
    font-size: 0.95rem;
  }

  .turn-badge {
    padding: 0.55rem 1.1rem;
    font-size: 1rem;
  }

  .top-bar-avatar {
    width: 52px;
    height: 52px;
  }

  .my-board-avatar {
    width: 40px;
    height: 40px;
  }

  .my-board-name {
    font-size: 1.1rem;
  }

  /* Game over modal */
  .game-over-modal {
    max-width: 520px;
  }

  .winner-avatar {
    width: 76px;
    height: 76px;
  }

  .ranking-avatar {
    width: 42px;
    height: 42px;
  }

  /* Notifications */
  .game-notification {
    width: 340px;
    height: 250px;
  }

  .game-notification-avatar {
    width: 90px;
    height: 90px;
  }

  .game-notification-player {
    font-size: 1.4rem;
  }
}

/* ========== EXTRA LARGE SCREENS (1920p / 2K) - ~137% scale ========== */
@media (min-width: 1920px) {
  :root {
    --card-w: 100px;
    --card-h: 137px;
  }

  .game-board {
    grid-template-columns: minmax(510px, 633px) 1fr minmax(510px, 633px);
    gap: 1.62rem;
    padding: 1.18rem;
  }

  .player-board-container {
    max-width: 596px;
    padding: 1.37rem 1.62rem;
  }

  .opponent-card {
    padding: 1.62rem;
    border-radius: 22px;
  }

  .opponent-avatar {
    width: 63px;
    height: 63px;
  }

  .opponent-name {
    font-size: 1.2rem;
  }

  .opponent-status {
    font-size: 0.93rem;
  }

  .board-grid {
    gap: 8px;
  }

  .mini-board {
    gap: 6px;
  }

  .piles-section {
    padding: 1.86rem 2.55rem;
    gap: 2.79rem;
    min-height: 279px;
  }

  .pile-card img {
    border-radius: 13px;
  }

  .board-cell img {
    border-radius: 13px;
  }

  .mini-cell img {
    border-radius: 9px;
  }

  .game-header {
    padding: 1.18rem 2.1rem;
  }

  .header-btn {
    padding: 0.65rem 1.3rem;
    font-size: 0.98rem;
  }

  .turn-badge {
    padding: 0.61rem 1.25rem;
    font-size: 1.03rem;
  }

  .top-bar-avatar {
    width: 60px;
    height: 60px;
  }

  .my-board-avatar {
    width: 45px;
    height: 45px;
  }

  .my-board-name {
    font-size: 1.18rem;
  }

  /* Game over modal */
  .game-over-modal {
    max-width: 559px;
  }

  .winner-avatar {
    width: 82px;
    height: 82px;
  }

  .ranking-avatar {
    width: 47px;
    height: 47px;
  }

  /* Notifications */
  .game-notification {
    width: 372px;
    height: 279px;
  }

  .game-notification-avatar {
    width: 101px;
    height: 101px;
  }

  .game-notification-player {
    font-size: 1.49rem;
  }

  /* Score table - AGRANDI */
  .score-table {
    font-size: 1.13rem;
  }

  .score-player-name {
    font-size: 1.03rem;
    min-width: 69px;
    max-width: 98px;
  }

  /* Emotes */
  .emote-btn {
    width: 45px;
    height: 45px;
    font-size: 1.63rem;
  }

  .floating-emote-icon {
    font-size: 2.79rem;
  }
}

/* ========== 2.5K / 4K SCREENS (2560p+) - ~154% scale ========== */
@media (min-width: 2560px) {
  :root {
    --card-w: 123px;
    --card-h: 170px;
  }

  .game-board {
    grid-template-columns: minmax(637px, 796px) 1fr minmax(637px, 796px);
    gap: 2.23rem;
    padding: 1.76rem;
  }

  .player-board-container {
    max-width: 753px;
    padding: 2rem 2.23rem;
  }

  .opponent-card {
    padding: 2.23rem;
    border-radius: 25px;
  }

  .opponent-avatar {
    width: 78px;
    height: 78px;
  }

  .opponent-name {
    font-size: 1.41rem;
  }

  .opponent-status {
    font-size: 1.06rem;
  }

  .board-grid {
    gap: 12px;
  }

  .mini-board {
    gap: 8px;
  }

  .piles-section {
    padding: 2.65rem 3.53rem;
    gap: 4.02rem;
    min-height: 354px;
  }

  .pile-card img {
    border-radius: 16px;
  }

  .board-cell img {
    border-radius: 16px;
  }

  .game-header {
    padding: 1.3rem 2.65rem;
  }

  .header-btn {
    padding: 0.74rem 1.55rem;
    font-size: 1.06rem;
  }

  .turn-badge {
    padding: 0.71rem 1.41rem;
    font-size: 1.11rem;
  }

  .top-bar-avatar {
    width: 71px;
    height: 71px;
  }

  .my-board-avatar {
    width: 53px;
    height: 53px;
  }

  .my-board-name {
    font-size: 1.3rem;
  }

  /* Game over modal */
  .game-over-modal {
    max-width: 637px;
  }

  .game-over-title {
    font-size: 1.76rem;
  }

  .winner-avatar {
    width: 88px;
    height: 88px;
  }

  .winner-name {
    font-size: 1.41rem;
  }

  .ranking-avatar {
    width: 49px;
    height: 49px;
  }

  .ranking-name {
    font-size: 0.98rem;
  }

  /* Notifications */
  .game-notification {
    width: 424px;
    height: 319px;
  }

  .game-notification-avatar {
    width: 116px;
    height: 116px;
  }

  .game-notification-player {
    font-size: 1.68rem;
  }

  /* Score table - AGRANDI */
  .score-table {
    font-size: 1.32rem;
  }

  .score-player-name {
    font-size: 1.18rem;
    min-width: 83px;
    max-width: 118px;
  }
}

/* ========== READY NEXT ROUND MINI MODAL ========== */
.ready-next-modal {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  animation: ready-modal-slide-up 0.3s ease-out;
}

@keyframes ready-modal-slide-up {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.ready-next-content {
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  min-width: 200px;
}

.ready-next-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.25rem;
}

.ready-next-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  justify-content: center;
}

.ready-status-item {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}

.ready-status-item.is-ready {
  color: #4ade80;
}

.ready-next-count {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

.ready-next-btn {
  margin-top: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.ready-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.ready-next-btn:active {
  transform: translateY(0);
}

.ready-next-waiting {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

/* Header waiting button */
.header-btn-waiting {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  cursor: default;
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ready-next-modal {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    transform: none;
  }

  @keyframes ready-modal-slide-up {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .ready-next-content {
    width: 100%;
    padding: 0.85rem 1rem;
  }
}

/* ============================================
   Modal Récap de fin de manche
   ============================================ */
.round-recap-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 950;
  padding: 1rem;
  animation: overlay-fade-in 0.3s ease-out;
}

.round-recap-modal {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, rgba(30, 30, 50, 0.98) 0%, rgba(15, 15, 25, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modal-pop-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.round-recap-header {
  text-align: center;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.round-recap-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.round-recap-subtitle {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}

/* Liste des joueurs */
.round-recap-players {
  padding: 1rem;
}

.recap-player-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all 0.2s;
}

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

.recap-player-row.is-best {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
}

.recap-player-row.is-doubled {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}

.recap-player-rank {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-right: 0.75rem;
}

.recap-player-row.is-best .recap-player-rank {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.recap-player-name {
  flex: 1;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.recap-player-scores {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.recap-score-round {
  text-align: right;
  min-width: 50px;
}

.recap-score-round-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.recap-player-row.is-best .recap-score-round-value {
  color: #4ade80;
}

.recap-player-row.is-doubled .recap-score-round-value {
  color: #f87171;
}

.recap-score-round-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.recap-score-total {
  text-align: right;
  min-width: 50px;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.recap-score-total-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.recap-score-total-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
}

.recap-doubled-badge {
  font-size: 0.6rem;
  padding: 0.15rem 0.35rem;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-radius: 4px;
  margin-left: 0.4rem;
  font-weight: 600;
}

/* Section actions */
.round-recap-actions {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.recap-ready-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  justify-content: center;
}

.recap-ready-item {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s;
}

.recap-ready-item.is-ready {
  color: #4ade80;
}

.recap-ready-count {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.recap-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recap-btn-continue {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.recap-btn-continue:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.recap-btn-ready {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.recap-btn-ready:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

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

.recap-waiting-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  padding: 0.5rem 0;
}

/* Responsive */
@media (max-width: 480px) {
  .round-recap-modal {
    max-width: none;
  }

  .recap-player-scores {
    gap: 0.75rem;
  }

  .recap-score-round,
  .recap-score-total {
    min-width: 45px;
  }
}
