.fehlspur-reader-trigger {
  cursor: pointer;
}

.fehlspur-reader-trigger:focus-visible {
  outline: 3px solid #b5201c;
  outline-offset: 5px;
}

.fehlspur-reader-dialog {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #08080a;
  color: #f7f4ee;
}

.fehlspur-reader-dialog::backdrop {
  background: rgba(0, 0, 0, 0.86);
}

.fehlspur-reader-shell {
  height: 100%;
  position: relative;
  background:
    radial-gradient(circle at 50% 30%, rgba(181, 32, 28, 0.14), transparent 34%),
    linear-gradient(180deg, #111114, #050506);
}

.fehlspur-reader-bar {
  position: absolute;
  inset: 8px 8px auto;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.fehlspur-reader-bar > div {
  max-width: min(52vw, 360px);
  padding: 7px 10px;
  background: rgba(5, 5, 6, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  opacity: 0.78;
}

.fehlspur-reader-title {
  margin: 0;
  font-family: "Oswald", system-ui, sans-serif;
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  line-height: 1;
  text-transform: uppercase;
}

.fehlspur-reader-status {
  display: none;
}

.fehlspur-reader-close,
.fehlspur-reader-button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 5, 6, 0.62);
  color: #fff;
  font-family: "Oswald", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.fehlspur-reader-close {
  width: 36px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.fehlspur-reader-button {
  padding: 0 14px;
  cursor: pointer;
}

.fehlspur-reader-button:hover,
.fehlspur-reader-close:hover {
  background: #b5201c;
  border-color: #b5201c;
}

.fehlspur-reader-stage {
  position: absolute;
  inset: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 4px;
  overflow: hidden;
}

.fehlspur-reader-book {
  width: min(99vw, 1680px);
  height: min(97dvh, 1120px);
}

.fehlspur-reader-page {
  background: #f3eee6;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.fehlspur-reader-page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f3eee6;
}

.fehlspur-reader-loading {
  width: min(440px, calc(100vw - 36px));
  display: grid;
  gap: 12px;
  text-align: center;
}

.fehlspur-reader-loading[hidden],
.fehlspur-reader-book[hidden] {
  display: none;
}

.fehlspur-reader-progress {
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.fehlspur-reader-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: #b5201c;
  transition: width 180ms ease;
}

.fehlspur-reader-controls {
  position: absolute;
  inset: auto 8px 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  pointer-events: none;
}

.fehlspur-reader-controls > * {
  pointer-events: auto;
}

.fehlspur-reader-page-indicator {
  min-width: 82px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: rgba(5, 5, 6, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
  color: rgba(247, 244, 238, 0.76);
  font-family: "Oswald", system-ui, sans-serif;
  font-size: 0.95rem;
  backdrop-filter: blur(12px);
}

.fehlspur-reader-error {
  max-width: 620px;
  margin: 0;
  color: #fff;
  text-align: center;
}

body.fehlspur-reader-lock {
  overflow: hidden;
}

@media (max-width: 720px) {
  .fehlspur-reader-bar {
    inset: 6px 6px auto;
  }

  .fehlspur-reader-bar > div {
    display: none;
  }

  .fehlspur-reader-stage {
    padding: 4px;
  }

  .fehlspur-reader-book {
    width: 99vw;
    height: 96dvh;
  }

  .fehlspur-reader-controls {
    gap: 8px;
  }

  .fehlspur-reader-button {
    min-height: 34px;
    padding: 0 12px;
  }
}
