@font-face { font-family: "Nosifer"; src: url("fonts/Nosifer-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("fonts/SpecialElite-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #050608;
  --panel: rgba(10, 15, 17, .9);
  --line: rgba(57, 255, 106, .22);
  --green: #39ff6a;
  --green-soft: rgba(57, 255, 106, .14);
  --blood: #9e0012;
  --blood-deep: #4a0008;
  --blood-hi: #ff2a55;
  --text: #f2f2ee;
  --muted: #8b9690;
  --type: "Special Elite", "Courier New", monospace;
  --scary: "Nosifer", "Special Elite", fantasy;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(57, 255, 106, .10), transparent 60%),
    radial-gradient(120% 50% at 50% 115%, rgba(158, 0, 18, .38), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* Grain + lignes de balayage, très légers */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--green); }

/* ---------------------------------------------------------------- sang qui coule */
.drips { position: fixed; top: 0; left: 0; width: 100%; height: 70px; z-index: 40; pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.drips path, .drips circle { fill: url(#sang); }
.drop { position: fixed; top: 0; width: 7px; height: 10px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 35%, #ff3b4f, var(--blood) 55%, var(--blood-deep));
  z-index: 39; pointer-events: none; opacity: 0; animation: fall 7s cubic-bezier(.55,0,1,.45) infinite; }
@keyframes fall {
  0%, 62% { transform: translateY(var(--y0, 30px)) scale(.4); opacity: 0; }
  66% { transform: translateY(var(--y0, 30px)) scale(1); opacity: 1; }
  100% { transform: translateY(105vh) scale(1, 1.5); opacity: .9; }
}

/* ---------------------------------------------------------------- en-tête */
.top { position: relative; z-index: 41; display: flex; justify-content: flex-end; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 14px 0; }
.tab { font-family: var(--type); font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; color: var(--green); padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(5, 6, 8, .75); }
.tab.on { background: var(--green); color: #031207; box-shadow: 0 0 14px rgba(57, 255, 106, .55); }

.logo { text-align: center; margin: 26px 0 6px; user-select: none; }
.logo .l1, .logo .l2 { display: block; font-family: var(--scary); line-height: 1.05; }
.logo .l1 { font-size: clamp(30px, 10.5vw, 52px); color: var(--green); letter-spacing: .02em;
  text-shadow: 0 0 6px rgba(57,255,106,.9), 0 0 18px rgba(57,255,106,.6), 0 0 42px rgba(57,255,106,.35);
  animation: flicker 6s infinite; }
.logo .l2 { font-size: clamp(30px, 10.5vw, 52px); color: var(--blood-hi); margin-top: 4px;
  text-shadow: 0 0 2px #000, 0 3px 0 var(--blood-deep), 0 0 22px rgba(255, 30, 60, .45); }
.logo small { display: block; margin-top: 10px; font-family: var(--type); color: var(--muted);
  letter-spacing: .3em; text-transform: uppercase; font-size: 12px; }
@keyframes flicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: .35; text-shadow: none; }
}

main { position: relative; z-index: 2; max-width: 540px; margin: 0 auto; padding: 8px 16px 60px; }

/* ---------------------------------------------------------------- blocs */
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 16px; margin: 16px 0; box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 10px 30px rgba(0,0,0,.45),
  inset 0 0 30px rgba(57,255,106,.03); }
.card.bloody { border-color: rgba(255, 42, 85, .35); box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 0 40px rgba(158,0,18,.18); }
h2 { margin: 0 0 12px; font-family: var(--type); font-weight: normal; text-transform: uppercase;
  letter-spacing: .16em; font-size: 15px; color: var(--green); }
h2 .n { color: var(--muted); letter-spacing: .05em; }
p { margin: 8px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 13px; }

.status { display: inline-block; font-family: var(--type); font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid currentColor; }
.status.prep { color: #f6d34a; }
.status.live { color: var(--green); box-shadow: 0 0 12px rgba(57,255,106,.35); }
.status.done { color: var(--muted); }
.status.dead { color: var(--blood-hi); }
.pulse::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; margin-right: 7px; vertical-align: 1px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .2; } }

/* ---------------------------------------------------------------- formulaires */
label { display: block; font-family: var(--type); font-size: 13px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=password], input[inputmode], textarea, select {
  width: 100%; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .55); outline: none; font-size: 17px; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(57,255,106,.18); }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; padding: 8px 10px; font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--green); background: rgba(57, 255, 106, .08); color: var(--green);
  font-family: var(--type); text-transform: uppercase; letter-spacing: .12em; font-size: 15px;
  padding: 13px 18px; border-radius: 10px; text-shadow: 0 0 8px rgba(57,255,106,.5);
  box-shadow: 0 0 14px rgba(57,255,106,.15), inset 0 0 12px rgba(57,255,106,.08); transition: .15s; }
.btn:active { transform: scale(.98); background: rgba(57, 255, 106, .2); }
.btn.full { width: 100%; margin-top: 16px; }
.btn.red { border-color: var(--blood-hi); color: #ffd7de; background: rgba(158, 0, 18, .35);
  text-shadow: 0 0 8px rgba(255,42,85,.5); box-shadow: 0 0 14px rgba(255,42,85,.2); }
.btn.ghost { border-color: var(--line); color: var(--muted); text-shadow: none; box-shadow: none; background: transparent; }
.btn.sm { padding: 7px 10px; font-size: 12px; border-radius: 8px; letter-spacing: .08em; }
.btn:disabled { opacity: .4; pointer-events: none; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 8px; font-size: 14px; }
.error { color: var(--blood-hi); font-size: 14px; min-height: 1em; margin-top: 8px; }

/* ---------------------------------------------------------------- rôles */
.roles { display: grid; gap: 10px; }
.role { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; cursor: pointer;
  padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.45); }
.role .ico { font-size: 30px; width: 44px; text-align: center; filter: drop-shadow(0 0 8px rgba(57,255,106,.35)); }
.role b { display: block; font-family: var(--type); font-weight: normal; text-transform: uppercase;
  letter-spacing: .14em; font-size: 17px; }
.role span.d { color: var(--muted); font-size: 14px; }
.role.murder { border-color: rgba(255, 42, 85, .45); }
.role.murder b { color: var(--blood-hi); }
.role.justicier b { color: #7fd4ff; }
.role.innocent b { color: var(--green); }
.role:active { transform: scale(.98); }

.secret { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none;
  border: 1px dashed var(--line); border-radius: 12px; padding: 22px 12px; text-align: center; cursor: pointer;
  background: repeating-linear-gradient(-45deg, rgba(57,255,106,.04) 0 10px, transparent 10px 20px); }
.secret .hide { font-family: var(--type); color: var(--muted); letter-spacing: .1em; }
.secret .show { display: none; }
.secret.open .hide { display: none; }
.secret.open .show { display: block; }
.secret .show .ico { font-size: 44px; }
.secret .show b { display: block; font-family: var(--scary); font-size: 28px; margin-top: 6px; font-weight: normal; }
.secret .show b.murder { color: var(--blood-hi); }
.secret .show b.justicier { color: #7fd4ff; }
.secret .show b.innocent { color: var(--green); }

/* ---------------------------------------------------------------- bouton « je suis mort » */
.deathzone { text-align: center; padding: 22px 16px; }
.hold { position: relative; width: 190px; height: 190px; border-radius: 50%; margin: 8px auto 10px;
  border: 2px solid var(--blood-hi); background: radial-gradient(circle at 50% 40%, #2a0006, #0a0002 70%);
  color: #ffe2e7; cursor: pointer; overflow: hidden; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: none;
  box-shadow: 0 0 30px rgba(255, 42, 85, .35), inset 0 0 30px rgba(158, 0, 18, .6); }
.hold .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0%;
  background: linear-gradient(180deg, #d4001f, var(--blood) 40%, var(--blood-deep)); }
.hold .fill::before { content: ""; position: absolute; left: -10%; right: -10%; top: -9px; height: 18px;
  background: radial-gradient(12px 9px at 20% 100%, #d4001f 98%, transparent) ,
              radial-gradient(14px 9px at 55% 100%, #d4001f 98%, transparent),
              radial-gradient(10px 8px at 85% 100%, #d4001f 98%, transparent); }
.hold .lbl { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; font-family: var(--scary); font-size: 20px; line-height: 1.25; padding: 20px;
  text-shadow: 0 2px 6px #000; }
.hold .lbl em { font-style: normal; font-family: var(--type); font-size: 12px; letter-spacing: .14em;
  margin-top: 10px; color: #ffb3c0; }
.hold.holding { animation: shake .12s infinite; }
@keyframes shake { 25% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 1px); } }

/* ---------------------------------------------------------------- mort */
.rip { text-align: center; padding: 26px 16px; }
.rip .t { font-family: var(--scary); color: var(--blood-hi); font-size: 44px; line-height: 1; text-shadow: 0 0 20px rgba(255,42,85,.5); }
body.dead { filter: saturate(.55); }
body.dead::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(120, 0, 12, .45)); }

/* ---------------------------------------------------------------- listes */
.people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.people li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people li.dead { color: var(--blood-hi); text-decoration: line-through; text-decoration-color: rgba(255,42,85,.7); opacity: .8; }
.people li.me { color: var(--green); }
.bar { height: 6px; border-radius: 6px; background: rgba(255, 42, 85, .35); overflow: hidden; margin: 2px 0 14px; }
.bar i { display: block; height: 100%; background: var(--green); box-shadow: 0 0 10px var(--green); transition: width .6s; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.feed li:last-child { border-bottom: 0; }
.feed time { font-family: var(--type); color: var(--muted); font-size: 13px; flex: none; width: 44px; padding-top: 1px; }
.feed .death { color: #ffb3c0; }
.feed .message { color: var(--text); }
.feed .message::before { content: "📢 "; }
.feed .death::before { content: "💀 "; }
.feed .start::before { content: "🔪 "; }
.feed .end::before { content: "🩸 "; }
.feed .revive::before { content: "↩️ "; }
.feed .meeting::before { content: "🔔 "; }
.feed .meeting { color: #f6d34a; }
.feed .start, .feed .end { color: var(--green); font-family: var(--type); }

.notice { display: flex; gap: 12px; align-items: flex-start; }
.notice .ico { font-size: 26px; }
.steps { margin: 8px 0 0; padding-left: 20px; color: var(--muted); }
.steps li { margin: 4px 0; }

/* ---------------------------------------------------------------- réunions */
.meet-card { text-align: center; border-color: rgba(246, 211, 74, .35); }
.meet-card h2 { color: #f6d34a; }
.meet-card form { text-align: left; }
.countdown { font-family: var(--type); font-size: 52px; line-height: 1.1; color: #f6d34a;
  text-shadow: 0 0 12px rgba(246, 211, 74, .5); font-variant-numeric: tabular-nums; }
.countdown.soon { color: var(--blood-hi); text-shadow: 0 0 14px rgba(255, 42, 85, .6); animation: pulse 1s infinite; }
.overlay.msg.meet .big { color: #f6d34a; text-shadow: 0 0 12px rgba(246,211,74,.8), 0 0 34px rgba(246,211,74,.4);
  font-size: clamp(34px, 11vw, 60px); animation: ring 1s .1s 3; }
@keyframes ring { 10%, 30% { transform: rotate(-8deg); } 20%, 40% { transform: rotate(8deg); } 50% { transform: none; } }

/* ---------------------------------------------------------------- admin */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { text-align: center; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.4); }
.stat b { display: block; font-family: var(--type); font-size: 26px; font-weight: normal; color: var(--green); }
.stat span { font-size: 12px; color: var(--muted); }
.stat.red b { color: var(--blood-hi); }
.stat.blue b { color: #7fd4ff; }
.stat.grey b { color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.plist li.dead .pname { color: var(--blood-hi); text-decoration: line-through; }
.plist .pname { font-weight: 600; }
.plist .meta { font-size: 12px; color: var(--muted); }
.plist .acts { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.plist .acts select { width: auto; flex: 1 1 130px; }
.plist .role-tag { font-family: var(--type); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.role-tag.murder { color: var(--blood-hi); }
.role-tag.justicier { color: #7fd4ff; }
.role-tag.innocent { color: var(--green); }
.role-tag.none { color: #f6d34a; }
.games { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.games li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.05); display: flex; justify-content: space-between; gap: 8px; }

/* ---------------------------------------------------------------- alertes plein écran */
.overlay { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 30px 20px; background: rgba(0, 0, 0, .92);
  animation: in .25s ease-out; cursor: pointer; }
.overlay svg.splat { position: absolute; width: 150vmax; height: 150vmax; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.1); animation: splat .35s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.overlay .big { position: relative; font-family: var(--scary); font-size: clamp(30px, 10vw, 56px); line-height: 1.1;
  color: #fff; text-shadow: 0 4px 0 #000, 0 0 30px #000; animation: thud .5s .15s both; }
.overlay .sub { position: relative; margin-top: 14px; font-family: var(--type); font-size: 18px; letter-spacing: .12em;
  text-transform: uppercase; color: #ffe2e7; text-shadow: 0 2px 4px #000; animation: in .4s .45s both; }
.overlay .tap { position: absolute; bottom: max(24px, env(safe-area-inset-bottom)); font-family: var(--type);
  color: rgba(255,255,255,.6); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.overlay.msg { background: radial-gradient(circle at 50% 40%, #0b2414, #020403 70%); }
.overlay.msg .big { color: var(--green); text-shadow: 0 0 10px rgba(57,255,106,.8), 0 0 30px rgba(57,255,106,.4); font-size: clamp(24px, 7vw, 40px); }
.overlay.msg .text { position: relative; margin-top: 20px; max-width: 520px; font-size: 22px; line-height: 1.4;
  white-space: pre-wrap; overflow-wrap: anywhere; animation: in .4s .3s both; }
@keyframes in { from { opacity: 0; } }
@keyframes splat { to { transform: translate(-50%, -50%) scale(1); } }
@keyframes thud { from { transform: scale(2.2); opacity: 0; } 70% { transform: scale(.95); opacity: 1; } }
.flash { animation: flash .6s; }
@keyframes flash { 0%, 30% { background: #b00018; } }

.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(0,0,0,.8); }
.modal .card { width: 100%; max-width: 420px; }

footer { text-align: center; color: rgba(255,255,255,.25); font-family: var(--type); font-size: 12px;
  letter-spacing: .2em; padding: 10px 0 30px; }

@media (prefers-reduced-motion: reduce) {
  .drop, .logo .l1, .hold.holding { animation: none !important; }
}
