/* ─── DOS player frame ────────────────────────────────────────
   The chrome around the emulator canvas and the CRT filter, for
   public/js-dos.html.

   These were a <style> block in that file. js-dos.html is served by
   express.static and has nowhere to carry a per-response nonce — the same
   reason its two inline <script> blocks became js/js-dos-player.js — so
   while the block was inline, style-src had to keep 'unsafe-inline' for the
   whole site. As a file it is covered by 'self' and the directive closes.

   Referenced by its bare name, like the two files beside it: a static page
   cannot call app.locals.asset. app.ts therefore serves this one
   revalidating rather than with the usual day, so a change reaches a browser
   holding yesterday's copy — see PLAYER_STYLESHEET there. */

/* Hide only js-dos 8.4.1's two ClickToLock hints. pointer-events-none is
   also on its save-error/warning toasts and loading/error messages, so
   selecting that utility alone silently hid failed saves from the player.
   The modal hint uses flex-col; ModalText uses flex-row at top-0, and the
   floating hint alone uses top-6. Keep those distinctions when upgrading
   js-dos — see src/window/dos/dos-window.tsx in its distributed source map. */
#dos .pointer-events-none.flex-col.top-0.left-0.w-full.h-full,
#dos .pointer-events-none.flex-row.top-6.left-0.w-full {
  display: none;
}

/* ── CRT filter ─────────────────────────────────────────────── */
#dos {
  position: relative;
  overflow: hidden;
}

/* Slight contrast boost to compensate scanline darkening */
#dos.crt-on canvas {
  filter: url(#crt-phosphor) brightness(1.02) contrast(1.04) blur(0.3px) !important;
}

/* Scanlines – dark gap after every 2 bright pixels */
#crt-scanlines {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.45) 2px,
    rgba(0, 0, 0, 0.45) 3px
  );
}

/* Vignette */
#crt-vignette {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 11;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0, 0, 0, 0.18) 100%
  );
}

/* RGB phosphor dot matrix (the "matice") */
#crt-matrix {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 50, 30, 0.05) 0px,
    rgba(255, 50, 30, 0.05) 1px,
    rgba(50, 255, 50, 0.05) 1px,
    rgba(50, 255, 50, 0.05) 2px,
    rgba(30, 50, 255, 0.05) 2px,
    rgba(30, 50, 255, 0.05) 3px
  );
}

#dos.crt-on #crt-scanlines,
#dos.crt-on #crt-vignette,
#dos.crt-on #crt-matrix {
  display: block;
}

/* Toggle button */
#crt-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 100;
  padding: 5px 11px;
  background: rgba(0, 0, 0, 0.6);
  color: #88ff88;
  border: 1px solid rgba(136, 255, 136, 0.35);
  border-radius: 3px;
  font:
    11px/1.4 "Courier New",
    monospace;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  user-select: none;
}

#crt-btn:hover {
  background: rgba(0, 40, 0, 0.75);
  border-color: rgba(136, 255, 136, 0.7);
}

#dos.crt-on #crt-btn {
  color: #aaffaa;
  border-color: rgba(170, 255, 170, 0.6);
}
/* ─────────────────────────────────────────────────────────── */

/* Shown by js/js-dos-player.js in place of the emulator when there is nothing
   it can start: the loader did not arrive (dos-load-failed — the connection
   dropped, a content blocker, or the integrity check refusing a changed
   file), or the game's address was missing or refused (dos-no-game — see the
   stream check there). Without it the frame was black, or an empty emulator,
   and said nothing.

   The background is stated rather than left to whatever is behind the
   document. Inside the game page the black comes from .game-detail-stream,
   seen through a frame that paints none of its own; opened on its own the
   document has the browser's white canvas behind it, and #ddd on white is
   not a message anyone can read. js-dos paints its own only once it has
   started, which in this state it has not. */
#dos.dos-load-failed,
#dos.dos-no-game {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 1rem;
  background-color: #000;
  color: #ddd;
  font-family: sans-serif;
  text-align: center;
}
