* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  min-height: 100%;
  background: #000;
  font-family: 'VT323', monospace;
  color: #eaeaea;
}

.background {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  user-select: none;
  pointer-events: none;
}

.background-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0.6;
  z-index: 1;
  pointer-events: none;
}

.back {
  position: fixed;
  top: 16px;
  left: 16px;
  color: #eaeaea;
  background: #000;
  border: 1px solid #eaeaea;
  padding: 4px 12px;
  font-size: 20px;
  text-decoration: none;
  z-index: 20;
}

.back:hover {
  background: #eaeaea;
  color: #000;
}

.book {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* la hauteur du cadre suit simplement l'image affichée, pas de ratio imposé
   -> jamais de bande vide si l'image n'a pas exactement le même format */
.page-frame {
  position: relative;
  width: 100%;
  background: #111;
  border: 1px solid #333;
  overflow: hidden;
}

.page-image {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}

.edge {
  position: absolute;
  top: 0;
  height: 100%;
  width: 18%;
  display: flex;
  align-items: center;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s ease;
}

.edge-prev {
  left: 0;
  justify-content: flex-start;
}

.edge-next {
  right: 0;
  justify-content: flex-end;
}

.edge-prev:hover {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.6), transparent);
}

.edge-next:hover {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.6), transparent);
}

.edge-label {
  background: #000;
  color: #eaeaea;
  border: 1px solid #eaeaea;
  padding: 4px 14px;
  font-size: 22px;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  margin: 0 8px;
}

.edge:hover .edge-label {
  opacity: 1;
}

.edge.disabled {
  cursor: default;
  pointer-events: none;
}

.counter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  border: 1px solid #444;
  color: #999;
  font-size: 18px;
  padding: 1px 10px;
}

.notes {
  width: 100%;
  background: #000;
  border: 1px solid #eaeaea;
}

/* fenêtre façon terminal : barre de titre + corps (même principe que sur
   l'accueil, voir .term-window dans le style.css racine) */
.term-titlebar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: #1a1a1a;
  border-bottom: 1px solid #eaeaea;
  padding: 2px;
}

.term-close {
  position: relative;
  width: 16px;
  height: 16px;
  background: #eaeaea;
  pointer-events: auto;
}

.term-close::before,
.term-close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background: #000;
}

.term-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.term-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.term-close:hover {
  background: #000;
}

.term-close:hover::before,
.term-close:hover::after {
  background: #eaeaea;
}

.term-body {
  padding: 18px 22px;
  font-family: ui-monospace, 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.6;
  color: #d8d8d8;
}

.term-body img {
  max-width: 100%;
  margin-top: 12px;
  display: block;
  border: 1px solid #333;
}
