/* UTF-8 ok tant que tes fichiers sont enregistrés en UTF-8 (sans BOM idéalement). */

:root{
  --bg:#0f1220;
  --panel:#171b2e;
  --panel2:#111428;
  --text:#eef1ff;
  --muted:#aeb6e6;
  --accent:#7cf0c6;
  --danger:#ff6b6b;
  --warn:#ffd166;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 900px at 20% 10%, #1e2450 0%, var(--bg) 45%, #0b0d17 100%);
  color:var(--text);
}

code{ color:var(--accent); }

.home-link{
  display:flex;
  justify-content:center;
  gap:10px;
  padding: 14px 18px 0;
}
.home-btn{
  display:inline-block;
  text-decoration:none;
}

.topbar{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.15);
  backdrop-filter: blur(8px);
}
.topbarRight{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.brand .title{
  font-weight:800;
  letter-spacing:.3px;
  font-size:18px;
}
.brand .subtitle{
  margin-top:4px;
  color:var(--muted);
  font-size:13px;
}

.counters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.pill{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  padding:8px 10px;
  border-radius:999px;
  font-size:13px;
  color:var(--text);
}
.pill span{ color:var(--muted); margin-right:6px; }
.timerPill{
  min-width: 110px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.timerInline{
  margin-top: 10px;
}
.dangerText{
  color:#ff6b6b;
  font-weight:800;
}

.app{
  padding:18px;
  max-width:1100px;
  margin:0 auto;
}

.view.hidden{ display:none; }

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding:16px;
}

.panelHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
h1{
  margin:0;
  font-size:18px;
}
.hint{
  margin:14px 0 0;
  color:var(--muted);
  font-size:13px;
}

.deckTools{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

.inline{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:13px;
}
input[type="number"],
input[type="text"]{
  width:90px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color:var(--text);
}

.rolesList{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap:10px;
}

.roleRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.10);
}

.roleLeft{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width: 0;
}
.roleName{
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:pointer;
  transition: color .12s ease;
}
.roleName.selected{
  color: var(--accent);
}
.roleRule{
  font-size:12px;
  color:var(--muted);
}
.roleRight{
  display:flex;
  align-items:center;
  gap:8px;
}
.counter{
  width:46px;
  text-align:center;
  font-weight:800;
  font-variant-numeric: tabular-nums;
}

.btn{
  cursor:pointer;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  transition: transform .06s ease, background .12s ease;
  user-select:none;
}
.btn:hover{ background: rgba(255,255,255,.10); }
.btn:active{ transform: translateY(1px); }
.btn.primary{
  background: rgba(124,240,198,.18);
  border-color: rgba(124,240,198,.35);
}
.btn.ghost{
  background: transparent;
}
.btn.danger{
  background: rgba(255,107,107,.22);
  border-color: rgba(255,107,107,.55);
  color: #fff5f5;
  font-weight: 800;
}
.btn.small{
  padding:7px 10px;
  border-radius:10px;
  font-size:13px;
}
.btn.win{
  background: rgba(255,255,255,.05);
}
.footerActions{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
}

.centerStage{
  min-height: calc(100vh - 120px);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:16px;
  text-align:center;
}
.hidden{ display:none !important; }

.bigPhase{
  color: var(--muted);
  font-weight:700;
  letter-spacing:.4px;
}

.roleButton{
  width:min(720px, 92vw);
  padding:26px 18px;
  border-radius: 22px;
  border:1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(124,240,198,.22), rgba(255,255,255,.05));
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
  cursor:pointer;
  box-shadow: var(--shadow);
}
.tinyNarration{
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 999px;
  opacity: .9;
}
.narrationText{
  color: var(--text);
  line-height: 1.45;
  white-space: pre-line;
}
.smallHint{ color: var(--muted); }
#flowHint{ display:none; }
.infiltrationMsg{
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255, 209, 102, .12);
  color: var(--warn);
  font-weight: 700;
  font-size: 13px;
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
}
.row.wrap{ flex-wrap:wrap; }
.gap{ gap:12px; }
.miniatureToolbar{
  justify-content:flex-end;
  margin-bottom: 6px;
}

.rolesGrid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
}
.votesGrid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
}
.votesGrid .hint{
  grid-column: 1 / -1;
}
.roleCard{
  background: rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.roleCard .name{ font-weight:800; }
.roleCard .count{ color: var(--muted); font-variant-numeric: tabular-nums; }
.roleCard .actions{ display:flex; gap:8px; }
.voteCard.selected{
  border-color: rgba(255,107,107,.65);
  box-shadow: 0 0 0 2px rgba(255,107,107,.25);
}
.voteCountBtn{
  min-width:56px;
  text-align:center;
  font-weight:800;
  font-variant-numeric: tabular-nums;
}

.dayMessages{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.msg{
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.msg strong{ font-weight:900; }
.msg .left{ display:flex; flex-direction:column; gap:3px; }
.msg .sub{ color: var(--muted); font-size:13px; }

.wins{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:10px;
}

.overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  padding:16px;
  z-index: 50;
}
.overlay.hidden{ display:none; }

.modal{
  width:min(520px, 92vw);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(0,0,0,.25));
  border:1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding:14px;
}
.modalTitle{ font-weight:900; font-size:16px; margin-bottom:8px; }
.modalBody{ color: var(--muted); line-height:1.35; }
.modalActions{
  margin-top:12px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
}
