/* 13.16 View mode: the tilted city alone; BACK (or Esc) brings the chrome back */
.play-page.view-mode #hud,
.play-page.view-mode #palette,
.play-page.view-mode .foldout,
.play-page.celebrating #hud,
.play-page.celebrating #palette,
.play-page.celebrating .foldout {
  display: none;   /* 14.10: the Megalopolis sweep shows the city alone too */
}
.view-exit {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  font: inherit;
  color: #c8d0f8;
  background: #000;
  border: 2px solid #c8d0f8;
  padding: 2px 8px;
  cursor: var(--hand, pointer);
}
.view-exit[hidden] {
  display: none;
}

/* First paint (operator finding 2026-10-12): until the title has drawn its
   first frame (<html data-ready>, set by title-screen.js or the diorama), every
   board under it stays transparent, so the page opens on the night colour and
   then the title, never on the MAP SELECT board and SIMCITY wordmark that the
   markup holds without a `hidden` attribute. Opacity, not visibility: a child
   with visibility: visible would show through a hidden parent. Scoped to the
   title page (<html class="title-page">): style.css also serves /play. */
html.title-page:not([data-ready]) body > :not(#scene) {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Title SETTINGS cog: 16x16 pixel art at 2 px, bottom-right, on the push,
   menu and scenario screens (MAP SELECT, naming and Goodbye fill the screen). */
.title-cog {
  display: none;
  position: fixed;
  right: max(0.5rem, env(safe-area-inset-right));
  bottom: max(0.5rem, env(safe-area-inset-bottom));
  z-index: 40;
  width: 40px;
  height: 40px;
  padding: 2px;
  background: #6868a8;
  border: 2px solid #181840;
  box-shadow: inset 0 0 0 2px #8080b8;
  cursor: var(--hand, pointer);
}

body[data-stage="push"] .title-cog,
body[data-stage="menu"] .title-cog,
body[data-stage="scenario"] .title-cog {
  display: block;
}

.title-cog canvas {
  display: block;
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

.title-cog:focus-visible {
  outline: 2px solid #f8f8c8;
  outline-offset: 2px;
}

.title-settings.map-window {
  z-index: 50;
}

/* The CRT screen (crt-pass.js): the page-wide overlay multiplies scanlines,
   the LCD triad, the edge falloff and the rounded black border onto the city
   and the DOM GUI alike. Click-through and on top of everything. */
/* while the CRT screen is on, the HUD's corner pieces step in past the mask */
html[data-crt="on"] {
  --crt-inset: 50px;
}

.crt-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2147483647;
  mix-blend-mode: multiply;
}

/* the glass (crt-glass.js): a reflection and smudges added on top (screen blend) */
.crt-glass {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2147483647;
  mix-blend-mode: screen;
}
.crt-glass[hidden] {
  display: none;
}

/* the mouse pointer under the glass (crt-pointer.js): the browser's is hidden,
   the same finger is a sprite just below the overlay and the glass */
html[data-crt-pointer="on"],
html[data-crt-pointer="on"] * {
  cursor: none !important;
}
.crt-pointer {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 2147483646;
  image-rendering: pixelated;
  will-change: transform;
}
.crt-pointer[hidden] {
  display: none;
}

/* the CRT group's effect rows in SETTINGS sit indented under CRT screen */
.settings-body .crt-sub {
  padding-left: calc(4 * var(--px));
}
