@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans-latin-ext-400-normal.woff2") format("woff2");
  font-weight: 400;
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans-latin-ext-600-normal.woff2") format("woff2");
  font-weight: 600;
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #07060a;
  --night: #0a0d18;
  --panel: #16121a;
  --panel-edge: #423a44;
  --cream: #fff4e2;
  --cream-dim: #ccbca8;
  --amber: #f7c962;
  --neon: #f45b95;
  --px: 4px;
  /* Set by ui/fonts.js to the chosen font and its crisp sizes. */
  --font: "Departure Mono", system-ui, sans-serif;
  --text-line: 22px;
  --text-ui: 16.5px;
  --text-small: 11px;
  --text-title: 44px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: radial-gradient(ellipse at center, #120e16 0%, var(--ink) 70%);
  color: var(--cream);
  font-family: var(--font);
  /* A pixel font has one weight; a faked bold or slant would blur it. */
  font-synthesis: none;
  overflow: hidden;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

.stage {
  position: fixed;
  inset: 0;
  /* A scene that covers the screen is cropped, not scrolled. */
  overflow: hidden;
  display: grid;
  place-items: center;
}

.scene,
.layer {
  grid-area: 1 / 1;
}

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

.scene.smooth {
  image-rendering: auto;
}

/* With the keyboard over the page, the scene rises a third of its height, so a face stays clear of the dialogue. */
.scene {
  translate: 0 calc(env(keyboard-inset-height, 0px) * -0.35);
  transition: translate 0.25s ease-out;
}

/* A place wider than the screen: dragged sideways, by finger or mouse. */
.scene.pannable {
  touch-action: none;
  cursor: grab;
}

.layer {
  position: relative;
  pointer-events: none;
}

.layer > * {
  pointer-events: auto;
}

[hidden] {
  display: none !important;
}

/* Panels: dark fill, a light rim, a black outline, notched pixel corners. */
.panel,
.button {
  --edge: 3px;
  background: rgba(22, 18, 26, 0.94);
  border: var(--edge) solid var(--panel-edge);
  box-shadow: 0 0 0 var(--edge) var(--ink);
  clip-path: polygon(
    0 calc(var(--edge) * 2), var(--edge) calc(var(--edge) * 2), var(--edge) var(--edge),
    calc(var(--edge) * 2) var(--edge), calc(var(--edge) * 2) 0,
    calc(100% - var(--edge) * 2) 0, calc(100% - var(--edge) * 2) var(--edge), calc(100% - var(--edge)) var(--edge),
    calc(100% - var(--edge)) calc(var(--edge) * 2), 100% calc(var(--edge) * 2),
    100% calc(100% - var(--edge) * 2), calc(100% - var(--edge)) calc(100% - var(--edge) * 2),
    calc(100% - var(--edge)) calc(100% - var(--edge)), calc(100% - var(--edge) * 2) calc(100% - var(--edge)),
    calc(100% - var(--edge) * 2) 100%, calc(var(--edge) * 2) 100%, calc(var(--edge) * 2) calc(100% - var(--edge)),
    var(--edge) calc(100% - var(--edge)), var(--edge) calc(100% - var(--edge) * 2), 0 calc(100% - var(--edge) * 2)
  );
}

.button {
  font: inherit;
  font-size: var(--text-ui);
  color: var(--cream);
  padding: 6px 14px 8px;
  cursor: pointer;
  border-color: #7d4a1c;
  background: #2e1a14;
}

.button:hover,
.button:focus-visible {
  background: #4a2a1c;
  color: var(--amber);
  outline: none;
}

.button.small {
  font-size: var(--text-small);
  padding: 2px 10px 4px;
}

/* Title, over her table: before sitting down, and after leaving */
.title-card {
  position: absolute;
  inset: 0;
  display: grid;
  /* Below her face: she is what the visitor came for. */
  place-content: end center;
  justify-items: center;
  padding-bottom: 7vh;
  text-align: center;
  background: linear-gradient(rgba(7, 6, 10, 0.3) 30%, rgba(7, 6, 10, 0.9));
}

.title-card h1 {
  margin: 0 0 6px;
  font-size: var(--text-title);
  font-weight: normal;
  color: var(--amber);
  text-shadow: 0 3px 0 var(--ink);
}

.title-line {
  margin: 0 0 22px;
  font-size: var(--text-ui);
  color: var(--cream);
  text-shadow: 0 2px 0 var(--ink);
}

.sit-down {
  font-size: var(--text-line);
  padding: 8px 22px 10px;
  animation: breathe 2.4s steps(6) infinite;
}

.privacy-link {
  color: var(--cream-dim);
}

/* Door */
.door-prompt {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  text-align: center;
}

.enter {
  font-size: var(--text-line);
  padding: 8px 22px 10px;
  animation: breathe 2.4s steps(6) infinite;
}

@keyframes breathe {
  50% {
    color: var(--amber);
  }
}

.note {
  margin: 12px 0 0;
  font-size: var(--text-small);
  color: var(--cream-dim);
  text-shadow: 0 2px 0 var(--ink);
}

/* Name tags over people in the room */
.tags {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Tags of people dragged out of view go with them. */
  overflow: hidden;
}

.tag {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: var(--text-small);
  padding: 0 6px 2px;
  color: var(--amber);
  background: rgba(7, 6, 10, 0.85);
  border: 2px solid var(--panel-edge);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s steps(3);
}

.tag.on {
  opacity: 1;
}

@media (hover: none) {
  .tag {
    opacity: 0.9;
  }
}

.hint {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 3%;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 12px 6px;
  font-size: var(--text-small);
  color: var(--cream);
  background: rgba(7, 6, 10, 0.75);
  white-space: nowrap;
  animation: breathe 2.4s steps(6) infinite;
}

.leave {
  position: absolute;
  left: 2.5%;
  top: 3%;
}

.hud {
  position: absolute;
  right: 2.5%;
  top: 3%;
  display: flex;
  gap: 10px;
}

.icon {
  width: 40px;
  height: 36px;
  padding: 7px;
  background: rgba(7, 6, 10, 0.7);
  border: 2px solid var(--panel-edge);
  cursor: pointer;
  fill: var(--cream);
}

.icon:hover,
.icon:focus-visible {
  fill: var(--amber);
  outline: none;
}

.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.icon .cross,
.icon[aria-pressed="false"] .waves {
  display: none;
}

.icon[aria-pressed="false"] .cross {
  display: inline;
}

.icon.music[aria-pressed="false"] {
  opacity: 0.45;
}

/* The dialogue box */
.dialogue {
  position: absolute;
  left: 3%;
  right: 3%;
  /* Above the on-screen keyboard where the browser lays it over the page (see main.js); 0 elsewhere. */
  bottom: calc(3.5% + env(keyboard-inset-height, 0px));
  transition: bottom 0.25s ease-out;
  max-width: 860px;
  margin: 0 auto;
  padding: 18px 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
  clip-path: none;
}

.speaker {
  position: absolute;
  top: -20px;
  left: 18px;
  padding: 1px 12px 3px;
  font-size: var(--text-ui);
  color: var(--ink);
  background: var(--amber);
  border: 3px solid var(--ink);
}

.speaker.you {
  background: var(--cream-dim);
}

.log-toggle {
  position: absolute;
  top: -18px;
  right: 18px;
}

.echo {
  margin: 0;
  font-size: var(--text-small);
  color: var(--cream-dim);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.echo:empty {
  display: none;
}

.echo::before {
  content: "› ";
}

.line {
  margin: 0;
  flex: 1;
  font-size: var(--text-line);
  line-height: 1.38;
  color: var(--cream);
}

.untyped {
  visibility: hidden;
}

/* At a table the box keeps room for three lines, so it does not jump between replies. */
.dialogue.at-table .line {
  min-height: calc(1.38em * 3);
}

.line.thinking .typed::after {
  content: "";
  display: inline-block;
  width: 3ch;
  text-align: left;
  animation: dots 1.2s steps(4) infinite;
}

@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}

.more {
  position: absolute;
  right: 18px;
  bottom: 10px;
  color: var(--amber);
  font-size: var(--text-small);
  animation: bob 0.8s steps(2) infinite;
}

@keyframes bob {
  50% {
    transform: translateY(3px);
  }
}

.line.narration {
  color: var(--cream-dim);
}

.retry {
  align-self: flex-start;
}

.composer {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.composer input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: var(--text-ui);
  color: var(--cream);
  background: var(--ink);
  border: 3px solid var(--panel-edge);
  padding: 6px 10px 8px;
  outline: none;
}

.composer input:focus {
  border-color: #a36422;
}

.composer input::placeholder {
  color: #6e5a52;
}

.composer input:disabled {
  opacity: 0.5;
}

.icon .hole {
  fill: rgba(7, 6, 10, 0.9);
}

/* Settings */
.settings {
  background: var(--panel);
  position: absolute;
  top: 4%;
  left: 6%;
  right: 6%;
  max-height: 92%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  clip-path: none;
}

.settings header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.settings h2 {
  margin: 0;
  font-size: var(--text-line);
  font-weight: normal;
  color: var(--amber);
}

.forget-me {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.forget-me .note {
  margin: 0;
}

.forget-me a {
  color: var(--cream-dim);
}

.forget.armed {
  color: var(--amber);
}

.settings h3 {
  margin: 0 0 8px;
  font-size: var(--text-small);
  font-weight: normal;
  color: var(--cream-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.volumes {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.volumes label {
  display: grid;
  grid-template-columns: 9em 1fr;
  align-items: center;
  gap: 12px;
  font-size: var(--text-ui);
  color: var(--cream);
}

.volumes input[type="range"] {
  appearance: none;
  height: 8px;
  background: var(--ink);
  border: 2px solid var(--panel-edge);
  cursor: pointer;
}

.volumes input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 20px;
  background: var(--amber);
  border: 2px solid var(--ink);
}

.volumes input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 20px;
  background: var(--amber);
  border: 2px solid var(--ink);
  border-radius: 0;
}

.volumes input[type="range"]:focus-visible {
  outline: 2px solid var(--amber);
}

.font-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.font-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: baseline;
  padding: 10px 12px;
  border: 3px solid var(--panel-edge);
  background: var(--ink);
  color: var(--cream);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.font-choice:hover,
.font-choice:focus-visible {
  border-color: #7d4a1c;
  outline: none;
}

.font-choice[aria-checked="true"] {
  border-color: var(--amber);
}

.font-choice .mark {
  grid-row: span 2;
  color: var(--amber);
  font-size: var(--text-ui);
  font-family: var(--font);
  visibility: hidden;
}

.font-choice[aria-checked="true"] .mark {
  visibility: visible;
}

.font-choice .name {
  color: var(--amber);
}

.font-choice .sample {
  color: var(--cream);
  line-height: 1.4;
}

.font-choice .note {
  grid-column: 2;
  margin: 0;
  font-size: 12px;
  font-family: system-ui, sans-serif;
  color: var(--cream-dim);
}

/* The log of the evening */
.log {
  background: var(--panel);
  position: absolute;
  inset: 4% 6%;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  clip-path: none;
}

.log header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.log h2 {
  margin: 0;
  font-weight: normal;
  font-size: var(--text-line);
  color: var(--amber);
}

.log ol {
  list-style: none;
  margin: 0;
  padding: 0 6px 0 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--text-ui);
  line-height: 1.35;
}

.log li b {
  display: block;
  font-size: var(--text-small);
  color: var(--amber);
}

.log li.you b {
  color: var(--cream-dim);
}

/* Fades between places, in steps like an old palette fade */
.fade {
  position: fixed;
  inset: 0;
  background: var(--ink);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.6s steps(5);
}

.fade.clear {
  opacity: 0;
}

@media (max-width: 540px) {
  .dialogue {
    left: 2%;
    right: 2%;
    bottom: 2%;
    padding: 16px 14px 12px;
  }
  .button {
    font-size: var(--text-ui);
  }
  .enter {
    font-size: var(--text-line);
  }
}
