/* ---- Sheet title (1.4): the SNES title and menu board ------------------
 * The canvas is CSS-pixel sized and draws every slice at a whole scale with
 * smoothing off; `pixelated` keeps the device-pixel upscale crisp too.
 * `--tk` is the title scale (title-screen.js titleScale). */
.title-canvas,
.title-crt,
.menu-board canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.push-start {
  position: fixed;
  inset: 0;
  z-index: 5;
  opacity: 0;
  cursor: var(--hand, pointer);
  border: 0;
  background: transparent;
}

.menu-board {
  position: fixed;
  top: 50%;
  left: 50%;
  width: calc(256 * var(--tk, 2px));
  height: calc(224 * var(--tk, 2px));
  margin: calc(-112 * var(--tk, 2px)) 0 0 calc(-128 * var(--tk, 2px));
  z-index: 8;
}

.menu-board canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.menu-line {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 1px;
  cursor: var(--hand, pointer);
  outline: none;
}

.menu-line:focus-visible {
  outline: calc(1 * var(--tk, 2px)) dotted #f8f8c8;
  outline-offset: calc(-1 * var(--tk, 2px));
}

/* 13.19 Goodbye board: the menu board's frame and scale; the rows are
   transparent buttons over the bitmap-font lines (plain text without the font). */
.goodbye {
  position: fixed;
  top: 50%;
  left: 50%;
  width: calc(256 * var(--tk, 2px));
  height: calc(224 * var(--tk, 2px));
  margin: calc(-112 * var(--tk, 2px)) 0 0 calc(-128 * var(--tk, 2px));
  z-index: 9;
}

.goodbye[hidden] {
  display: none;
}

.goodbye canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.gb-head {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gb-row,
.gb-push {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font: inherit;
  cursor: var(--hand, pointer);
}

.gb-push {
  left: calc(80 * var(--tk, 2px));
  top: calc(190 * var(--tk, 2px));
  width: calc(96 * var(--tk, 2px));
  height: calc(20 * var(--tk, 2px));
}

.gb-row:focus-visible,
.gb-push:focus-visible {
  outline: calc(1 * var(--tk, 2px)) dotted #f8f8c8;
  outline-offset: calc(-1 * var(--tk, 2px));
}

.goodbye.plain .gb-head {
  position: absolute;
  width: auto;
  height: auto;
  clip: auto;
  left: 0;
  right: 0;
  top: calc(14 * var(--tk, 2px));
  margin: 0;
  text-align: center;
  color: #f8f8c8;
  font-size: calc(12 * var(--tk, 2px));
}

.goodbye.plain .gb-row,
.goodbye.plain .gb-push {
  color: #f8f8c8;
  font-size: calc(9 * var(--tk, 2px));
  text-align: left;
  padding-left: calc(10 * var(--tk, 2px));
}

.title-status {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 1rem;
  margin: 0;
  text-align: center;
  color: #f8f8c8;
  z-index: 9;
  pointer-events: none;
}

#menu-back {
  display: none;
}

body[data-title="sheet"] #menu-back {
  display: inline-block;
  pointer-events: auto;
}

body[data-title="sheet"]:not([data-stage="new"]) #title {
  display: none;
}

body[data-title="sheet"] #title .wordmark,
body[data-title="sheet"] #title .tagline {
  display: none;
}

body[data-title="sheet"] #title {
  background: rgba(0, 0, 0, 0.82);
  border: 2px solid #506868;
}

/* SELECT SCENARIO (8.4 hook-up): the cards over the title scene, one link
 * per scenario; the card art is a 128×111 canvas cut from misc-scenarios.png. */
.scenario-cards {
  position: fixed;
  inset: 3rem 1rem auto;
  z-index: 8;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
}

.scenario-cards[hidden] {
  display: none;
}

.scenario-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 128px;
  padding: 0.25rem;
  color: #f8f8c8;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid #f8f8c8;
}

.scenario-card canvas {
  width: 128px;
  height: 111px;
  image-rendering: pixelated;
}

.scenario-card:hover,
.scenario-card:focus-visible {
  outline: 2px dotted #f8f8c8;
  outline-offset: 2px;
}

#scenario-back {
  align-self: flex-start;
}
