/* =========================================================================
   base.css — variables, remise à zéro, briques communes aux deux pages
   ========================================================================= */

:root {
  --bg:        #0c0a15;
  --bg-soft:   #141127;
  --panel:     rgba(255, 255, 255, .045);
  --panel-2:   rgba(255, 255, 255, .075);
  --line:      rgba(255, 255, 255, .11);
  --text:      #ece9f6;
  --muted:     #9b94b6;
  --gold:      #e9b64d;
  --gold-dim:  #8a6a22;
  --blood:     #cf4a52;
  --wolf:      #8b6bff;
  --moon:      #d6e0ff;
  --green:     #5fc48a;
  --radius:    16px;
  --shadow:    0 10px 34px rgba(0, 0, 0, .45);
  --serif:     "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:      system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
p  { margin: 0 0 .8em; }
a  { color: var(--gold); }

.muted { color: var(--muted); }
.hint  { color: var(--muted); font-size: .85rem; margin: .5rem 0 0; }
.sub   { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; margin-top: 1.2rem; }

/* ---------------- boutons ---------------- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: .62rem 1.05rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, opacity .18s;
}
.btn:hover:not(:disabled) { background: rgba(255,255,255,.13); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, #f0c463, var(--gold));
  border-color: #f7d68a;
  color: #29200a;
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #f6d179, #efc25c); }

.btn-danger { background: linear-gradient(180deg, #e0616a, var(--blood)); border-color: #ec8a90; color: #2a0d0f; }
.btn-ghost  { background: transparent; }
.btn-quiet  { background: transparent; border-color: transparent; color: var(--muted); font-weight: 500; }
.btn-quiet:hover { color: var(--text); }
.btn-big    { width: 100%; padding: .9rem 1.2rem; font-size: 1.05rem; }
.btn-mini   { padding: .2rem .6rem; border-radius: 9px; font-size: 1rem; line-height: 1.2; }

/* ---------------- champs ---------------- */
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .62rem .8rem;
  outline: none;
  width: 100%;
}
input:focus, select:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(233, 182, 77, .15); }
input:disabled, select:disabled, button:disabled { opacity: .55; }
select { cursor: pointer; }
option { background: var(--bg-soft); }

/* ---------------- icônes Font Awesome ----------------
   Les pictogrammes remplacent les emojis dans toute l'interface. Ils héritent
   de la couleur du texte : c'est ce qui permet de les teinter par contexte
   (or pour les titres, rouge pour la mort, vert pour le camp du village…). */
i.fa-solid, i.fa-regular, i.fa-brands { line-height: 1; }
.rolecard-emoji i { font-size: 2.2rem; color: var(--gold); }
.rolecard.team-loups   .rolecard-emoji i { color: var(--blood); }
.rolecard.team-village .rolecard-emoji i { color: var(--green); }
.pcard-role i { color: inherit; }
.announce-emoji i, .waiting-emoji i { font-size: 2.6rem; color: var(--gold); }
.stage-title i { color: var(--gold); }
.death-av .skull i, .pcard-av .skull i { color: var(--blood); font-size: .8rem; }
.death-role i { color: inherit; }
.pcard-badges i { font-size: .82rem; }
.log-day + span i, .log-line i { opacity: .9; }
.tag.crown i { color: var(--gold); }

/* ---------------- avatars ----------------
   Les personnages sont des PNG à fond transparent, dessinés en traits noirs :
   sur un thème sombre ils disparaîtraient. On leur pose donc systématiquement
   une pastille claire derrière. */
.avatar {
  display: inline-block;
  vertical-align: middle;
  width: 2rem;
  height: 2rem;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(180deg, #fbf7ec, #ddd6c4);
  object-fit: contain;
  padding: 1px;
}
.avatar-emoji {
  display: inline-grid;
  place-items: center;
  background: var(--panel-2);
  font-size: .95em;
  line-height: 1;
}
.av-xs { width: 1.35rem; height: 1.35rem; border-radius: 6px; margin-right: .22rem; }
.av-sm { width: 1.7rem;  height: 1.7rem;  border-radius: 7px; margin-right: .22rem; }
.av-md { width: 2.5rem;  height: 2.5rem; }
.av-lg { width: 3rem;    height: 3rem;   border-radius: 11px; }
.av-xl { width: 3.6rem;  height: 3.6rem; border-radius: 13px; }

/* ---------------- cartes ---------------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  backdrop-filter: blur(6px);
}

.pill {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 .55rem;
  font-size: .8rem;
  font-family: var(--sans);
  color: var(--muted);
  vertical-align: middle;
}

.chip {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .18rem .65rem;
  font-size: .82rem;
  margin: .18rem .18rem 0 0;
}
.chip-ghost { background: transparent; color: var(--muted); }

/* ---------------- toast ---------------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: #241f3c;
  border: 1px solid var(--line);
  color: var(--text);
  padding: .7rem 1.1rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 999;
  font-size: .92rem;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- bandeau de connexion ---------------- */
#conn-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--blood);
  color: #fff;
  text-align: center;
  padding: .4rem;
  font-size: .88rem;
  transform: translateY(-100%);
  transition: transform .25s;
  z-index: 1000;
}
#conn-banner.show { transform: none; }

/* ---------------- divers ---------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.13); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
