:root {
  --bg-void: #0c0d0f;
  --bg-panel: #16181b;
  --bg-surface: #1e2126;
  --bg-elevated: #272b31;
  --border-steel: #343942;
  --border-bright: #4f5663;
  --text-main: #e2e5e9;
  --text-dim: #9aa2ad;
  --text-muted: #676f7a;
  --cyan: #8fb8ad;
  --cyan-dim: rgba(143, 184, 173, 0.14);
  --amber: #c79346;
  --amber-dim: rgba(199, 147, 70, 0.16);
  --crimson: #b83b3b;
  --crimson-dim: rgba(184, 59, 59, 0.16);
  --uv: #7a52d4;
  --uv-bright: #c5b2f8;
  --green: #5ba876;
  --green-dim: rgba(91, 168, 118, 0.14);
  --font-ui: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "Fira Code", "Courier New", monospace;
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-ui);
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Natural camera-lens ambient vignette (never muddies text) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 890;
  background: radial-gradient(circle at 50% 45%, transparent 58%, rgba(0, 0, 0, 0.48) 100%);
}

.n7-ico {
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
}

input, textarea {
  user-select: text;
}

/* Tangible matte anodized hardware switches */
button {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--border-steel);
  background: linear-gradient(180deg, #272b31 0%, #1c1f24 100%);
  color: var(--text-main);
  border-radius: 3px;
  padding: 6px 12px;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.45);
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, transform 0.06s ease;
}
button:hover:not(:disabled) {
  border-color: var(--border-bright);
  background: linear-gradient(180deg, #30353d 0%, #23272d 100%);
  color: #ffffff;
}
button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.72);
}
button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(180deg, #2e4c45 0%, #203732 100%);
  border-color: var(--cyan);
  color: #f1f5f4;
  font-weight: 600;
  letter-spacing: 0.25px;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #385c54 0%, #27443d 100%);
  border-color: #a9ccc3;
}

.btn-danger {
  background: linear-gradient(180deg, #5d2323 0%, #411717 100%);
  border-color: var(--crimson);
  color: #f7ecec;
  font-weight: 600;
}
.btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #712b2b 0%, #4f1c1c 100%);
  border-color: #d65c5c;
}

.btn-uv {
  border-color: var(--uv);
  color: var(--uv-bright);
}
.btn-uv.active {
  background: linear-gradient(180deg, #432b7d 0%, #2e1d58 100%);
  border-color: #d7cafb;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 12px rgba(122, 82, 212, 0.35);
}

input[type="text"], input[type="password"], input[type="number"], textarea, select {
  background: #0d0f12;
  border: 1px solid var(--border-steel);
  color: #eef1f4;
  border-radius: 3px;
  padding: 8px 11px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.72);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--cyan);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.72), 0 0 4px rgba(143, 184, 173, 0.24);
}

.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* CRT scanline texture scoped strictly inside hardware displays instead of polluting the full page */
.terminal-box, .osc-screen-box, .cctv-feed {
  position: relative;
}
.terminal-box::after, .osc-screen-box::after, .cctv-feed::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
}

@keyframes pulse-red {
  0%, 100% { box-shadow: inset 0 0 0 rgba(184, 59, 59, 0); }
  50% { box-shadow: inset 0 0 12px rgba(184, 59, 59, 0.42); }
}

@keyframes eye-glitch {
  0% { transform: translate(0); filter: brightness(1); }
  25% { transform: translate(-2px, 1px); filter: contrast(1.3); }
  50% { transform: translate(2px, -1px); filter: brightness(1.2); }
  100% { transform: translate(0); filter: brightness(1); }
}

@keyframes voice-bar {
  from { height: 3px; }
  to { height: 12px; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes modalPopIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes neonFlicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 24%, 55% { opacity: 0.72; }
}

@keyframes twistCrimsonPulse {
  0%, 100% { box-shadow: inset 0 0 44px rgba(184, 59, 59, 0.16); }
  50% { box-shadow: inset 0 0 96px rgba(184, 59, 59, 0.34); }
}

.anim-flicker {
  animation: neonFlicker 7s infinite;
}

body.twist-alert {
  --cyan: #d66363;
  --cyan-dim: rgba(184, 59, 59, 0.2);
}

body.twist-alert #ep2-os-root::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 880;
  animation: twistCrimsonPulse 2.4s infinite;
}

/* Invitation au plein écran automatique */
#fs-hint {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 6000;
  padding: 7px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: #e6e9ec;
  background: rgba(12, 14, 17, 0.88);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  pointer-events: none;
  animation: fsHint 2.4s ease-in-out infinite;
}
@keyframes fsHint { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* Commandes réservées au Maître du Jeu */
body:not(.is-gm) .gm-only { display: none !important; }

/* Bandeau de transmission du Maître du Jeu (Régie en direct) */
.live-banner {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 4500;
  width: min(440px, calc(100vw - 44px));
  padding: 14px 40px 14px 16px;
  background: linear-gradient(180deg, rgba(28, 17, 24, 0.97), rgba(16, 10, 14, 0.97));
  border: 1px solid #6e2b45;
  border-left: 3px solid #ff9ec4;
  border-radius: 3px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.live-banner.show { opacity: 1; transform: none; pointer-events: auto; }
.live-banner.hint { border-color: #6b5a2a; border-left-color: var(--amber); background: linear-gradient(180deg, rgba(30, 24, 12, 0.97), rgba(18, 14, 8, 0.97)); }
.live-banner-title { font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: #ff9ec4; margin-bottom: 6px; }
.live-banner.hint .live-banner-title { color: #f0ca7d; }
.live-banner-text { font-size: 14px; line-height: 1.5; color: #f1f1ee; white-space: pre-line; }
.live-banner-close { position: absolute; top: 6px; right: 8px; padding: 0 8px; font-size: 18px; background: transparent; border: none; color: #aaa; cursor: pointer; }
