.comic-page {
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.18), transparent 22%),
    radial-gradient(circle at 88% 8%, rgba(255, 179, 74, 0.16), transparent 24%),
    linear-gradient(180deg, #101010 0%, #1d1d1d 100%);
  color: #f6f0e8;
}

.comic-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 1rem;
  align-items: start;
}

.panel {
  border-radius: 18px;
  border: 3px solid #0f0f0f;
  background: #f5efe4;
  color: #141414;
  box-shadow: 12px 12px 0 #0f0f0f;
}

.comic-hero {
  grid-column: 1 / -1;
  padding: 1.2rem 1.3rem;
  background:
    linear-gradient(135deg, rgba(255, 196, 72, 0.12), rgba(255, 255, 255, 0.02)),
    #f7f0e1;
}

.comic-hero h1,
.comic-stage h2,
.comic-sidebar h2 {
  margin: 0;
}

.comic-hero h1 {
  margin: 0.2rem 0 0.45rem;
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.story-kicker,
.case-label,
.stage-badge,
.panel-index,
.comic-meter-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.story-kicker {
  margin: 0;
  color: #a65a00;
  font-size: 0.76rem;
}

.comic-stage,
.comic-sidebar {
  padding: 1rem;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.stage-controls {
  display: flex;
  gap: 0.5rem;
}

.stage-controls button {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  border: 2px solid #0f0f0f;
  background: #ffcf66;
  color: #111;
  cursor: pointer;
  box-shadow: 3px 3px 0 #0f0f0f;
}

.comic-meter {
  height: 0.72rem;
  margin: 0.9rem 0 1rem;
  border: 2px solid #0f0f0f;
  background: #fff;
  overflow: hidden;
}

.comic-meter-fill {
  width: 14.28%;
  height: 100%;
  background: repeating-linear-gradient(90deg, #ffcf66, #ffcf66 18px, #ff7d3a 18px, #ff7d3a 36px);
  transition: width 220ms ease;
}

.comic-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  grid-template-rows: repeat(2, minmax(180px, 1fr));
  gap: 0.7rem;
}

.comic-card {
  position: relative;
  overflow: hidden;
  border: 3px solid #0f0f0f;
  background: #fff;
  cursor: pointer;
  box-shadow: 6px 6px 0 #0f0f0f;
}

.comic-card.is-active {
  outline: 4px solid #ffb547;
  transform: translateY(-2px);
}

.comic-card.hero {
  grid-column: 1 / span 2;
  grid-row: 1 / span 2;
}

.comic-card.small {
  min-height: 180px;
}

.comic-art {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--sky, #748db0), var(--ground, #7a5a3a));
}

.comic-art::before,
.comic-art::after {
  content: '';
  position: absolute;
}

.comic-art::before {
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, var(--terrain, #5e4030));
  clip-path: polygon(0 34%, 14% 20%, 28% 30%, 42% 11%, 54% 24%, 68% 8%, 82% 20%, 100% 10%, 100% 100%, 0 100%);
}

.comic-art::after {
  left: 50%;
  bottom: 8%;
  width: 18%;
  height: 45%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--figure, #20131a));
  clip-path: polygon(45% 0, 55% 0, 66% 18%, 76% 40%, 90% 100%, 72% 100%, 60% 57%, 55% 100%, 45% 100%, 40% 57%, 28% 100%, 10% 100%, 24% 40%, 34% 18%);
}

.panel-index {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 1;
  padding: 0.22rem 0.45rem;
  border: 2px solid #0f0f0f;
  background: #fff;
  font-size: 0.72rem;
}

.speech-bubble {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1;
  padding: 0.7rem 0.85rem;
  border: 3px solid #0f0f0f;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  color: #141414;
  font-size: 0.93rem;
  line-height: 1.45;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  left: 1.2rem;
  bottom: -0.65rem;
  width: 1rem;
  height: 1rem;
  background: inherit;
  border-left: 3px solid #0f0f0f;
  border-bottom: 3px solid #0f0f0f;
  transform: rotate(-45deg);
}

.comic-sidebar .speech-box {
  margin: 1rem 0;
  padding: 1rem;
  border: 3px dashed #0f0f0f;
  background: #fff9e9;
  font-weight: 700;
}

.comic-sidebar ul {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.6rem;
}

@media (max-width: 1120px) {
  .comic-shell {
    grid-template-columns: 1fr;
  }

  .comic-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .comic-card.hero {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 230px;
  }
}

@media (max-width: 760px) {
  .comic-stage,
  .comic-sidebar,
  .comic-hero {
    padding: 0.85rem;
  }

  .stage-header {
    flex-direction: column;
  }

  .comic-grid {
    grid-template-columns: 1fr;
  }
}