/* ════════════════════════════════════════════════════════════════
   SHELTER bingo — Styles (version PHP)
   Dark neon-party aesthetic
════════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --bg-deep: #050818;
  --bg-dark: #0a0e27;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.12);
  --border-bright: rgba(255,255,255,0.25);

  --gold: #FFA500;
  --gold-light: #FFD166;
  --orange: #FF6B6B;
  --green: #4CAF50;
  --green-bright: #00E676;
  --red: #FF4444;
  --blue-accent: #4ECDC4;

  --text-primary: #F0F4FF;
  --text-secondary: rgba(240,244,255,0.6);
  --text-muted: rgba(240,244,255,0.35);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --glow-gold: 0 0 30px rgba(255,165,0,0.6);
  --glow-green: 0 0 20px rgba(76,175,80,0.6);
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  font-family: 'Nunito', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
}

/* ── Screen Management ─────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ── Shared Button Styles ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border: none; border-radius: var(--radius);
  font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 800;
  cursor: pointer; transition: all 0.2s ease; letter-spacing: 0.5px;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0); transition: background 0.2s;
}
.btn:hover::after { background: rgba(255,255,255,0.1); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-full { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #1a0a00; text-shadow: none;
  box-shadow: 0 4px 20px rgba(255,165,0,0.4);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(255,165,0,0.6); transform: translateY(-1px); }

.btn-secondary {
  background: linear-gradient(135deg, var(--blue-accent), #0984e3);
  color: #fff;
  box-shadow: 0 4px 20px rgba(78,205,196,0.3);
}
.btn-secondary:hover { box-shadow: 0 6px 28px rgba(78,205,196,0.5); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { border-color: var(--border-bright); color: var(--text-primary); }

/* ── Input Styles ──────────────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%; padding: 14px 18px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
  font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 600;
  transition: all 0.2s; outline: none;
  -webkit-appearance: none; appearance: none;
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder { color: var(--text-muted); }
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--gold); background: rgba(255,165,0,0.08);
  box-shadow: 0 0 0 3px rgba(255,165,0,0.2);
}

/* ── Input with icon ───────────────────────────────────────────── */
.input-wrap {
  position: relative; display: flex; align-items: center;
}
.input-wrap input { padding-left: 44px; }
.input-icon {
  position: absolute; left: 14px; font-size: 18px;
  pointer-events: none; z-index: 1;
}
.input-eye {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 18px; padding: 4px; line-height: 1;
  color: var(--text-muted); transition: color 0.2s;
}
.input-eye:hover { color: var(--text-primary); }

/* ── Error Message ─────────────────────────────────────────────── */
.error-msg {
  background: rgba(255,68,68,0.15); border: 1px solid rgba(255,68,68,0.4);
  color: #ff8080; padding: 12px 18px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 14px; text-align: center;
  animation: fadeIn 0.3s ease;
}

/* ── Dots Loader ───────────────────────────────────────────────── */
.dots-loader { display: flex; gap: 6px; justify-content: center; margin-bottom: 8px; }
.dots-loader span {
  width: 8px; height: 8px; background: var(--gold);
  border-radius: 50%; animation: dotBounce 1.4s infinite ease-in-out;
}
.dots-loader span:nth-child(2) { animation-delay: 0.2s; }
.dots-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* ── Volume Button ─────────────────────────────────────────────── */
.btn-volume {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
  cursor: pointer; font-size: 20px; display: flex; align-items: center;
  justify-content: center; transition: all 0.2s;
}
.btn-volume:hover { background: rgba(255,255,255,0.18); transform: scale(1.1); }


/* ════════════════════════════════════════════════════════════════
   AUTH SCREEN
════════════════════════════════════════════════════════════════ */
#screen-auth {
  align-items: center; justify-content: center;
  min-height: 100vh; position: relative;
}

.auth-container {
  width: 100%; max-width: 420px; padding: 32px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}

.auth-header { text-align: center; }

.auth-card {
  width: 100%;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column; gap: 16px;
}

.auth-tabs {
  display: flex; gap: 0;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm); padding: 4px;
  margin-bottom: 4px;
}
.auth-tab {
  flex: 1; padding: 12px 8px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-secondary);
  font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.auth-tab.active {
  background: rgba(255,165,0,0.2); color: var(--gold);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.auth-form { display: none; flex-direction: column; gap: 12px; }
.auth-form.active { display: flex; }

.auth-separator {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
}
.auth-separator::before,
.auth-separator::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}


/* ════════════════════════════════════════════════════════════════
   HOME SCREEN
════════════════════════════════════════════════════════════════ */
#screen-home {
  align-items: center; justify-content: center;
  min-height: 100vh; position: relative;
}

.home-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,165,0,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(78,205,196,0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(10,14,39,1) 0%, rgba(5,8,24,1) 100%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}
@keyframes bgPulse {
  0% { filter: brightness(1); }
  100% { filter: brightness(1.15); }
}

/* User profile bar */
.user-profile-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px);
}
.profile-avatar-sm {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #000; flex-shrink: 0;
  background: var(--gold);
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-weight: 800; font-size: 15px; display: block; }
.profile-stats { font-size: 12px; color: var(--text-secondary); display: block; }
.btn-logout {
  background: rgba(255,68,68,0.15); border: 1px solid rgba(255,68,68,0.3);
  color: #ff8080; padding: 6px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 700; transition: all 0.2s;
  white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,68,68,0.25); }

.home-container {
  width: 100%; max-width: 880px; padding: 40px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}

.home-header { text-align: center; }
.home-logo { font-size: 72px; line-height: 1; animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.home-title {
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(56px, 10vw, 96px);
  line-height: 0.9; letter-spacing: 4px;
  background: linear-gradient(135deg, #fff 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  filter: drop-shadow(0 0 30px rgba(255,165,0,0.5));
}
.title-accent {
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.home-subtitle {
  font-size: 18px; color: var(--text-secondary);
  font-weight: 600; margin-top: 8px; letter-spacing: 2px; text-transform: uppercase;
}

.home-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px; width: 100%;
}

.home-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  backdrop-filter: blur(20px); transition: all 0.3s;
}
.home-card:hover { border-color: var(--border-bright); transform: translateY(-2px); box-shadow: var(--shadow); }

.card-icon { font-size: 40px; margin-bottom: 12px; }
.home-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.home-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }

.form-group { display: flex; flex-direction: column; gap: 12px; }
.form-group .btn { width: 100%; }

.home-rules {
  color: var(--text-muted); font-size: 13px; text-align: center;
  border-top: 1px solid var(--border); padding-top: 20px; width: 100%;
}


/* ════════════════════════════════════════════════════════════════
   LOBBY SCREEN
════════════════════════════════════════════════════════════════ */
#screen-lobby {
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,165,0,0.08) 0%, transparent 50%),
    var(--bg-deep);
  align-items: center; justify-content: center;
}

.lobby-container {
  width: 100%; max-width: 600px; padding: 40px 24px;
  display: flex; flex-direction: column; gap: 28px;
}

.lobby-header { text-align: center; }
.lobby-title {
  font-family: 'Bebas Neue', cursive; font-size: 42px; letter-spacing: 3px;
  color: var(--gold-light);
}

.party-code-box {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.party-code-label { color: var(--text-secondary); font-size: 14px; font-weight: 600; }
.party-code {
  font-family: 'Bebas Neue', cursive; font-size: 36px; letter-spacing: 8px;
  color: var(--gold); text-shadow: 0 0 20px rgba(255,165,0,0.5);
  background: rgba(255,165,0,0.1); padding: 4px 16px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,165,0,0.3);
}

.btn-copy {
  background: rgba(255,255,255,0.1); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px; cursor: pointer;
  font-size: 18px; transition: all 0.2s; color: var(--text-primary);
}
.btn-copy:hover { background: rgba(255,255,255,0.2); }

.lobby-body {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  display: flex; flex-direction: column; gap: 24px;
}

.players-section h3 {
  font-size: 16px; font-weight: 800; color: var(--text-secondary);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px;
}

.players-list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }

.player-item {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.05); border-radius: var(--radius-sm);
  padding: 10px 14px; animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.player-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #000; flex-shrink: 0;
}
.player-item-name { font-weight: 700; font-size: 15px; }
.player-host-badge {
  margin-left: auto; background: rgba(255,165,0,0.2); color: var(--gold);
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 20px;
  border: 1px solid rgba(255,165,0,0.4); text-transform: uppercase;
}
.player-you-badge {
  background: rgba(78,205,196,0.15); color: var(--blue-accent);
  font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 20px;
  border: 1px solid rgba(78,205,196,0.3); text-transform: uppercase;
}

.lobby-actions { text-align: center; }
.waiting-msg { color: var(--text-secondary); font-size: 15px; }
.btn-start { width: 100%; font-size: 20px; padding: 18px; }
.lobby-min-msg { color: var(--text-muted); font-size: 13px; margin-top: 8px; }


/* ════════════════════════════════════════════════════════════════
   GAME SCREEN
════════════════════════════════════════════════════════════════ */
#screen-game {
  display: none; flex-direction: column;
  background: var(--bg-deep);
  min-height: 100vh;
  position: relative;
}
#screen-game.active { display: flex; }

/* Tension Overlay */
.tension-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 10;
  border: 4px solid transparent; transition: all 0.5s;
}
.tension-1 .tension-overlay { border-color: rgba(255,165,0,0.2); }
.tension-2 .tension-overlay {
  border-color: rgba(255,100,0,0.4);
  box-shadow: inset 0 0 40px rgba(255,100,0,0.15);
}
.tension-3 .tension-overlay {
  border-color: rgba(255,68,68,0.7);
  box-shadow: inset 0 0 60px rgba(255,68,68,0.25);
  animation: tensionPulse 0.8s ease-in-out infinite alternate;
}
@keyframes tensionPulse {
  0% { border-color: rgba(255,68,68,0.5); box-shadow: inset 0 0 40px rgba(255,68,68,0.2); }
  100% { border-color: rgba(255,68,68,0.9); box-shadow: inset 0 0 80px rgba(255,68,68,0.4); }
}

/* ── Top Bar ───────────────────────────────────────────────────── */
.game-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; background: rgba(5,8,24,0.92);
  border-bottom: 1px solid var(--border); backdrop-filter: blur(10px);
  flex-shrink: 0; min-height: 52px; z-index: 20;
  position: sticky; top: 0;
}
.topbar-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-logo { font-size: 22px; }
#topbar-party {
  font-family: 'Bebas Neue', cursive; font-size: 20px;
  letter-spacing: 2px; color: var(--gold);
}
.numeros-bande {
  flex: 1; display: flex; gap: 5px; overflow-x: auto;
  scrollbar-width: none; padding: 0 4px;
}
.numeros-bande::-webkit-scrollbar { display: none; }
.numero-badge {
  flex-shrink: 0; min-width: 34px; height: 28px;
  background: linear-gradient(135deg, #1a3a4a, #1d9e75);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  animation: badgeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes badgeIn {
  from { transform: scale(0) translateX(20px); opacity: 0; }
  to   { transform: scale(1) translateX(0);    opacity: 1; }
}
.draw-count {
  font-family: 'Bebas Neue', cursive; font-size: 18px;
  color: var(--text-secondary); flex-shrink: 0;
}

/* ── Bouton tirage hôte ────────────────────────────────────────── */
.host-draw-zone {
  flex-shrink: 0;
}

.btn-draw-action {
  width: 100%; padding: 16px; font-size: 18px; font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #FF6B35, #FF4500);
  color: #fff; border: none; border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(255,80,0,0.45);
  transition: all 0.2s; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.btn-draw-action:hover   { box-shadow: 0 6px 32px rgba(255,80,0,0.65); transform: translateY(-1px); }
.btn-draw-action:active  { transform: scale(0.97); }
.btn-draw-action:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-draw-action.ready   { animation: drawPulse 1.8s ease-in-out infinite; }
@keyframes drawPulse {
  0%,100% { box-shadow: 0 4px 24px rgba(255,80,0,0.4); }
  50%      { box-shadow: 0 4px 40px rgba(255,80,0,0.8); }
}
.btn-draw-desktop { font-size: 15px; padding: 12px; }

/* ── Layout principal (desktop : 2 colonnes) ───────────────────── */
.game-main {
  flex: 1; display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px; padding: 16px;
  align-items: start;
}
.game-panel {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-secondary); flex-shrink: 0;
}
.progress-badge {
  background: rgba(255,165,0,0.15); color: var(--gold);
  padding: 3px 10px; border-radius: 20px; border: 1px solid rgba(255,165,0,0.3);
  font-size: 13px; font-weight: 900;
}

/* ── Grille ────────────────────────────────────────────────────── */
.game-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 5px; flex: 1;
}

.grid-cell {
  aspect-ratio: 1; min-height: 60px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3px; cursor: default; transition: all 0.3s; position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.grid-cell:hover { border-color: var(--border-bright); }

/* Numéro en filigrane — rendu via <span class="cell-num"> pour fiabilité */
.cell-num {
  position: absolute;
  font-family: 'Bebas Neue', cursive;
  font-size: clamp(28px, 5vw, 44px);
  color: rgba(255,255,255,0.28);
  line-height: 1; pointer-events: none; z-index: 0;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  letter-spacing: -1px; user-select: none;
}
.grid-cell.checked .cell-num { color: rgba(76,175,80,0.30); }

.grid-cell .cell-emoji {
  font-size: clamp(18px, 2.8vw, 30px); line-height: 1;
  position: relative; z-index: 1;
}
.grid-cell .cell-text {
  font-size: clamp(8px, 1.1vw, 11px); color: var(--text-muted);
  text-align: center; line-height: 1.2; margin-top: 2px;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  position: relative; z-index: 1;
}

.grid-cell.checked {
  background: linear-gradient(135deg, rgba(76,175,80,0.3), rgba(0,230,118,0.15));
  border-color: var(--green);
  box-shadow: var(--glow-green), inset 0 0 20px rgba(76,175,80,0.1);
}
.grid-cell.checked .cell-text { color: rgba(255,255,255,0.8); }
.grid-cell.just-checked { animation: cellCheck 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cellCheck {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); box-shadow: 0 0 30px rgba(76,175,80,0.8); }
  100% { transform: scale(1); }
}
.cell-check-overlay {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(76,175,80,0.18); z-index: 1;
}
.cell-check-overlay::after { content: '✓'; color: var(--green-bright); font-weight: 900; font-size: 16px; }

/* ── Draw Display ──────────────────────────────────────────────── */
.draw-display {
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  text-align: center; min-height: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.draw-waiting { color: var(--text-muted); }
.draw-waiting p { font-size: 13px; margin-top: 8px; }
.draw-number-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: drawReveal 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes drawReveal {
  0%   { transform: scale(0.3) translateY(-20px); opacity: 0; }
  100% { transform: scale(1)   translateY(0);     opacity: 1; }
}
.draw-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); }
.draw-number {
  font-family: 'Bebas Neue', cursive; font-size: 76px; line-height: 1;
  background: linear-gradient(135deg, #fff 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  filter: drop-shadow(0 0 20px rgba(255,165,0,0.7));
  animation: numberGlow 2s ease-in-out infinite alternate;
}
@keyframes numberGlow {
  0%   { filter: drop-shadow(0 0 10px rgba(255,165,0,0.5)); }
  100% { filter: drop-shadow(0 0 30px rgba(255,165,0,0.9)); }
}
.draw-defi-text {
  font-size: 13px; font-weight: 700; color: var(--green-bright);
  max-width: 200px; text-align: center; line-height: 1.3;
  background: rgba(76,175,80,0.15); padding: 5px 10px;
  border-radius: var(--radius-sm); border: 1px solid rgba(76,175,80,0.3);
}
.draw-defi-emoji { font-size: 26px; }
.draw-hit-badge { font-size: 11px; font-weight: 800; color: var(--green-bright); text-transform: uppercase; letter-spacing: 1px; }

/* ── Players Status ────────────────────────────────────────────── */
.players-status { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
.status-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 4px; flex-shrink: 0; }
.players-status-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex: 1; }
.status-player {
  display: flex; flex-direction: column; gap: 3px;
  background: rgba(255,255,255,0.04); border-radius: var(--radius-sm);
  padding: 9px 11px; border: 1px solid transparent; transition: all 0.3s; flex-shrink: 0;
}
.status-player.tension-player { border-color: rgba(255,68,68,0.4); animation: playerPulse 1s ease-in-out infinite alternate; }
@keyframes playerPulse {
  0%   { background: rgba(255,68,68,0.05); }
  100% { background: rgba(255,68,68,0.15); }
}
.status-player-top { display: flex; align-items: center; gap: 8px; }
.status-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 900; color: #000; flex-shrink: 0; }
.status-name { font-size: 13px; font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-progress-text { font-size: 14px; font-weight: 900; color: var(--gold); flex-shrink: 0; }
.status-bar-wrap { height: 5px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.status-bar { height: 100%; border-radius: 3px; transition: width 0.4s cubic-bezier(0.4,0,0.2,1); }
.status-state { font-size: 10px; color: var(--text-muted); font-weight: 700; text-align: right; text-transform: uppercase; letter-spacing: 0.5px; }
.status-state.alert { color: var(--orange); animation: blink 0.5s ease-in-out infinite alternate; }
@keyframes blink { 0% { opacity: 1; } 100% { opacity: 0.3; } }


/* ════════════════════════════════════════════════════════════════
   MOBILE GAME SCREEN  (≤ 768 px)
   Grille 10 cases = 5 colonnes × 2 rangées
════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Topbar collant en haut */
  .game-topbar { position: sticky; top: 0; z-index: 20; }

  /* Empilement vertical : grille en haut, infos en bas */
  .game-main {
    grid-template-columns: 1fr;
    padding: 10px; gap: 10px;
  }

  /* Grille : 5 colonnes, 2 rangées — toujours visible d'un coup */
  .game-grid { gap: 6px; }

  /* Cellules : square, taille déterminée par les colonnes 1fr */
  .grid-cell { aspect-ratio: 1; }

  .grid-cell .cell-emoji { font-size: clamp(20px, 6vw, 32px); }
  .grid-cell .cell-text  { font-size: clamp(8px, 2.2vw, 11px); }
  .cell-num              { font-size: clamp(28px, 7vw, 44px); }

  /* Panneau droit : draw + classement côte à côte */
  .right-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: start;
  }

  .host-draw-zone { grid-column: 1 / -1; }
  .players-status { grid-column: 2; }
  .draw-display   { grid-column: 1; min-height: 100px; padding: 12px; }

  .draw-number { font-size: 68px; }

  .btn-draw-action { font-size: 16px; padding: 14px; }
}


/* ════════════════════════════════════════════════════════════════
   RESULTS SCREEN
════════════════════════════════════════════════════════════════ */
#screen-results {
  background: radial-gradient(ellipse at center, rgba(255,165,0,0.1) 0%, var(--bg-deep) 70%);
  align-items: center; justify-content: center;
}

.results-container {
  width: 100%; max-width: 560px; padding: 40px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 32px;
}

.winner-banner { text-align: center; }
.winner-crown { font-size: 64px; animation: crownBounce 1s ease-in-out infinite alternate; }
@keyframes crownBounce {
  0% { transform: translateY(0) rotate(-5deg); }
  100% { transform: translateY(-8px) rotate(5deg); }
}
.winner-name {
  font-family: 'Bebas Neue', cursive; font-size: 72px;
  background: linear-gradient(135deg, var(--gold-light), var(--orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  filter: drop-shadow(0 0 30px rgba(255,165,0,0.5));
  letter-spacing: 4px; line-height: 1;
}
.winner-subtitle { font-size: 28px; font-weight: 900; color: var(--gold); margin-top: 4px; }
.winner-reward {
  font-size: 16px; font-weight: 700; color: var(--orange);
  background: rgba(255,100,0,0.1); border: 1px solid rgba(255,100,0,0.3);
  padding: 8px 20px; border-radius: var(--radius); margin-top: 12px; display: inline-block;
}

.results-ranking { width: 100%; }
.ranking-title { font-size: 20px; font-weight: 900; text-align: center; margin-bottom: 16px; }
.ranking-list { display: flex; flex-direction: column; gap: 8px; }

.ranking-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  animation: rankIn 0.4s ease backwards;
}
.ranking-item:nth-child(1) { border-color: rgba(255,215,0,0.4); background: rgba(255,215,0,0.06); animation-delay: 0.1s; }
.ranking-item:nth-child(2) { animation-delay: 0.2s; }
.ranking-item:nth-child(3) { animation-delay: 0.3s; }
.ranking-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes rankIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.rank-medal { font-size: 28px; flex-shrink: 0; }
.rank-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: #000;
}
.rank-name { flex: 1; font-size: 16px; font-weight: 800; }
.rank-score { font-size: 20px; font-weight: 900; color: var(--gold); }
.rank-reward { font-size: 12px; color: var(--orange); font-weight: 700; }

.stats-update {
  display: flex; align-items: center; gap: 8px;
  background: rgba(76,175,80,0.15); border: 1px solid rgba(76,175,80,0.3);
  color: var(--green-bright); padding: 10px 16px; border-radius: var(--radius);
  font-weight: 700; font-size: 14px;
}

.btn-play-again { font-size: 18px; padding: 16px 40px; }


/* ════════════════════════════════════════════════════════════════
   BINGO OVERLAY
════════════════════════════════════════════════════════════════ */
.bingo-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.bingo-content { text-align: center; animation: bingoAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes bingoAppear {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.bingo-emoji { font-size: 80px; animation: emojiSpin 0.6s ease; }
@keyframes emojiSpin { from { transform: rotate(-30deg) scale(0.5); } to { transform: rotate(0) scale(1); } }
.bingo-text {
  font-family: 'Bebas Neue', cursive; font-size: clamp(80px, 15vw, 140px);
  letter-spacing: 8px; line-height: 1;
  background: linear-gradient(135deg, var(--gold-light), var(--orange));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  filter: drop-shadow(0 0 40px rgba(255,165,0,0.8));
}
.bingo-winner { font-size: 32px; font-weight: 900; color: #fff; margin-top: 8px; }


/* ════════════════════════════════════════════════════════════════
   ANIMATIONS UTILS
════════════════════════════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.shake { animation: shake 0.4s ease; }


/* ════════════════════════════════════════════════════════════════
   RESPONSIVE — Autres écrans (hors game screen géré plus haut)
════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .home-title { font-size: 44px; }
  .home-logo  { font-size: 44px; }
  .auth-container { width: 95%; padding: 16px 12px; }
  .auth-card  { padding: 20px 16px; }
  .home-container { padding: 24px 16px; gap: 20px; }
  .home-cards { grid-template-columns: 1fr; gap: 16px; }
  .home-card  { padding: 24px 20px; }
  .lobby-container { padding: 24px 16px; }
  .results-container { padding: 20px 12px; }
  .winner-name { font-size: 52px; }
  .party-code { font-size: 26px; letter-spacing: 5px; }
}

@media (max-width: 400px) {
  .home-title  { font-size: 36px; }
  .home-logo   { font-size: 36px; }
  .winner-name { font-size: 42px; }
  .party-code  { font-size: 22px; letter-spacing: 3px; }
}
