/* ==========================================================================
   Le Maillon Mouillé — Design system partagé (identité Déferlantes)
   Extrait fidèlement de 03_maquettes/Le Maillon Mouillé.dc.html (planche Fondations).
   Source de vérité visuelle : les maquettes. Ne pas improviser.
   ========================================================================== */

:root {
  /* Palette */
  --c-primary:      #1C3FE5;  /* bleu électrique — fond webapp, secondaire CTA */
  --c-secondary:    #FF1F8F;  /* fuchsia — CTA principal */
  --c-yellow:       #FFD400;  /* accent — victoire / cadeau / concours */
  --c-green:        #39E75F;  /* bonne réponse / OK / valider */
  --c-green-deep:   #0A2E16;  /* texte sur vert */
  --c-orange:       #FF8A1E;  /* accent / hover liens */
  --c-danger:       #E63946;  /* mauvaise réponse / tir / erreur */
  --c-ink:          #121212;  /* texte principal / bordures */
  --c-cream:        #F4F1E9;  /* fond clair (back office, mur) — teinte design */
  --c-cream-2:      #ECE7DB;
  --c-muted:        #8B877D;  /* texte secondaire */
  --c-muted-2:      #6B675E;
  --c-disabled-bg:  #DAD5CA;  /* bouton désactivé */
  --c-white:        #FFFFFF;

  /* Typo */
  --f-display: 'Anton', sans-serif;          /* titres XXL bâton */
  --f-stamp:   'Titan One', sans-serif;      /* labels / tampons */
  --f-body:    'Poppins', sans-serif;        /* corps / interface */

  /* Rayons */
  --r-pill: 999px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;

  /* Ombres */
  --sh-card: 0 12px 40px rgba(0,0,0,.06);
  --sh-phone: 0 26px 60px rgba(0,0,0,.22);
  --sh-pop: 0 10px 24px rgba(0,0,0,.15);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--f-body);
  color: var(--c-ink);
  -webkit-font-smoothing: antialiased;
}

/* Correctifs typo repris des maquettes (aération des capitales condensées) */
.f-display { font-family: var(--f-display); letter-spacing: .015em; line-height: 1.06; }
.f-stamp   { font-family: var(--f-stamp);   letter-spacing: .01em; }
a { color: var(--c-yellow); }
a:hover { color: var(--c-orange); }

/* --------------------------------------------------------------------------
   Boutons pilule
   -------------------------------------------------------------------------- */
.btn {
  border: none;
  border-radius: var(--r-pill);
  padding: 18px;
  font-family: var(--f-body);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .04em;
  cursor: pointer;
  color: #fff;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--cta       { background: var(--c-secondary); color: #fff; }
.btn--secondary { background: var(--c-primary);   color: #fff; }
.btn--valid     { background: var(--c-green);     color: var(--c-green-deep); }
.btn--disabled,
.btn:disabled   { background: var(--c-disabled-bg); color: var(--c-muted); cursor: not-allowed; }

/* --------------------------------------------------------------------------
   Champs de saisie
   -------------------------------------------------------------------------- */
.field {
  background: #fff;
  border: 3px solid var(--c-ink);
  border-radius: var(--r-md);
  padding: 16px;
  font-weight: 700;
  font-size: 17px;
  color: var(--c-ink);
  width: 100%;
  font-family: var(--f-body);
  outline: none;
}
.field::placeholder { color: #9a9a9a; font-weight: 600; }
.field:focus, .field.is-active { border-color: var(--c-primary); }
.field.is-error { border-color: var(--c-danger); color: var(--c-ink); }

/* --------------------------------------------------------------------------
   Badges de statut
   -------------------------------------------------------------------------- */
.badge {
  font-weight: 800; font-size: 12px; padding: 6px 14px;
  border-radius: var(--r-pill); display: inline-block;
}
.badge--active { background: var(--c-green);  color: var(--c-green-deep); }
.badge--soon   { background: var(--c-yellow); color: #5A4A00; }
.badge--done   { background: var(--c-disabled-bg); color: var(--c-muted-2); }
.badge--ok     { background: var(--c-green);  color: var(--c-green-deep); }
.badge--ko     { background: var(--c-danger); color: #fff; }

/* --------------------------------------------------------------------------
   Cadre téléphone joueur (390 × 844)
   -------------------------------------------------------------------------- */
.phone {
  width: 390px; height: 844px;
  border-radius: 44px; overflow: hidden; position: relative;
  border: 9px solid var(--c-ink);
  box-shadow: var(--sh-phone);
  background: var(--c-primary);
  display: flex; flex-direction: column;
}
.phone__statusbar {
  height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; color: #fff; font-size: 13px; font-weight: 700;
}
.phone__statusbar .dots { letter-spacing: 3px; font-size: 9px; }
.phone__body { flex: 1; display: flex; flex-direction: column; position: relative; min-height: 0; }
.phone__footer {
  flex-shrink: 0;
  display: flex; justify-content: space-between;
  padding: 16px 26px 20px;
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  color: rgba(255,255,255,.7);
}

/* étoiles décoratives */
.deco-star { position: absolute; pointer-events: none; }

/* --------------------------------------------------------------------------
   Animations (reprises du design)
   -------------------------------------------------------------------------- */
@keyframes lmm-blink   { 0%,100%{opacity:1} 50%{opacity:.25} }
@keyframes lmm-pulse   { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
@keyframes lmm-breathe { 0%,100%{transform:scale(1);opacity:.9} 50%{transform:scale(1.15);opacity:.5} }
@keyframes lmm-dots    { 0%{opacity:.2} 50%{opacity:1} 100%{opacity:.2} }
@keyframes lmm-flash   { 0%{opacity:.85} 100%{opacity:0} }
@keyframes lmm-spin    { to { transform: rotate(360deg); } }
.anim-blink   { animation: lmm-blink 1s step-end infinite; }
.anim-breathe { animation: lmm-breathe 1.8s ease-in-out infinite; }
.anim-dot     { animation: lmm-dots 1.2s infinite; }

/* ==========================================================================
   Back office (section C des maquettes) — fond crème, interface dense
   ========================================================================== */
.admin-body { background: var(--c-cream); min-height: 100vh; color: var(--c-ink); }
.admin-topnav {
  height: 66px; background: #fff; border-bottom: 3px solid var(--c-ink);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px;
  position: sticky; top: 0; z-index: 10;
}
.admin-brand { font-family: var(--f-stamp); font-size: 16px; color: var(--c-primary); white-space: nowrap; }
.admin-brand span { color: var(--c-secondary); }
.admin-nav { display: flex; gap: 18px; font-weight: 700; font-size: 13px; color: #666; flex-wrap: wrap; }
.admin-nav a { color: #666; text-decoration: none; padding-bottom: 4px; }
.admin-nav a:hover { color: var(--c-primary); }
.admin-nav a.is-current { color: var(--c-primary); border-bottom: 3px solid var(--c-primary); }
.admin-logout { border: none; border-radius: var(--r-pill); padding: 10px 20px; background: var(--c-cream); color: #555; font-weight: 700; font-size: 13px; cursor: pointer; }
.admin-main { padding: 32px; max-width: 1440px; margin: 0 auto; }
.admin-title { font-family: var(--f-display); font-size: 40px; color: var(--c-ink); margin: 0; letter-spacing: .015em; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }

.btn-sm { border: none; border-radius: var(--r-pill); padding: 14px 24px; font-weight: 800; font-size: 14px; cursor: pointer; color: #fff; }
.btn-launch { background: var(--c-green); color: var(--c-green-deep); }
.btn-stop   { background: var(--c-danger); color: #fff; }
.btn-ghost  { background: var(--c-disabled-bg); color: var(--c-muted); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 2px solid var(--c-cream-2); border-radius: var(--r-md); padding: 20px; }
.stat-card .label { font-size: 13px; font-weight: 700; color: var(--c-muted); }
.stat-card .value { font-family: var(--f-display); font-size: 48px; line-height: 1.1; }
.stat-card.span2 { grid-column: span 2; }

.panel { background: #fff; border: 2px solid var(--c-cream-2); border-radius: var(--r-md); padding: 20px; }
.panel .panel-title { font-size: 13px; font-weight: 800; color: #333; margin-bottom: 14px; }
.charts-row { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; }
.bars > div { flex: 1; background: var(--c-primary); border-radius: 6px 6px 0 0; }
.bars > div.hi { background: var(--c-secondary); }
.donut { width: 150px; height: 150px; border-radius: 999px; }
.legend { display: flex; gap: 12px; margin-top: 14px; font-size: 11px; font-weight: 700; color: #666; flex-wrap: wrap; justify-content: center; }

.empty-state { border: 4px dashed #cfc8b8; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 60px 20px; text-align: center; }
.empty-state .big { font-family: var(--f-display); font-size: 42px; color: #a59d89; }

.offline-banner { background: var(--c-danger); color: #fff; font-weight: 800; font-size: 14px; padding: 14px 32px; display: flex; align-items: center; gap: 12px; }

/* tables back office */
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r-md); overflow: hidden; border: 2px solid var(--c-cream-2); }
.admin-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); padding: 14px 16px; border-bottom: 2px solid var(--c-cream-2); }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--c-cream-2); font-weight: 600; font-size: 14px; }
.admin-table tr:last-child td { border-bottom: none; }

/* login */
.login-bg { min-height: 100vh; background: linear-gradient(165deg, #1C3FE5, #122a9e); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.login-card { width: 440px; max-width: 92vw; background: #fff; border-radius: var(--r-lg); padding: 44px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.login-card .kicker { font-family: var(--f-stamp); font-size: 16px; color: var(--c-primary); margin-bottom: 6px; }
.login-card h1 { font-family: var(--f-display); font-size: 44px; color: var(--c-ink); margin: 0 0 24px; }
.login-card label { font-weight: 700; font-size: 13px; color: #555; }
.login-input { width: 100%; background: var(--c-cream); border: 2px solid #d8d2c4; border-radius: 12px; padding: 14px; font-weight: 600; font-size: 15px; margin: 6px 0 18px; font-family: var(--f-body); }
.login-input:focus { outline: none; border-color: var(--c-primary); background: #fff; }
.login-error { background: #fdeaec; border: 2px solid var(--c-danger); color: #c22532; border-radius: 12px; padding: 12px 14px; font-weight: 800; font-size: 13px; margin-bottom: 20px; }
