@font-face {
  font-family: "Pixel Esperanza";
  src: url("font_esp.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "BDO Grotesk";
  src: url("BDOGrotesk-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #05070a;
  --text: #f8f4f9;
  --muted: #706572;
  --pink: #f198ff;
  --pink-faded: rgba(241, 152, 255, 0.5);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Pixel Esperanza", "Courier New", monospace;
}

button { font: inherit; }

.experience {
  background: var(--background);
  min-height: 100dvh;
  overflow: visible;
  position: relative;
}

.story {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 96px 20px 190px;
  overflow: visible;
  width: min(100%, 430px);
}

.story-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-margin-bottom: 170px;
}

.line {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  min-height: 1.6em;
  overflow-wrap: anywhere;
}

.line--white {
  color: var(--text);
  text-shadow: 0 4px 6px rgba(255, 255, 255, 0.55);
}

.line--gray { color: var(--muted); }

.line--chain-break { margin-top: 48px; }

.line--choice-response {
  align-self: flex-end;
  color: var(--pink);
  max-width: 85%;
  text-align: right;
  text-shadow: 0 4px 14px rgba(241, 152, 255, 0.62);
}

.response-choices {
  display: grid;
  gap: 12px;
  margin: 0;
}

.response-choice {
  background: #fff;
  border: 1px solid var(--pink-faded);
  color: #1e1e1e;
  cursor: pointer;
  font-size: 16px;
  min-height: 70px;
  padding: 20px;
  text-align: left;
  transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.response-choice:hover,
.response-choice:focus-visible {
  background: #f9e4fc;
  box-shadow: 0 4px 20px rgba(241, 152, 255, 0.28);
  color: #1e1e1e;
  outline: none;
}

.response-choice:disabled {
  background: #fff;
  color: #1e1e1e;
  cursor: pointer;
  opacity: 1;
}

.line--bdo {
  color: var(--text);
  font-family: "BDO Grotesk", monospace;
  line-height: 120%;
  min-height: 0;
  text-shadow: 0 4px 10px rgba(255, 255, 255, 0.55);
}

.line--special {
  align-items: center;
  color: var(--pink);
  display: grid;
  filter: drop-shadow(0 4px 14px rgba(241, 152, 255, 0.72));
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  justify-content: space-between;
  line-height: 1.25;
  overflow: visible;
  text-align: center;
}

.line--special::before,
.line--special::after {
  color: var(--pink);
  content: "█▓▒▒░░░";
  font-size: 18px;
  letter-spacing: -2px;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.line--special::before { text-align: left; }
.line--special::after { content: "░░░▒▒▓█"; }
.line--special::after { text-align: right; }

.special-content {
  grid-column: 2;
  min-width: max-content;
  white-space: nowrap;
}

.special { color: var(--pink); text-shadow: 0 4px 14px rgba(241, 152, 255, 0.62); }

.glitch-character { display: inline-block; text-align: center; }

.typing-character {
  color: var(--pink) !important;
  text-shadow: 0 0 5px rgba(241, 152, 255, 0.95), 0 4px 14px rgba(241, 152, 255, 0.7);
}

.line--special .typing-character {
  color: var(--text) !important;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.95), 0 4px 14px rgba(255, 255, 255, 0.7);
}

.word { white-space: nowrap; }

.cursor {
  animation: blink 750ms steps(1, end) infinite;
  color: var(--text);
  display: inline-block;
  margin-left: 2px;
}

.controls {
  background: linear-gradient(to top, var(--background) 52%, rgba(5, 7, 10, 0));
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  left: 0;
  padding: 42px 20px 20px;
  position: fixed;
  overflow: visible;
  right: 0;
  z-index: 2;
}

.controls > * { margin-inline: auto; max-width: 390px; width: 100%; }

.progress-track {
  background: transparent;
  border: 1px solid var(--pink-faded);
  box-shadow: none;
  height: 21px;
  isolation: isolate;
  overflow: visible;
  position: relative;
  z-index: 0;
}

.progress-dots {
  color: #4b3152;
  bottom: 0;
  font-family: "Pixel Esperanza", monospace;
  font-size: 20px;
  left: 3px;
  line-height: 24px;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  right: 3px;
  text-align: right;
  top: 0;
  white-space: nowrap;
  z-index: 0;
}

.progress {
  background: var(--pink);
  box-shadow: 0 4px 20px rgba(241, 152, 255, 0.5);
  height: 100%;
  position: relative;
  transform-origin: left;
  width: 100%;
  z-index: 1;
}

.duration-summary {
  background: rgba(5, 7, 10, 0.9);
  border: 1px solid var(--pink-faded);
  color: var(--pink);
  left: 50%;
  padding: 10px 14px;
  position: fixed;
  top: 24px;
  transform: translateX(-50%);
  width: max-content;
  z-index: 3;
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  text-align: center;
  text-shadow: 0 2px 8px rgba(241, 152, 255, 0.55);
}

.controls > .duration-summary { max-width: calc(100% - 40px); width: max-content; }

#advance {
  background: #fff;
  border: 1px solid var(--pink-faded);
  color: #1e1e1e;
  cursor: pointer;
  font-size: 16px;
  min-height: 70px;
  padding: 20px;
  transition: background-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

#advance:hover:not(:disabled) { background: #f9e4fc; }
#advance:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
#advance:disabled { background: transparent; color: var(--pink-faded); cursor: wait; opacity: 0.9; }

.top-fade,
.bottom-fade {
  height: 120px;
  left: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  z-index: 1;
}

.top-fade { background: linear-gradient(to bottom, var(--background), transparent); top: 0; }
.bottom-fade { display: none; }

@keyframes blink { 50% { opacity: 0; } }

@media (min-width: 431px) {
  .experience { margin: 0 auto; max-width: 430px; }
  .controls, .top-fade { left: 50%; max-width: 430px; right: auto; transform: translateX(-50%); width: 100%; }
}
