/* ═══════════════════════════════════════════════════════
   Lexique du Jour — Nuit Parisienne
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:        #0d0d1e;
  --bg2:       #12122a;
  --bg3:       #1a1a35;
  --surface:   #1e1e3a;
  --surface2:  #252545;
  --border:    #2e2e58;
  --border2:   #3d3d6a;

  --gold:      #c9a84c;
  --gold-dim:  #8a6f30;
  --gold-glow: rgba(201,168,76,0.15);

  --text:      #e8e8f4;
  --text-dim:  #8888aa;
  --text-faint:#444466;

  --red:       #d94f4f;
  --amber:     #d4843a;
  --green:     #3da86e;
  --gold-win:  #c9a84c;

  --red-bg:    rgba(217,79,79,0.12);
  --amber-bg:  rgba(212,132,58,0.12);
  --green-bg:  rgba(61,168,110,0.12);
  --gold-bg:   rgba(201,168,76,0.15);

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --font-title: 'Playfair Display', Georgia, serif;
  --font-mono:  'DM Mono', 'Courier New', monospace;
  --font-body:  'Outfit', system-ui, sans-serif;

  --nav-h: 72px;
  --header-h: 60px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Noise texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Utilities ── */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.text-gold { color: var(--gold); }
.text-sm { font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════
   SPLASH
   ═══════════════════════════════════════════════════════ */
#splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 1000;
  gap: 20px;
  animation: splashOut 0.5s 1.5s ease-out forwards;
}

.splash-logo {
  width: 80px;
  height: 80px;
  background: var(--gold);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: splashPulse 1s ease-in-out infinite alternate;
}

.splash-l {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--bg);
  line-height: 1;
}

.splash-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: var(--text);
  letter-spacing: 0.02em;
}

@keyframes splashPulse {
  from { box-shadow: 0 0 20px rgba(201,168,76,0.3); }
  to   { box-shadow: 0 0 40px rgba(201,168,76,0.6), 0 0 80px rgba(201,168,76,0.2); }
}

@keyframes splashOut {
  to { opacity: 0; pointer-events: none; }
}

/* ═══════════════════════════════════════════════════════
   AUTH SCREEN
   ═══════════════════════════════════════════════════════ */
#auth-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
}

#auth-screen::after {
  content: '';
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(201,168,76,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-container {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  position: relative;
  z-index: 1;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 12px;
  animation: rotateStar 8s linear infinite;
  display: inline-block;
}

@keyframes rotateStar {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.auth-logo h1 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-tagline {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

.app-version {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-top: 6px;
  letter-spacing: 0.08em;
}

/* Bannière de mise à jour */
.update-banner {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface2);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px var(--gold-dim);
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  animation: slideUp 0.3s ease-out;
}

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

.update-banner button {
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity 0.2s;
}

.update-banner button:hover { opacity: 0.85; }

.auth-tabs {
  display: flex;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--surface2);
  color: var(--gold);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

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

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

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.field input::placeholder { color: var(--text-faint); }

.auth-error {
  font-size: 0.85rem;
  color: var(--red);
  text-align: center;
  min-height: 18px;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════ */
.btn-primary {
  padding: 13px 24px;
  background: var(--gold);
  color: #0d0d1e;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.btn-primary:hover {
  background: #d4b355;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201,168,76,0.3);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-full { width: 100%; }

.btn-secondary {
  padding: 9px 18px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--gold-dim);
}

.btn-danger {
  padding: 7px 14px;
  background: rgba(217,79,79,0.12);
  color: var(--red);
  border: 1px solid rgba(217,79,79,0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover { background: rgba(217,79,79,0.2); }

.btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover { border-color: var(--border2); color: var(--text); }

/* ═══════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════ */
#header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(13,13,30,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 1.1rem;
  color: var(--gold);
  animation: rotateStar 10s linear infinite;
  display: inline-block;
}

.brand-name {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-pseudo {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════════
   BOTTOM NAV
   ═══════════════════════════════════════════════════════ */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(18,18,42,0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-btn.active { color: var(--gold); }
.nav-btn.active::after { opacity: 1; }

.nav-icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s;
}

.nav-btn.active .nav-icon { transform: scale(1.15); }

.nav-label {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════ */
#main-content {
  min-height: calc(100dvh - var(--header-h) - var(--nav-h));
  padding-bottom: calc(var(--nav-h) + 16px);
  position: relative;
  z-index: 1;
}

.page { padding: 20px; max-width: 640px; margin: 0 auto; }

.page-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════
   JEU — Vue principale
   ═══════════════════════════════════════════════════════ */
.jeu-header {
  text-align: center;
  padding: 24px 0 20px;
}

.jeu-date {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 8px;
}

.jeu-titre {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
}

.jeu-indice {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Mot révélé */
.mot-revele {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.lettre-tile {
  width: 44px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bg);
  box-shadow: 0 4px 12px rgba(201,168,76,0.3);
  animation: tileReveal 0.4s ease-out backwards;
}

@keyframes tileReveal {
  from { transform: rotateX(-90deg) scale(0.8); opacity: 0; }
  to   { transform: rotateX(0deg) scale(1); opacity: 1; }
}

/* Zone de saisie */
.zone-saisie {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 50;
}

.zone-saisie input {
  flex: 1;
  padding: 14px 18px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(8px);
}

.zone-saisie input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-glow);
}

.zone-saisie input::placeholder {
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.btn-proposer {
  padding: 14px 20px;
  background: var(--gold);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-proposer:hover { background: #d4b355; box-shadow: 0 4px 16px rgba(201,168,76,0.4); }
.btn-proposer:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* Message jeu */
.jeu-message {
  text-align: center;
  padding: 14px 20px;
  border-radius: var(--radius);
  margin: 12px 0;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.jeu-message.erreur { background: var(--red-bg); color: var(--red); border: 1px solid rgba(217,79,79,0.3); }
.jeu-message.succes { background: var(--gold-bg); color: var(--gold); border: 1px solid rgba(201,168,76,0.3); }

/* Résolu banner */
.banner-victoire {
  text-align: center;
  padding: 24px 20px;
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(201,168,76,0.05));
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-lg);
  margin: 16px 0;
  animation: victoire 0.5s ease-out;
}

@keyframes victoire {
  0%   { transform: scale(0.95); opacity: 0; }
  60%  { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

.banner-victoire .emoji { font-size: 2.5rem; margin-bottom: 10px; display: block; }
.banner-victoire h2 { font-family: var(--font-title); font-size: 1.6rem; color: var(--gold); margin-bottom: 6px; }
.banner-victoire p { color: var(--text-dim); font-size: 0.9rem; }

/* Liste des propositions */
.propositions-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.proposition-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: propAppear 0.35s ease-out backwards;
  position: relative;
  overflow: hidden;
}

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

.prop-numero {
  font-size: 0.7rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.prop-mot {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.1em;
  flex: 1;
}

.prop-score {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  min-width: 48px;
  text-align: center;
}

.score-red    { color: var(--red);   background: var(--red-bg);   }
.score-amber  { color: var(--amber); background: var(--amber-bg); }
.score-green  { color: var(--green); background: var(--green-bg); }
.score-gold   { color: var(--gold);  background: var(--gold-bg);  }

/* Barre de score */
.prop-barre {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  transition: width 0.6s ease-out;
  border-radius: 0 2px 2px 0;
}

.prop-barre.red   { background: var(--red); }
.prop-barre.amber { background: var(--amber); }
.prop-barre.green { background: var(--green); }
.prop-barre.gold  { background: var(--gold); }

/* Section indices progressifs */
.indices-section {
  margin: 4px 0 16px;
  text-align: center;
}

.indice-tiles {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.indice-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 44px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-faint);
}

.indice-tile.revele {
  background: var(--gold-bg);
  border-color: var(--gold);
  color: var(--gold);
  animation: revelerTile 0.5s ease-out;
}

@keyframes revelerTile {
  from { transform: rotateY(90deg) scale(0.8); opacity: 0; }
  to   { transform: rotateY(0) scale(1);       opacity: 1; }
}

.indice-info {
  font-size: 0.72rem;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

.indice-info strong {
  color: var(--text-dim);
}

/* Catégorie du mot */
.jeu-categorie {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 6px;
  letter-spacing: 0.03em;
}

.jeu-categorie strong {
  color: var(--gold);
  font-weight: 600;
  text-transform: capitalize;
}

/* ═══════════════════════════════════════════════════════
   CLASSEMENT
   ═══════════════════════════════════════════════════════ */
.classement-header {
  text-align: center;
  padding: 20px 0 16px;
}

.classement-titre {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
}

.classement-date {
  font-size: 0.8rem;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

.classement-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.classement-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.classement-item:hover { border-color: var(--border2); }

.classement-item.rank-1 { border-color: rgba(201,168,76,0.4); background: rgba(201,168,76,0.05); }
.classement-item.rank-2 { border-color: rgba(192,192,192,0.3); }
.classement-item.rank-3 { border-color: rgba(180,130,70,0.3); }

.rank-medal {
  font-size: 1.2rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.rank-pseudo {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}

.rank-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.rank-essais {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.rank-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 12px;
}

.rank-badge.resolu  { background: var(--green-bg); color: var(--green); }
.rank-badge.en-cours { background: var(--amber-bg); color: var(--amber); }

/* ═══════════════════════════════════════════════════════
   PROFIL
   ═══════════════════════════════════════════════════════ */
.profil-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.profil-card::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(201,168,76,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.profil-avatar {
  width: 72px;
  height: 72px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 700;
  color: var(--bg);
  margin: 0 auto 14px;
}

.profil-nom {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.profil-role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.stat-item {
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 16px 8px;
  text-align: center;
}

.stat-valeur {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
}

/* Historique */
.historique-titre {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 14px;
}

.historique-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.hist-date {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  flex-shrink: 0;
  width: 80px;
}

.hist-mot {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  letter-spacing: 0.08em;
}

.hist-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 12px;
}

.hist-badge.win { background: var(--green-bg); color: var(--green); }
.hist-badge.fail { background: var(--red-bg); color: var(--red); }

/* ═══════════════════════════════════════════════════════
   ADMIN
   ═══════════════════════════════════════════════════════ */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg2);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.admin-tab {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-tab.active {
  background: var(--surface2);
  color: var(--gold);
}

.stats-globales {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.stat-card .valeur {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
}

.admin-section-titre {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Formulaire d'ajout */
.form-ajout {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.form-ajout input, .form-ajout select {
  flex: 1;
  min-width: 120px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  outline: none;
}

.form-ajout input:focus, .form-ajout select:focus {
  border-color: var(--gold);
}

.form-ajout select option { background: var(--bg2); text-transform: none; }

/* Table admin */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(46,46,88,0.5);
  font-size: 0.85rem;
  color: var(--text);
  vertical-align: middle;
}

.admin-table tr:hover td { background: rgba(30,30,58,0.5); }

.admin-table .mot-cell {
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-admin  { background: var(--gold-bg); color: var(--gold); }
.badge-joueur { background: var(--surface2); color: var(--text-dim); }
.badge-actif  { background: var(--green-bg); color: var(--green); }
.badge-inactif { background: var(--red-bg); color: var(--red); }

/* Actions table */
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Loader ── */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-dim);
  gap: 10px;
}

.loader-dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: bounce 1.2s ease-in-out infinite;
}
.loader-dot:nth-child(2) { animation-delay: 0.2s; }
.loader-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; display: block; opacity: 0.4; }
.empty-state p { font-size: 0.9rem; }

/* ── Overflow scroll table ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-container { padding: 28px 20px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-globales { grid-template-columns: repeat(2, 1fr); }
  .zone-saisie input { font-size: 0.95rem; padding: 12px 14px; }
  .jeu-titre { font-size: 1.6rem; }
  .lettre-tile { width: 38px; height: 48px; font-size: 1.2rem; }
  .admin-tab { font-size: 0.72rem; padding: 7px 4px; }
}

/* ═══════════════════════════════════════════════════════
   DESKTOP — PHONE FRAME MOCKUP
   ═══════════════════════════════════════════════════════ */
#desktop-bg { display: none; }

@media (min-width: 768px) {
  /* Fond bureau */
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #06060f;
    overflow: hidden;
  }

  /* Fond animé derrière le téléphone */
  #desktop-bg {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
      radial-gradient(ellipse 60% 50% at 20% 40%, rgba(201,168,76,0.07) 0%, transparent 70%),
      radial-gradient(ellipse 50% 60% at 80% 60%, rgba(61,100,168,0.08) 0%, transparent 70%),
      radial-gradient(ellipse 80% 80% at 50% 50%, #0d0d1e 0%, #06060f 100%);
  }

  /* Cadre téléphone */
  #phone-frame {
    position: relative;
    z-index: 1;
    width: 390px;
    height: 844px;
    border-radius: 52px;
    border: 8px solid #252545;
    box-shadow:
      0 0 0 1px #3a3a6a,
      0 0 0 2px #1a1a32,
      0 50px 100px rgba(0,0,0,0.85),
      0 20px 40px rgba(0,0,0,0.5),
      inset 0 0 0 1px rgba(255,255,255,0.04);
    overflow: hidden;
    /* Crée un nouveau containing block pour position:fixed */
    transform: translateZ(0);
    flex-shrink: 0;
  }

  /* Encoche Dynamic Island */
  #phone-frame::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 30px;
    background: #06060f;
    border-radius: 20px;
    z-index: 9999;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.8);
  }

  /* Boutons latéraux gauche */
  #phone-frame::after {
    content: '';
    position: absolute;
    left: -12px;
    top: 120px;
    width: 4px;
    height: 36px;
    background: #252545;
    border-radius: 2px 0 0 2px;
    box-shadow: 0 52px 0 #252545, 0 104px 0 #252545;
  }

  /* Tous les enfants directs remplissent le cadre */
  #phone-frame > #splash,
  #phone-frame > #app,
  #phone-frame > #auth-screen {
    position: absolute;
    inset: 0;
    border-radius: 44px;
  }

  /* L'app scroll en interne (pas le viewport) */
  #phone-frame > #app {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }
  #phone-frame > #app::-webkit-scrollbar { display: none; }

  /* Hauteur contenu basée sur le cadre (844px) et non le viewport */
  #phone-frame #main-content {
    min-height: calc(844px - var(--header-h) - var(--nav-h));
  }
}
