/* Dead Current — interface.
   Direction (d'après les références : Darkwood, Lethal Company, Phasmophobia, Little Nightmares, Dead by Daylight) :
   noir profond, grain de film et vignette ; une seule couleur d'accent, l'ambre de la lampe ; rouge réservé au danger ;
   menus en texte, pas de cartes arrondies ; objets « réels » de la maison : tableau électrique, ruban adhésif, rapport tapé à la machine.
   Polices libres servies en local (fonts/fonts.css). */
@import url('/fonts/fonts.css');
:root {
  --black: #060708; --soot: #0d0e11; --steel: #1b1e23; --steel2: #262a31; --line: #2e333b;
  --bone: #e8e0cf; --dim: #8b8579; --faint: #4a4741;
  --amber: #ffb238; --amber-d: #b9741a; --red: #d8382c; --led: #6fe08a; --tape: #d8cba4; --paper: #e6dcc4;
  --f-title: 'Big Shoulders Stencil Display', 'Arial Narrow', Impact, sans-serif;
  --f-ui: 'Big Shoulders Display', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --f-type: 'Special Elite', 'Courier New', monospace;
  --f-hand: 'Permanent Marker', 'Marker Felt', 'Comic Sans MS', cursive;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--black); color: var(--bone); font-family: var(--f-ui); overflow: hidden; }
.hidden { display: none !important; }

/* ---------- grain de film + vignette, posés au-dessus de tout ---------- */
.grain { position: fixed; inset: -50%; pointer-events: none; z-index: 90; opacity: .085; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain .9s steps(6) infinite; }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-6%, 4%); } 40% { transform: translate(5%, -7%); } 60% { transform: translate(-3%, 8%); } 80% { transform: translate(7%, 2%); } 100% { transform: translate(0, 0); } }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 89; background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0,0,0,.55) 80%, rgba(0,0,0,.9) 100%); }

/* ---------- titre ---------- */
.title { font-family: var(--f-title); font-weight: 900; text-transform: uppercase; letter-spacing: .04em; line-height: .82; margin: 0; color: var(--bone);
  text-shadow: 0 0 .35em rgba(255,178,56,.18); }
.title .w { display: block; }
.title .c { color: var(--amber); text-shadow: 0 0 .25em rgba(255,178,56,.55), 0 0 .9em rgba(255,178,56,.25); }
.title .f1 { animation: dying 5.5s steps(1) infinite; }
.title .f2 { animation: dying 7.3s steps(1) infinite 2.1s; }
@keyframes dying { 0%, 83%, 87%, 91%, 100% { opacity: 1; } 85%, 89% { opacity: .12; text-shadow: none; } }
.tag { font-family: var(--f-type); color: var(--dim); font-size: 1.05em; letter-spacing: .02em; margin: .9em 0 0; }

/* ---------- petites capitales d'interface ---------- */
.caps { font-family: var(--f-ui); font-weight: 800; text-transform: uppercase; letter-spacing: .22em; font-size: 13px; color: var(--dim); }
.rule-line { height: 1px; background: linear-gradient(90deg, var(--line), transparent); border: 0; margin: 0; }

/* ---------- menu en texte (pas de boutons-cartes) ---------- */
.menu { display: flex; flex-direction: column; gap: 4px; }
.mi { font: inherit; font-family: var(--f-ui); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 26px; color: var(--bone);
  background: none; border: 0; padding: 6px 0 6px 26px; text-align: left; cursor: pointer; position: relative; transition: color .12s, padding .12s; }
.mi::before { content: ""; position: absolute; left: 0; top: 50%; width: 12px; height: 2px; background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform .12s; }
.mi:hover:not(:disabled), .mi:focus-visible { color: var(--amber); padding-left: 32px; outline: none; }
.mi:hover:not(:disabled)::before, .mi:focus-visible::before { transform: scaleX(1); }
.mi:disabled { color: var(--faint); cursor: default; }
.mi.small { font-size: 15px; letter-spacing: .16em; color: var(--dim); padding-top: 3px; padding-bottom: 3px; }
.mi .val { color: var(--amber); margin-left: .6em; }
.mi .val.off { color: var(--faint); }
.mi.primary { font-size: 34px; color: var(--amber); }
.mi.primary:disabled { color: var(--faint); }

/* ---------- bouton matériel (téléphone) : plastique sombre, lettrage pochoir ---------- */
.hw { font: inherit; font-family: var(--f-ui); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--bone); cursor: pointer;
  background: linear-gradient(#1d2025, #14161a); border: 1px solid #000; border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 -2px 0 rgba(0,0,0,.5), 0 2px 0 #000; padding: 16px 20px; font-size: 20px;
  transition: transform .06s, filter .15s; touch-action: manipulation; }
.hw:active, .hw.pressed { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), inset 0 2px 6px rgba(0,0,0,.6); }
.hw.amber { background: linear-gradient(#ffbf55, #e8961f); color: #1a1105; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 0 rgba(0,0,0,.25), 0 2px 0 #000, 0 0 24px rgba(255,178,56,.25); }
.hw:disabled { filter: grayscale(1) brightness(.6); cursor: default; }

/* ---------- ruban adhésif avec écriture au marqueur ---------- */
.tape { display: inline-block; font-family: var(--f-hand); color: #1b1712; background: var(--tape); padding: 4px 14px 2px; transform: rotate(-1.5deg);
  box-shadow: 0 1px 2px rgba(0,0,0,.5); clip-path: polygon(2% 8%, 98% 0, 100% 46%, 97% 100%, 3% 94%, 0 52%);
  background-image: linear-gradient(90deg, rgba(255,255,255,.12), transparent 30%, rgba(0,0,0,.06) 70%, rgba(255,255,255,.1)); }
.tape.empty { color: #8c8269; opacity: .55; font-family: var(--f-type); font-size: .8em; }

/* ---------- papier tapé à la machine (règles, rôle, rapport) ---------- */
.paper { background: var(--paper); color: #221d16; font-family: var(--f-type); line-height: 1.5; position: relative;
  background-image: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.35), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(120,90,40,.18), transparent 55%);
  box-shadow: 0 18px 40px rgba(0,0,0,.6); }
.paper::before { content: ""; position: absolute; left: 50%; top: -12px; width: 110px; height: 26px; margin-left: -55px; background: rgba(216,203,164,.85); transform: rotate(-2deg);
  clip-path: polygon(3% 10%, 97% 0, 100% 50%, 96% 100%, 2% 90%, 0 45%); }
.stamp { display: inline-block; font-family: var(--f-title); font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--red);
  border: 4px solid var(--red); padding: 2px 14px; transform: rotate(-8deg); opacity: .85; mix-blend-mode: multiply;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence baseFrequency='.8' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.2 1.6'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.stamp.ok { color: #2f6b3a; border-color: #2f6b3a; }

/* ---------- curseur clignotant de machine à écrire ---------- */
.cursor::after { content: "▌"; color: var(--amber); animation: blinkc 1s steps(1) infinite; margin-left: 2px; }
@keyframes blinkc { 50% { opacity: 0; } }

/* ---------- LED ---------- */
.led { width: 10px; height: 10px; border-radius: 50%; background: #2a1a18; box-shadow: inset 0 0 0 1px rgba(0,0,0,.6); display: inline-block; flex: none; }
.led.on { background: var(--led); box-shadow: 0 0 8px var(--led), inset 0 -2px 2px rgba(0,0,0,.3); }
.led.red { background: var(--red); box-shadow: 0 0 10px var(--red); animation: standby 2.4s ease-in-out infinite; }
@keyframes standby { 50% { opacity: .35; box-shadow: 0 0 3px var(--red); } }

.fadeout { animation: fadeout .6s ease forwards; }
@keyframes fadeout { to { opacity: 0; visibility: hidden; } }
.fadein { animation: fadein .8s ease both; }
@keyframes fadein { from { opacity: 0; } }

/* ---------- fond de repli (sans image d'ambiance) : maison en ombre chinoise, brume, faisceau ---------- */
.nightbg { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(90% 70% at 70% 30%, #151a24 0%, #0a0c10 55%, #050607 100%); }
.nightbg .stars { display: none; }
.nightbg .house { position: absolute; right: -6%; bottom: -2px; width: min(1300px, 95vw); color: #030405; }
.nightbg .house .win { fill: #0b0d11; }
.nightbg .house .win.lit { fill: #ffb238; filter: drop-shadow(0 0 12px #ffb238); animation: winflick 6s steps(1) infinite; }
@keyframes winflick { 0%, 58%, 63%, 100% { fill: #ffb238; } 59%, 61% { fill: #0b0d11; } }
.nightbg .beam { position: absolute; right: 18%; bottom: 8%; width: 120vmax; height: 120vmax; margin-right: -60vmax; transform-origin: 50% 100%;
  background: conic-gradient(from -10deg at 50% 100%, rgba(255,214,150,.10) 0deg, rgba(255,214,150,.03) 18deg, transparent 22deg, transparent 360deg);
  animation: sweep 11s ease-in-out infinite alternate; mix-blend-mode: screen; }
@keyframes sweep { from { transform: rotate(-70deg); } to { transform: rotate(10deg); } }
.nightbg::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(transparent, rgba(40,46,58,.25)); }
.dot { display: inline-block; border-radius: 50%; }
