/* built from game/seen-once.html by tools/build-seen-once.ts — edit the source, not this */
/* one screen: a low-res PSX canvas fills it; the hud and paper float over it in house type (times = the voice, courier = the machine) */
:root {
  --ink: #131210;
  --bone: #f4ecce;
  --bruise: #b04a5e;
  --blood: #6e1423;
  --dim: #8c8576;
  --rule: #3a3630;
  --voice: "Times New Roman", Times, "Liberation Serif", serif;
  --machine: "Courier New", Courier, "Liberation Mono", monospace;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--machine);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  touch-action: none;
  cursor: none;
}

/* hud */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  letter-spacing: .08em;
  pointer-events: none;
  opacity: .82;
}
.candle { display: flex; align-items: center; gap: 10px; }
.bar { width: 88px; height: 7px; border: 1px solid var(--bone); }
.bar i { display: block; height: 100%; width: 100%; background: var(--bone); }
.bar.low i { background: var(--bruise); }
.msg {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  margin: 0;
  text-align: center;
  font-family: var(--voice);
  font-size: clamp(17px, 2.4vw, 22px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s;
}
.msg.on { opacity: 1; }

/* the controls, hovering in the corner of the dark */
.guide {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  top: calc(44px + env(safe-area-inset-top, 0px));
  max-width: min(320px, calc(100% - 32px));
  border: 1px solid rgba(244, 236, 206, .28);
  background: rgba(19, 18, 16, .62);
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  transition: opacity 1.2s;
}
.guide.faded { opacity: 0; }
.guide p { margin: 0; }
.guide-head { font-family: var(--voice); font-size: 16px; margin-bottom: 8px !important; }
.guide dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 0; }
.guide dt { color: var(--bone); }
.guide dd { margin: 0; color: var(--dim); }
.guide-foot { color: var(--dim); margin-top: 8px !important; font-size: 11px; }
.hold {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 12px 18px;
  border: 1px solid rgba(244, 236, 206, .4);
  background: rgba(19, 18, 16, .7);
  font-size: 13px;
  letter-spacing: .12em;
  pointer-events: none;
  text-align: center;
  max-width: calc(100% - 32px);
}

/* the notice, held up to the candle */
.note {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: radial-gradient(ellipse at center, rgba(19, 18, 16, .35), rgba(5, 4, 4, .88) 70%);
  pointer-events: none;
}
.note.touch { pointer-events: auto; }
.sheet {
  position: relative;
  width: min(360px, 84vw, 58vh);
  aspect-ratio: 3 / 4;
  transform: rotate(var(--rot, -1.5deg));
  animation: lift .35s steps(5) both;
}
@keyframes lift { from { transform: translateY(40px) rotate(var(--rot, -1.5deg)); opacity: 0; } }
.sheet canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}
.sheet-text {
  position: absolute;
  inset: 11% 12% 14% 12%;
  color: #1f1812;
  text-shadow: 0 0 1px rgba(31, 24, 18, .55);
  display: grid;
  align-content: start;
  gap: .9em;
}
.sheet-head {
  margin: 0;
  font-family: var(--voice);
  font-size: clamp(15px, 4.4vw, 21px);
  border-bottom: 1px solid rgba(31, 24, 18, .7);
  padding-bottom: .3em;
}
.sheet-body {
  margin: 0;
  font-size: clamp(12px, 3.5vw, 15px);
  line-height: 1.5;
  white-space: pre-line;
  letter-spacing: .01em;
}
.sheet-hem {
  position: absolute;
  left: 12%; right: 12%; bottom: 8%;
  margin: 0;
  font-size: clamp(9px, 2.4vw, 10px);
  letter-spacing: .08em;
  color: rgba(31, 24, 18, .7);
}
.note-prompt { margin: 0; font-size: 12px; letter-spacing: .14em; color: var(--dim); }

/* end panels: 1px rules, no radius, no shadow */
.screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding-block: calc(24px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: rgba(10, 9, 8, .9);
  overflow-y: auto;
}
.panel {
  width: 100%;
  max-width: 34rem;
  border: 1px solid var(--rule);
  background: var(--ink);
  padding: 32px clamp(20px, 5vw, 40px);
  display: grid;
  gap: 20px;
}
.eyebrow { font-size: 12px; letter-spacing: .14em; color: var(--dim); margin: 0; }
h2 {
  font-family: var(--voice);
  font-weight: normal;
  margin: 0;
  text-wrap: balance;
  line-height: 1.05;
  font-size: clamp(28px, 6vw, 40px);
}
p { margin: 0; line-height: 1.55; }
.lede { font-family: var(--voice); font-size: 19px; color: var(--dim); }
.fine { font-size: 12px; color: var(--dim); letter-spacing: .04em; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
button, .link {
  font-family: var(--machine);
  font-size: 14px;
  letter-spacing: .1em;
  padding: 14px 22px;
  border: 1px solid var(--bone);
  background: var(--bone);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  border-radius: 0;
}
button.ghost { background: transparent; color: var(--bone); }
button:hover, .link:hover { background: var(--ink); color: var(--bone); }
button.ghost:hover { background: var(--bone); color: var(--ink); }
button:focus-visible, .link:focus-visible { outline: 2px solid var(--bruise); outline-offset: 3px; }
.sign { display: grid; gap: 10px; border: 1px solid var(--bruise); padding: 18px; }
.sign-email {
  font-family: var(--machine); font-size: 14px; letter-spacing: .04em;
  padding: 13px 14px; min-width: 0; flex: 1 1 14rem;
  border: 1px solid var(--bone); background: transparent; color: var(--bone); border-radius: 0;
}
.sign-email:focus-visible { outline: 2px solid var(--bruise); outline-offset: 3px; }
.sign-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* the threshold: the house shows through behind it */
.door { background: rgba(10, 9, 8, .55); }
.door .panel { max-width: 26rem; }
.door-keys { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; font-size: 13px; }
.door-keys dt { color: var(--bone); }
.door-keys dd { margin: 0; color: var(--dim); }
.door button { width: 100%; }
/* the register leads the end panels */
.sign-line { font-family: var(--voice); font-size: 18px; color: var(--bone); letter-spacing: 0; }
.slats {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 35%, rgba(3, 2, 2, .9) 80%),
    repeating-linear-gradient(to bottom, rgba(6, 4, 3, .96) 0 22px, rgba(6, 4, 3, 0) 22px 34px);
}
/* under the bed: the boards a hand's width over your face, the sheet's edge hanging */
.underbed {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(to right, rgba(14, 11, 8, .95) 0 34px, rgba(30, 25, 20, .95) 34px 37px),
    radial-gradient(ellipse at 50% 70%, rgba(0, 0, 0, 0) 30%, rgba(3, 2, 2, .92) 78%);
  background-size: 100% 36%, 100% 100%;
  background-position: 0 0, 0 0;
  background-repeat: no-repeat;
}
.underbed::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 36%;
  height: 7%;
  background: repeating-linear-gradient(to right, rgba(120, 112, 92, .85) 0 18px, rgba(80, 74, 60, .85) 18px 26px, rgba(110, 102, 84, .0) 26px 31px);
}
.pause {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 9, 8, .6);
}
.pause .panel { max-width: 24rem; }
.slider { display: grid; gap: 10px; font-size: 13px; letter-spacing: .06em; }
.slider input { width: 100%; accent-color: var(--bruise); }
.shot { margin: 0; display: grid; gap: 12px; }
.shot canvas { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
.link.ghost { background: transparent; color: var(--bone); }
.link.ghost:hover { background: var(--bone); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .msg, .guide { transition: none; }
  .sheet { animation: none; }
}
