*{ box-sizing:border-box; }
html,body{ height:100%; margin:0; }
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(99,102,241,.20), transparent 60%),
              radial-gradient(1200px 800px at 80% 10%, rgba(236,72,153,.16), transparent 60%),
              #070a13;
  color:#e5e7eb;
}

.top{
  display:flex; align-items:flex-end; justify-content:space-between;
  padding:14px 14px 10px 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.brand .title{ font-size:18px; font-weight:800; letter-spacing:.3px; }
.brand .subtitle{ font-size:13px; opacity:.85; margin-top:2px; }
.topRight{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }

.panel{
  padding:10px 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.field{ min-width:170px; }
.field.grow{ flex:1 1 320px; }
.lab{ font-size:12px; opacity:.85; margin-bottom:6px; }
.input{
  width:100%;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  color:#e5e7eb;
  padding:10px 10px;
  border-radius:12px;
  outline:none;
}
.input:disabled{ opacity:.55; }

.btn{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.16);
  color:#e5e7eb;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}
.btn:disabled{ opacity:.55; cursor:not-allowed; }
.btn.primary{
  background: linear-gradient(135deg, rgba(99,102,241,.9), rgba(236,72,153,.75));
  border-color: rgba(255,255,255,.18);
}

/* Bouton Son OFF clignotant (au chargement et tant que OFF) */
@keyframes blinkSoft {
  0%   { opacity: 1; }
  50%  { opacity: .35; }
  100% { opacity: 1; }
}
.blinkOff{
  animation: blinkSoft 1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(236,72,153,.25) inset;
}

.main{
  padding:14px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 980px){
  .main{ grid-template-columns: 1fr; }
}

.card{
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  padding:14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.cardTitle{ font-size:12px; opacity:.85; margin-bottom:8px; }
.big{ font-size:34px; font-weight:900; letter-spacing:.2px; }
.small{ font-size:13px; opacity:.86; margin-top:8px; }

.status{ font-size:12px; opacity:.88; padding-top:6px; }
.status.right{ margin-left:auto; text-align:right; }
.status.mid{ flex:1 1 auto; text-align:center; }

/* GRILLE affichée en gros */
.gridBar{
  margin:12px 14px 4px;
  padding:14px 14px 12px;
  border-radius:18px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.gridTop{
  font-size:14px;
  opacity:.9;
  font-weight:800;
  letter-spacing:.2px;
}
.gridBig{
  margin-top:8px;
  font-size:34px;
  font-weight:1000;
  letter-spacing:.6px;
  line-height:1.15;
  word-break: break-word;
}
.gridHint{
  margin-top:8px;
  font-size:12px;
  opacity:.75;
}

/* Modal */
.modal{
  position:fixed; inset:0;
  display:flex; align-items:center; justify-content:center;
  background: rgba(0,0,0,.65);
  z-index:50;
}
.modalCard{
  width:min(460px, calc(100% - 24px));
  background: rgba(15,18,34,.92);
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  padding:16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.modalTitle{ font-size:20px; font-weight:900; }
.modalSub{ opacity:.85; margin:4px 0 12px; }
.lbl{ display:block; font-size:12px; opacity:.85; margin:10px 0 6px; }
.err{ color:#fca5a5; font-size:12px; margin-top:10px; min-height:16px; }
.hint{ margin-top:12px; font-size:12px; opacity:.75; line-height:1.35; }

/* Overlays */
.overlay{
  position:fixed;
  left:50%; top:14%;
  transform: translate(-50%, -50%) scale(.96);
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);
  color:#fff;
  padding:18px 20px;
  border-radius:22px;
  font-size:42px;
  font-weight:1000;
  letter-spacing:.2px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
  z-index:40;
  backdrop-filter: blur(10px);
  opacity:0;
}
.smallOverlay{
  top:24%;
  font-size:28px;
  padding:12px 16px;
  border-radius:18px;
}
.endOverlay{
  top:50%;
  font-size:68px;
  padding:22px 26px;
  border-radius:26px;
}
.hidden{ display:none; }

@keyframes popCute{
  0%   { opacity:0; transform: translate(-50%, -50%) scale(.88); }
  35%  { opacity:1; transform: translate(-50%, -50%) scale(1.06); }
  70%  { opacity:1; transform: translate(-50%, -50%) scale(1.00); }
  100% { opacity:0; transform: translate(-50%, -50%) scale(.98); }
}
.pop{ display:block; animation: popCute 1s ease-out; }
.popHalf{ display:block; animation: popCute .5s ease-out; }

/* Overlay fin (2 s) */
@keyframes endPop2s{
  0%   { opacity:0; transform: translate(-50%, -50%) scale(.86); }
  18%  { opacity:1; transform: translate(-50%, -50%) scale(1.07); }
  65%  { opacity:1; transform: translate(-50%, -50%) scale(1.00); }
  100% { opacity:0; transform: translate(-50%, -50%) scale(.98); }
}
.endPop{ display:block; animation: endPop2s 2s ease-out; }
