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

html, body {
  min-height: 100%;
  background: #17132e;
  color: #fff;
  font-family: 'Baloo 2', 'Comic Sans MS', 'Segoe UI', Arial, sans-serif;
}

body {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

h1 { font-size: 28px; margin-bottom: 8px; }

.hint {
  opacity: 0.7;
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.4;
}

#status {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

#status.ok { background: rgba(46, 226, 123, 0.25); color: #4dff88; }
#status.down { background: rgba(255, 77, 109, 0.25); color: #ff8a9e; }

.field { margin-bottom: 16px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.75;
  margin-bottom: 6px;
}

input[type="text"] {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

input[type="text"]:focus { outline: none; border-color: #3fd0ff; }

section { margin: 22px 0; }

h2 { font-size: 16px; opacity: 0.85; margin-bottom: 10px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

button {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease, background 0.1s ease;
}

button:hover { transform: translateY(-2px); border-color: #3fd0ff; background: rgba(63, 208, 255, 0.15); }
button:active { transform: translateY(0); }

.gift-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.gift-btn .icon { width: 40px; height: 40px; object-fit: contain; margin-bottom: 4px; }
.gift-btn .name { font-size: 14px; }
.gift-btn .price { font-size: 11px; opacity: 0.6; font-weight: 600; }

/* ---- Onglets ---- */
#tabs { display: flex; gap: 8px; margin-bottom: 18px; }
#tabs .tab { padding: 10px 18px; }
#tabs .tab.actif { background: rgba(63, 208, 255, 0.22); border-color: #3fd0ff; }

label.auto { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; opacity: 0.8; margin: 0; }
button.danger { border-color: rgba(255, 77, 109, 0.5); }
button.danger:hover { background: rgba(255, 77, 109, 0.18); border-color: #ff4d6d; }

/* ---- Etat de la connexion au live ---- */
.etat-live {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.etat-ligne { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }

.pastille {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.pastille.ok { background: #4dff88; box-shadow: 0 0 10px rgba(77, 255, 136, 0.7); }
.pastille.ko { background: #ff4d6d; box-shadow: 0 0 10px rgba(255, 77, 109, 0.7); }
.pastille.attente { background: #ffd23f; animation: pastilleClignote 1s ease-in-out infinite; }

@keyframes pastilleClignote { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.etat-live .row { margin-top: 10px; }
.etat-live input[type="text"] { width: auto; flex: 1; min-width: 160px; }

/* ---- Reglages en direct ---- */
.reglages {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.reglages h2 { margin-bottom: 10px; }

.reglage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.9;
}

.reglage input[type="number"] {
  width: 6em;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.reglage input[type="number"]:focus { outline: none; border-color: #3fd0ff; }

.cfg-etat { font-size: 13px; font-weight: 700; }
.cfg-etat.ok { color: #4dff88; }
.cfg-etat.ko { color: #ff8a9e; }

/* ---- Cartes de chiffres cles ---- */
.cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 18px 0 6px;
}

.carte {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 12px 14px;
}

.carte-valeur { font-size: 22px; font-weight: 800; color: #3fd0ff; }
.carte-titre { font-size: 12px; font-weight: 700; opacity: 0.8; margin-top: 2px; }
.carte-precision { font-size: 11px; opacity: 0.5; margin-top: 2px; }

/* ---- Tableaux ---- */
.tableau { overflow-x: auto; }

.tableau table { width: 100%; border-collapse: collapse; font-size: 13px; }

.tableau th, .tableau td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.tableau th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.6; }
.tableau tbody tr:hover { background: rgba(255, 255, 255, 0.05); }
.tableau td:first-child { opacity: 0.5; }

.vide { font-size: 13px; opacity: 0.5; padding: 10px 0; font-style: italic; }

#log {
  margin-top: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.log-row {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.log-row.skip { opacity: 0.5; font-style: italic; }
