body, html {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: "Courier New", monospace;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


.reader-page {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}
.reader-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


.preview-image {
  position: absolute;
  left: calc(458 / 1920 * 100%);
  top: calc(165 / 1080 * 100%);
  width: calc(470 / 1920 * 100%);
  height: calc(298 / 1080 * 100%);
  object-fit: cover;
  pointer-events: none;
  border-radius: 4px;
}


.bg-text {
  position: absolute;
  left: calc(980 / 1920 * 100%);
  top: calc(190 / 1080 * 100%);
  width: calc(467 / 1920 * 100%);
  height: calc(681 / 1080 * 100%);
  white-space: pre-line;
  font-size: 18px;
  color: black;
  padding: 20px;
  overflow: hidden;
  line-height: 1.5;
  pointer-events: none;
}


.label-tag {
  position: absolute;
  left: calc(1300 / 1920 * 100%);
  top: calc(830 / 1080 * 100%);
  padding: 6px 14px;
  background: #003a33;
  color: #f5f5f5;
  font-size: 14px;
  letter-spacing: 1px;
  border: 2px solid #008b7f;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: bold;
  transform: rotate(-1.5deg);
  box-shadow: 0 0 4px #000, 0 0 6px rgba(0, 139, 95, 0.3);
  text-shadow: 0 0 3px rgba(0, 255, 221, 0.6);
  backdrop-filter: blur(1px);
  transition: all 0.18s ease;
}
.label-tag:hover {
  background: #00553b;
  border-color: #00ffc8;
  box-shadow: 0 0 8px #00ffbf;
  transform: rotate(-1deg) scale(1.02);
}


.paper-hitbox {
  position: absolute;
  left: calc(980 / 1920 * 100%);
  top: calc(190 / 1080 * 100%);
  width: calc(467 / 1920 * 100%);
  height: calc(681 / 1080 * 100%);
  cursor: pointer;
}


.overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 10, 0.92);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 36px;
  z-index: 999;
  transition: opacity 0.28s ease;
}
.hidden {
  opacity: 0;
  pointer-events: none;
}


.overlay-inner {
  width: 880px;
  max-height: 88vh;
  background-color: #17211e;
  border-radius: 6px;
  padding: 26px 34px;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), 0 0 50px rgba(0, 40, 27, 0.08);
  border: 1px solid rgba(12, 120, 102, 0.9);
  display: flex;
  flex-direction: column;
  background-image: url('assets/papertexture.jpg');
  background-size: cover;
  background-blend-mode: multiply;
  transform: rotate(-0.5deg);
}


.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: #c0bfb0;
  font-weight: bold;
  margin-top: -10px;
}


.page-number {
  font-family: "Courier New", monospace;
  font-size: 20px;
  color: #f5f4e5;
  margin-bottom: 6px;
}


.page-nav button {
  font-size: 18px;
  padding: 6px 12px;
  margin-left: 8px;
  cursor: pointer;
  border: 1px solid #00aa88;
  background-color: #263732;
  color: #f5f5e5;
  border-radius: 6px;
}
.page-nav button:hover { background-color: #005548; box-shadow: 0 0 8px #00ffc8; }


.doc-header {
  margin-bottom: 12px;
  text-align: left;
}
.doc-title {
  color: #f5f5e5;
  font-size: 22px;
  text-align: left;
  margin: 4px 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-left: 2px;
}
.doc-date {
  color: #c0beb0;
  font-size: 14px;
  text-align: left;
  margin: 0 0 8px 0;
  font-style: italic;
  padding-left: 2px;
}


.reader-text {
  font-family: "Courier New", monospace;
  color: #f5f4e5;
  font-size: 18px;
  line-height: 1.6;
  white-space: pre-line;
  transition: opacity 0.22s ease, transform 0.22s ease;
}


.overlay-footer {
  margin-top: 18px;
  text-align: center;
}
.overlay-footer span {
  color: #f5f3e5; 
  font-weight: bold;
  margin-right: 8px;
}
.overlay-footer button {
  margin: 0 4px;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #00aa8e;
  background-color: #263734;
  color: #f5f5e5;
}
.overlay-footer button:hover { background-color: #00554a; box-shadow: 0 0 8px #00ffee; }


.close-btn {
  position: relative;
  display: inline-block;
  margin: 18px auto 0 auto;
  padding: 8px 18px;
  font-size: 15px;
  background: linear-gradient(180deg, rgb(0, 170, 147), rgb(0, 119, 95));
  border: 2px solid #004b46;
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 255, 204, 0.06);
  transform: translateY(0);
}
.close-btn:hover { background: linear-gradient(180deg, rgb(51, 204, 156), rgb(0, 153, 105)); transform: translateY(-1px); }


@keyframes flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% { opacity: 1; }
  20%, 22%, 24%, 55% { opacity: 0; }
}
.flicker { animation: flicker 0.15s linear; }

