/* Comic Reader Styles - Matching Site Aesthetic */

.comic-reader {
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 50% -220px, rgba(0,0,0,.05), transparent 60%),
    linear-gradient(180deg, #f4f2ee, #efece6);
  padding: clamp(16px, 3.5vw, 34px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.5vw, 24px);
}

/* Top Navigation Bar */
.comic-nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(16px, 2.5vw, 24px);
}

.comic-back-link {
  font-family: "Special Elite", monospace;
  font-size: 13px;
  color: rgba(0,0,0,.65);
  text-decoration: none;
}

.comic-back-link:hover {
  text-decoration: underline;
}

.page-title {
  font-family: "Nothing You Could Do", cursive;
  font-size: clamp(18px, 2.5vw, 24px);
  color: rgba(0,0,0,.86);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

/* Comic Viewport - Image taped directly to background */
.comic-viewport-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.comic-viewport {
  position: relative;
  width: 100%;
  height: 70vh;
  overflow: hidden;
}

.comic-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: 0 0;
}

#comicImage {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  box-shadow: 0 18px 44px rgba(0,0,0,.18);
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 4px;
}

/* Tape decorations - hidden during panel zoom */
.tape-tl,
.tape-tr {
  position: absolute;
  width: 150px;
  height: 64px;
  background: url("/img/RSCO-Tape-06.png") center / contain no-repeat;
  opacity: 0;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.20));
  pointer-events: none;
  z-index: 10;
  top: -26px;
  transition: opacity 0.3s ease;
}

.comic-image-wrapper.show-tape .tape-tl,
.comic-image-wrapper.show-tape .tape-tr {
  opacity: .95;
}

.tape-tl {
  left: -10px;
  transform: rotate(-10deg);
}

.tape-tr {
  right: -10px;
  transform: rotate(12deg) scaleX(-1);
}

.panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.panel-highlight {
  fill: none;
  stroke: transparent;
  stroke-width: 0;
}

/* Controls Section */
.comic-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  padding: clamp(12px, 2vw, 20px);
  background: rgba(255,255,255,.45);
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,.08);
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.panel-btn {
  padding: clamp(10px, 1.5vw, 14px) clamp(16px, 2.5vw, 24px);
  background: rgba(255,255,255,.75);
  color: rgba(0,0,0,.78);
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 6px;
  cursor: pointer;
  font-family: "Special Elite", monospace;
  font-size: clamp(12px, 1.5vw, 14px);
  font-weight: 400;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
  letter-spacing: 0.3px;
}

.panel-btn:hover:not(:disabled) {
  background: rgba(255,255,255,.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,.12);
  border-color: rgba(0,0,0,.25);
}

.panel-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}

.panel-btn:disabled {
  background: rgba(255,255,255,.35);
  color: rgba(0,0,0,.35);
  cursor: not-allowed;
  border-color: rgba(0,0,0,.08);
  box-shadow: none;
}

.comic-indicator {
  display: flex;
  justify-content: center;
  padding: 12px 0 0;
}

#panelIndicator {
  font-family: "Nothing You Could Do", cursive;
  font-weight: 400;
  font-size: clamp(16px, 2vw, 20px);
  color: rgba(0,0,0,.78);
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .comic-reader {
    padding: 16px;
    gap: 16px;
  }

  .comic-nav-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .page-nav {
    width: 100%;
    justify-content: space-between;
  }

  .tape-tl,
  .tape-tr {
    width: 120px;
    height: 48px;
  }

  .comic-controls {
    gap: 0.5rem;
    padding: 12px;
  }

  .panel-btn {
    flex: 1 1 auto;
    min-width: 100px;
  }

  #panelIndicator {
    flex: 1 1 100%;
    order: -1;
    padding: 8px 0;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 18px;
  }

  .comic-viewport {
    min-height: 50vh;
  }

  .panel-btn {
    flex: 1 1 45%;
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* Welcome Popup */
.welcome-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.welcome-content {
  background: #f8f7f3;
  padding: clamp(24px, 4vw, 40px);
  border-radius: 12px;
  max-width: 600px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  border: 1px solid rgba(0,0,0,.15);
  position: relative;
}

.welcome-content h2 {
  margin: 0 0 16px 0;
  font-family: "Nothing You Could Do", cursive;
  font-size: clamp(24px, 4vw, 32px);
  color: rgba(0,0,0,.86);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

.welcome-content p {
  margin: 12px 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: clamp(14px, 2vw, 16px);
  color: rgba(0,0,0,.78);
  line-height: 1.6;
}

.welcome-content ul {
  margin: 16px 0;
  padding-left: 24px;
}

.welcome-content li {
  margin: 8px 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: clamp(14px, 2vw, 16px);
  color: rgba(0,0,0,.78);
  line-height: 1.6;
}

.welcome-tip {
  margin-top: 20px;
  padding: 12px;
  background: rgba(0,0,0,.04);
  border-radius: 6px;
  font-size: clamp(13px, 1.8vw, 14px);
  font-style: italic;
}

.welcome-tip kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 3px;
  font-family: "Special Elite", monospace;
  font-size: 12px;
  font-style: normal;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}

.welcome-content button {
  margin-top: 20px;
  width: 100%;
  font-size: 16px;
  padding: 14px 24px;
}
