/* --- CSS Custom Properties (Design Tokens) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Supprime le délai 300ms sur tous les éléments interactifs (Android Chrome) */
input, textarea, select, button, a, label {
  touch-action: manipulation;
}

/*
 * VIEW TRANSITIONS — navigation fluide entre pages (iOS Safari 18+, Chrome 126+)
 * Le bottombar reçoit un nom de transition → il "reste en place" pendant la navigation
 * Le contenu principal fait un fondu rapide
 */
@view-transition {
  navigation: auto;
}
/* Contenu principal : fondu simple */
::view-transition-old(root) {
  animation: vt-fade-out 120ms ease forwards;
}
::view-transition-new(root) {
  animation: vt-fade-in 180ms ease forwards;
}
@keyframes vt-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes vt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

:root {
  --color-primary: #c0392b;
  --color-primary-light: #e74c3c;
  --color-secondary: #f39c12;
  --color-success: #229954;
  --color-success-light: #27ae60;
  --color-info: #2980b9;
  --color-warning: #e67e22;
  --color-danger: #c0392b;
  --color-text: #1a1a2e;
  --color-text-light: #555;
  --color-text-muted: #888;
  --color-bg: #f0f2f8;
  --color-bg-card: #fff;
  --color-border: #e8ecf4;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 50px;
  --shadow-sm: 0 2px 8px rgba(44,62,80,0.06);
  --shadow-md: 0 4px 20px rgba(44,62,80,0.09);
  --shadow-lg: 0 8px 40px rgba(44,62,80,0.13);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s ease;
  --bottombar-height: 60px;
  --ticket-bar-height: 52px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==========================================
   HERO DRAW BANNER
   ========================================== */
.hero-draw-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 18px 24px;
  margin: 0;
  gap: 12px;
  border-bottom: 3px solid #e74c3c;
  position: relative;
  overflow: hidden;
}
.hero-draw-banner::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(231,76,60,0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-draw-banner::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 30%;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(243,156,18,0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-draw-label {
  font-size: 0.65em;
  font-weight: 700;
  letter-spacing: 2px;
  color: #f39c12;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hero-draw-name {
  font-size: 1.2em;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.2;
}
.hero-draw-result {
  font-size: 0.82em;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}
.hero-draw-left { flex: 1; min-width: 0; }
.hero-draw-right { flex-shrink: 0; text-align: center; }

/* Countdown blocks */
.hero-countdown {
  display: flex;
  align-items: center;
  gap: 4px;
}
.hero-cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 52px;
}
.hero-cd-val {
  font-size: 1.6em;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.hero-cd-lbl {
  font-size: 0.6em;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.hero-cd-sep {
  font-size: 1.4em;
  font-weight: 900;
  color: rgba(255,255,255,0.4);
  line-height: 1;
  margin-bottom: 12px;
}
.hero-draw-status {
  font-size: 0.7em;
  font-weight: 600;
  color: #f39c12;
  text-align: center;
  margin-top: 6px;
  letter-spacing: 0.5px;
}
.hero-draw-status.open {
  color: #2ecc71;
}
.hero-draw-status.closed {
  color: #e74c3c;
}
@keyframes cd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.hero-cd-val.ticking { animation: cd-pulse 1s infinite; }

@media (max-width: 500px) {
  .hero-draw-banner { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .hero-draw-right { align-self: flex-end; }
  .hero-cd-block { min-width: 44px; padding: 6px 8px; }
  .hero-cd-val { font-size: 1.3em; }
}

/* ==========================================
   QUICK PICK BUTTON
   ========================================== */
.bloc-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.bloc-title-row .bloc-title {
  margin-bottom: 0;
}
.quick-pick-btn {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.85em;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 8px rgba(243,156,18,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.quick-pick-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(243,156,18,0.45);
}
.quick-pick-btn:active {
  transform: scale(0.97);
}

/* ==========================================
   GENERAL POLISH
   ========================================== */

/* ==========================================
   LAYOUT PRINCIPAL
   ========================================== */
.main-section {
  padding: 0;
  max-width: 100%;
  margin: 0;
}
#main-jeux {
  padding: 10px 14px 0 14px;
}

/* Jeu-type-tabs : directement en haut, sans marge excessive */
.jeu-type-tabs {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin: 10px 0 12px 0;
  padding: 0 2px;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: stretch;
  width: 100%;
}
.jeu-type-tabs::-webkit-scrollbar { display: none; }

/* blocs-jeux : moins de marge */
.blocs-jeux {
  margin: 0 0 12px 0;
}


/* === RÉSULTAT PANEL — ligne unique compacte === */
.result-panel {
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  padding: 6px 14px;
  position: sticky;
  top: calc(44px + var(--safe-top));
  z-index: 99;
  border-bottom: 2px solid rgba(108,92,231,0.45);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  flex-wrap: wrap;
}
.result-panel-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 90px;
  flex: 1 0 auto;
}
.result-panel-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.result-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #636e72;
  flex-shrink: 0;
  transition: background 0.4s, box-shadow 0.4s;
}
.result-dot.open   { background: #2ecc71; box-shadow: 0 0 7px rgba(46,204,113,0.8); }
.result-dot.closed { background: #e74c3c; box-shadow: 0 0 7px rgba(231,76,60,0.8); }
.result-lottery-name {
  font-size: 0.75em;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.result-lottery-status {
  font-size: 0.58em;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(46,204,113,0.18);
  color: #2ecc71;
  flex-shrink: 0;
}
.result-lottery-status.closed {
  background: rgba(231,76,60,0.18);
  color: #e74c3c;
}
.result-panel-clock {
  display: flex;
  align-items: center;
  gap: 1px;
}
.rcd {
  font-size: 0.78em;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 2px 4px;
  min-width: 20px;
  text-align: center;
  letter-spacing: -0.5px;
}
.rcd-sep {
  color: rgba(255,255,255,0.4);
  font-size: 0.78em;
  font-weight: 800;
  padding: 0 1px;
}
/* Balles centrées */
.result-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 2;
}
.result-date-label {
  font-size: 0.68em;
  color: rgba(255,255,255,0.85);
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
/* Balles rondes */
.res-ball {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5),
              inset 0 -3px 5px rgba(0,0,0,0.25),
              inset 0 3px 8px rgba(255,255,255,0.22);
  flex-shrink: 0;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  transition: transform 0.2s;
  animation: ball-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.res-ball:hover { transform: scale(1.12); }
.res-ball-1 { background: radial-gradient(circle at 35% 30%, #60a5fa 0%, #1d4ed8 100%); }
.res-ball-2 { background: radial-gradient(circle at 35% 30%, #f87171 0%, #b91c1c 100%); }
.res-ball-3 { background: radial-gradient(circle at 35% 30%, #fbbf24 0%, #b45309 100%); }
@keyframes ball-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}
/* Pills Cash3 / Play4 */
.res-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 11px;
  border-radius: 15px;
  font-size: 0.88em;
  font-weight: 900;
  color: #fff;
  animation: ball-pop 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.res-pill-label {
  font-size: 0.62em;
  font-weight: 700;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.res-pill-c3 { background: linear-gradient(135deg, #059669 0%, #10b981 100%); box-shadow: 0 3px 10px rgba(5,150,105,0.45); }
.res-pill-p4 { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); box-shadow: 0 3px 10px rgba(124,58,237,0.45); }
/* Aucun résultat */
.res-no-result {
  font-size: 0.78em;
  font-style: italic;
  color: rgba(255,255,255,0.35);
}

/* --- FLAT PANELS (formulaire plat, sans carte mobile) --- */
.flat-panels {
  position: relative;
  margin-bottom: 6px;
}
.flat-panel {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(44,62,80,0.07);
  margin-bottom: 4px;
}

.flat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.flat-type-badge {
  font-size: 0.82em;
  font-weight: 800;
  color: #fff;
  background: var(--bc, #8e44ad);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px 5px 8px;
  border-radius: 30px;
}
.flat-inputs {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.flat-inputs input {
  margin-bottom: 0;
}

/* ==========================================
   BARRE TICKET FLOTTANTE (au-dessus du bottombar)
   ========================================== */
.ticket-float-bar {
  position: fixed;
  left: 0;
  bottom: 80px;
  width: 100%;
  height: var(--ticket-bar-height);
  background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  z-index: 98;
  box-shadow: 0 -4px 20px rgba(108,92,231,0.25);
  border-top: 1px solid rgba(255,255,255,0.12);
  transition: bottom 0.12s ease;
}
.ticket-float-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ticket-float-label {
  font-size: 0.6em;
  font-weight: 700;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}
.ticket-float-val {
  font-size: 1.2em;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
}
.creer-ticket-float {
  background: linear-gradient(135deg, #FF9F43 0%, #ee5253 100%);
  color: #fff;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  padding: 10px 22px;
  font-size: 0.9em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(238,82,83,0.35);
  transition: all 0.2s;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-left: auto;
}
.creer-ticket-float:active { transform: scale(0.96); }
.creer-ticket-float:hover {
  background: linear-gradient(135deg, #ffaf40 0%, #ff6b6b 100%);
  box-shadow: 0 6px 20px rgba(238,82,83,0.45);
}

/* navbar aussi sticky, z-index élevé */

* {
  box-sizing: border-box;
}

/* Fixe la hauteur réelle du viewport iOS Safari (empêche le bottombar de bouger entre pages) */
html {
  height: -webkit-fill-available;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  padding: 0;
  /* 60px bottombar + 20px padding barre + 8px marge */
  padding-bottom: 88px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
  min-height: 100vh;
}

/* --- Focus visible pour accessibilité --- */
:focus-visible {
  outline: 3px solid var(--color-info);
  outline-offset: 2px;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--color-info);
  outline-offset: 2px;
}

/* --- Améliorations accessibilité, responsive et visuelles --- */
/* --- Navbar supérieure moderne --- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: calc(12px + var(--safe-top)) 22px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.logo {
  font-size: 1.4em;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search {
  flex: 1;
  margin: 0 18px;
  padding: 9px 14px;
  border-radius: 8px;
  border: none;
  font-size: 1em;
  background: rgba(255,255,255,0.15);
  color: #fff;
  outline: none;
  box-shadow: 0 1px 4px rgba(192,57,43,0.07);
  transition: background 0.2s;
}
.search::placeholder {
  color: #ffe5b4;
  opacity: 1;
}
.icons {
  display: flex;
  gap: 18px;
  align-items: center;
}
.icons span {
  font-size: 1.35em;
  color: #fff700;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s;
}
.icons span:active {
  transform: scale(1.15);
}
.icons .notif-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  font-size: 0.7em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(192,57,43,0.15);
}
@media (max-width: 600px) {
  .navbar {
    flex-direction: row;
    align-items: center;
    padding: calc(8px + var(--safe-top)) 14px 8px;
  }
  .logo {
    font-size: 1.15em;
  }
  .search {
    margin: 0 10px;
    padding: 7px 10px;
    font-size: 0.88em;
    min-width: 0;
  }
  .icons {
    justify-content: flex-end;
    gap: 14px;
    flex-shrink: 0;
  }
}

/* --- Barre de tabs horizontale pour jeux de borlette (sans scroll) --- */
.tabs-jeux {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 9px 10px 8px;
  background: #16213e;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: calc(98px + var(--safe-top)); /* navbar ~44px + result-panel ~54px + notch */
  z-index: 98;
}
.tabs-jeux::-webkit-scrollbar,
.tabs-jeux::-webkit-scrollbar-thumb {
  display: none;
}
.tab-jeu {
  min-width: 90px;
  padding: 7px 12px;
  border-radius: 20px;
  font-size: 0.82em;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  outline: none;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s;
  margin-bottom: 2px;
  user-select: none;
  position: relative;
  z-index: 1;
  letter-spacing: 0.3px;
}
.tab-jeu.active {
  background: linear-gradient(90deg, var(--tab-color1,#e74c3c) 0%, var(--tab-color2,#f39c12) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transform: scale(1.06);
}
.tab-jeu:hover:not(.active) {
  background: rgba(255,255,255,0.14);
  color: #fff;
  border-color: rgba(255,255,255,0.25);
}
@media (max-width: 900px) {
  .tabs-jeux {
    gap: 6px;
    flex-wrap: wrap;
    padding: 7px 6px 6px;
  }
  .tab-jeu {
    min-width: 78px;
    font-size: 0.78em;
    padding: 6px 9px;
  }
}
@keyframes tab-slide-in {
  0% { opacity: 0; transform: translateY(18px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Bottombar navigation PWA --- */
.bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  /* 60px icônes + 20px pour dépasser le home indicator iPhone (sans viewport-fit) */
  box-sizing: content-box;
  height: 60px;
  padding-bottom: 20px;

  background: #ffffff;
  box-shadow: 0 -1px 0 #e5e7eb;

  display: flex;
  justify-content: space-around;
  align-items: center;
}

/* ---- Items ---- */
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #9ca3af;
  font-size: 0.70em;
  font-weight: 600;
  text-decoration: none;
  min-width: 0;
  height: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s;
  cursor: pointer;
}

.nav-item p {
  margin: 0;
  font-size: 1em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
  line-height: 1;
}

/* ---- Icône pill (fond derrière l'icône SVG) ---- */
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 28px;
  border-radius: 14px;
  background: transparent;
  transition: background 0.25s, transform 0.25s, box-shadow 0.25s;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
  transition: stroke 0.18s;
}

/* ---- État actif ---- */
.nav-item.active {
  color: #c0392b;
}
.nav-item.active .nav-icon {
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
  transform: scale(1.05);
  box-shadow: 0 3px 12px rgba(192,57,43,0.30);
}
.nav-item.active svg {
  stroke: #ffffff;
}

/* ---- Hover (desktop) ---- */
.nav-item:not(.active):hover { color: #e74c3c; }

/* ---- Feedback tactile ---- */
.nav-item:not(.active):active .nav-icon { transform: scale(0.88); }
.nav-item.active:active .nav-icon       { transform: scale(0.95); }

/* ---- Responsive (taille icônes seulement, pas la hauteur de la barre) ---- */
@media (max-width: 600px) {
  .nav-item  { font-size: 0.62em; gap: 3px; }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-icon  { width: 40px; height: 26px; border-radius: 13px; }
}
@media (max-width: 380px) {
  .nav-item  { font-size: 0.58em; gap: 2px; }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-icon  { width: 36px; height: 24px; border-radius: 12px; }
}
@media (max-width: 360px) {
  .nav-item p { display: none; }
  .nav-item   { justify-content: center; }
}
/* --- Animation douce au clic --- */
.icons span:active {
  animation: bounce 0.3s;
}
@keyframes bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* --- Blocs de jeux (cards) --- */
.blocs-jeux {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin: 0 0 12px 0;
}
.bloc-jeu {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 20px rgba(44,62,80,0.08);
  padding: 20px 18px 18px 18px;
  min-width: 260px;
  max-width: 340px;
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: box-shadow 0.22s, transform 0.2s;
  position: relative;
  border-top: 4px solid #6C5CE7;
}
.bloc-directo { border-top-color: #8e44ad; }
.bloc-pale     { border-top-color: #e67e22; }
.bloc-cash3    { border-top-color: #27ae60; }
.bloc-play4    { border-top-color: #2980b9; }
.bloc-jeu:hover {
  box-shadow: 0 10px 36px rgba(108,92,231,0.14);
  transform: translateY(-3px);
}
.bloc-title {
  font-size: 1em;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 0;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
textarea, input[type="number"], input[type="text"] {
  width: 100%;
  margin-bottom: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid #e4e8f4;
  font-size: 1.08em;
  background: #f6f7fb;
  color: #1a1a2e;
  outline: none;
  font-family: var(--font-main);
  transition: border 0.18s, box-shadow 0.18s, background 0.18s;
  font-weight: 600;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
textarea:focus, input[type="number"]:focus, input[type="text"]:focus {
  border-color: #6C5CE7;
  box-shadow: 0 0 0 3px rgba(108,92,231,0.18);
  background: #fff;
}
.ajouter-jeu {
  background: #6C5CE7;
  color: #fff;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  padding: 15px 0;
  font-size: 1.05em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(108,92,231,0.35);
  margin-bottom: 0;
  transition: all 0.18s;
  letter-spacing: 0.5px;
  width: 100%;
}
.ajouter-jeu:active {
  transform: scale(0.97);
  filter: brightness(0.92);
}
.ajouter-jeu:hover {
  filter: brightness(1.1);
}

/* Taille de base (mobile ≤600px) */
.jeu-type-tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 4px;
  border: 2px solid #e0e0e0;
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s;
  color: #636e72;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.jeu-type-tab:hover {
  border-color: var(--tc, #8e44ad);
  background: #faf8ff;
  transform: translateY(-1px);
}
.jeu-type-tab.active {
  border-color: var(--tc, #8e44ad);
  background: var(--tc, #8e44ad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}
.jeu-type-icon {
  font-size: 1.4em;
  line-height: 1;
}
.jeu-type-label {
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
/* Petit mobile (≤380px) */
@media (max-width: 380px) {
  .jeu-type-icon { font-size: 1.25em; }
  .jeu-type-label { font-size: 0.65em; }
  .jeu-type-tab { padding: 10px 2px; }
}
/* Tablette portrait (401-600px) */
@media (min-width: 401px) and (max-width: 600px) {
  .jeu-type-tab { padding: 13px 8px; }
  .jeu-type-label { font-size: 0.74em; }
  .jeu-type-icon { font-size: 1.5em; }
}
/* Tablette (601px-1023px) : meme layout que mobile */
@media (min-width: 601px) and (max-width: 1023px) {
  .jeu-type-tab { padding: 14px 12px; }
  .jeu-type-label { font-size: 0.82em; }
  .jeu-type-icon { font-size: 1.6em; }
}


/* ─── Desktop (≥1024px) : tabs cachés, panneaux visibles ─── */
@media (min-width: 1024px) {
  .jeu-type-tabs { display: none !important; }
  #panel-directo, #panel-pale, #panel-cash3, #panel-play4 {
    display: flex !important;
  }
  .flat-panels {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
  }
  .flat-panel {
    background: #fff;
    border-radius: 18px;
    padding: 18px 16px 14px;
    box-shadow: 0 4px 22px rgba(44,62,80,0.10), 0 1px 4px rgba(44,62,80,0.06);
    border-top: 4px solid #6C5CE7;
    transition: box-shadow 0.22s, transform 0.2s;
    position: relative;
  }
  .flat-panel:hover {
    box-shadow: 0 10px 36px rgba(44,62,80,0.15);
    transform: translateY(-2px);
  }
  .flat-directo { border-top-color: #8e44ad; }
  .flat-pale    { border-top-color: #e67e22; }
  .flat-cash3   { border-top-color: #27ae60; }
  .flat-play4   { border-top-color: #2980b9; }
  .flat-inputs  { flex-direction: column; gap: 10px; }
  .result-panel { top: 44px; }
}

/* ─── Desktop moyen (1024–1279px) : 2 colonnes ─── */
@media (min-width: 1024px) and (max-width: 1279px) {
  .flat-panel {
    flex: 1 1 calc(50% - 7px);
    min-width: 200px;
    max-width: calc(50% - 7px);
  }
}

/* ─── Desktop large (≥1280px) : 4 colonnes en 1 rangée ─── */
@media (min-width: 1280px) {
  .flat-panel {
    flex: 1 1 0;
    min-width: 180px;
    max-width: none;
  }
  .flat-panels { flex-wrap: nowrap; gap: 16px; }
}

@media (max-width: 1023px) {
  .blocs-jeux {
    flex-direction: column;
    gap: 18px;
    align-items: center;
  }
  .bloc-jeu {
    max-width: 98vw;
    min-width: 220px;
  }
}

/* --- Ticket Header Bar --- */
.ticket-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 50%, #00cec9 100%);
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(108,92,231,0.25);
  padding: 16px 24px;
  margin-bottom: 24px;
  font-weight: 700;
  font-size: 1.08em;
}
.ticket-header-left, .ticket-header-center, .ticket-header-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ticket-label {
  font-size: 0.95em;
  letter-spacing: 1px;
  color: #dfe6e9; 
  text-transform: uppercase;
  opacity: 0.9;
}
#ticket-plays, #ticket-total {
  font-size: 1.25em;
  font-weight: 700;
  color: #000 !important; 
}
.creer-ticket {
  background: linear-gradient(135deg, #FF9F43 0%, #ee5253 100%);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(238,82,83,0.25);
  transition: background 0.2s, color 0.2s, transform 0.18s;
}
.creer-ticket:active {
  animation: bounce 0.3s;
}
.creer-ticket:hover {
  background: linear-gradient(135deg, #ffaf40 0%, #ff6b6b 100%);
  color: #fff;
  color: #fff;
}
@media (max-width: 700px) {
  .ticket-header-bar {
    flex-direction: column;
    gap: 10px;
    padding: 12px 8px;
    font-size: 1em;
  }
}
#fiche-apercu {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(192,57,43,0.07);
  padding: 18px 16px;
  margin-bottom: 18px;
  border: 1.5px solid #f39c12;
}
.btn-imprimer {
  background: linear-gradient(90deg, #c0392b 0%, #f39c12 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(192,57,43,0.10);
  transition: background 0.2s, transform 0.2s;
}
.btn-imprimer:hover {
  background: linear-gradient(90deg, #f39c12 0%, #c0392b 100%);
  transform: scale(1.05);
}

/* --- Règles du jeu (Rules) --- */
.rules-container {
  background: #fffbe6;
  border: 1.5px solid #f39c12;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(192,57,43,0.07);
  padding: 18px 16px;
  margin: 12px auto 24px auto;
  max-width: 520px;
  font-size: 1em;
  color: #c0392b;
}
.rules-container h3 {
  margin-top: 0;
  color: #c0392b;
  font-size: 1.15em;
}
.rules-container ul {
  margin: 8px 0 0 0;
  padding-left: 18px;
}
.rules-container li {
  margin-bottom: 6px;
}
.resultats-jeux {
  background: #eafaf1;
  border: 1.5px solid #27ae60;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(39,174,96,0.07);
  padding: 18px 16px;
  margin: 12px auto 24px auto;
  max-width: 520px;
  font-size: 1em;
  color: #229954;
}
.resultats-jeux h3 {
  margin-top: 0;
  color: #229954;
  font-size: 1.15em;
}
.ticket-historique {
  background: #f8fff8;
  border: 1px solid #43b36a;
  border-radius: 12px;
  margin: 18px auto;
  max-width: 420px;
  box-shadow: 0 2px 8px #22995422;
  padding: 18px 18px 10px 18px;
  font-size: 1.08em;
}
.ticket-historique ul {
  margin: 10px 0 0 0;
  padding: 0 0 0 18px;
}
.ticket-historique li {
  margin-bottom: 4px;
  font-size: 1em;
}
.ticket-historique b {
  color: #229954;
}
.ticket-historique .barcode-zone {
  margin-top: 12px;
}
  @media print {
  body, html {
    background: #fff !important;
    color: #222 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
  }
  .navbar, .bottombar, #suggestions-fiche, #fiche-modal, .btn-print-fiche, .ticket-print-btn, .btn-fermer-fiche {
    display: none !important;
  }
}

/* Affichage écran : ticket large, pas de max-width ni width forcés */
#fiche-print-preview, .fiche-feuille {
    background: #fff;
    color: #222;
    box-shadow: none;
    border-radius: 0;
    margin: 0 auto;
    padding: 0;
    font-size: 1em;
    font-family: 'Consolas', 'Courier New', monospace;
    border: none;
}
#fiche-print-preview > div, .fiche-feuille > div {
    margin-bottom: 4px !important;
    text-align: center !important;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}
.barcode-zone, #barcode-print-preview {
    display: block !important;
    margin: 8px auto 0 auto !important;
    width: 95% !important;
    height: 48px !important;
}
#fiche-print-preview b, .fiche-feuille b {
    font-weight: bold !important;
    font-size: 1em !important;
    letter-spacing: 1px !important;
}
/* Impression : ticket étroit */
@media print {
  #fiche-print-preview, .fiche-feuille {
    max-width: 58mm !important;
    width: 100% !important;
    margin: 0 auto !important;
    background: #fff !important;
    color: #222 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    font-size: 1em !important;
    font-family: 'Consolas', 'Courier New', monospace !important;
    page-break-inside: avoid !important;
    border: none !important;
  }
  #fiche-print-preview > div, .fiche-feuille > div {
    margin-bottom: 4px !important;
    text-align: center !important;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
  }
  .barcode-zone, #barcode-print-preview {
    display: block !important;
    margin: 8px auto 0 auto !important;
    width: 95% !important;
    height: 48px !important;
  }
  #fiche-print-preview b, .fiche-feuille b {
    font-weight: bold !important;
    font-size: 1em !important;
    letter-spacing: 1px !important;
  }
  .ticket-header-bar, .blocs-jeux, #liste-jeux, #resultats-jeux, .rules-container {
    display: none !important;
  }
@page {
  size: 72mm 180mm;
  margin: 4mm;
}
}

/* ================================================
   TOAST NOTIFICATION SYSTEM
   ================================================ */
#toast-container {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 36px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text);
  box-shadow: var(--shadow-lg);
  font-size: 0.98em;
  font-weight: 500;
  pointer-events: all;
  opacity: 0;
  transform: translateX(40px) scale(0.95);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  border-left: 4px solid var(--color-info);
  cursor: default;
}

.toast-show {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.toast-hiding {
  opacity: 0;
  transform: translateX(40px) scale(0.92);
}

.toast-success { border-left-color: var(--color-success); }
.toast-error { border-left-color: var(--color-danger); background: #fff5f5; }
.toast-warning { border-left-color: var(--color-warning); background: #fffdf0; }
.toast-info { border-left-color: var(--color-info); background: #f0f8ff; }

.toast-icon {
  font-size: 1.3em;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  font-size: 1.4em;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--color-danger);
}

@media (max-width: 480px) {
  #toast-container {
    top: 8px;
    right: 8px;
    left: 8px;
    max-width: 100%;
    width: auto;
  }
  .toast {
    font-size: 0.92em;
    padding: 12px 14px;
  }
}

/* ================================================
   FICHE ITEM STYLES (liste des jeux ajoutés)
   ================================================ */
/* ==========================================
   CHIPS — JEUX AJOUTÉS
   ========================================== */
#liste-jeux {
  list-style: none;
  padding: 0;
  margin: 0 0 6px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Message vide */
.fiche-empty-hint {
  width: 100%;
  text-align: center;
  font-size: 0.8em;
  color: #b0b8cc;
  font-weight: 500;
  padding: 6px 0 2px;
  letter-spacing: 0.3px;
}

/* Chip individuel */
.jeu-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 2px solid var(--chip-color, #6C5CE7);
  border-radius: 50px;
  padding: 5px 10px 5px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  animation: chipIn 0.2s cubic-bezier(.4,0,.2,1) both;
  transition: transform 0.18s, opacity 0.18s;
}
.jeu-chip.chip-out {
  opacity: 0;
  transform: scale(0.85);
}
@keyframes chipIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chip-type {
  font-size: 0.65em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--chip-color, #6C5CE7);
  background: color-mix(in srgb, var(--chip-color, #6C5CE7) 12%, transparent);
  border-radius: 30px;
  padding: 2px 7px;
  white-space: nowrap;
}

.chip-nums {
  font-size: 0.88em;
  font-weight: 800;
  color: #1a1a2e;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.chip-montant {
  font-size: 0.78em;
  font-weight: 700;
  color: #555;
  white-space: nowrap;
}
.chip-montant small {
  font-size: 0.82em;
  color: #999;
  font-weight: 600;
}

.chip-remove {
  background: none;
  border: none;
  color: #c0392b;
  font-size: 0.75em;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s, background 0.15s;
  margin-left: 2px;
}
.chip-remove:hover {
  opacity: 1;
  background: #fde8e8;
}

/* Legacy — gardé pour compatibilité */
.fiche-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--color-bg-card);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  animation: fadeSlideIn 0.3s ease;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.fiche-item:hover {
  border-color: var(--color-primary);
  background: #fef9f9;
}
.fiche-item-text {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.98em;
}
.fiche-item-remove {
  background: none;
  border: none;
  color: var(--color-danger);
  font-size: 1.2em;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.fiche-item-remove:hover {
  background: #fde8e8;
  transform: scale(1.15);
}
.fiche-empty {
  color: var(--color-text-muted);
  text-align: center;
  padding: 20px;
  font-style: italic;
  font-size: 0.95em;
}

.fiche-item-success {
  background: #eafaf1;
  border-color: var(--color-success);
  color: var(--color-success);
  gap: 8px;
  font-weight: 600;
}

.btn-action-inline {
  background: var(--color-info);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.92em;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-action-inline:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ================================================
   LOADING SKELETON
   ================================================ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ================================================
   IMPROVED FORM ELEMENTS
   ================================================ */
textarea, input[type="number"], input[type="text"], input[type="email"], input[type="password"], input[type="search"], select {
  font-family: var(--font-main);
}

textarea::placeholder, input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ================================================
   SCROLL TO TOP BUTTON
   ================================================ */
.scroll-top-btn {
  position: fixed;
  /* bottombar = 60px height + 20px padding = 80px total + 16px marge = 96px */
  bottom: 96px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition-normal), visibility var(--transition-normal), transform var(--transition-normal);
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--color-primary-light);
  transform: scale(1.1);
}

/* Bouton Vider la fiche */
.vider-fiche {
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: var(--radius-md, 8px);
  padding: 8px 12px;
  font-size: 1em;
  cursor: pointer;
  transition: var(--transition-base, all 0.2s ease);
}
.vider-fiche:hover {
  background: #c0392b;
  transform: scale(1.05);
}

/* Modal de confirmation */
.confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.confirm-dialog {
  background: var(--color-surface, #fff);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-lg, 0 8px 32px rgba(0,0,0,0.2));
  padding: 28px 24px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  animation: fadeSlideIn 0.3s ease;
}
.confirm-dialog h3 {
  margin: 0 0 12px 0;
  color: var(--color-text, #1a1a2e);
  font-size: 1.2em;
}
.confirm-dialog p {
  color: #666;
  margin: 0 0 20px 0;
  font-size: 0.95em;
  line-height: 1.4;
}
.confirm-dialog .confirm-summary {
  background: #f8fdf8;
  border-radius: var(--radius-md, 8px);
  padding: 12px;
  margin-bottom: 20px;
  text-align: left;
  font-size: 0.92em;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e8f5e9;
}
.confirm-dialog .confirm-summary .summary-line {
  padding: 3px 0;
  border-bottom: 1px solid #f0f0f0;
}
.confirm-dialog .confirm-summary .summary-total {
  font-weight: 700;
  color: var(--color-primary, #229954);
  border-bottom: none;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 2px solid #e8f5e9;
}
.confirm-buttons {
  display: flex;
  gap: 12px;
}
.confirm-buttons button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md, 8px);
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-base, all 0.2s ease);
}
.btn-confirm-cancel {
  background: #f0f0f0;
  color: #666;
}
.btn-confirm-cancel:hover {
  background: #e0e0e0;
}
.btn-confirm-ok {
  background: linear-gradient(135deg, var(--color-primary, #229954), var(--color-primary-dark, #176d3b));
  color: #fff;
}
.btn-confirm-ok:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34,153,84,0.3);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Empty fiche state */
.fiche-empty {
  text-align: center;
  color: #aaa;
  font-style: italic;
  padding: 18px 12px;
  font-size: 0.95em;
}

/* --- Index Page Specifics --- */
.bottombar .nav-item,
.bottombar a {
  text-decoration: none;
  color: inherit;
}
#heure-actuelle {
  font-size: 1.3em;
  color: var(--color-success, #229954);
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 8px;
  text-align: right;
  background: #fffbe7; 
  border: 2px solid #229954; 
  padding: 8px 18px; 
  border-radius: 8px; 
  display: inline-block; 
}
#loterie-selected {
  font-size: 1.5em;
  font-weight: 700;
  color: #8e44ad;
  background: linear-gradient(135deg, #fffbe7, #fef3c7);
  padding: 12px 24px;
  border-radius: var(--radius-md, 12px);
  min-width: 220px;
  text-align: center;
  box-shadow: var(--shadow-sm, 0 2px 12px #b3c6e7);
  margin-bottom: 12px;
  border: 2px solid #8e44ad;
  position: relative;
  display: block;
}
#resultat-centre {
  font-size: 1.8em;
  color: #1a237e;
  font-weight: 700;
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
  border-radius: var(--radius-md, 12px);
  padding: 18px 12px;
  margin: 20px 12px 20px 12px;
  box-shadow: var(--shadow-sm, 0 2px 8px #b3c6e7);
  text-align: center;
  transition: all 0.3s ease;
}
/* Devenir Agent Button */
.devenir-agent-btn {
  margin-left: 18px;
  color: #229954;
  font-weight: bold;
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid #229954;
  border-radius: 6px;
  transition: all 0.2s;
}
.devenir-agent-btn:hover {
  background-color: #229954;
  color: white;
}


/* Alerts */
.system-alert {
  color: #c0392b;
  font-weight: bold;
  text-align: center;
  background: #fffbe7;
  border: 2px solid #c0392b;
  padding: 10px 0;
  margin-bottom: 10px;
  z-index: 9999;
  position: relative;
}
.error-msg {
  color: #c0392b;
  font-weight: bold;
}


/* --- Lottery Balls Results --- */
.lotterie-resultats-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px; /* Réduit */
  padding: 10px; /* Réduit */
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 15px;
  width: 95%; /* Un peu moins large */
  max-width: 500px; /* Max plus petit */
  margin-left: auto;
  margin-right: auto;
}
.lottery-balls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px; /* Espacement réduit */
  flex-wrap: wrap;
}
.lottery-ball {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 45px; /* Taille réduite */
  height: 45px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.25em; /* Police réduite */
  box-shadow: inset -5px -5px 10px rgba(0,0,0,0.2), 3px 3px 8px rgba(0,0,0,0.15);
  position: relative;
  border: 3px solid rgba(255,255,255,0.3);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}
.lottery-ball::after {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 30%;
  height: 30%;
  background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(255,255,255,0));
  border-radius: 50%;
}
.ball-1 { 
    background: radial-gradient(circle at 30% 30%, #3498db, #2980b9); 
    color: white; 
    border-color: #5dade2;
    transform: scale(1.15); 
    z-index: 1;
}
.ball-2 { 
    background: radial-gradient(circle at 30% 30%, #e74c3c, #c0392b); 
    color: white; 
    border-color: #ec7063; 
    transform: scale(0.9);
}
.ball-3 { 
    background: radial-gradient(circle at 30% 30%, #f1c40f, #f39c12); 
    color: white; 
    border-color: #f7dc6f; 
    transform: scale(0.9);
}

.lottery-extra-row {
  display: flex;
  gap: 15px; /* Réduit */
  justify-content: center;
  margin-top: 3px;
}
.extra-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.extra-label {
    font-size: 0.65em;
    font-weight: 700;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.lottery-pill {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 4px 14px; /* Réduit */
  border-radius: 20px;
  font-weight: 700;
  font-size: 1.0em; /* Réduit */
  color: white;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  min-width: 60px; /* Réduit */
  text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}
.pill-cash3 { background: linear-gradient(135deg, #2ecc71, #27ae60); border-bottom: 3px solid #1e8449; }
.pill-play4 { background: linear-gradient(135deg, #9b59b6, #8e44ad); border-bottom: 3px solid #71368a; }


/* --- Header Clock/Date Alignment --- */
.header-top {
  display: flex;
  justify-content: flex-end; /* Push to right */
  align-items: center;
  padding: 4px 10px;
}
.heure-actuelle {
  font-size: 0.6em; /* Smaller */
  color: #95a5a6; /* Lighter color */
  font-weight: 500;
  text-align: right;
  margin-left: auto; /* Ensure right alignment */
}


/* =========================================
   MODERN UI OVERRIDES (2026 REFRESH) - DASHBOARD COHERENCE THEME
   ========================================= */

/* --- General Font & Background --- */
body {
    background-color: #f0f2f8; /* Matches Dashboard Body */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Bloc R�sum� Ticket (Matches Dashboard Stats Card) --- */
.ticket-header-bar {
    margin: 15px; 
    border-radius: 14px; /* Dashboard radius */
    background: #fff;
    border: none;
    padding: 18px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04); /* Dashboard Shadow */
    position: relative;
    overflow: hidden;
}

/* Add the top gradient bar from dashboard cards */
.ticket-header-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #fd79a8, #e84393); /* Profit Gradient */
}

.ticket-label {
    font-size: 0.75em;
    font-weight: 600;
    color: #636e72; /* Dashboard Label Color */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

#ticket-total {
    color: #2d3436; /* Dashboard Value Color */
    font-weight: 800;
    font-size: 1.4em;
}

/* --- Bouton CR�ER TICKET (Matches Dashboard Welcome Gradient) --- */
.creer-ticket {
    background: linear-gradient(135deg, #6C5CE7 0%, #a29bfe 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.9em;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
    transition: all 0.2s;
}
.creer-ticket:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.4);
}
.creer-ticket:active {
    transform: scale(0.96);
}

/* --- Cartes de Jeux (Matches Dashboard Stat Cards) --- */
.blocs-jeux {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 20px;
    padding: 0 15px 100px 15px;
}

/* ================================================
   MACHINE POS — écran compact (≤ 420px)
   Empêche tout débordement horizontal
   ================================================ */
@media (max-width: 420px) {
  /* Navbar plus compacte */
  .navbar {
    padding: calc(6px + var(--safe-top)) 10px 6px;
  }
  .logo { font-size: 1em; }
  .fl-wordmark .fl-tagline { display: none; }

  /* Result panel : balles plus petites, tout tient sur une ligne */
  .result-panel {
    padding: 4px 8px;
    gap: 6px;
    min-height: 44px;
  }
  .result-lottery-name { font-size: 0.68em; }
  .result-lottery-status { font-size: 0.52em; padding: 1px 5px; }
  .result-date-label { font-size: 0.6em; }
  .rcd { font-size: 0.68em; padding: 1px 3px; min-width: 14px; }
  .rcd-sep { font-size: 0.68em; }

  /* Balles de résultat : 38px → 26px */
  .res-ball {
    width: 26px;
    height: 26px;
    font-size: 0.75em;
    letter-spacing: 0;
  }
  .result-numbers { gap: 4px; }
  .res-pill { height: 24px; padding: 0 7px; font-size: 0.78em; }

  /* Barre loteries : boutons plus petits */
  .tabs-jeux { padding: 5px 6px 4px; gap: 4px; }
  .tab-jeu { min-width: 62px; font-size: 0.72em; padding: 5px 7px; }

  /* Formulaire : inputs moins hauts */
  textarea, input[type="number"], input[type="text"] {
    padding: 10px 11px;
    font-size: 1em;
  }
  .flat-panel { padding: 10px 10px 10px; }
  .flat-panel-header { margin-bottom: 8px; }
  .ajouter-jeu { padding: 12px 0; font-size: 0.97em; }

  /* Onglets de type de jeu */
  .jeu-type-tab { padding: 8px 2px; }
  .jeu-type-icon { font-size: 1.1em; }
  .jeu-type-label { font-size: 0.62em; }
  .jeu-type-tabs { margin: 7px 0 9px; }

  /* Ticket float bar */
  .ticket-float-bar { padding: 0 10px; gap: 8px; }
  .ticket-float-val { font-size: 1.05em; }
  .creer-ticket-float { padding: 8px 14px; font-size: 0.85em; }

  /* Chips ajoutés */
  .jeu-chip { padding: 4px 8px 4px 6px; }
  .chip-nums { font-size: 0.82em; }
  .chip-montant { font-size: 0.72em; }

  /* S'assurer qu'aucun élément ne dépasse */
  body, .main-section, .flat-panels, .flat-panel,
  .tabs-jeux, .result-panel, #main-jeux {
    max-width: 100vw;
    overflow-x: hidden;
  }
}

.bloc-jeu {
    background: #ffffff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.bloc-jeu:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08); /* Dashboard Hover */
}

/* Top Borders matching Dashboard Categories */
.bloc-directo::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background: linear-gradient(90deg, #0984e3, #74b9ff); } /* Fiches Blue */
.bloc-pale::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background: linear-gradient(90deg, #6C5CE7, #a29bfe); } /* Ventes Purple */
.bloc-cash3::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background: linear-gradient(90deg, #00b894, #55efc4); } /* Gains Green */
.bloc-play4::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; background: linear-gradient(90deg, #e17055, #fdcb6e); } /* Winners Orange */

/* Titles */
.bloc-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2d3436; /* Dark Dashboard Text */
}
/* Icon placeholders for titles if needed, roughly matching dashboard icons */
.bloc-directo .bloc-title { color: #0984e3; }
.bloc-pale .bloc-title { color: #6C5CE7; }
.bloc-cash3 .bloc-title { color: #00b894; }
.bloc-play4 .bloc-title { color: #e17055; }

/* --- Inputs (Dashboard Clean Style) --- */
.bloc-jeu textarea, 
.bloc-jeu input[type='number'],
.bloc-jeu input[type='text'] {
    background-color: #f0f2f8; /* Light grey bg like dashboard body */
    border: 2px solid transparent; /* Cleaner look */
    border-radius: 12px;
    padding: 16px;
    font-size: 1.05rem;
    color: #2d3436;
    width: 100%;
    margin-bottom: 16px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.bloc-jeu textarea:focus, 
.bloc-jeu input[type='number']:focus,
.bloc-jeu input[type='text']:focus {
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(100, 100, 100, 0.1);
    outline: none;
}

/* Individual Focus Colors */
.bloc-directo textarea:focus, .bloc-directo input:focus { border-color: #0984e3; box-shadow: 0 0 0 4px rgba(9, 132, 227, 0.15); }
.bloc-pale textarea:focus, .bloc-pale input:focus { border-color: #6C5CE7; box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15); }
.bloc-cash3 textarea:focus, .bloc-cash3 input:focus { border-color: #00b894; box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.15); }
.bloc-play4 textarea:focus, .bloc-play4 input:focus { border-color: #e17055; box-shadow: 0 0 0 4px rgba(225, 112, 85, 0.15); }

.bloc-jeu textarea::placeholder,
.bloc-jeu input::placeholder {
    color: #b2bec3; /* Dashboard Muted Text */
    font-weight: 400;
}

/* --- Bouton Ajouter (Coherent Gradients) --- */
.ajouter-jeu {
    width: 100%;
    color: white;
    font-weight: 700;
    border-radius: 12px;
    padding: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    margin-top: 10px;
    cursor: pointer;
    transition: all 0.2s;
    /* Default fallback */
    background: #636e72; 
}

/* Buttons match their card gradients */
.bloc-directo .ajouter-jeu { background: linear-gradient(135deg, #0984e3, #74b9ff); box-shadow: 0 4px 10px rgba(9, 132, 227, 0.3); }
.bloc-pale .ajouter-jeu { background: linear-gradient(135deg, #6C5CE7, #a29bfe); box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3); }
.bloc-cash3 .ajouter-jeu { background: linear-gradient(135deg, #00b894, #55efc4); box-shadow: 0 4px 10px rgba(0, 184, 148, 0.3); }
.bloc-play4 .ajouter-jeu { background: linear-gradient(135deg, #e17055, #fdcb6e); box-shadow: 0 4px 10px rgba(225, 112, 85, 0.3); }

.ajouter-jeu:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}
.ajouter-jeu:active {
    transform: scale(0.98);
}

