/* ---------- Fonts (self-hosted in fonts/, SIL Open Font License) ---------- */

@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/archivo-black-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Archivo Black";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/archivo-black-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Michroma";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/michroma-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Michroma";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/michroma-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/oswald-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/oswald-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* One classic tile pixel. Cells are 16u; JS sets --cell to fit the viewport. */
  --cell: 32px;
  --u: calc(var(--cell) / 16);

  --win-face: #c0c0c0;
  --win-light: #ffffff;
  --win-shadow: #808080;

  --page-bg: #0b0c0e;
  --objective: #ffd21a;
  --comms-accent: #9fd8ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--page-bg);
  color: #fff;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  gap: 20px;
}

/* Unless there's room beside the game, the comms flyout sits above it, so leave it room. */
@media (max-width: 1080px) {
  .hud-screen .stage {
    padding-top: max(170px, calc(env(safe-area-inset-top) + 158px));
  }
}

/* ---------- Icons (images/icons/, js/icons.js) ---------- */

img.ico {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Inline with text: sized by the img's width/height attributes, nudged onto the text line. */
img.ico-inline {
  vertical-align: -0.28em;
  margin-right: 0.35em;
}

img.ico-inline.ico-after {
  margin-right: 0;
  margin-left: 0.35em;
}

/* ---------- Classic window chrome ---------- */

.game {
  background: var(--win-face);
  border: calc(var(--u) * 3) solid;
  border-color: var(--win-light) var(--win-shadow) var(--win-shadow) var(--win-light);
  padding: calc(var(--u) * 6);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--u) * 37);
  padding: 0 calc(var(--u) * 5);
  border: calc(var(--u) * 2) solid;
  border-color: var(--win-shadow) var(--win-light) var(--win-light) var(--win-shadow);
  margin-bottom: calc(var(--u) * 6);
}

.lcd {
  display: flex;
  background: #000;
  border: var(--u) solid;
  border-color: var(--win-shadow) var(--win-light) var(--win-light) var(--win-shadow);
}

.lcd svg {
  display: block;
  width: calc(var(--u) * 13);
  height: calc(var(--u) * 23);
}

.lcd .on {
  fill: #ff0000;
}

.lcd .off {
  fill: #2a0000;
}

.face {
  appearance: none;
  -webkit-appearance: none;
  width: calc(var(--u) * 26);
  height: calc(var(--u) * 26);
  padding: 0;
  margin: 0;
  background: var(--win-face);
  border: calc(var(--u) * 3) solid;
  border-color: var(--win-light) var(--win-shadow) var(--win-shadow) var(--win-light);
  outline: var(--u) solid var(--win-shadow);
  outline-offset: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  touch-action: manipulation;
}

.face:active {
  border-width: var(--u);
  border-color: var(--win-shadow);
  padding: calc(var(--u) * 2) 0 0 calc(var(--u) * 2);
}

.face svg {
  width: calc(var(--u) * 17);
  height: calc(var(--u) * 17);
  display: block;
}

/* Face states: data-face = smile | o | win; .talking opens the mouth. */
.face .eyes-o,
.face .shades,
.face .mouth-talk,
.face .mouth-o {
  display: none;
}

.face[data-face="o"] .eyes {
  display: none;
}

.face[data-face="o"] .eyes-o {
  display: inline;
}

.face[data-face="o"] .mouth-smile {
  display: none;
}

.face[data-face="o"] .mouth-o {
  display: inline;
}

.face[data-face="win"] .eyes {
  display: none;
}

.face[data-face="win"] .shades {
  display: inline;
}

.face.talking:not([data-face="o"]) .mouth-smile {
  display: none;
}

.face.talking:not([data-face="o"]) .mouth-talk {
  display: inline;
}

/* ---------- Board ---------- */

.board-wrap {
  border: calc(var(--u) * 3) solid;
  border-color: var(--win-shadow) var(--win-light) var(--win-light) var(--win-shadow);
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols, 9), var(--cell));
  grid-auto-rows: var(--cell);
  touch-action: none;
  cursor: default;
}

.cell {
  position: relative;
  width: var(--cell);
  height: var(--cell);
  background: var(--win-face);
  border: calc(var(--u) * 2) solid;
  border-color: var(--win-light) var(--win-shadow) var(--win-shadow) var(--win-light);
}

.cell svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cell.open,
.cell.pressed {
  border-width: var(--u) 0 0 var(--u);
  border-color: #7b7b7b;
}

/* In open cells the SVG is drawn in the same 16u frame as closed cells. */
.cell.open svg,
.cell.pressed svg {
  inset: calc(var(--u) * -1) 0 0 calc(var(--u) * -1);
  width: var(--cell);
  height: var(--cell);
}

.cell:not(.open):not(.pressed) svg {
  inset: calc(var(--u) * -2);
  width: var(--cell);
  height: var(--cell);
}

.cell.hit {
  background: #ff0000;
}

/* ---------- Objective marker ---------- */

.objective {
  position: absolute;
  left: calc(var(--c) * var(--cell));
  top: calc(var(--r) * var(--cell));
  width: var(--cell);
  height: var(--cell);
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}

.objective::before {
  content: "";
  position: absolute;
  inset: 0;
  /* A dark pool under the waypoint so it reads against the light cells. */
  background: radial-gradient(circle closest-side, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.2) 70%, rgba(0, 0, 0, 0));
  box-shadow: inset 0 0 0 calc(var(--u) * 1) rgba(255, 210, 26, 0.95),
    inset 0 0 calc(var(--u) * 5) rgba(255, 190, 0, 0.6);
  animation: objective-cell 1.4s ease-in-out infinite;
}

.objective .wp,
.objective .ring {
  grid-area: 1 / 1;
  width: 44%;
  height: 44%;
  transform: rotate(45deg);
}

.objective .wp {
  background: rgba(255, 210, 26, 0.85);
  border: calc(var(--u) * 1.5) solid var(--objective);
  /* Dark outline and shadow first, then the yellow glow. */
  box-shadow: 0 0 0 calc(var(--u) * 0.75) rgba(0, 0, 0, 0.8),
    0 0 calc(var(--u) * 3) rgba(255, 200, 0, 0.9),
    0 0 calc(var(--u) * 5) calc(var(--u) * 1) rgba(0, 0, 0, 0.45);
  animation: objective-pulse 1.4s ease-in-out infinite;
}

.objective .ring {
  border: calc(var(--u) * 1) solid var(--objective);
  box-shadow: 0 0 0 calc(var(--u) * 0.5) rgba(0, 0, 0, 0.5);
  opacity: 0;
  animation: objective-ring 1.4s ease-out infinite;
}

.objective.in {
  animation: objective-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.objective.out {
  animation: objective-out 0.2s ease-in both;
}

@keyframes objective-in {
  from {
    transform: scale(1.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes objective-out {
  to {
    transform: scale(0.6);
    opacity: 0;
  }
}

@keyframes objective-pulse {

  0%,
  100% {
    transform: rotate(45deg) scale(1);
  }

  50% {
    transform: rotate(45deg) scale(1.12);
  }
}

@keyframes objective-ring {
  0% {
    transform: rotate(45deg) scale(1);
    opacity: 0.9;
  }

  100% {
    transform: rotate(45deg) scale(2.1);
    opacity: 0;
  }
}

@keyframes objective-cell {

  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

/* ---------- Subtitles ---------- */

.subtitle {
  width: min(560px, 100%);
  text-wrap: balance;
  /* two-line subtitles split into even lines */
  font-family: "Oswald", "Arial Narrow", sans-serif;
  min-height: 3.2em;
  text-align: center;
  font-size: clamp(13.2px, 3.52vw, 17px);
  /* subtitle size in the ?hud=screen layout */
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  text-shadow:
    -2px -2px 0 #000, 0 -2px 0 #000, 2px -2px 0 #000,
    -2px 0 0 #000, 2px 0 0 #000,
    -2px 2px 0 #000, 0 2px 0 #000, 2px 2px 0 #000,
    0 0 6px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.subtitle.show {
  opacity: 1;
}

/* One row per speaker, the name in caps. NPC lines are in the radio panel's
   color; the protagonist's are white. */
.subtitle-line {
  display: block;
}

.subtitle-line+.subtitle-line {
  margin-top: 0.3em;
}

.subtitle-line:not(.protag) {
  color: var(--comms-accent);
}

.subtitle-name {
  text-transform: uppercase;
}

/* ---------- NPC comms flyout ---------- */

.comms {
  position: fixed;
  font-family: "Michroma", "Eurostile", "Arial", sans-serif;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: min(300px, calc(100vw - 24px));
  padding: 12px 14px 14px;
  background: linear-gradient(90deg, rgba(10, 16, 22, 0.9), rgba(10, 16, 22, 0.78));
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
  pointer-events: none;
  z-index: 10;
}

.comms.show {
  transform: translateX(0);
  opacity: 1;
}

.comms-name {
  font-size: 12px;
  font-weight: 400;
  /* Michroma has one weight */
  text-transform: uppercase;
  color: var(--comms-accent);
}

.comms-wave {
  display: block;
  width: 100%;
  height: 36px;
  margin-top: 8px;
}

/* ---------- Recovery vignette ---------- */

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  background: radial-gradient(ellipse at center, rgba(160, 0, 0, 0) 45%, rgba(170, 0, 0, 0.55) 75%, rgba(200, 0, 0, 0.9) 100%);
  box-shadow: inset 0 0 12vmin 2vmin rgba(200, 0, 0, 0.85);
}

/* ---------- HUD contained in the game window (default layout) ---------- */


.hud-board .game-frame {
  position: relative;
  /* Room for the subtitles under the game window (js/main.js fitBoard sets --sub-h). */
  padding-bottom: var(--sub-h, 0px);
}

.hud-board .game,
.hud-board .board-wrap {
  position: relative;
  overflow: hidden;
}

.hud-board .vignette {
  position: absolute;
  z-index: 3;
  background: radial-gradient(ellipse at center, rgba(160, 0, 0, 0) 55%, rgba(170, 0, 0, 0.4) 85%, rgba(200, 0, 0, 0.8) 100%);
  box-shadow: inset 0 0 calc(var(--u) * 16) calc(var(--u) * 2) rgba(200, 0, 0, 0.85);
}

.hud-board .subtitle {
  /* Below the game window, never over the cells: the band the game frame reserves
     under the window (--sub-h, two lines), as wide as the window, centred. The
     subtitle dock in the ending has the frame's box too, so it lands in the same place. */
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--sub-h, 0px);
  padding: 8px 2px 0;
  width: auto;
  min-height: 0;
  z-index: 6;
  pointer-events: none;
  font-size: var(--sub-font, 16px);
  line-height: 1.3;
  text-shadow:
    -1.5px -1.5px 0 #000, 0 -1.5px 0 #000, 1.5px -1.5px 0 #000,
    -1.5px 0 0 #000, 1.5px 0 0 #000,
    -1.5px 1.5px 0 #000, 0 1.5px 0 #000, 1.5px 1.5px 0 #000,
    0 0 4px rgba(0, 0, 0, 0.8);
}

/* SETTINGS > SUBTITLES: OFF (js/save.js applySettings). */
.subs-off .subtitle {
  visibility: hidden;
}

.hud-board .comms {
  position: absolute;
  /* Covers the header's right side (the timer) without reaching the smiley, and
     never grows past the header onto the cells. */
  top: calc(var(--u) * 6);
  right: calc(var(--u) * 6);
  width: calc(var(--u) * 60);
  height: calc(var(--u) * 37);
  max-height: calc(var(--u) * 37);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 calc(var(--u) * 5);
  transform: translateX(calc(100% + var(--u) * 8));
  z-index: 5;
}

.hud-board .comms.show {
  transform: translateX(0);
}

.hud-board .comms-name {
  font-size: calc(var(--u) * 5.5);
}

.hud-board .comms-wave {
  height: calc(var(--u) * 14);
  margin-top: calc(var(--u) * 3);
}

/* ---------- Ending ---------- */

/* Holds the subtitles in place over where the game window was during the
   ending, so the window can drift away under them. */
.subtitle-dock {
  position: fixed;
  pointer-events: none;
  z-index: 10;
}

.subtitle-dock[hidden] {
  display: none;
}

/* Holds the comms flyout in place over where the game window was, so the
   window can drift away under it. Clips like the window did. */
.comms-dock {
  position: fixed;
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}

.comms-dock[hidden] {
  display: none;
}

/* Black screen the credits scroll up over. */
.credits {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: #000;
  overflow: hidden;
  opacity: 0;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.credits[hidden] {
  display: none;
}

.credits-roll {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  padding: 0 16px;
  color: #ece9e2;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  will-change: transform;
}

/* ---------- HOLD TO SKIP (js/skip.js), shared by every skippable moment ---------- */

.skip-prompt {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 52;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 22px 7px 7px;
  border-radius: 999px;
  background: rgba(6, 9, 12, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  color: #f2f5f3;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.skip-prompt.on {
  opacity: 1;
  transform: none;
  animation: sp-pulse 2.4s ease-in-out infinite;
}

@keyframes sp-pulse {
  50% { box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(47, 224, 122, 0.55), 0 0 22px rgba(47, 224, 122, 0.22); }
}

.skip-prompt.holding,
.skip-prompt.done {
  animation: none;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(47, 224, 122, 0.85), 0 0 26px rgba(47, 224, 122, 0.35);
}

.sp-ring {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.sp-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.sp-svg circle { fill: none; stroke-width: 3.5; }
.sp-track { stroke: rgba(255, 255, 255, 0.2); }
.sp-fill { stroke: #2fe07a; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(47, 224, 122, 0.8)); }

.sp-key {
  position: relative;
  min-width: 28px;
  padding: 2px 4px 1px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-align: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sp-finger { position: relative; display: none; width: 24px; height: 24px; color: #fff; }
.skip-prompt.touch .sp-key { display: none; }
.skip-prompt.touch .sp-finger { display: block; }
.skip-prompt.holding .sp-key { background: rgba(47, 224, 122, 0.3); transform: translateY(1px); }

.sp-label {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
  .skip-prompt { right: max(12px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); padding-right: 18px; gap: 10px; }
  .sp-label { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .skip-prompt.on { animation: none; }
}

.credits {
  -webkit-touch-callout: none;
  touch-action: none;
}

.credits-heading {
  margin: 72px 0 22px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #8f8b84;
}

/* Role on the left of the centre line, names on the right. */
.credits-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
  margin: 0 auto 14px;
  max-width: 760px;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.credits-role {
  text-align: right;
  color: #8f8b84;
}

.credits-names {
  text-align: left;
}

.credits-names-only {
  display: block;
  text-align: center;
}

.credits-names-only .credits-names {
  text-align: center;
}

/* The opening credit gets a card of its own. */
.credits-feature {
  display: block;
  margin: 0 auto 160px;
  text-align: center;
}

.credits-feature .credits-role {
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.32em;
  margin-bottom: 10px;
}

.credits-feature .credits-names {
  text-align: center;
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 0.18em;
}

@media (max-width: 520px) {
  .credits-entry {
    column-gap: 16px;
    font-size: 12px;
    letter-spacing: 0.06em;
  }

  .credits-feature .credits-names {
    font-size: 24px;
  }
}

/* ---------- Wake-up intro ---------- */

/* Eyelids: black with an elliptical opening, drawn by js/wakeUp.js. */
.eyes {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: #000;
  pointer-events: none;
}

.eyes[hidden] {
  display: none;
}

/* Title over the wake-up. Letters start a little apart and drift further
   (js/title.js moves each one). */
.title {
  position: fixed;
  inset: 0;
  /* Above the logo screen (40), since it starts fading in on the black after
     the last logo; below the credits (45). */
  z-index: 42;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}

.title[hidden] {
  display: none;
}

.title-word {
  display: flex;
  font-family: "Archivo Black", "Arial Black", sans-serif;
  font-size: min(8.2vw, 105px);
  /* fully spread, at most ~88% of the width */
  line-height: 1;
  color: #ece9e2;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.title-word span {
  display: inline-block;
  margin: 0 0.05em;
  will-change: transform;
}

/* The game can't be touched until the intro hands over control. */
.stage.waking {
  pointer-events: none;
}

/* ---------- Logo sequence ---------- */

.logo-sequence {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: #000;
  opacity: 0;
  cursor: default;
}

.logo-sequence[hidden] {
  display: none;
}

/* Logos are flattened to an off-white silhouette, whatever their colors. */
.logo-sequence .logo {
  width: auto;
  height: auto;
  max-width: calc(min(62vw, 440px) * var(--size, 1));
  max-height: calc(min(26vh, 200px) * var(--size, 1));
  filter: brightness(0) invert(1) sepia(0.12);
  opacity: 0;
  user-select: none;
  -webkit-user-drag: none;
}

.logo-sequence .logo.shaded {
  filter: grayscale(1) invert(1) brightness(1.35) contrast(1.2) sepia(0.12);
}

/* ---------- Start screen: Win95 desktop ---------- */

.desktop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: #008080;
  cursor: default;
}

.desktop[hidden] {
  display: none;
}

.shortcut {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  outline: none;
  cursor: default;
  touch-action: manipulation;
}

/* Desktop caption in pixel lettering (hidden in this build). */
.desktop-credit {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

/* Dimmed to stay subtle; only the name brightens on hover. */
.desktop-credit canvas {
  display: block;
  opacity: 0.7;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.desktop-credit a {
  cursor: pointer;
  outline: none;
}

.desktop-credit a:hover canvas,
.desktop-credit a:focus-visible canvas {
  opacity: 1;
}

.shortcut canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}